[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
sudo 'class' directive not doing what I would expect
- To: misc_(_at_)_openbsd_(_dot_)_org
- Subject: sudo 'class' directive not doing what I would expect
- From: Rich <openbsd64_(_at_)_rbentley_(_dot_)_com>
- Date: Tue, 10 Aug 2004 21:50:57 +0059
- Reply-to: openbsd64_(_at_)_rbentley_(_dot_)_com
I'm assuming I'm misunderstanding something here, but I can't seem to get
sudo's '-c' option to do what I want / expect.
Simple Example :
In /etc/login.conf, I have the following classes defined :
:path=/usr/bin /bin /usr/sbin /sbin /usr/X11R6/bin /usr/local/bin:\
I have a user (let's call it 'me') with the class 'service' set for it. ie...
> chpass me
# Changing user database information for me.
Encrypted password: *
Uid [#]: 1003
Gid [# or name]: 1003
Change [month day year]:
Expire [month day year]:
Home directory: /home/me
Full Name: Me
If (from root), I do this....
> sudo -u me -c service echo env
...I would expect it to print the environment of the 'service' class, but it
doesn't - instead it seems to prints the environment of 'default' class.
SSH_CONNECTION=192.168.0.5 4130 22.214.171.124 22
...bla bla bla...
It's got USER right, but I would also expect to see the PATH set by 'system'
printed, but instead I get the PATH set by 'default'. Same goes for SHELL.
Any ideas why I don't get the (well, my !) expected result or am I just
completely misunderstanding something here ?