Make that 'mode & 07777' for the previous commit.
authorZac Medico <zmedico@gentoo.org>
Tue, 14 Mar 2006 08:46:23 +0000 (08:46 -0000)
committerZac Medico <zmedico@gentoo.org>
Tue, 14 Mar 2006 08:46:23 +0000 (08:46 -0000)
svn path=/main/trunk/; revision=2881

pym/portage_util.py

index 68faa78029476743933be08d92c1305ce08302b6..3715da1d256b613a81f584bbfed5080ed093f913 100644 (file)
@@ -471,7 +471,7 @@ def apply_permissions(filename, uid=-1, gid=-1, mode=-1, mask=-1,
                        (gid != -1 and gid != stat_cached.st_gid):
                        os.chown(filename, uid, gid)
 
-               st_mode = stat_cached.st_mode & 0777 # protect from unwanted bits
+               st_mode = stat_cached.st_mode & 07777 # protect from unwanted bits
                if mask >= 0:
                        if mode == -1:
                                mode = 0 # Don't add any mode bits when mode is unspecified.
@@ -481,7 +481,7 @@ def apply_permissions(filename, uid=-1, gid=-1, mode=-1, mask=-1,
                                new_mode = mask ^ new_mode
                                os.chmod(filename, new_mode)
                elif mode != -1:
-                       mode = mode & 0777 # protect from unwanted bits
+                       mode = mode & 07777 # protect from unwanted bits
                        if mode != st_mode:
                                os.chmod(filename, mode)
        except OSError, oe: