check permissions

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
RickM [ Mi, 16 Januar 2008 17:23 ] [ ID #1908939 ]

Re: check permissions

On Wed, 16 Jan 2008 08:23:37 -0800 (PST), rickm [at] 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
Stephane CHAZELAS [ Mi, 16 Januar 2008 17:25 ] [ ID #1908940 ]

Re: check permissions

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 <stephane_chaze... [at] yahoo.fr>
wrote:
> On Wed, 16 Jan 2008 08:23:37 -0800 (PST), ri... [at] 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
RickM [ Mi, 16 Januar 2008 17:41 ] [ ID #1908942 ]

Re: check permissions

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... [at] 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 <stephane_chaze... [at] yahoo.fr>
> wrote:
>
> > On Wed, 16 Jan 2008 08:23:37 -0800 (PST), ri... [at] 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
RickM [ Mi, 16 Januar 2008 18:25 ] [ ID #1908943 ]

Re: check permissions

On Wed, 16 Jan 2008 09:25:10 -0800 (PST), rickm [at] 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
Stephane CHAZELAS [ Mi, 16 Januar 2008 18:48 ] [ ID #1908946 ]

Re: check permissions

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.
mallin.shetland [ Mi, 16 Januar 2008 22:26 ] [ ID #1908960 ]
Linux » comp.unix.shell » check permissions

Vorheriges Thema: Req: Senior .Net Developer required
Nächstes Thema: eval usage