From 20cb29c2f8c5c87bc590896854a20b1473ceb358 Mon Sep 17 00:00:00 2001 From: "info@mode42.com" Date: Sat, 8 Aug 2026 03:54:55 +0000 Subject: #2 --- include/hybbx/privilege.h | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 include/hybbx/privilege.h (limited to 'include/hybbx/privilege.h') 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 */ -- cgit v1.3.1