summaryrefslogtreecommitdiff
path: root/src/basic/util.h
diff options
context:
space:
mode:
authorMichael Chapman <mike@very.puzzling.org>2015-09-06 00:07:17 +1000
committerMichael Chapman <mike@very.puzzling.org>2015-09-06 00:07:17 +1000
commit88ced61bf9673407f4b15bf51b1b408fd78c149d (patch)
treeb6cf57f054c3e65497b01100446a6667b3ef474d /src/basic/util.h
parent403ed0e5c914f2a0a683403d8ba7eaf96e3ffcdf (diff)
core: pass details to polkit for some unit actions
The following details are passed: - unit: the primary name of the unit upon which the action was invoked (i.e. after resolving any aliases); - verb: one of 'start', 'stop', 'reload', 'restart', 'try-restart', 'reload-or-restart', 'reload-or-try-restart', 'kill', 'reset-failed', or 'set-property', corresponding to the systemctl verb used to invoke the action. Typical use of these details in a polkit policy rule might be: // Allow alice to manage example.service; // fall back to implicit authorization otherwise. polkit.addRule(function(action, subject) { if (action.id == "org.freedesktop.systemd1.manage-units" && action.lookup("unit") == "example.service" && subject.user == "alice") { return polkit.Result.YES; } }); We also supply a custom polkit message that includes the unit's name and the requested operation.
Diffstat (limited to 'src/basic/util.h')
-rw-r--r--src/basic/util.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/basic/util.h b/src/basic/util.h
index f8e32360f0..0fafebd52d 100644
--- a/src/basic/util.h
+++ b/src/basic/util.h
@@ -567,6 +567,7 @@ void *xbsearch_r(const void *key, const void *base, size_t nmemb, size_t size,
void *arg);
#define _(String) gettext (String)
+#define N_(String) String
void init_gettext(void);
bool is_locale_utf8(void);