[Gambas-user] Any possible way to level up?

Bruce Steers bsteers4 at gmail.com
Fri Jun 3 16:33:02 CEST 2022


On Fri, 3 Jun 2022 at 15:09, Rolf-Werner Eilert <rwe-sse at osnanet.de> wrote:

> Am 03.06.22 um 15:42 schrieb T Lee Davidson:
> > On 6/3/22 05:48, Bruce Steers wrote:
> >> Many programs, for example mint update shows available updates and
> >> only when i press "Install updates" does it ask for su elevation.
> >>
> >
> > I could be wrong since I have tried Debian-flavored distros only twice:
> > once out of curiosity and once out of necessity. However, I am fairly
> > certain that it does not escalate its own privileges but calls an
> > install script with the su privileges through sudo.
> >
> >
>
> I think there is a one-program-calls-second-one mechanism. I know it
> from Ubuntu, but it seems as if the password thing calls another process
> which is in the sudo list and uses the password given to call sudo (and
> sudo is only that it may be called from a non-sudo user).
>
> Or something like that...
>

Right i think i get it.
I think my method could be considered sound if there was a .Begin() and
.End() method.
The downfall i'm experiencing in my software is that i have to bunch all
the root commands up into a temporary script to run them all at once as
Desktop.RunAsRoot() is a one hit wonder, then the user only has to enter
password once for all the commands.

With the RootShell.class i could .Begin()  (set up the term with pkexec
bash) then allow the program to issue various commands as needed,  then
.End() (kill the terminal when done)

the Process_Read() function sucks though. it misses things/truncates :(
Useful for commands that do not give output like cp / mv / rm

downside is the process running in the terminalview is bash. so the
Process.State does not represent the command bash is running just that bash
is running.


Cheers all
BruceS
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20220603/02beb5f0/attachment.htm>


More information about the User mailing list