For example the following command
busctl call org.freedesktop.login1 /org/freedesktop/login1 org.freedesktop.login1.Manager UnlockSessions
could be translated in Lua
local bus = require'lsdbus.core'.open'system'
local ok, res = bus:call('org.freedesktop.login1', '/org/freedesktop/login1', 'org.freedesktop.login1.Manager', 'UnlockSessions')
if not ok then
error(res[2])
end
Now, in the context of a daemon written in Lua and running as unpriviligied user
a direct call like os.execute'busctl call ...' fails with Call failed: Access denied.
but os.execute'sudo busctl call ...' works.
So, how to do an equivalent of the sudo with lsdbus ?
For example the following command
could be translated in Lua
Now, in the context of a daemon written in Lua and running as unpriviligied user
a direct call like
os.execute'busctl call ...'fails withCall failed: Access denied.but
os.execute'sudo busctl call ...'works.So, how to do an equivalent of the
sudowith lsdbus ?