question

Todd C. Miller Todd.Miller at courtesan.com
Thu Feb 20 12:39:13 EST 2003


In message <6808DCE827EBD5119DFB0002A58EF4DA02F5BBD1 at hqempn06.agedwards.com>
	so spake "Boehler, Joe" (Joe.Boehler):

> I have users who need to be able to zero some root owned log files by
> directing stdout to the file. For example,
> >/var/opt/OV/share/databases/eventdb/log_2, but when I enter that as a
> command alias, sudo complains about the syntax.
> 
> Is there a way to write this so the syntax is acceptable to sudo?

The problem is that this uses shell redirection which won't work
in sudo.  The shell does all this behind sudo's back.  To truncate
files with sudo I would use:

    cp /dev/null /var/opt/OV/share/databases/eventdb/log_2

 - todd


More information about the sudo-users mailing list