Re: start / run a program only when logged in as root
- From: Hassan Aurag <aurag crm umontreal ca>
- To: Sean Thomas Middleditch <sean middleditch iname com>
- Cc: Adam Sleight <adams linearcorp com>, gnome-devel-list gnome org
- Subject: Re: start / run a program only when logged in as root
- Date: Thu, 25 May 2000 01:53:34 GMT
I have always wanted to ask that question.
Ok, say you got the root password: example with
gnome.app.equest_password (I think the name is correct), what next?
How do you change to root user? How do you check password?
A small example would be nice. Something in Python?
>>>>>>>>>>>>>>>>>> Original Message <<<<<<<<<<<<<<<<<<
On 5/24/00, 6:51:29 PM, Sean Thomas Middleditch
<sean.middleditch@iname.com> wrote regarding Re: start / run a program
only when logged in as root:
> Adam Sleight wrote:
> > linuxconf will not start if your not logged in as root.
> > same with rpm won't run without being root.
> >
> > What is involved (details) of how to require the program to be
executed only as
> > root. Currently this program runs under any user but that is not
ideal since
> > it'll probably screw it up.
> Check the user ID (getuid () or something like that, check the man
pages) and see
> if it is 0 (which is root's UID). Also, you could setup PAM files so
that when
> you run the program, PAM will ask for root password and run the
program as root,
> which is cool, is makes it a LOT easier to people too lazy (or too
much of
> computer novices) to open up a terminal, run su, then the command.
GUI's are
> fun. ^,^
> Anyways, something like, in pseudo code
> if getuid () != 0 then
> nonRootErrorFunctionThingyButPleaseUseAShorterName ()
> endif
> Wow. That's the first time I ever wrote pseudo-code. I don't think I
like it.
> ~,^
> Sean Middleditch
> _______________________________________________
> gnome-devel-list mailing list
> gnome-devel-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gnome-devel-list
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]