]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Fix for restart-as-user problem reported via the -dev list
authorTilghman Lesher <tilghman@meg.abyt.es>
Fri, 21 Dec 2007 15:07:42 +0000 (15:07 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Fri, 21 Dec 2007 15:07:42 +0000 (15:07 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@94418 65c4cc65-6c06-0410-ace0-fbb531ad65f3

main/asterisk.c

index 202a19086c8c62937464d780eabda38e05456be8..319f647e2dcd442444bbf3651be4c0c53e1bc000 100644 (file)
@@ -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);
                        }