aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2008-07-28 15:50:12 +0100
committerAvatar David Leverton <levertond@googlemail.com> 2008-07-28 18:16:11 +0100
commitfa37c7c5b9a7b784feb39b291480aac42d7a4589 (patch)
tree16805d097160271f7686bea37300a7d9fdf983d2
parent4c7255f4dc491af29e6e3308f0270d8fa04a2550 (diff)
downloadpaludis-fa37c7c5b9a7b784feb39b291480aac42d7a4589.tar.gz
paludis-fa37c7c5b9a7b784feb39b291480aac42d7a4589.tar.xz
Don't clobber set*id bits. Fixes: ticket:623
-rw-r--r--paludis/merger.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/paludis/merger.cc b/paludis/merger.cc
index 9dbaf9f..c4e0843 100644
--- a/paludis/merger.cc
+++ b/paludis/merger.cc
@@ -663,18 +663,18 @@ Merger::do_ownership_fixes_recursive(const FSEntry & dir)
if (uid_t(-1) != new_ids.first || gid_t(-1) != new_ids.second)
{
FSEntry f(*d);
+ mode_t mode(f.permissions());
f.lchown(new_ids.first, new_ids.second);
if (et_dir == entry_type(*d))
{
- mode_t mode(f.permissions());
if (uid_t(-1) != new_ids.first)
mode &= ~S_ISUID;
if (gid_t(-1) != new_ids.second)
mode &= ~S_ISGID;
- f.chmod(mode);
}
+ f.chmod(mode); /* set*id */
_imp->fixed_entries.insert(f);
}