aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2008-07-28 21:32:10 +0100
committerAvatar David Leverton <levertond@googlemail.com> 2008-07-28 21:40:19 +0100
commit8c6fda1b4e24e182b98850a5269d257b26efa344 (patch)
tree045cb45fdb95f06ce47d027bc4ab89ca60628b97
parent5c6206dba5629933408567723916c56d5127e525 (diff)
downloadpaludis-8c6fda1b4e24e182b98850a5269d257b26efa344.tar.gz
paludis-8c6fda1b4e24e182b98850a5269d257b26efa344.tar.xz
Change the mode of the symlink, not its target.
-rw-r--r--paludis/merger.cc19
1 files changed, 12 insertions, 7 deletions
diff --git a/paludis/merger.cc b/paludis/merger.cc
index c4e0843..d7adab2 100644
--- a/paludis/merger.cc
+++ b/paludis/merger.cc
@@ -663,18 +663,23 @@ 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))
+ if (et_sym != entry_type(*d))
{
- if (uid_t(-1) != new_ids.first)
- mode &= ~S_ISUID;
- if (gid_t(-1) != new_ids.second)
- mode &= ~S_ISGID;
+ mode_t mode(f.permissions());
+
+ if (et_dir == entry_type(*d))
+ {
+ if (uid_t(-1) != new_ids.first)
+ mode &= ~S_ISUID;
+ if (gid_t(-1) != new_ids.second)
+ mode &= ~S_ISGID;
+ }
+
+ f.chmod(mode); /* set*id */
}
- f.chmod(mode); /* set*id */
_imp->fixed_entries.insert(f);
}