[Twisted-Python] mktap --uid=0 bug

Tommi Virtanen tv at twistedmatrix.com
Tue Mar 4 09:03:33 EST 2003


	If you do mktap --uid=0 --gid=0, t.i.app ignores your
	setting and stores the uid/gid of the user running mktap.
	Here's a patch; if I hear no objections, I will commit.

Index: twisted/internet/app.py
===================================================================
RCS file: /cvs/Twisted/twisted/internet/app.py,v
retrieving revision 1.79
diff -u -u -r1.79 app.py
--- twisted/internet/app.py	1 Mar 2003 21:58:47 -0000	1.79
+++ twisted/internet/app.py	4 Mar 2003 13:55:05 -0000
@@ -281,8 +282,12 @@
             self._authorizer = a
             self._authorizer.setApplication(self)
         if platform.getType() == "posix":
-            self.uid = uid or os.getuid()
-            self.gid = gid or os.getgid()
+            if uid is None:
+                uid = os.getuid()
+            self.uid = uid
+            if gid is None:
+                gid = os.getgid()
+            self.gid = gid
 
     persistenceVersion = 12
 


-- 
:(){ :|:&};:




More information about the Twisted-Python mailing list