trick question about sudo

Luciano Rocha strange at
Mon Feb 18 18:46:44 UTC 2008

On Mon, Feb 18, 2008 at 07:43:09PM +0100, 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?

Only when your current user (not the one you're sudoing to) can write
to /proc/fs/cifs/LinuxExtensionsEnabled.

The redirection is made by the shell, before running sudo, so it has to
be able to open the specified file for output.

The example you found is obviously wrong.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: <>

More information about the fedora-list mailing list