summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Braun <rbraun@sceen.net>2014-02-05 23:57:40 +0100
committerRichard Braun <rbraun@sceen.net>2014-02-05 23:57:40 +0100
commit4edd4887541eeff2970c27aa16328a42051e20f4 (patch)
tree0cb41b6d083d3fe0e080c787543725c647e075a3
parent801256914d42b3aa4bb0af22432471b1d911a66c (diff)
trans/fakeroot: fix chmod
Unconditionally relay chmod requests instead of filtering those that don't change the executable bit. * trans/fakeroot.c (netfs_attempt_chmod): Unconditionally call file_chmod with an unaltered mode.
-rw-r--r--trans/fakeroot.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/trans/fakeroot.c b/trans/fakeroot.c
index b79a37d0..c2847c58 100644
--- a/trans/fakeroot.c
+++ b/trans/fakeroot.c
@@ -511,16 +511,10 @@ netfs_attempt_chmod (struct iouser *cred, struct node *np, mode_t mode)
mode |= np->nn_stat.st_mode & S_IFMT;
if ((mode & S_IFMT) != (np->nn_stat.st_mode & S_IFMT))
return EOPNOTSUPP;
- if (((mode | (mode << 3) | (mode << 6))
- ^ (np->nn_stat.st_mode | (np->nn_stat.st_mode << 3)
- | (np->nn_stat.st_mode << 6)))
- & S_IEXEC)
- {
- /* We are changing the executable bit, so this is not all fake. We
- don't bother with error checking since the fake mode change should
- always succeed--worst case a later open will get EACCES. */
- (void) file_chmod (np->nn->file, real_from_fake_mode (mode));
- }
+
+ /* We don't bother with error checking since the fake mode change should
+ always succeed--worst case a later open will get EACCES. */
+ (void) file_chmod (np->nn->file, mode);
np->nn->faked |= FAKE_MODE;
np->nn_stat.st_mode = mode;
return 0;