SOURCES: trac-root2http.patch - update to 0.11
glen
glen at pld-linux.org
Mon Nov 3 11:59:55 CET 2008
Author: glen Date: Mon Nov 3 10:59:55 2008 GMT
Module: SOURCES Tag: HEAD
---- Log message:
- update to 0.11
---- Files affected:
SOURCES:
trac-root2http.patch (1.2 -> 1.3)
---- Diffs:
================================================================
Index: SOURCES/trac-root2http.patch
diff -u SOURCES/trac-root2http.patch:1.2 SOURCES/trac-root2http.patch:1.3
--- SOURCES/trac-root2http.patch:1.2 Fri May 30 15:54:41 2008
+++ SOURCES/trac-root2http.patch Mon Nov 3 11:59:49 2008
@@ -1,35 +1,37 @@
---- trac-0.10.4/scripts/trac-admin 2008-05-29 18:50:02.424943471 +0300
-+++ trac-0.10.4/scripts/trac-admin 2008-05-30 16:51:32.685504393 +0300
-@@ -16,7 +16,31 @@
- individuals. For the exact contribution history, see the revision
- history and logs, available at http://trac.edgewall.org/log/."""
+--- Trac-0.11.1/trac/admin/console.py~ 2008-08-06 20:29:01.000000000 +0300
++++ Trac-0.11.1/trac/admin/console.py 2008-11-03 12:57:57.255366488 +0200
+@@ -129,7 +129,34 @@
+ if not self.interactive:
+ return rv
--import sys
-+import sys, os
++ def switchuid(self):
++ # switch to http user if ran as root
++ if os.getuid() == 0:
++ import pwd
++ import grp
+
-+# switch to http user if ran as root
-+if os.getuid() == 0:
-+ import pwd
-+ import grp
-+
-+ user = 'http'
-+ group = 'http'
-+
-+ uid = pwd.getpwnam(user)[2]
-+ gid = pwd.getpwnam(group)[2]
-+
-+ os.setgid(gid);
-+ l = [gid]
-+ for groupname, password, gidn, userlist in grp.getgrall():
-+ if user in userlist:
-+ l.append(gidn)
-+ os.setgroups(l)
-+ os.setegid(gid);
-+ os.setuid(uid);
-+ os.seteuid(uid);
++ user = 'http'
++ group = 'http'
+
-+# set 660 permissions
-+os.umask(0006);
-
- from trac.scripts.admin import run
- sys.exit(run(sys.argv[1:]))
++ uid = pwd.getpwnam(user)[2]
++ gid = pwd.getpwnam(group)[2]
++
++ os.setgid(gid);
++ l = [gid]
++ for groupname, password, gidn, userlist in grp.getgrall():
++ if user in userlist:
++ l.append(gidn)
++ os.setgroups(l)
++ os.setegid(gid);
++ os.setuid(uid);
++ os.seteuid(uid);
++
++ # set 660 permissions
++ os.umask(0006);
++
+ def run(self):
++ self.switchuid()
++
+ self.interactive = True
+ printout(_("""Welcome to trac-admin %(version)s
+ Interactive Trac administration console.
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/trac-root2http.patch?r1=1.2&r2=1.3&f=u
More information about the pld-cvs-commit
mailing list