aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2012-12-24 18:46:29 -0500
committerMike Frysinger <vapier@gentoo.org>2012-12-24 18:57:40 -0500
commit45fa8714a1d35e6555083d88a71851ada2aacac4 (patch)
treef8bc29a0db8f1afffd2c5369905d4e2049e9c2dc /tests
parenttests: expand usage strings (diff)
downloadsandbox-45fa8714a1d35e6555083d88a71851ada2aacac4.tar.gz
sandbox-45fa8714a1d35e6555083d88a71851ada2aacac4.tar.bz2
sandbox-45fa8714a1d35e6555083d88a71851ada2aacac4.zip
libsandbox: handle open(O_NOFOLLOW)
We don't check for O_NOFOLLOW in the open wrappers, so we end up returning the wrong error when operating on broken symlinks. URL: https://bugs.gentoo.org/413441 Reported-by: Marien Zwart <marienz@gentoo.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'tests')
-rwxr-xr-xtests/open-2.sh10
-rw-r--r--tests/open.at1
2 files changed, 11 insertions, 0 deletions
diff --git a/tests/open-2.sh b/tests/open-2.sh
new file mode 100755
index 0000000..bba9bee
--- /dev/null
+++ b/tests/open-2.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+# make sure we handle open(O_NOFOLLOW) correctly #413441
+
+set -e
+rm -f tgt
+ln -s tgt sym
+open-0 -1,ELOOP sym O_NOFOLLOW 0
+
+touch tgt
+open-0 -1,ELOOP sym O_NOFOLLOW 0
diff --git a/tests/open.at b/tests/open.at
index 081d7d2..d364b4b 100644
--- a/tests/open.at
+++ b/tests/open.at
@@ -1 +1,2 @@
SB_CHECK(1)
+SB_CHECK(2)