Unix security automating script

Guy Harris guy at auspex.auspex.com
Fri Mar 23 05:43:30 AEST 1990


>>find / -type d -perm -0002 -print

	...

>To do this under SysV use:
>
>
>find / -type d -perm -002 -print
>                      ^^^

Are you trying to say that you need to use a different number of leading
zeroes in System V?  I just checked the 4.3BSD "find" and the System V
Release 3 "find", and the code that handles the "-perm" option when
parsing the command line, and that executes the "perm" test when doing
the tree walk, is *identical* in the two versions of "find" (as in "the
only difference in the source code, if any, is in white space between C
tokens" - the comparison code I was using ignores white space, including
new lines). 

What the *documentation* says is:

     -perm onum     True if the  file  permission  flags  exactly
                    match  the octal number onum (see chmod(1V)).
                    If onum is prefixed by  a  minus  sign,  more
                    flag bits (017777, see chmod(1V)) become sig-
                    nificant  and   the   flags   are   compared:
                    (flags&onum)==onum.

which doesn't say bugger all about leading zeroes - all it talks about
is a leading "-".  The code (in both versions of "find", natch) *always*
treats the argument as an octal number (just as the documentation
says!), and doesn't treat leading zeroes specially.



More information about the Comp.unix.wizards mailing list