diff options
author | Paulo Neves <ptsneves@gmail.com> | 2022-07-03 13:41:14 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2022-07-04 15:15:14 +0100 |
commit | f0ee9008597b08704726c5c140836c2497002711 (patch) | |
tree | 9afaf4ecd1f563f831f15aaced0502f52fd1b001 /meta-selftest | |
parent | 0e84a9d697842fce615f2d6a9fbbae121955051c (diff) | |
download | poky-f0ee9008597b08704726c5c140836c2497002711.tar.gz |
utils: create_cmdline_shebang_wrapper preserve permission and ownership
The .real command was not given the same permissions and ownership as
the original pre-wrap file and this is now fixed.
A situation where the original pre-wrap file did not have write
permissions would cause a failure in the wrapping is also fixed.
Test update also included.
(From OE-Core rev: 47973fd4f3fbb0af1a0d1bc2c39f2900a963177d)
Signed-off-by: Paulo Neves <ptsneves@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta-selftest')
-rw-r--r-- | meta-selftest/recipes-test/wrapper/cmdline-shebang-wrapper-test.bb | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/meta-selftest/recipes-test/wrapper/cmdline-shebang-wrapper-test.bb b/meta-selftest/recipes-test/wrapper/cmdline-shebang-wrapper-test.bb index c4126a41fc..c3d3548d4a 100644 --- a/meta-selftest/recipes-test/wrapper/cmdline-shebang-wrapper-test.bb +++ b/meta-selftest/recipes-test/wrapper/cmdline-shebang-wrapper-test.bb | |||
@@ -8,7 +8,10 @@ SRC_URI += "file://test.awk" | |||
8 | EXCLUDE_FROM_WORLD = "1" | 8 | EXCLUDE_FROM_WORLD = "1" |
9 | do_install() { | 9 | do_install() { |
10 | install -d ${D}${bindir} | 10 | install -d ${D}${bindir} |
11 | install -m 0755 ${WORKDIR}/test.awk ${D}${bindir}/test | 11 | # was not able to make ownership preservation check |
12 | install -m 0400 ${WORKDIR}/test.awk ${D}${bindir}/test | ||
13 | |||
14 | perm_old="$(stat --format='%a' ${D}${bindir}/test)" | ||
12 | sed -i -e 's|@AWK_BIN@|${bindir}/awk|g' ${D}${bindir}/test | 15 | sed -i -e 's|@AWK_BIN@|${bindir}/awk|g' ${D}${bindir}/test |
13 | create_cmdline_shebang_wrapper ${D}${bindir}/test | 16 | create_cmdline_shebang_wrapper ${D}${bindir}/test |
14 | if [ $(${D}${bindir}/test) != "Don't Panic!" ]; then | 17 | if [ $(${D}${bindir}/test) != "Don't Panic!" ]; then |
@@ -16,6 +19,12 @@ do_install() { | |||
16 | else | 19 | else |
17 | bbnote "Wrapper is good" | 20 | bbnote "Wrapper is good" |
18 | fi | 21 | fi |
22 | |||
23 | perm_new="$(stat --format='%a' ${D}${bindir}/test.real)" | ||
24 | |||
25 | if [ "$perm_new" != "$perm_old" ]; then | ||
26 | bbfatal "Wrapper permissions for ${D}${bindir}/test.real not preserved. Found $perm_new but expected $perm_old" | ||
27 | fi | ||
19 | } | 28 | } |
20 | 29 | ||
21 | BBCLASSEXTEND = "native" | 30 | BBCLASSEXTEND = "native" |