aboutgitcodelistschat:MatrixIRC
path: root/common/util.c
diff options
context:
space:
mode:
authorStefano Brivio <sbrivio@redhat.com>2023-06-28 17:45:36 +0200
committerStefano Brivio <sbrivio@redhat.com>2023-06-28 17:47:35 +0200
commitbeeefb214a2dc8917b5a31945e740ecce4536764 (patch)
treef0dcb124e3d1c3763842c4119daf786fd222fce3 /common/util.c
parent7c783a3b82b27033b86f75c018f991ffa59fa548 (diff)
downloadseitan-beeefb214a2dc8917b5a31945e740ecce4536764.tar
seitan-beeefb214a2dc8917b5a31945e740ecce4536764.tar.gz
seitan-beeefb214a2dc8917b5a31945e740ecce4536764.tar.bz2
seitan-beeefb214a2dc8917b5a31945e740ecce4536764.tar.lz
seitan-beeefb214a2dc8917b5a31945e740ecce4536764.tar.xz
seitan-beeefb214a2dc8917b5a31945e740ecce4536764.tar.zst
seitan-beeefb214a2dc8917b5a31945e740ecce4536764.zip
cooker, seitan: Add support for GID/UID in context
Similarly to namespace specifications, the special value "caller", as well as login/group names and numeric UID/GIDs are supported. Example of usage in demo/mknod.hjson. Light on checks and with some TODOs left behind at the moment. Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'common/util.c')
-rw-r--r--common/util.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/common/util.c b/common/util.c
index 21676b0..d74e199 100644
--- a/common/util.c
+++ b/common/util.c
@@ -8,6 +8,9 @@
* Author: Stefano Brivio <sbrivio@redhat.com>
*/
+#include <bits/local_lim.h> /* TODO: Why isn't __USE_POSIX with limits.h
+ * enough for LOGIN_NAME_MAX here?
+ */
#include <stdio.h>
#include <stdarg.h>
#include <string.h>
@@ -35,7 +38,9 @@ const char *gluten_offset_name[OFFSET_TYPE_MAX + 1] = {
};
const char *context_type_name[CONTEXT_TYPE_MAX + 1] = {
- "mnt", "cgroup", "uts", "ipc", "user", "pid", "net", "time", "cwd",
+ "mnt", "cgroup", "uts", "ipc", "user", "pid", "net", "time",
+ "cwd",
+ "uid", "gid",
};
const char *context_spec_type_name[CONTEXT_SPEC_TYPE_MAX + 1] = {