Skip to content

how to elevate privilege ? #15

Description

@fperrad

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 ?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions