fix restart + -u issue FSCORE-199

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9892 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale 2008-10-08 14:53:31 +00:00
parent e4dfe9ffd4
commit c07d3c5eb3
1 changed files with 5 additions and 0 deletions

View File

@ -564,6 +564,11 @@ SWITCH_DECLARE(int32_t) change_user_group(const char *user, const char *group)
runas_gid = gr->gr_gid;
}
if (runas_uid && getuid() == runas_uid && (!runas_gid || runas_gid == getgid())) {
/* already running as the right user and group, nothing to do! */
return 0;
}
if (runas_uid) {
#ifdef HAVE_SETGROUPS
/*