[Pkg-zope-developers] Bug#313621: Erroneous patch for 313621

Igor Stroh stroh at scan-plus.de
Wed Aug 17 13:16:33 UTC 2005


Uh, I should've sent the patch as attachment, thunderbird wrapped the lines :(

Next try (see attached file).

Cheers,
Igor
-------------- next part --------------
--- zope2.7-2.7.5.broken/utilities/mkzopeinstance.py	2005-08-17 14:49:25.000000000 +0200
+++ zope2.7-2.7.5/utilities/mkzopeinstance.py	2005-08-17 15:01:10.000000000 +0200
@@ -191,16 +191,17 @@
     fp = open(fn, "w")
     pw = binascii.b2a_base64(sha.new(password).digest())[:-1]
     fp.write('%s:{SHA}%s\n' % (user, pw))
+    stat = os.fstat(fp.fileno())
     fp.close()
     ####Mennucc: patch by martin f krafft
-    os.chmod(fn, 0640)
     if uid is not None or gid is not None :
-        if uid is None: uid = fstat(fp.fileno())[4]
-        if gid is None: gid = fstat(fp.fileno())[5]
-        try: 
+        if uid is None: uid = stat[4]
+        if gid is None: gid = stat[5]
+        try:
             os.chown(fn, uid, gid)
         except OSError, a:
             print "WARNING! while trying to set ",fn," to uid=",uid," gid=",gid," got the error ",a
+    os.chmod(fn, 0640)
 
 if __name__ == "__main__":
     main()


More information about the Pkg-zope-developers mailing list