Re: NFS and setuid programs fails on 2.1

Rogier Wolff (R.E.Wolff@BitWizard.nl)
Thu, 13 Aug 1998 11:11:34 +0200 (MEST)


Kees Bakker wrote:
> >>>>> "Alan" == Alan Cox <alan@lxorguk.ukuu.org.uk> writes:
>
> Alan> Ok send me the example again (I didnt keep it - I should have) I'll look at
> Alan> 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 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.

I certainly missed the beginning of this thread.

Rogier.

-- 
| The secret of success is sincerity.  Once you can |  R.E.Wolff@BitWizard.nl 
| fake that, you've got it made.  -- Jean Giraudoux |       T: +31-15-2137555 
- Custom Linux device drivers for sale! Call for a quote. - F: +31-15-2138217

- 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