[PyQt] Asking for temporary privilege elevation
Barry
barry at barrys-emacs.org
Sat Jan 6 16:16:43 GMT 2018
> On 6 Jan 2018, at 15:33, Shriramana Sharma <samjnaa at gmail.com> wrote:
>
>> On 1/6/18, Barry <barry at barrys-emacs.org> wrote:
>>
>> This is not pyqt problem.
>
> Never said it was. Just wanted to know what approach PyQt users employ
> for this problem.
>
>> But short answer is you cannot change current
>> process privs.
>
> OK.
>
>> Use subprocess to spawn a sudo command line. You need to set sudo askpass to
>> allow the sudo password to be entered.
>
> To avoid external dependency on an askpass program (and there only
> seem to be "ssh-askpass" programs, none for generic sudo), I suppose I
> can just get the password from an input dialog and then pass it to
> `sudo -S`?
>
Have a look at the scm workbench code that solves a related problem with git.
Look at the small program that used the askpass interface to call back into the gui to get the username and password that is needed.
https://github.com/barry-scott/scm-workbench
Barry
> --
> Shriramana Sharma ஶ்ரீரமணஶர்மா श्रीरमणशर्मा 𑀰𑁆𑀭𑀻𑀭𑀫𑀡𑀰𑀭𑁆𑀫𑀸
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20180106/e1b25b51/attachment.html>
More information about the PyQt
mailing list