diff options
author | Svante Signell <svante.signell@gmail.com> | 2015-06-17 00:12:49 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2015-06-17 00:12:49 +0200 |
commit | f57ed76faed9e9e922ba93dd3bf8740974eb718a (patch) | |
tree | 7391e61683c67b6c866c269bced9caa04d9b0cfd | |
parent | f5bc22b18e3c3042dbf7e4ecc38e046b13a2a992 (diff) |
Cope with scripts which chmod -x directories
As well as other potential mode changes which are indeed supposed to still
work as root.
* trans/fakeroot.c (netfs_attempt_chmod): Always set S_IRUSR and S_IWUSR in
real_mode, and set S_IXUSR also when this is a directory.
-rw-r--r-- | trans/fakeroot.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/trans/fakeroot.c b/trans/fakeroot.c index 63303a09..4275152d 100644 --- a/trans/fakeroot.c +++ b/trans/fakeroot.c @@ -554,13 +554,11 @@ netfs_attempt_chmod (struct iouser *cred, struct node *np, mode_t mode) /* Make sure that `check_openmodes' will still always be able to reopen it. */ - real_mode = mode; nn = netfs_node_netnode (np); - if (nn->openmodes & O_READ) - real_mode |= S_IRUSR; - if (nn->openmodes & O_WRITE) - real_mode |= S_IWUSR; - if (nn->openmodes & O_EXEC) + real_mode = mode; + real_mode |= S_IRUSR; + real_mode |= S_IWUSR; + if (S_ISDIR (mode) || (nn->openmodes & O_EXEC)) real_mode |= S_IXUSR; /* We don't bother with error checking since the fake mode change should |