Re: trick question about sudo
- From: Phil Meyer <pmeyer@xxxxxxxxxxxxxxxx>
- Date: Mon, 18 Feb 2008 13:03:58 -0700
Valent Turkovic wrote:
Hi,
I have one question about sudo.
While looking for uid/gid override for samba mounts I found this solution:
sudo echo 0 > /proc/fs/cifs/LinuxExtensionsEnabled
But this obviously doesn't work on Fedora but this works:
sudo sh -c 'echo 0 > /proc/fs/cifs/LinuxExtensionsEnabled'
But the trick question is in which setups and which circumstances can
the first sudo work?
Cheers,
Valent.
The answer: Never
Here is why: plumbing
The command sudo as I type it, belongs to me, and the connections to it, ie: STDIN, STDOUT, and STDERR (file handles 0, 1, and 2) are owned by me, and controlled by the shell that I am in.
These are attached by the shell/OS when sudo is run as a part of loading it, and well before the actual sudo code begins to execute.
Think of it as plumbing and everything in the pipeline before and after the command is mine.
mine >command> mine
ls > /tmp/file
/tmp/file is created with my permissions
any_command > /tmp/file
same
sudo any_command > /tmp/file
same
command < /tmp/file1 > /tmp/file2
/tmp/file1 must be readable by me
/tmp/file2 must be writable by me
Both sides of that pipe are performed as my user, regardless of the command being executed.
Hope that helps.
--
fedora-list mailing list
fedora-list@xxxxxxxxxx
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
- Follow-Ups:
- Re: trick question about sudo
- From: Valent Turkovic
- Re: trick question about sudo
- References:
- trick question about sudo
- From: Valent Turkovic
- trick question about sudo
- Prev by Date: Re: A sound problem one more time.- THE SOLUTION AT LAST (PLEASE NOTE)
- Next by Date: Re: A sound problem one more time.- THE SOLUTION AT LAST (PLEASE NOTE)
- Previous by thread: Re: trick question about sudo
- Next by thread: Re: trick question about sudo
- Index(es):
Relevant Pages
|