diff options
author | Michael Orlitzky <mjo@gentoo.org> | 2018-01-27 22:38:26 -0500 |
---|---|---|
committer | Mike Gilbert <floppym@gentoo.org> | 2023-06-22 09:55:26 -0400 |
commit | 817965df90b7f421da65d2e1355957b588d8d2fe (patch) | |
tree | 2a3e2f101b9a0b6c01b431bab89d3261ebdc475b | |
parent | tests: add test case for fchown/fchmod with O_RDONLY. (diff) | |
download | sandbox-817965df90b7f421da65d2e1355957b588d8d2fe.tar.gz sandbox-817965df90b7f421da65d2e1355957b588d8d2fe.tar.bz2 sandbox-817965df90b7f421da65d2e1355957b588d8d2fe.zip |
tests: add more tests to make sure fchown/fchmod are handled correctly.
Closes: https://bugs.gentoo.org/599706
Signed-off-by: Michael Orlitzky <mjo@gentoo.org>
Signed-off-by: Mike Gilbert <floppym@gentoo.org>
-rwxr-xr-x | tests/fchmod-2.sh | 11 | ||||
-rw-r--r-- | tests/fchmod.at | 1 | ||||
-rwxr-xr-x | tests/fchown-2.sh | 11 | ||||
-rw-r--r-- | tests/fchown.at | 1 |
4 files changed, 24 insertions, 0 deletions
diff --git a/tests/fchmod-2.sh b/tests/fchmod-2.sh new file mode 100755 index 0000000..96d7cc9 --- /dev/null +++ b/tests/fchmod-2.sh @@ -0,0 +1,11 @@ +#!/bin/sh +# +# Ensure that fchmod() doesn't trigger spurious violations in the most +# basic of cases. +# +addwrite $PWD + +# This should not trigger a violation. +rm -f file +touch file +fchmod-0 0644 file || exit 1 diff --git a/tests/fchmod.at b/tests/fchmod.at index 081d7d2..d364b4b 100644 --- a/tests/fchmod.at +++ b/tests/fchmod.at @@ -1 +1,2 @@ SB_CHECK(1) +SB_CHECK(2) diff --git a/tests/fchown-2.sh b/tests/fchown-2.sh new file mode 100755 index 0000000..dedfbe4 --- /dev/null +++ b/tests/fchown-2.sh @@ -0,0 +1,11 @@ +#!/bin/sh +# +# Ensure that fchown() doesn't trigger spurious violations in the most +# basic of cases. +# +addwrite $PWD + +# This should not trigger a violation. +rm -f file +touch file +fchown-0 ${SB_UID} ${SB_GID} file || exit 1 diff --git a/tests/fchown.at b/tests/fchown.at index 081d7d2..d364b4b 100644 --- a/tests/fchown.at +++ b/tests/fchown.at @@ -1 +1,2 @@ SB_CHECK(1) +SB_CHECK(2) |