aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ali Polatel <alip@exherbo.org> 2021-02-27 09:13:29 +0100
committerAvatar Ali Polatel <alip@exherbo.org> 2021-02-27 15:55:34 +0100
commitb73d0c0d7b2c0b76bc536ab9411018c745fd5b60 (patch)
tree1ece5687506d09e5ae27ae2a2e4dceb2db910d34
parent24fef428729e92b73d92a21b55459f5a0f9d73ac (diff)
downloadsydbox-1-b73d0c0d7b2c0b76bc536ab9411018c745fd5b60.tar.gz
sydbox-1-b73d0c0d7b2c0b76bc536ab9411018c745fd5b60.tar.xz
initial support for renameat2
Signed-off-by: Ali Polatel <alip@exherbo.org>
-rw-r--r--src/syscall-file.c8
-rw-r--r--src/syscall.c4
2 files changed, 11 insertions, 1 deletions
diff --git a/src/syscall-file.c b/src/syscall-file.c
index aa49593..56af41c 100644
--- a/src/syscall-file.c
+++ b/src/syscall-file.c
@@ -3,7 +3,7 @@
*
* File system related system call handlers
*
- * Copyright (c) 2011, 2012, 2013, 2014, 2015 Ali Polatel <alip@exherbo.org>
+ * Copyright (c) 2011, 2012, 2013, 2014, 2015, 2021 Ali Polatel <alip@exherbo.org>
* Released under the terms of the 3-clause BSD license
*/
@@ -785,6 +785,12 @@ int sys_rename(syd_process_t *current)
return r;
}
+/*
+ * This handles both renameat and renameat2.
+ * We do not take into account the flags argument of renameat2 as none of the
+ * currently supported flags (RENAME_EXCHANGE, RENAME_NOREPLACE,
+ * RENAME_WHITEOUT) are relevant for sandboxing.
+ */
int sys_renameat(syd_process_t *current)
{
int r;
diff --git a/src/syscall.c b/src/syscall.c
index 4fcece5..8c6aefe 100644
--- a/src/syscall.c
+++ b/src/syscall.c
@@ -240,6 +240,10 @@ static const sysentry_t syscall_entries[] = {
.name = "renameat",
.enter = sys_renameat,
},
+ {
+ .name = "renameat2",
+ .enter = sys_renameat,
+ },
{
.name = "symlink",