Closed gfgit closed 7 months ago
and lxqt-session (daemon, root priviledge).
I'm really surprised here. Does lxqt-session run as root on your side? If the answer is yes. How are then all other lxqt components spawned by lxqt-session dropping their privileges?
My bad, I made the "daemon = root" equation. Without root privileges this topic becomes just a stylistic matter so I'm closing it. Sorry for the noise.
This is a continuation of bug lxqt/lxqt-session#2496
Current behavior is to loop providers both inside
lxqt-leave
(user) andlxqt-session
(daemon, root priviledge). They are tested in this order: (See lxqtpower.cpp#L41)CustomProvider
LXQtProvider
only if not called from daemon itselfSystemdProvider
UPowerProvider
ConsoleKitProvider
LxSessionProvider
So if
CustomProvider
succeeds fromlxqt-leave
, the daemon will never be called (lower priority) and it will never execute custom commands with root privileges. IfCustomProvider
fails, it will fail also if called by daemon soon after so again it will never be called with root privileges. This is becauseCustomProvider
fails only if command cannot be started, it does not check command exit status, so it will always treat started commands as succeeded.Now why should the code be duplicated if
CustomProvider
can never be called bylxqt-session
if not by manually calling DBus without passing throughlxqt-leave
? This would also be inconsistent behavior in my opinion.By swapping
CustomProvider
withLXQtProvider
we run custom commands from daemon and if daemon is not running (is it always running?) then we execute them directly fromlxqt-leave
as user. This is same policy applied to other providers.