changeset 2481:8f2d1aabd940

fixed -g arg to roundup-server [SF#973946]
author Richard Jones <richard@users.sourceforge.net>
date Mon, 21 Jun 2004 04:33:52 +0000
parents 7f9f1c66c1b6
children 55b496fb7b5b
files CHANGES.txt roundup/scripts/roundup_server.py
diffstat 2 files changed, 8 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGES.txt	Thu Jun 17 10:14:13 2004 +0000
+++ b/CHANGES.txt	Mon Jun 21 04:33:52 2004 +0000
@@ -22,6 +22,7 @@
   backend
 - fixed some more mysql 0.6->0.7 upgrade bugs (sf bug 950410)
 - fixed Boolean values in postgresql (sf bugs 972546 and 972600)
+- fixed -g arg to roundup-server (sf bug 973946)
 
 
 2004-06-10 0.7.4
--- a/roundup/scripts/roundup_server.py	Thu Jun 17 10:14:13 2004 +0000
+++ b/roundup/scripts/roundup_server.py	Mon Jun 21 04:33:52 2004 +0000
@@ -17,7 +17,7 @@
 
 """Command-line script that runs a server over roundup.cgi.client.
 
-$Id: roundup_server.py,v 1.50 2004-05-18 19:25:24 a1s Exp $
+$Id: roundup_server.py,v 1.51 2004-06-21 04:33:52 richard Exp $
 """
 __docformat__ = 'restructuredtext'
 
@@ -478,19 +478,19 @@
                       _("Unable to bind to port %s, port already in use." % port)
             raise
 
-        if group is not None and hasattr(os, 'getgid'):
+        if group is not None and hasattr(os, 'getuid'):
             # if root, setgid to the running user
-            if not os.getgid() and user is not None:
+            if not os.getuid():
                 try:
-                    import pwd
+                    import grp
                 except ImportError:
-                    raise ValueError, _("Can't change groups - no pwd module")
+                    raise ValueError, _("Can't change groups - no grp module")
                 try:
-                    gid = pwd.getpwnam(user)[3]
+                    gid = grp.getgrnam(group)[2]
                 except KeyError:
                     raise ValueError,_("Group %(group)s doesn't exist")%locals()
                 os.setgid(gid)
-            elif os.getgid() and user is not None:
+            elif os.getuid():
                 print _('WARNING: ignoring "-g" argument, not root')
 
         if hasattr(os, 'getuid'):

Roundup Issue Tracker: http://roundup-tracker.org/