Update of /cvsroot/mailman/mailman/bin
In directory sc8-pr-cvs1:/tmp/cvs-serv17210
Modified Files:
Tag: Release_2_1-maint
mailmanctl
Log Message:
check_privs(): Set the process's supplemental groups to those of the
setuid'd user, if os.setgroup() is available (it's not in Python
2.1). Close SF bug #777444 posted by Richard Barrett, identified and
solved by Jonas Muerer.
Index: mailmanctl
===================================================================
RCS file: /cvsroot/mailman/mailman/bin/mailmanctl,v
retrieving revision 2.24.2.2
retrieving revision 2.24.2.3
diff -u -d -r2.24.2.2 -r2.24.2.3
--- mailmanctl 22 Sep 2003 02:29:50 -0000 2.24.2.2
+++ mailmanctl 14 Dec 2003 17:57:40 -0000 2.24.2.3
@@ -288,6 +288,13 @@
uid = pwd.getpwnam(mm_cfg.MAILMAN_USER)[2]
myuid = os.getuid()
if myuid == 0:
+ groups = [x[2] for x in grp.getgrall() if mm_cfg.MAILMAN_USER in x[3]]
+ groups.append(gid)
+ try:
+ os.setgroups(groups)
+ except AttributeError:
+ # Python 2.1 doesn't have setgroups
+ syslog('error', 'Warning: unable to setgroups(%s)' % groups)
os.setgid(gid)
os.setuid(uid)
elif myuid <> uid:
_______________________________________________
Mailman-checkins mailing list
[EMAIL PROTECTED]
Unsubscribe: http://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org