Skip to content

Privileged backend: QProcess + pkexec wrapper and machine-readable CLI output #23

Description

@vhrabar

Description

Single audited privilege boundary. The CLI already resolves the real user from PKEXEC_UID, so pkexec secureEye -U <user> … is the transport. In C++ this means an async QProcess wrapper plus strict parsing,which requires the CLI to emit structured output.

Tasks

  • GuiBackend class (QObject): async run(command, args) via QProcess, signals for finished/failed/cancelled; never blocks the UI thread
  • Add/verify --plain or JSON output on the CLI commands the GUI consumes (list has --plain; audit add, remove, clear, disable, set, version), parse with QJsonDocument, never scrape human-readable text
  • Ship polkit policy com.github.vhrabar.secureeye.policy with separate action IDs for read vs write (…manage-models, …modify-config, …control-service)
  • Map pkexec exit codes (126 dismissed, 127 not authorized) and CLI non-zero exits to distinct user-visible errors
  • Refuse to start if launched as root (check geteuid() at startup, explain why)

Acceptance criteria

  • Cancelling the polkit dialog leaves every view consistent
  • All CLI interaction goes through GuiBackend; no raw QProcess calls elsewhere
  • Policy file installed by meson and listed in packaging

Activity

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

Metadata

Metadata

Assignees

Projects

  • Status
    In progress

Relationships

None yet

Development

No branches or pull requests

Issue actions