gksudo disable elevation persistence
Fabio A. Miranda
fabio.a.miranda at gmail.com
Sat Jan 16 12:11:50 UTC 2010
Sorry, I mean
On Sat, 2010-01-16 at 06:05 -0600, Fabio A. Miranda wrote:
> On Fri, 2010-01-15 at 23:20 +0100, Nils Kassube wrote:
> > Fabio A. Miranda wrote:
> > > I need gksudo to always ask for password, limiting itself to elevate
> > > the just fork'ed process and that is.
> >
> > You could execute the command "sudo -k" to invalidate the sudo timestamp
> > before you execute your gksudo command.
>
> Thanks for your fast reply.
>
> sudo -K and sudo -K seems to work in command line but the EUID / UID of
> a Java application do NOT fork().
>
The EUID/UID of the elevated ProcessBuilt() bash command line remains
elevated as it were the entire JVM process, so consecutive
ProcessÇBuilder() calls will behave as uid=o (include calls to EUID home
directory)
> After a call to gksudo using ProcessBuilder(), the WaitFor() mnthod
> returns, then, another ProcessBuilder does bash -c '/usr/bin/gksudo -k'
>
> The command works perfect but the next ProcessBuilder() is still
> elevated so it doens't do anything.
>
> The feature of gksudo is kool, another attempt to be "user friendly" but
> in other situations we do need more control over run command as root or
> run them as a normal user.
>
> If a JVM is "elevated", the System.getProperty("user.home"); will return
> root's home, bcause gksudo was ran 2 minutes ago.
>
> Can anyone please help ?
>
> thanks,
>
>
>
>
>
> >
> > Nils
> >
>
>
More information about the ubuntu-users
mailing list