summaryrefslogtreecommitdiffstats
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
commit152a12592d3c5ee2794e938ed18c4939cac5cace (patch)
treee1f64bc6940fc7969fe8e03869db0a98b11f088e
parent26a5ec711f60c65d74e1fee0b539372a492a3e6f (diff)
downloadtxr-152a12592d3c5ee2794e938ed18c4939cac5cace.tar.gz
txr-152a12592d3c5ee2794e938ed18c4939cac5cace.tar.bz2
txr-152a12592d3c5ee2794e938ed18c4939cac5cace.zip
chmod: fix broken Coreutils-compatible sticky clear.
* sysif.c (chmod_wrap): Clear the sticky bit from the right variable: cmode rather than bits.
-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;