Re: NFS client permission bug

Matthias Urlichs (smurf@smurf.noris.de)
Mon, 11 Nov 1996 10:09:14 +0100 (MET)


Hi,

Elliot Lee wrote:
>
>> > > neumann /ubackup # su hzoli -c 'echo bad' > test
>> > > zsh: write error: permission denied
>>
>> So what? The file is open, thus the echo should be able to write to it,
>> even though it's now running 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.
>
IS NOT. The write() system call is issued by the actual user because that
is what the echo command is running as.

The _open_() system call is done as root (by the shell). This is precisely
the problem -- the Linux NFS client doesn't remember the UID of the user
who opened the file and thus, when it writes, this case is one among many
where it falls flat on its face.

>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.
>
I don't think so.

-- 
Checkbook Balancer's Law:
In matters of dispute, the bank's balance is always smaller than yours.
-- 
Matthias Urlichs         \  noris network GmbH  /  Xlink-POP Nürnberg 
Schleiermacherstraße 12   \   Linux+Internet   /   EMail: urlichs@noris.de
90491 Nürnberg (Germany)   \    Consulting+Programming+Networking+etc'ing
   PGP: 1024/4F578875   1B 89 E2 1C 43 EA 80 44  15 D2 29 CF C6 C7 E0 DE
       Click <A HREF="http://info.noris.de/~smurf/finger">here</A>.    42