diff options
author | Mike Frysinger <vapier@gentoo.org> | 2011-01-01 21:10:42 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2011-01-01 21:19:34 -0500 |
commit | 7f251191a4975f2b7e8183b51da8097e647e6b2b (patch) | |
tree | 2421d49b77fd4cf92e2c435ec36e737725132552 | |
parent | tests: make defaults for fds saner (diff) | |
download | sandbox-7f251191a4975f2b7e8183b51da8097e647e6b2b.tar.gz sandbox-7f251191a4975f2b7e8183b51da8097e647e6b2b.tar.bz2 sandbox-7f251191a4975f2b7e8183b51da8097e647e6b2b.zip |
libsandbox: handle NULL filenames with futimesat
We need to special case a NULL filename with futimesat just like we
already do with utimensat.
URL: http://bugs.gentoo.org/348640
Reported-by: Jeremy Olexa <darkside@gentoo.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rw-r--r-- | libsandbox/libsandbox.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libsandbox/libsandbox.c b/libsandbox/libsandbox.c index 041abe8..e2ac750 100644 --- a/libsandbox/libsandbox.c +++ b/libsandbox/libsandbox.c @@ -1051,9 +1051,12 @@ bool before_syscall(int dirfd, int sb_nr, const char *func, const char *file, in */ if (file == NULL || file[0] == '\0') { if (file == NULL && dirfd != AT_FDCWD && - (sb_nr == SB_NR_UTIMENSAT)) + (sb_nr == SB_NR_UTIMENSAT || sb_nr == SB_NR_FUTIMESAT)) { - /* let it slide */ + /* let it slide -- the func is magic and changes behavior + * from "file relative to dirfd" to "dirfd is actually file + * fd" whenever file is NULL. + */ } else { errno = ENOENT; return false; |