[Gambas-user] How to authenticate and switch to root user fromwithin gambas application?

Timothy Marshal-Nichols timothy.marshal-nichols at ...247...
Wed Oct 4 09:15:38 CEST 2006


Hello

Not sure how you can switch to being root user when the application is
running. But you could test if the current user is root and provide a
warning message and also disable option only available to root:

	' root user always has an Id of 0
	IF User.Id = 0 THEN
		' Disable options that can only be run by root
		Message.Info("Not root user - you would have a better
message")
	END IF

In KDE you can create desktop shortcuts and menu items that will run an
application as root and prompt for the root password.
 
Thanks

8-) Timothy Marshal-Nichols
<mailto: timothy.marshal-nichols at ...247...>

 

> -----Original Message-----
> From: gambas-user-bounces at lists.sourceforge.net [mailto:gambas-user-
> bounces at lists.sourceforge.net] On Behalf Of Jose J. Rodriguez
> Sent: 04 October 2006 07:36
> To: mailing list for gambas users
> Subject: Re: [Gambas-user] How to authenticate and switch to root user
> fromwithin gambas application?
> 
> On 10/4/06, Fabien Bodard <gambas.fr at ...626...> wrote:
> > look at the console example !
> >
> > you can run a virtual shell and then execute something in it !
> >
> > maybe it can work ! And you need it as the instance for the program
need
> to
> > be the same as the su one !
> >
> 
> Checked out the console example. I'm afraid running "su" in it gives
> the same error as SHELL: "su: su must be run from a terminal".
> 
> Regards,
> Joe1962
> 
>
------------------------------------------------------------------------
-
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to
share
> your
> opinions on IT & business topics through brief surveys -- and earn
cash
>
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDE
V
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user






More information about the User mailing list