diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2020-02-08 08:47:44 -0800 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2020-02-08 08:47:44 -0800 |
commit | d201dc097fa6920b37c16dd83ca7e52575223d2f (patch) | |
tree | 1fbef878311b1c1a8355563d9cea4461a6e1f150 /sysif.c | |
parent | b8a5b08de163e80e1b72459c5c889bb70eef947b (diff) | |
download | txr-d201dc097fa6920b37c16dd83ca7e52575223d2f.tar.gz txr-d201dc097fa6920b37c16dd83ca7e52575223d2f.tar.bz2 txr-d201dc097fa6920b37c16dd83ca7e52575223d2f.zip |
chmod: ugo perms sees effects from same clause.
This is Coreutils chmod behavior.
* sysif.c (chmod_wrap): Sample cmode into oldm at the start of
every assigment before punching the masked hole into cmode.
* tests/018/chmod.tl: Breaking test case added.
Diffstat (limited to 'sysif.c')
-rw-r--r-- | sysif.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -673,6 +673,7 @@ static val chmod_wrap(val target, val mode) case chm_sub: cmode &= ~bits; break; case chm_set: if (cs == chm_perm) { + oldm = cmode; cmode &= ~mask; if (implicit_all || (who & CHM_O) != 0) cmode &= ~S_ISVTX; /* GNU Coreutils 8.28 chmod behavior */ |