[asterisk-commits] trunk - r7858 /trunk/asterisk.c
asterisk-commits at lists.digium.com
asterisk-commits at lists.digium.com
Sat Jan 7 14:08:51 CST 2006
Author: markster
Date: Sat Jan 7 14:08:51 2006
New Revision: 7858
URL: http://svn.digium.com/view/asterisk?rev=7858&view=rev
Log:
Only set group for "runuser" if "rungroup" is not specified.
Modified:
trunk/asterisk.c
Modified: trunk/asterisk.c
URL: http://svn.digium.com/view/asterisk/trunk/asterisk.c?rev=7858&r1=7857&r2=7858&view=diff
==============================================================================
--- trunk/asterisk.c (original)
+++ trunk/asterisk.c Sat Jan 7 14:08:51 2006
@@ -2171,9 +2171,11 @@
ast_log(LOG_WARNING, "No such user '%s'!\n", runuser);
exit(1);
}
- if (initgroups(pw->pw_name, pw->pw_gid)) {
- ast_log(LOG_WARNING, "Unable to init groups for '%s'\n", runuser);
- exit(1);
+ if (!ast_strlen_zero(rungroup))
+ if (initgroups(pw->pw_name, pw->pw_gid)) {
+ ast_log(LOG_WARNING, "Unable to init groups for '%s'\n", runuser);
+ exit(1);
+ }
}
if (setuid(pw->pw_uid)) {
ast_log(LOG_WARNING, "Unable to setuid to %d (%s)\n", pw->pw_uid, runuser);
More information about the asterisk-commits
mailing list