aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2011-01-01 21:10:42 -0500
committerMike Frysinger <vapier@gentoo.org>2011-01-01 21:19:34 -0500
commit7f251191a4975f2b7e8183b51da8097e647e6b2b (patch)
tree2421d49b77fd4cf92e2c435ec36e737725132552 /libsandbox
parenttests: make defaults for fds saner (diff)
downloadsandbox-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>
Diffstat (limited to 'libsandbox')
-rw-r--r--libsandbox/libsandbox.c7
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;