actions: fix symbolic mode parsing in the mode() action

When I implemented symbolic modes in the mode() action (i.e.
u+r-w) I made an oversight.  I didn't realise the specification
allowed multiple =-+ sequences after the ownership specification.
In otherwords if you wanted to add r (+r) and remove w (-w)
from user, I assumed you would do u+r,u-w.  After revisiting
the symbolic mode specification it turns out you should be able
to do u+r-w as a short cut to the previous specification.  It
also should be obvious I don't tend to use the symbolic mode but
directly use the octal specification!

So fix the parser to allow multiple =-+ sequences.

So the syntax of the symbolic mode support goes from

[ugoa]+[+-=]PERMS
PERMS = [rwxXst]+ or [ugo]

to

[ugoa]*[[+-=]PERMS]+
PERMS = [rwxXst]+ or [ugo]

Signed-off-by: Phillip Lougher <phillip@squashfs.org.uk>
2 files changed