HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials

HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials (http://www.howtoforge.com/forums/index.php)
-   Installation/Configuration (http://www.howtoforge.com/forums/forumdisplay.php?f=16)
-   -   strange problem adding a new user to a group (http://www.howtoforge.com/forums/showthread.php?t=46884)

gilas 30th June 2010 11:05

strange problem adding a new user to a group
 
Hi "moderator"
thank you for your great work.

I suffering due to a strange problem, here described:

o.s./sw data:
Debian Lenny
ISPConfig Version: 2.2.35

1. I added some code to force ISPConfig to add a news user to a group, for my o.s. is 'www-data'.
http://www.howtoforge.com/forums/showthread.php?t=10287

2. Looking for the code located in:
/root/ispconfig/scripts/lib/classes/ispconfig_system.lib.php

line # 534
function add_user_to_group($group, $user = 'admispconfig'){
the user is added correctly and the whole file /etc/group is updated (re-written).
All is ok, I verified it adding after this line:
$mod->file->wf($this->server_conf["group_datei"], $new_group_file);


3. just added a new user to the group create (i.e. web100), through the method:
$mod->system->add_user_to_group("web100","www-data");
this code:
$group_file = $mod->file->rf($this->server_conf["group_datei"]);
(then the group file /etc/group is read and saved into the $group_file var)
then I send the var via email:
mail("mymail@mydomain.ext","group file",$group_file);

4. all is ok I receive the whole content without problems and the www-data group is added.

5. some seconds after this I check with the linux command:
groups www-data

the output show (only) for few seconds the group added, i.e.:

www-data web10 web11 web100

6. I repeat the linux command described above (step 5)
and the group added disappeared!

what happens?!?

Thank you very much for your answer, cordially


All times are GMT +2. The time now is 05:55.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.