[Gambas-user] su on non english computers

Bruce Steers bsteers4 at gmail.com
Sat Jan 16 13:40:07 CET 2021


Thanks Bruce.  (and apologies Jussi, was a long day yesterday for me)

gksu (or pkexec as is now used for policy-kit)  (or groot the gambas app i
made that does a similar job but more "cheap hack" like ;) ) are no good
for me though.

It's for a program that compiles and installs latest Gambas so
*./reconf-all* to *make* run as normal user then the last *'make install'*
requires root permissions.

the downside of automating the compile process is that on a slow machine it
can take a long time to get to the 'make install' command and if you've got
bored waiting and gone to watch telly or something the sudo/su command will
timeout asking for password.

I gave the app 3 options at the point of 'make install'
1. do nothing, just run as usual, ask for pass , if not entered just
timeout.
2. pop open a Message, pausing the process till the user clicks okay and is
there ready to type pass.
3. Enter pass at the start and when 'make install' is run auto-type it for
you on detecting the prompt.

Works great with sudo and will in all languages as the sudo prompt line
always starts with [sudo]
I may just make the app not offer the , er , hack , if user has no sudo
just su.

I've had confirmation from a German user that su asks  Passwort in German
Prompts...

sudo  :       [sudo] Passwort für xxxxxxxxxx:
su -c :       Passwort:

And thanks for the info about su , i just tried the su pw using
.terminalview.Input() (works for sudo) and Desktop.Senkeys() and you
are quite right, both failed :'(


BruceS


On Sat, 16 Jan 2021 at 06:37, Bruce <adamnt42 at gmail.com> wrote:

> On 16/1/21 2:34 pm, Bruce Steers wrote:
> > Yes i am sure , It works , thanks.  jeesh
> > I'd thank you for all you other words but i don't want them. for starters
> > my question is about su not sudo.
> >
> > could you at least tell me if you type in a terminal..
> > su -c "echo 'i like to be a smart arse'"
> >
> > what does su ask ?'
> > Does it say
> > Password:
> > In English or is it written in your language?
> >
> > that was my question.
> > I thought it was a simple question.
> >
> > Anyone else?
> >
> > BruceS
> >
> >
> > On Sat, 16 Jan 2021 at 01:58, Jussi Lahtinen <jussi.lahtinen at gmail.com>
> > wrote:
> >
> >> Are you sure you can get the password that way? Sounds fishy to me.
> >> Anyway, look at sudo arguments  --command-timeout and --validate. I
> think
> >> they may offer a more standard way to do this.
> >>
> >
> > nope.  ;)
> >
> >
> >
> > ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
> >
>
> The "Password:" prompt comes from su itself and is not a level 3
> implemented or detectable thing. It's like the true virtual terminal
> login "Password:" prompt, so I presume it is translated according to the
> system locale.
> su is a little harder to work with as it is running itself at a higher
> than "user" level. If you want the same "power" (cough, ahem) as sudo
> then gksu (or the less better new thing, I cant remember its name) or
> kdesu. Both from memory give you program level detection and the ability
> to complete. Also from memory su will only accept a password from the
> keyboard, you (or more correctly I) cannot auto suplly the password.
>
> b
>
> ----[ http://gambaswiki.org/wiki/doc/netiquette ]----
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gambas-basic.org/pipermail/user/attachments/20210116/addc94b6/attachment.htm>


More information about the User mailing list