Re: NFS client permission bug

Elliot Lee (sopwith@cuc.edu)
Sun, 10 Nov 1996 23:17:08 -0500 (EST)


On Mon, 11 Nov 1996, Matthias Urlichs wrote:

> In linux.dev.kernel, article <Pine.LNX.3.95.961108011553.25921U-100000@moisil.wal.rhno.columbia.edu>,
> Ion Badulescu <ionut@moisil.wal.rhno.columbia.edu> writes:
>
> > > neumann /ubackup # su hzoli -c 'echo bad' > test
> > > zsh: write error: permission denied
> > > neumann /ubackup # ls -l test
> > > -rw-r--r-- 1 root root 0 Nov 6 18:52 test
> > > neumann /ubackup #
> >
> > It's your root shell that creates the file! The output of the su command
> > gets redirected, not the output of the echo command.
> >
> So what? The file is open, thus the echo should be able to write to it,
> even though it's now runing as another user.

The output to the file is done as root, since bash doesn't care whether
you are redirecting the output of echo 'foo' or su auser -c echo 'foo'
into the test file.

> Quick fix for _this_ problem is to remember the uid of whoever opened the
> file in the NFS file structure so that whoever writes to it can do so.

The UID that opened it here is root. However there are bugs in NFS that
let open() work without adequate permissions, it seems, when UID 0
squashing is in effect.

-- Elliot

A: "Talk about stupidity!"
B: "Who, you?"
A: "No, me!"