summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-03-17 21:04:45 +0000
committerZac Medico <zmedico@gentoo.org>2006-03-17 21:04:45 +0000
commit6029dff0b6843024d8864adcc7a355145d7a9bdf (patch)
tree5507cd826f16e52d6884e2173b748f246551ab3d
parent4a82b39375460721d38b48d980f44d8d36567876 (diff)
downloadportage-6029dff0b6843024d8864adcc7a355145d7a9bdf.tar.gz
portage-6029dff0b6843024d8864adcc7a355145d7a9bdf.tar.bz2
portage-6029dff0b6843024d8864adcc7a355145d7a9bdf.zip
Fix the apply_permissions XOR logic so that mask removes mode bits correctly.
svn path=/main/trunk/; revision=2917
-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 61730c5fe..38a03087a 100644
--- a/pym/portage_util.py
+++ b/pym/portage_util.py
@@ -495,9 +495,9 @@ def apply_permissions(filename, uid=-1, gid=-1, mode=-1, mask=-1,
else:
mode = mode & 07777
if (mode & st_mode != mode) or \
- (mask ^ st_mode != st_mode):
+ ((mask ^ st_mode) & st_mode != st_mode):
new_mode = mode | st_mode
- new_mode = mask ^ new_mode
+ new_mode = (mask ^ new_mode) & mode
elif mode != -1:
mode = mode & 07777 # protect from unwanted bits
if mode != st_mode: