aboutsummaryrefslogtreecommitdiff
path: root/utils.h
diff options
context:
space:
mode:
authorKarel Kočí <cynerd@email.cz>2022-02-11 13:06:01 +0100
committerKarel Kočí <cynerd@email.cz>2022-02-11 13:06:01 +0100
commitdb9e7c9a30e9430119efb34ca9b5324314e6b4a8 (patch)
tree5a8d1978e779ff6b6b473efc0081eaf93b8961dd /utils.h
parent8d61610974c4e60510358ce1bdb22c1042c465a9 (diff)
downloaduroot-db9e7c9a30e9430119efb34ca9b5324314e6b4a8.tar.gz
uroot-db9e7c9a30e9430119efb34ca9b5324314e6b4a8.tar.bz2
uroot-db9e7c9a30e9430119efb34ca9b5324314e6b4a8.zip
Read subuid and subgid files instead of hard coded values
This implements reading of /etc/subuid and /etc/subgid files to correctly map user and group IDs. It also allows just mapping the user itself if there is no mapping configured.
Diffstat (limited to 'utils.h')
-rw-r--r--utils.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/utils.h b/utils.h
index b9c943f..3a41956 100644
--- a/utils.h
+++ b/utils.h
@@ -35,7 +35,12 @@ char *printf_into(char *dst, const char *msg, ...) __attribute__((format(printf,
// returns path to shell interpreter
const char *get_shell();
-// call newuidmap and newgidmap for process of given pid
-int new_map_id(const char *idtp, pid_t pid, int id);
+enum mapidtype {
+ MAP_ID_USER,
+ MAP_ID_GROUP
+};
+
+// call newuidmap or newgidmap for process of given pid
+int new_map_id(enum mapidtype type, pid_t pid, int id);
#endif