echo bug?

Jay Daniels tux at myt60.net
Sat Sep 12 04:03:19 UTC 2009


On Fri, 2009-09-11 at 20:13 -0700, Smoot Carl-Mitchell wrote:
> 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.


Thanks, that works.


jay





More information about the ubuntu-users mailing list