Skip to content

Commit 168ec20

Browse files
author
Richard Jones
committed
fixed -g arg to roundup-server [SF#973946]
1 parent aaa9565 commit 168ec20

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

CHANGES.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ Fixed:
2222
backend
2323
- fixed some more mysql 0.6->0.7 upgrade bugs (sf bug 950410)
2424
- fixed Boolean values in postgresql (sf bugs 972546 and 972600)
25+
- fixed -g arg to roundup-server (sf bug 973946)
2526

2627

2728
2004-06-10 0.7.4

roundup/scripts/roundup_server.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717

1818
"""Command-line script that runs a server over roundup.cgi.client.
1919
20-
$Id: roundup_server.py,v 1.50 2004-05-18 19:25:24 a1s Exp $
20+
$Id: roundup_server.py,v 1.51 2004-06-21 04:33:52 richard Exp $
2121
"""
2222
__docformat__ = 'restructuredtext'
2323

@@ -478,19 +478,19 @@ def run(port=PORT, success_message=None):
478478
_("Unable to bind to port %s, port already in use." % port)
479479
raise
480480

481-
if group is not None and hasattr(os, 'getgid'):
481+
if group is not None and hasattr(os, 'getuid'):
482482
# if root, setgid to the running user
483-
if not os.getgid() and user is not None:
483+
if not os.getuid():
484484
try:
485-
import pwd
485+
import grp
486486
except ImportError:
487-
raise ValueError, _("Can't change groups - no pwd module")
487+
raise ValueError, _("Can't change groups - no grp module")
488488
try:
489-
gid = pwd.getpwnam(user)[3]
489+
gid = grp.getgrnam(group)[2]
490490
except KeyError:
491491
raise ValueError,_("Group %(group)s doesn't exist")%locals()
492492
os.setgid(gid)
493-
elif os.getgid() and user is not None:
493+
elif os.getuid():
494494
print _('WARNING: ignoring "-g" argument, not root')
495495

496496
if hasattr(os, 'getuid'):

0 commit comments

Comments
 (0)