summaryrefslogtreecommitdiffstats
path: root/parser.l
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-02-08 07:50:07 -0800
committerKaz Kylheku <kaz@kylheku.com>2020-02-08 08:43:23 -0800
commitb8a5b08de163e80e1b72459c5c889bb70eef947b (patch)
treebabbb8db9933a0c509c25e39cd52d74b359a6af4 /parser.l
parent158211060c413bcbdebba3f87478673cbee12dc0 (diff)
downloadtxr-b8a5b08de163e80e1b72459c5c889bb70eef947b.tar.gz
txr-b8a5b08de163e80e1b72459c5c889bb70eef947b.tar.bz2
txr-b8a5b08de163e80e1b72459c5c889bb70eef947b.zip
chmod: ugo must refer to unaltered perms.
Within the same clause, permissions given by ugo must refer to the unaltered permissions, before the target bits were masked out, otherwise self-assignment like o=o just clears the permissions. The other self-referential perm is X: it checks for existing x permissions. That works with the current value. * sysif.c (chmod_wrap): Keep the old permissions in a new loop variable called oldm. The u, g and o perms refer to oldm rather than to the updated value in cmode. When we hit a comma, we update oldm to the current value. The code for this is now in one place with a goto. * tests/018/chmod.tl: New test case that fails in the absence of this fix. Test cases confirming that X refers to the current permissions.
Diffstat (limited to 'parser.l')
0 files changed, 0 insertions, 0 deletions