Re: permissions not honoured by /bin/pwd aka getcwd

From: Richard B. Johnson (root@chaos.analogic.com)
Date: Thu Feb 24 2000 - 09:10:38 EST


On Thu, 24 Feb 2000, Harald Kirsch wrote:

> On Thu, Feb 24, 2000 at 08:18:17AM -0500, Richard B. Johnson wrote:
> > On Thu, 24 Feb 2000, Harald Kirsch wrote:
> > > Why is /bin/pwd (or getcwd) allowed to return an output in the following
> > > command sequence?
> > >
> > >
> > > % mkdir -p really/closed; cd really/closed; chmod 000 ..; /bin/pwd
> > > /home1_phys/kir/sunHome/tmp/really/closed
> > >
> > > Harald Kirsch
> >
> > Because permissions don't prevent you from reading a directory.
>
> Strange answer. What is `chmod a-r some/directory' good for if not to
> forbid reading a directory?
>
> Harald Kirsch

If prevents non-root from reading (i.e. entering) the directory. You
are never going to hide the directory contents from root.

Here is a non-root user:

Script started on Thu Feb 24 09:07:10 2000
$ pwd
/tmp
$ mkdir foo
$ mkdir foo/bat
$ ls
foo typescript
$ ls foo/*
$ cd foo
$ ls
bat
$ cd ..
$ ls
foo typescript
$ chmod 0 foo
$ ls
foo typescript
$ cd foo
bash: foo: Permission denied
$ ls foo/*
ls: foo/*: Permission denied
$ exit
exit

Script done on Thu Feb 24 09:08:37 2000

Cheers,
Dick Johnson

Penguin : Linux version 2.3.41 on an i686 machine (800.63 BogoMips).

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Tue Feb 29 2000 - 21:00:10 EST