aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'libsandbox')
-rw-r--r--libsandbox/symbols.h.in2
-rw-r--r--libsandbox/trace.c14
2 files changed, 11 insertions, 5 deletions
diff --git a/libsandbox/symbols.h.in b/libsandbox/symbols.h.in
index 40c04e3..ecf141c 100644
--- a/libsandbox/symbols.h.in
+++ b/libsandbox/symbols.h.in
@@ -78,7 +78,7 @@ __utime64
utimes
__utimes64
utimensat
-__utimensat64
+__utimensat64 utimensat_time64
futimesat
__futimesat64
lutimes
diff --git a/libsandbox/trace.c b/libsandbox/trace.c
index ae5f935..b7e65b4 100644
--- a/libsandbox/trace.c
+++ b/libsandbox/trace.c
@@ -305,7 +305,7 @@ static bool trace_check_syscall(const struct syscall_entry *se, void *regs)
state.regs = regs;
state.nr = nr = se->sys;
state.func = name = se->name;
- if (!SB_NR_IS_DEFINED(nr)) goto done;
+ if (!SB_NR_IS_DEFINED(se->nr)) goto done;
else if (nr == SB_NR_MKDIR) state.pre_check = sb_mkdirat_pre_check;
else if (nr == SB_NR_MKDIRAT) state.pre_check = sb_mkdirat_pre_check;
else if (nr == SB_NR_UNLINK) state.pre_check = sb_unlinkat_pre_check;
@@ -313,8 +313,7 @@ static bool trace_check_syscall(const struct syscall_entry *se, void *regs)
else state.pre_check = NULL;
/* Hmm, add these functions to the syscall table and avoid this if() ? */
- if (!SB_NR_IS_DEFINED(nr)) goto done;
- else if (nr == SB_NR_CHMOD) return trace_check_syscall_C (&state);
+ if (nr == SB_NR_CHMOD) return trace_check_syscall_C (&state);
else if (nr == SB_NR_CHOWN) return trace_check_syscall_C (&state);
else if (nr == SB_NR_CREAT) return trace_check_syscall_C (&state);
/* NB: Linux syscall does not have a flags argument. */
@@ -343,7 +342,14 @@ static bool trace_check_syscall(const struct syscall_entry *se, void *regs)
else if (nr == SB_NR_UNLINKAT) return trace_check_syscall_DCF(&state);
else if (nr == SB_NR_UTIME) return trace_check_syscall_C (&state);
else if (nr == SB_NR_UTIMES) return trace_check_syscall_C (&state);
- else if (nr == SB_NR_UTIMENSAT) return _trace_check_syscall_DCF(&state, 1, 4);
+
+ else if (nr == SB_NR_UTIMENSAT) {
+ utimensat:
+ return _trace_check_syscall_DCF(&state, 1, 4);
+ } else if (nr == SB_NR___UTIMENSAT64) {
+ state.nr = SB_NR_UTIMENSAT;
+ goto utimensat;
+ }
else if (nr == SB_NR_ACCESS) {
char *path = do_peekstr(trace_arg(regs, 1));