summaryrefslogtreecommitdiffstats
path: root/sysif.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-02-07 20:33:58 -0800
committerKaz Kylheku <kaz@kylheku.com>2020-02-07 20:33:58 -0800
commit9dddf656328b2bcd76292aabc44112e99ad1b25a (patch)
treee1f64bc6940fc7969fe8e03869db0a98b11f088e /sysif.c
parent3f229bc3ffd56da0742555d902cd3dce1697394b (diff)
downloadtxr-9dddf656328b2bcd76292aabc44112e99ad1b25a.tar.gz
txr-9dddf656328b2bcd76292aabc44112e99ad1b25a.tar.bz2
txr-9dddf656328b2bcd76292aabc44112e99ad1b25a.zip
chmod: fix broken Coreutils-compatible sticky clear.
* sysif.c (chmod_wrap): Clear the sticky bit from the right variable: cmode rather than bits.
Diffstat (limited to 'sysif.c')
-rw-r--r--sysif.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sysif.c b/sysif.c
index 4f5da7c5..11c07ce5 100644
--- a/sysif.c
+++ b/sysif.c
@@ -676,7 +676,7 @@ static val chmod_wrap(val target, val mode)
case chm_set:
cmode &= ~mask;
if ((who & CHM_O) != 0)
- bits &= ~S_ISVTX; /* GNU Coreutils 8.28 chmod behavior */
+ cmode &= ~S_ISVTX; /* GNU Coreutils 8.28 chmod behavior */
if (!S_ISDIR(cmode))
cmode &= ~(S_ISUID | S_ISGID);
cmode |= bits;