Skip to content

Commit

Permalink
Merge pull request #794 from wagnert/1.0
Browse files Browse the repository at this point in the history
Change order of switching user/group to group/user because of necessa…
  • Loading branch information
wagnert committed May 8, 2015
2 parents e1d05b6 + abc27e6 commit 4a19232
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions src/AppserverIo/Appserver/Core/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -597,18 +597,21 @@ protected function switchProcessUser()
}
}

// As we should only change user and group AFTER we made all chown and chgrp changes we will do it here
// after collecting if we are able to
if ($userChangeable) {
// As we should only change user and group AFTER we made all chown and chgrp
// changes we will do it here after collecting if we are able to.

// change the user ID
posix_setuid($userId);
}
// ATTENTION: We first need to change the group, because we need to be root
// to do that. After that we can change the user also!!!!!!!!!!!
if ($groupChangeable) {

// change the group ID
posix_setgid($groupId);
}
if ($userChangeable) {

// change the user ID
posix_setuid($userId);
}

// log a message with the time needed for restart
$this->getSystemLogger()->info(
Expand Down

0 comments on commit 4a19232

Please sign in to comment.