From 4edd4887541eeff2970c27aa16328a42051e20f4 Mon Sep 17 00:00:00 2001 From: Richard Braun Date: Wed, 5 Feb 2014 23:57:40 +0100 Subject: 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. --- trans/fakeroot.c | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'trans') 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; -- cgit v1.2.3