"Request Administrator Mode" equivalent: ideas & suggestions
Posted: Mon Feb 23, 2015 6:25 pm
hi folks,
i am writing a custom (GUI) installer which needs to run as a specific (system) user. Not root, but a different user from the one that is currently logged in. Things i have tried or pondered to achieve this in a couple of different ways:
0. launching the GUI app as a different user through (gk)su(do). the problem is that a. these commands are not available on every distribution nor do they behave the same everywhere, and b. the x server does not allow me to connect as a different user without some xauthority fun/xhost modification. ("cannot connect to X server :0.0")
1. creating a separate (CLI) binary for the part that needs to run as a separate user, while the GUI runs in current user mode. the problem is that i have to give the password to the (sudo -S) command in clear text, which shows up in the logs, so not a good idea either.
2. going from 1. and put everything i need into a shell script file. however my own design restrictions do not allow me to have external bash scripts.
3. several command combinations of export display, .Xauthority, xhost and anything i could find on stackoverflow, without much success.
i'd be thankful for any thoughts on the matter.
PS: i do realize this topic is not directly related to the PB language, although i am writing the installer in PB - so feel free to move it if necessary.
i am writing a custom (GUI) installer which needs to run as a specific (system) user. Not root, but a different user from the one that is currently logged in. Things i have tried or pondered to achieve this in a couple of different ways:
0. launching the GUI app as a different user through (gk)su(do). the problem is that a. these commands are not available on every distribution nor do they behave the same everywhere, and b. the x server does not allow me to connect as a different user without some xauthority fun/xhost modification. ("cannot connect to X server :0.0")
1. creating a separate (CLI) binary for the part that needs to run as a separate user, while the GUI runs in current user mode. the problem is that i have to give the password to the (sudo -S) command in clear text, which shows up in the logs, so not a good idea either.
2. going from 1. and put everything i need into a shell script file. however my own design restrictions do not allow me to have external bash scripts.
3. several command combinations of export display, .Xauthority, xhost and anything i could find on stackoverflow, without much success.
i'd be thankful for any thoughts on the matter.
PS: i do realize this topic is not directly related to the PB language, although i am writing the installer in PB - so feel free to move it if necessary.