aboutgitcodelistschat:MatrixIRC
diff options
context:
space:
mode:
authorAlice Frosi <afrosi@redhat.com>2023-08-25 09:59:08 +0200
committerAlice Frosi <afrosi@redhat.com>2023-08-25 09:59:08 +0200
commitdf9e3287663155d89fe990712e90080f4a621a79 (patch)
tree5431786670a217609c1e0762f09b18f1f3a1333a
parent6fcea0af3c9a81606b59b9503bffd322c630e342 (diff)
downloadseitan-df9e3287663155d89fe990712e90080f4a621a79.tar
seitan-df9e3287663155d89fe990712e90080f4a621a79.tar.gz
seitan-df9e3287663155d89fe990712e90080f4a621a79.tar.bz2
seitan-df9e3287663155d89fe990712e90080f4a621a79.tar.lz
seitan-df9e3287663155d89fe990712e90080f4a621a79.tar.xz
seitan-df9e3287663155d89fe990712e90080f4a621a79.tar.zst
seitan-df9e3287663155d89fe990712e90080f4a621a79.zip
cooker: add chown and lchown
-rw-r--r--cooker/calls/fs.c27
-rw-r--r--cooker/cooker.h5
2 files changed, 31 insertions, 1 deletions
diff --git a/cooker/calls/fs.c b/cooker/calls/fs.c
index 469dd88..4135be9 100644
--- a/cooker/calls/fs.c
+++ b/cooker/calls/fs.c
@@ -175,8 +175,35 @@ static struct arg mknodat_args[] = {
{ 0 }
};
+static struct arg chown_args[] = {
+ { 0,
+ {
+ "path", STRING, 0,
+ 0, PATH_MAX,
+ { 0 }
+ }
+ },
+ { 1,
+ {
+ "uid", UID_T, 0,
+ 0, 0,
+ { .d_num = modes },
+ }
+ },
+ { 2,
+ {
+ "gid", GID_T, 0,
+ 0, 0,
+ { 0 },
+ }
+ },
+ { 0 }
+};
+
struct call syscalls_fs[] = {
{ __NR_mknod, "mknod", mknod_args },
{ __NR_mknodat, "mknodat", mknodat_args },
+ { __NR_chown, "chown", chown_args },
+ { __NR_lchown, "lchown", chown_args },
{ 0 },
};
diff --git a/cooker/cooker.h b/cooker/cooker.h
index cd804d3..9217c40 100644
--- a/cooker/cooker.h
+++ b/cooker/cooker.h
@@ -90,6 +90,8 @@ enum type {
GNU_DEV_MINOR,
FDPATH,
+ UID_T,
+ GID_T,
TYPE_END,
};
@@ -117,7 +119,8 @@ enum flags {
#define TYPE_IS_NUM(t) \
((t) == USHORT || (t) == INT || (t) == U32 || \
(t) == U64 || (t) == LONG || \
- (t) == GNU_DEV_MAJOR || (t) == GNU_DEV_MINOR)
+ (t) == GNU_DEV_MAJOR || (t) == GNU_DEV_MINOR) || \
+ (t) == UID_T || (t) == GID_T
#define TYPE_IS_64BIT(t) \
((t) == U64 || (t) == LONG || \
(t) == GNU_DEV_MAJOR || (t) == GNU_DEV_MINOR)