summaryrefslogtreecommitdiff
path: root/include/hybbx/privilege.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/hybbx/privilege.h')
-rw-r--r--include/hybbx/privilege.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/include/hybbx/privilege.h b/include/hybbx/privilege.h
new file mode 100644
index 0000000..df646c8
--- /dev/null
+++ b/include/hybbx/privilege.h
@@ -0,0 +1,24 @@
+#ifndef HYBBX_PRIVILEGE_H
+#define HYBBX_PRIVILEGE_H
+
+#include "hybbx/config.h"
+#include "hybbx/types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * Apply [service] user=/group=/uid=/gid= from @p config.
+ *
+ * Linux: hybbxd must not keep running as root. When euid==0, @c user is
+ * required and privileges drop immediately via setuid/setgid.
+ * Non-root starts are unchanged (optional @c user must match effective uid).
+ */
+hybbx_result_t hybbx_privilege_apply_from_config(const hybbx_config_t *config);
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* HYBBX_PRIVILEGE_H */
git clone -b <branch> https://cgit.mode42.com/<repo>.git
git clone -b <branch> git://cgit.mode42.com/<repo>.git

info@mode42.com