Commits

Ian Bicking  committed 510ff7d Merge

Merged in clayg/pastescript/setgroups (pull request #3)

  • Participants
  • Parent commits edb9ca5, a19e462

Comments (0)

Files changed (2)

 syntax: glob
+*.pyc
 *.egg-info/
 build/
 dist/

File paste/script/serve.py

         if self.verbose > 0:
             print 'Changing user to %s:%s (%s:%s)' % (
                 user, group or '(unknown)', uid, gid)
+        if hasattr(os, 'initgroups'):
+            os.initgroups(user, gid)
+        else:
+            os.setgroups([e.gr_gid for e in grp.getgrall()
+                          if user in e.gr_mem] + [gid]) 
         if gid:
             os.setgid(gid)
         if uid: