diff options
author | 2021-10-21 22:38:12 -0400 | |
---|---|---|
committer | 2021-10-22 00:15:04 -0400 | |
commit | be55fcb37786f6d29ac3db0c9c98bad5b1de5d94 (patch) | |
tree | 7a502f0a034edb0ca0570d9f9749a09b395b0f27 | |
parent | libsandbox: add renameat2 wrapper (diff) | |
download | sandbox-be55fcb37786f6d29ac3db0c9c98bad5b1de5d94.tar.gz sandbox-be55fcb37786f6d29ac3db0c9c98bad5b1de5d94.tar.bz2 sandbox-be55fcb37786f6d29ac3db0c9c98bad5b1de5d94.zip |
libsandbox: add renameat2 wrapper
It's basically renameat at this point as we don't care about the flags.
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
-rwxr-xr-x | tests/renameat2-2.sh | 12 | ||||
-rwxr-xr-x | tests/renameat2-3.sh | 11 |
2 files changed, 23 insertions, 0 deletions
diff --git a/tests/renameat2-2.sh b/tests/renameat2-2.sh new file mode 100755 index 0000000..420b36d --- /dev/null +++ b/tests/renameat2-2.sh @@ -0,0 +1,12 @@ +#!/bin/sh +# make sure we can clobber symlinks #612202 + +addwrite $PWD + +ln -s /asdf sym || exit 1 +touch file +renameat2-0 0 AT_FDCWD file AT_FDCWD sym || exit 1 +[ ! -e file ] +[ ! -L sym ] +[ -e sym ] +test ! -s "${SANDBOX_LOG}" diff --git a/tests/renameat2-3.sh b/tests/renameat2-3.sh new file mode 100755 index 0000000..ca945a5 --- /dev/null +++ b/tests/renameat2-3.sh @@ -0,0 +1,11 @@ +#!/bin/sh +# make sure we reject bad renames #612202 + +addwrite $PWD +mkdir deny +adddeny $PWD/deny + +touch file +renameat2-0 -1,EACCES AT_FDCWD file AT_FDCWD deny/file || exit 1 +[ -e file ] +test -s "${SANDBOX_LOG}" |