In a polkitd enabled system running icewm whose policy does not allow an ordinary user to reboot, when an ordinary user wants to reboot, a graphic password window is expected to be ready to authenticate.
I want to achieve this by running a polkit gnome agent. When I have a /usr/lib/polkit-gnome-authentication-agent-1 running in background. I tried things like following, and meet a weird problem:
$ nohup /usr/lib/polkit-gnome-authentication-agent-1 &
$ systemctl reboot # run from xterm
=> The authentication dialog can be pop up successfully
=> However clicking the reboot button from the icewm "logout" submenu, the
desktop looks "frozen" without accepting mouse and keyboard events.
Interestingly, it actually not hangs, wait for 10-20 minutes or so, the
authentication dialog pops out, which behaves in a very sluggish way. And
each of the subsequent mouse/keyboard actions become extremely slowly
responded.
Hanging around icewm src, I found the following attempted patch actually could
resolve the problem. While the difference seems runCommand() ends up with calling "execvp()"
and doLogout() ends up with calling "system()".
But the thing is I am pretty new to icewm, and not very experienced of subtle practice of system() and
execvp() running in the context. So I probably underestimated the risk of the change. Are there any one here could possibly help to take a look? Any thoughts will be appreciated. Thank you. If you think submitting the following patch is fine, I will do that :-)
Index: icewm-1.3.12/src/wmapp.cc
===================================================================
--- icewm-1.3.12.orig/src/wmapp.cc
+++ icewm-1.3.12/src/wmapp.cc
@@ -1821,7 +1821,7 @@ void YWMApp::handleSMAction(int message)
break;
case ICEWM_ACTION_REBOOT:
rebootOrShutdown = 1;
- wmapp->doLogout();
+ wmapp->runCommand(rebootCommand);
break;
case ICEWM_ACTION_RESTARTWM:
wmapp->restartClient(0, 0);