Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

bug 484972: post_upload.py should chmod files/dirs to 644/755 for --r…

…elease-to-candidates-dir target. r=bhearsum
  • Loading branch information...
commit 9f7309ce4c7935307f3156d584bc93fe36bda19d 1 parent 08e93f2
Nick Thomas authored April 21, 2009

Showing 1 changed file with 10 additions and 1 deletion. Show diff stats Hide diff stats

  1. 11  stage/post_upload.py
11  stage/post_upload.py
@@ -31,7 +31,7 @@ def CopyFileToDir(original_file, source_dir, dest_dir, preserve_dirs=False):
31 31
     new_file = os.path.join(dest_dir, relative_path)
32 32
     full_dest_dir = os.path.dirname(new_file)
33 33
     if not os.path.isdir(full_dest_dir):
34  
-        os.makedirs(full_dest_dir)
  34
+        os.makedirs(full_dest_dir, 0755)
35 35
     if os.path.exists(new_file):
36 36
         os.unlink(new_file)
37 37
     shutil.copyfile(original_file, new_file)
@@ -127,6 +127,15 @@ def ReleaseToCandidatesDir(options, upload_dir, files):
127 127
         if 'win32' in f:
128 128
             realCandidatesPath = os.path.join(realCandidatesPath, 'unsigned')
129 129
         CopyFileToDir(f, upload_dir, realCandidatesPath, preserve_dirs=True)
  130
+        # We always want release files chmod'ed this way so other users in
  131
+        # the group cannot overwrite them.
  132
+        os.chmod(f, 0644)
  133
+
  134
+    # Same thing for directories, but 0755
  135
+    for root,dirs,files in os.walk(candidatesPath):
  136
+        for d in dirs:
  137
+            os.chmod(os.path.join(root, d), 0755)
  138
+
130 139
 
131 140
 
132 141
 if __name__ == '__main__':

0 notes on commit 9f7309c

Please sign in to comment.
Something went wrong with that request. Please try again.