commit:     652097eb4228ac9ba9973811b2832fc77f2048a2
Author:     Michael Orlitzky <mjo <AT> gentoo <DOT> org>
AuthorDate: Sun Jan 28 03:38:26 2018 +0000
Commit:     Mike Gilbert <floppym <AT> gentoo <DOT> org>
CommitDate: Thu Jun 22 13:54:38 2023 +0000
URL:        https://gitweb.gentoo.org/proj/sandbox.git/commit/?id=652097eb

tests: add more tests to make sure fchown/fchmod are handled correctly.

Closes: https://bugs.gentoo.org/599706
Signed-off-by: Michael Orlitzky <mjo <AT> gentoo.org>
Signed-off-by: Mike Gilbert <floppym <AT> gentoo.org>

 tests/fchmod-2.sh | 11 +++++++++++
 tests/fchmod.at   |  1 +
 tests/fchown-2.sh | 11 +++++++++++
 tests/fchown.at   |  1 +
 4 files changed, 24 insertions(+)

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)

Reply via email to