check permissions

check permissions

am 16.01.2008 17:23:37 von RickM

Im looking for a way to identify the files in a large directory tree
have write permissions enabled. This if for locking down a files
system. Any ideas would be appreciated

Thanks

Re: check permissions

am 16.01.2008 17:25:53 von Stephane CHAZELAS

On Wed, 16 Jan 2008 08:23:37 -0800 (PST), rickm@galaxy.nsc.com wrote:
> Im looking for a way to identify the files in a large directory tree
> have write permissions enabled. This if for locking down a files
> system. Any ideas would be appreciated
[...]

I'm not sure I understand the question. "write permissions" for
whom.

Have you checks the manual for find (-perm option). See also
zsh's globbing qualifiers and recursive globbing.

--
Stephane

Re: check permissions

am 16.01.2008 17:41:16 von RickM

Thanks for the tip on find.

heres an example, traverse thru the file hierachy and print out the
line which has write
enabled

dr-xr-xr-x 2 dbadmin users 4096 Apr 12 2007 test_io
dr-xwrxr-x 2 dbadmin users 4096 Apr 12 2007 test_io_27




On Jan 16, 8:25 am, Stephane Chazelas
wrote:
> On Wed, 16 Jan 2008 08:23:37 -0800 (PST), ri...@galaxy.nsc.com wrote:
> > Im looking for a way to identify the files in a large directory tree
> > have write permissions enabled. This if for locking down a files
> > system. Any ideas would be appreciated
>
> [...]
>
> I'm not sure I understand the question. "write permissions" for
> whom.
>
> Have you checks the manual for find (-perm option). See also
> zsh's globbing qualifiers and recursive globbing.
>
> --
> Stephane

Re: check permissions

am 16.01.2008 18:25:10 von RickM

find almost works, is there a way to look for g+w OR u+w OR o
+w ? ...or does it take 3 passes?



On Jan 16, 8:41 am, ri...@galaxy.nsc.com wrote:
> Thanks for the tip on find.
>
> heres an example, traverse thru the file hierachy and print out the
> line which has write
> enabled
>
> dr-xr-xr-x 2 dbadmin users 4096 Apr 12 2007 test_io
> dr-xwrxr-x 2 dbadmin users 4096 Apr 12 2007 test_io_27
>
> On Jan 16, 8:25 am, Stephane Chazelas
> wrote:
>
> > On Wed, 16 Jan 2008 08:23:37 -0800 (PST), ri...@galaxy.nsc.com wrote:
> > > Im looking for a way to identify the files in a large directory tree
> > > have write permissions enabled. This if for locking down a files
> > > system. Any ideas would be appreciated
>
> > [...]
>
> > I'm not sure I understand the question. "write permissions" for
> > whom.
>
> > Have you checks the manual for find (-perm option). See also
> > zsh's globbing qualifiers and recursive globbing.
>
> > --
> > Stephane

Re: check permissions

am 16.01.2008 18:48:26 von Stephane CHAZELAS

On Wed, 16 Jan 2008 09:25:10 -0800 (PST), rickm@galaxy.nsc.com wrote:
> find almost works, is there a way to look for g+w OR u+w OR o
> +w ? ...or does it take 3 passes?
[...] [please do not top post]

Yes, I think you need 3 -perm options unless you have GNU find
in which case you can do find ... -perm /222.

find ... \( -perm -002 -o -perm -020 -o -perm -200 \)

--
Stephane

Re: check permissions

am 16.01.2008 22:26:08 von mallin.shetland

Stephane Chazelas scrisse:

> ... unless you have GNU find in which case you
> can do find ... -perm /222.

.... or find ... -perm /a+w

Or unless you have a BSD find in which case you
can do find ... -perm +222.

With GNU find "-perm +222" also works but is deprecated.