From 987942a206ef0f2342bf81d5de6432c6af42b7e7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Tue, 21 Nov 2023 09:56:26 +0100 Subject: New upstream version 4.17 --- doc/process_management.rst | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'doc/process_management.rst') diff --git a/doc/process_management.rst b/doc/process_management.rst index 8fe282b..d999608 100644 --- a/doc/process_management.rst +++ b/doc/process_management.rst @@ -202,7 +202,17 @@ User identity control #include - int HXproc_switch_user(const char *user, const char *group); + enum HXproc_su_status { + HXPROC_INITGROUPS_FAILED = -5, + HXPROC_SETGID_FAILED = -4, + HXPROC_SETUID_FAILED = -3, + HXPROC_GROUP_NOT_FOUND = -2, + HXPROC_USER_NOT_FOUND = -1, + HXPROC_SU_NOOP = 0, + HXPROC_SU_SUCCESS = 1, + }; + + enum HXproc_su_status HXproc_switch_user(const char *user, const char *group); ``HXproc_switch_user`` is a wrapper for changing process identity to an unprivileged user. This utilizes ``setuid``, and possibly ``setgid`` plus @@ -217,6 +227,9 @@ process group(s) will change to the the user's group(s) — both primary and secondary — provided a user was specified (see above). When ``gruop`` is the empty string, no change of process group identity occurs. +The return value is an enum indicating failure with values <0, and success with +>=0. + Process information =================== -- cgit v1.2.3