From 1b5b089c788ed0bec4be8666e1f8c1712f5ba570 Mon Sep 17 00:00:00 2001 From: Ophestra Umiker Date: Fri, 6 Dec 2024 03:26:09 +0900 Subject: [PATCH] fortify: rename --dbus-id to --id This value is no longer specific to D-Bus defaults. Signed-off-by: Ophestra Umiker --- comp/_fortify | 2 +- main.go | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/comp/_fortify b/comp/_fortify index 1744237..127675b 100644 --- a/comp/_fortify +++ b/comp/_fortify @@ -6,6 +6,7 @@ _fortify_app() { _fortify_run() { _arguments \ + '--id[App ID, leave empty to disable security context app_id]:id' \ '-a[Fortify application ID]: :_numbers' \ '-g[Groups inherited by the app process]: :_groups' \ '-d[Application home directory]: :_files -/' \ @@ -16,7 +17,6 @@ _fortify_run() { '--pulse[Share PulseAudio socket and cookie]' \ '--dbus-config[Path to D-Bus proxy config file]: :_files -g "*.json"' \ '--dbus-system[Path to system D-Bus proxy config file]: :_files -g "*.json"' \ - '--dbus-id[D-Bus ID of application, leave empty to disable own paths]:id' \ '--mpris[Allow owning MPRIS D-Bus path]' \ '--dbus-log[Force logging in the D-Bus proxy]' } diff --git a/main.go b/main.go index 19f3feb..4074bfa 100644 --- a/main.go +++ b/main.go @@ -149,10 +149,10 @@ func main() { var ( dbusConfigSession string dbusConfigSystem string - dbusID string mpris bool dbusVerbose bool + fid string aid int groups gl homeDir string @@ -162,15 +162,15 @@ func main() { set.StringVar(&dbusConfigSession, "dbus-config", "builtin", "Path to D-Bus proxy config file, or \"builtin\" for defaults") set.StringVar(&dbusConfigSystem, "dbus-system", "nil", "Path to system D-Bus proxy config file, or \"nil\" to disable") - set.StringVar(&dbusID, "dbus-id", "", "D-Bus ID of application, leave empty to disable own paths, has no effect if custom config is available") set.BoolVar(&mpris, "mpris", false, "Allow owning MPRIS D-Bus path, has no effect if custom config is available") set.BoolVar(&dbusVerbose, "dbus-log", false, "Force logging in the D-Bus proxy") + set.StringVar(&fid, "id", "", "App ID, leave empty to disable security context app_id") set.IntVar(&aid, "a", 0, "Fortify application ID") set.Var(&groups, "g", "Groups inherited by the app process") set.StringVar(&homeDir, "d", "os", "Application home directory") set.StringVar(&userName, "u", "chronos", "Passwd name within sandbox") - set.BoolVar(&enablements[system.EWayland], "wayland", false, "Share Wayland socket") + set.BoolVar(&enablements[system.EWayland], "wayland", false, "Allow Wayland connections") set.BoolVar(&enablements[system.EX11], "X", false, "Share X11 socket and allow connection") set.BoolVar(&enablements[system.EDBus], "dbus", false, "Proxy D-Bus connection") set.BoolVar(&enablements[system.EPulse], "pulse", false, "Share PulseAudio socket and cookie") @@ -180,7 +180,7 @@ func main() { // initialise config from flags config := &app.Config{ - ID: dbusID, + ID: fid, Command: set.Args(), } @@ -241,7 +241,7 @@ func main() { // parse D-Bus config file from flags if applicable if enablements[system.EDBus] { if dbusConfigSession == "builtin" { - config.Confinement.SessionBus = dbus.NewConfig(dbusID, true, mpris) + config.Confinement.SessionBus = dbus.NewConfig(fid, true, mpris) } else { if c, err := dbus.NewConfigFromFile(dbusConfigSession); err != nil { fmsg.Fatalf("cannot load session bus proxy config from %q: %s", dbusConfigSession, err)