diff options
author | Jim Meyering <jim@meyering.net> | 2001-11-19 13:32:23 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2001-11-19 13:32:23 +0000 |
commit | 500578e250a903f5bbf8c740caae652adac372ba (patch) | |
tree | d1d1c4fb794060edb7387be5b5d889df286fef67 | |
parent | bc0c927da91877982a861a47b33c4232577f39e4 (diff) | |
download | coreutils-500578e250a903f5bbf8c740caae652adac372ba.tar.xz |
(mode_adjust): Fix error introduced on 1999-04-26
that made e.g., `chmod a=,o=w,g=o F' cause F to be group readable
rather than group writable. Patch by Juan F. Codagnone.
-rw-r--r-- | lib/modechange.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/modechange.c b/lib/modechange.c index c7681160f..6fb9832ef 100644 --- a/lib/modechange.c +++ b/lib/modechange.c @@ -413,18 +413,18 @@ mode_adjust (mode_t oldmode, const struct mode_change *changes) if (changes->value & S_IRWXU) /* Copy `u' permissions onto `g' and `o'. */ - value |= ((value & S_IRUSR ? S_IRGRP | S_IROTH : 0) - | (value & S_IWUSR ? S_IWGRP | S_IROTH : 0) + value |= ( (value & S_IRUSR ? S_IRGRP | S_IROTH : 0) + | (value & S_IWUSR ? S_IWGRP | S_IWOTH : 0) | (value & S_IXUSR ? S_IXGRP | S_IXOTH : 0)); else if (changes->value & S_IRWXG) /* Copy `g' permissions onto `u' and `o'. */ - value |= ((value & S_IRGRP ? S_IRUSR | S_IROTH : 0) - | (value & S_IWGRP ? S_IWUSR | S_IROTH : 0) + value |= ( (value & S_IRGRP ? S_IRUSR | S_IROTH : 0) + | (value & S_IWGRP ? S_IWUSR | S_IWOTH : 0) | (value & S_IXGRP ? S_IXUSR | S_IXOTH : 0)); else /* Copy `o' permissions onto `u' and `g'. */ - value |= ((value & S_IROTH ? S_IRUSR | S_IRGRP : 0) - | (value & S_IWOTH ? S_IWUSR | S_IRGRP : 0) + value |= ( (value & S_IROTH ? S_IRUSR | S_IRGRP : 0) + | (value & S_IWOTH ? S_IWUSR | S_IWGRP : 0) | (value & S_IXOTH ? S_IXUSR | S_IXGRP : 0)); /* In order to change only `u', `g', or `o' permissions, |