Re: NFS and setuid programs fails on 2.1

Albert D. Cahalan (acahalan@cs.uml.edu)
Thu, 13 Aug 1998 19:33:57 -0400 (EDT)


Rogier Wolff (R.E.Wolff@BitWizard.nl)
> Kees Bakker wrote:
>> Alan Cox <alan@lxorguk.ukuu.org.uk> writes:

>>> Ok send me the example again (I didnt keep it - I should have)
>>> I'll look at it this end
>>
>> #!/bin/sh
>>
>> file1=${1-/mnt/kernel/temp}
>> user=hanneke
>>
>> # Now execute a suid program by some other user.
>> su $user -c date > $file1
>
> What do you expect?

The FSUID is carried with the file descriptor, so that I can freely pass
file descriptors around.

> The file gets opened by the shell here, and gets written to by
> $user. That might fail on NFS, indeed.
>
> Use
> su $user -c "date > $file1"
> or something like that to let $user open the file.

No, because $user may not have permission to open the file.
The file may be mode 600, owned by the original user.

-
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.altern.org/andrebalsa/doc/lkml-faq.html