Re: Sudoers list?
- From: erik@xxxxxxxxxxxxx (Erik Christiansen)
- Date: Wed, 5 Apr 2006 13:19:51 +1000
On Tue, Apr 04, 2006 at 10:14:05PM +0100, Daniel Carrera wrote:
Chris Bannister wrote:
I don't want to force people to run this script as root. Running stuff
as root is a really bad habit. I want this script to be as non-root
friendly as possible. There is only one step that *might* warrant root
access and that's if the destination directory belongs to root.
Just run gksudo and test for whatever error code it gives if the user
isn't in the sudoers file / gives the wrong password.
The problem with that is that is that the user still gets a password
prompt even if they are not sudoers.
But not if doing only "sudo -l" (or -v). I just tried it.
Then the return value can be tested, as already suggested, can't it?:
erik@dvalin:~$ sudo -v
erik@dvalin:~$ echo $?
0
I guess I'll just assume that the user is a sudoer and give them the
prompt...
Hopefully not. :-)
Erik
--
ubuntu-users mailing list
ubuntu-users@xxxxxxxxxxxxxxxx
https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
- Follow-Ups:
- Re: Sudoers list?
- From: Daniel Carrera
- Re: Sudoers list?
- From: Matthew Kuiken
- Re: Sudoers list?
- References:
- Sudoers list?
- From: Daniel Carrera
- Re: Sudoers list?
- From: Matthew R. Dempsky
- Re: Sudoers list?
- From: Daniel Carrera
- Re: Sudoers list?
- From: Chris Bannister
- Re: Sudoers list?
- From: Daniel Carrera
- Re: Sudoers list?
- From: Stephen R Laniel
- Re: Sudoers list?
- From: Daniel Carrera
- Re: Sudoers list?
- From: Chris Bannister
- Re: Sudoers list?
- From: Daniel Carrera
- Sudoers list?
- Prev by Date: Re: Fw: NOT HAPPY after Breezy upgrade/install
- Next by Date: Re: Destroying "only" your home directory (was Re: Newbie question on permissions)
- Previous by thread: Re: Sudoers list?
- Next by thread: Re: Sudoers list?
- Index(es):
Relevant Pages
|