[OE-core] [PATCH][PSEUDO 2/4] test-cp-setuid.sh: add

Richard Tollerton rich.tollerton at ni.com
Wed Nov 29 18:02:40 UTC 2017


New test to verify that special bits including setuid are preserved
under `cp -Rp`. This is a regression test of [YOCTO #12379]. Without a
recently committed fix, this test will fail on coreutils 8.24 and later.

Signed-off-by: Richard Tollerton <rich.tollerton at ni.com>
---
 test/test-cp-setuid.sh | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)
 create mode 100755 test/test-cp-setuid.sh

diff --git a/test/test-cp-setuid.sh b/test/test-cp-setuid.sh
new file mode 100755
index 0000000..cdb2cd3
--- /dev/null
+++ b/test/test-cp-setuid.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+set -e
+
+# Verify that special bits (setuid/setgid/sticky) are preserved.
+#
+# Return vals:
+#
+#                 2 - Incorrect permissions
+# All other nonzero - Unexpected command error
+#                 0 - Pass
+
+trap "rm -rf d1 d2" EXIT
+
+mkdir d1
+chmod 7777 d1
+cp -Rp d1 d2
+perms=`ls -od d1 d2 | cut -c 1-10 | uniq`
+if [ "$perms" != drwsrwsrwt ]; then
+	exit 2
+fi
+
+
+exit 0
-- 
2.14.1




More information about the Openembedded-core mailing list