From: Tilghman Lesher Date: Fri, 21 Dec 2007 15:07:42 +0000 (+0000) Subject: Fix for restart-as-user problem reported via the -dev list X-Git-Tag: 1.4.17~36 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=2f24e1b1bf4025174676695b9ea6749878ade67a;p=thirdparty%2Fasterisk.git Fix for restart-as-user problem reported via the -dev list git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@94418 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/main/asterisk.c b/main/asterisk.c index 202a19086c..319f647e2d 100644 --- a/main/asterisk.c +++ b/main/asterisk.c @@ -2749,7 +2749,7 @@ int main(int argc, char *argv[]) ast_log(LOG_WARNING, "Unable to setgid to %d!\n", (int)pw->pw_gid); exit(1); } - if (initgroups(pw->pw_name, pw->pw_gid)) { + if (isroot && initgroups(pw->pw_name, pw->pw_gid)) { ast_log(LOG_WARNING, "Unable to init groups for '%s'\n", runuser); exit(1); }