summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pym/portage_util.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/pym/portage_util.py b/pym/portage_util.py
index 68faa7802..3715da1d2 100644
--- a/pym/portage_util.py
+++ b/pym/portage_util.py
@@ -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: