echo bug?

Smoot Carl-Mitchell smoot at tic.com
Sat Sep 12 03:13:32 UTC 2009


On Fri, 2009-09-11 at 22:56 -0400, Jay Daniels wrote:

> Works from root terminal, so it must be a bug in sudo.

No, it is not a bug in sudo.  The redirection is handled before the
shell forks the privileged sudo process. You can do something like this
to get around the issue:

sudo sh -c "echo hello >/etc/zzz"

In this case sudo executes a privileged shell which handles the
redirection and then runs the echo command.
-- 
Smoot Carl-Mitchell
Computer Systems and
Network Consultant
smoot at tic.com
+1 480 922 7313
cell: +1 602 421 9005




More information about the ubuntu-users mailing list