[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: /sys/power/state question with sudoers!



>"Douglas A. Tutty" <dtutty@porchlight.ca>
 
>Today 08:59:23
   
>On Sun, Aug 19, 2007 at 01:58:10PM +0300, Andrei Popescu wrote:
> On Sun, Aug 19, 2007 at 11:36:03AM +0200, Gilles Mocellin wrote:
>  
> > I've just read the manpage of sudo, and here's what it says :
> > 
> > To make a usage listing of the directories in the /home partition.  
Note that 
> > >this runs the commands in a sub-shell to make the cd and file 
>>>redirection 
> > >work.
> > 
> > >$ sudo sh -c "cd /home ; du -s * ??? sort -rn > USAGE"
> > 
> > >So, you can do it in on command, sudo is lauching a shell, which is 
> >> responsible of redirections, pipes, chaining commands...
> 
> >Please correct me if I'm wrong, but this defeats the purpose of 
>> restricting sudo to a certain set of commands.
> 

>You could put the command in a script, owned by root, executable by root
>only, then tell sudo to let you run that command.  This should then log
>that command being run.

I got that same answer in the channel last night, but as you so clearly 
stated you need to be root to run the command. Also the fine gentleman 
stated that cat takes standard output, from the user with the same 
permission the user has, passes it along. I really don't want to give cat 
higher privileges. That also raises the questions when a standard sudo 
user is presented with a password they assume it will be their password 
not roots. With the c option it presents a password, but does not tell 
you it needs root privileges. It also would not solve my problem, of 
getting a standard user the ability to hibernate.

Anyone have any other suggestions, can I have an alias, function, macro, 
in bash with root privileges that would run the command?

Gnu_Raiz



Reply to: