diff options
-rw-r--r-- | cooker/calls/fs.c | 27 | ||||
-rw-r--r-- | cooker/cooker.h | 5 |
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) |