summaryrefslogtreecommitdiffstats
path: root/sysif.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-02-07 21:03:49 -0800
committerKaz Kylheku <kaz@kylheku.com>2020-02-07 21:03:49 -0800
commit158211060c413bcbdebba3f87478673cbee12dc0 (patch)
tree4181c8f72e0b96eba1be8e3cd682f493e52ce27c /sysif.c
parent7b094eccd23ab67c39c4569ffd8e0ce7533038bb (diff)
downloadtxr-158211060c413bcbdebba3f87478673cbee12dc0.tar.gz
txr-158211060c413bcbdebba3f87478673cbee12dc0.tar.bz2
txr-158211060c413bcbdebba3f87478673cbee12dc0.zip
chmod: bug handling comma after right hand ugo.
* sysif.c (chmod_wrap): The chm_comma state is transitioned to after seeing a right hand side u, g or o. These do not combine with other letters, so ch_comma expects a comma after which a new permission clause we start,. Therefore the srcm and who variables must be rest. It's also a good idea to continue the loop. * tests/018/chmod.tl: New test case which exposed the above issue.
Diffstat (limited to 'sysif.c')
-rw-r--r--sysif.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sysif.c b/sysif.c
index 44e236d7..8778a242 100644
--- a/sysif.c
+++ b/sysif.c
@@ -630,8 +630,7 @@ static val chmod_wrap(val target, val mode)
case chm_comma:
if (ch != ',')
goto inval;
- cs = chm_who;
- break;
+ srcm = 0; who = 0; cs = chm_who; continue;
}
{