aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2010-11-26 21:53:24 -0500
committerMike Frysinger <vapier@gentoo.org>2010-11-26 21:53:24 -0500
commit2c90a2dd2d5be3ca593a7bcd8d79e6d0db296204 (patch)
treefd3f6f23fa24f305d9333100507e52174ad9d07d /tests
parenttests: allow dirfds to specify mode too (diff)
downloadsandbox-2c90a2dd2d5be3ca593a7bcd8d79e6d0db296204.tar.gz
sandbox-2c90a2dd2d5be3ca593a7bcd8d79e6d0db296204.tar.bz2
sandbox-2c90a2dd2d5be3ca593a7bcd8d79e6d0db296204.zip
libsandbox: fix utimensat regression with NULL filename
The previous commit (libsandbox: handle dirfd in mkdir/open/unlink *at prechecks) unified some path checks while unifying the dirfd code, but prevented valid NULL paths from also being handled. Make sure we still handle that behavior, and add a test for it to prevent future regressions. URL: http://bugs.gentoo.org/346815 Reported-by: Jake Todd <jaketodd422@gmail.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/utimensat-3.sh6
-rw-r--r--tests/utimensat.at1
2 files changed, 7 insertions, 0 deletions
diff --git a/tests/utimensat-3.sh b/tests/utimensat-3.sh
new file mode 100755
index 0000000..4ecd4b3
--- /dev/null
+++ b/tests/utimensat-3.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+# make sure NULL filename is handled correctly
+
+addwrite $PWD
+
+exec utimensat-0 -1:22 'f:O_WRONLY|O_CREAT:0666' NULL NULL 0
diff --git a/tests/utimensat.at b/tests/utimensat.at
index d364b4b..eec4638 100644
--- a/tests/utimensat.at
+++ b/tests/utimensat.at
@@ -1,2 +1,3 @@
SB_CHECK(1)
SB_CHECK(2)
+SB_CHECK(3)