[Buildbot-commits] buildbot/buildbot/slave commands.py,1.80,1.81

Brian Warner warner at users.sourceforge.net
Tue Jul 3 17:59:05 UTC 2007


Update of /cvsroot/buildbot/buildbot/buildbot/slave
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24963/buildbot/slave

Modified Files:
	commands.py 
Log Message:
[project @ rmdirRecursive: chmod files to 0700 before deleting them. Closes #29.]

Original author: warner at lothar.com
Date: 2007-07-03 17:51:51+00:00

Index: commands.py
===================================================================
RCS file: /cvsroot/buildbot/buildbot/buildbot/slave/commands.py,v
retrieving revision 1.80
retrieving revision 1.81
diff -u -d -r1.80 -r1.81
--- commands.py	17 Apr 2007 06:38:50 -0000	1.80
+++ commands.py	3 Jul 2007 17:59:03 -0000	1.81
@@ -66,17 +66,24 @@
         os.remove(dir)
         return
 
+    # Verify the directory is read/write/execute for the current user
+    os.chmod(dir, 0700)
+
     for name in os.listdir(dir):
         full_name = os.path.join(dir, name)
         # on Windows, if we don't have write permission we can't remove
         # the file/directory either, so turn that on
         if os.name == 'nt':
             if not os.access(full_name, os.W_OK):
+                # I think this is now redundant, but I don't have an NT
+                # machine to test on, so I'm going to leave it in place
+                # -warner
                 os.chmod(full_name, 0600)
+
         if os.path.isdir(full_name):
             rmdirRecursive(full_name)
         else:
-            # print "removing file", full_name
+            os.chmod(full_name, 0700)
             os.remove(full_name)
     os.rmdir(dir)
 





More information about the Commits mailing list