From 9dddf656328b2bcd76292aabc44112e99ad1b25a Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 7 Feb 2020 20:33:58 -0800 Subject: chmod: fix broken Coreutils-compatible sticky clear. * sysif.c (chmod_wrap): Clear the sticky bit from the right variable: cmode rather than bits. --- sysif.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'sysif.c') 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; -- cgit v1.2.3