actions: implement perm() test function

Implement perm() test function, this is modelled directly on
find -perm and implements its behaviour.

Following find, three types of match are supported:

perm(mode) - exact match
perm(-mode) - all of the permission bits are set for the file
perm(/mode) - any of the permission bits are set for the file

With perm(/mode) if no permission bits are set in mode match
on any file, this is to be consistent with find, which
does this to be consistent with the behaviour of
-perm -000

Note, only symbolic modes are currently implemented.  Octal modes
will be implemented next.

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