summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJose Quaresma <quaresma.jose@gmail.com>2021-11-07 11:36:52 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2021-11-15 11:56:16 +0000
commitbe28d98b3adfa58ca65102040c41a8390aa145a6 (patch)
treee179d8fd9c871cb6a09b1d48ac9fd6f39f6fea53
parentd6768d9d52336094c4570395149c61bc26b9e3e1 (diff)
downloadpoky-be28d98b3adfa58ca65102040c41a8390aa145a6.tar.gz
sstate: another fix for touching files inside pseudo
This patch is a fixup for 676757f "sstate: fix touching files inside pseudo" running the 'id' command inside the sstate_unpack_package function shows that this funcion run inside the pseudo: uid=0(root) gid=0(root) groups=0(root) The check for [ -w ${SSTATE_PKG} ] and [ -O ${SSTATE_PKG}.siginfo ] will always return true and the touch can fail when the real user don't have permission or in readonly filesystem. As the documentation refers: - the file test operator "-w" check if the file has write permission (for the user running the test). - the file test operator "-O" check if you are owner of file We can avoid this test running the touch and mask any return errors that we have. (From OE-Core rev: 29fc85997ade490ae46ffca37ef8e1a56957c876) (From OE-Core rev: 10e300e6b4c3935d3fd177478f07c429c9b8c735) Signed-off-by: Jose Quaresma <quaresma.jose@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org> (cherry picked from commit 5b9210d66c78bb3f79056e5586cea7b0edd714a9) Signed-off-by: Anuj Mittal <anuj.mittal@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/sstate.bbclass12
1 files changed, 6 insertions, 6 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index 1f37383598..ba2c9fee35 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -888,12 +888,12 @@ python sstate_report_unihash() {
888# 888#
889sstate_unpack_package () { 889sstate_unpack_package () {
890 tar -xvzf ${SSTATE_PKG} 890 tar -xvzf ${SSTATE_PKG}
891 # update .siginfo atime on local/NFS mirror 891 # update .siginfo atime on local/NFS mirror if it is a symbolic link
892 [ -O ${SSTATE_PKG}.siginfo ] && [ -w ${SSTATE_PKG}.siginfo ] && [ -h ${SSTATE_PKG}.siginfo ] && touch -a ${SSTATE_PKG}.siginfo 892 [ ! -h ${SSTATE_PKG}.siginfo ] || touch -a ${SSTATE_PKG}.siginfo 2>/dev/null || true
893 # Use "! -w ||" to return true for read only files 893 # update each symbolic link instead of any referenced file
894 [ ! -w ${SSTATE_PKG} ] || touch --no-dereference ${SSTATE_PKG} 894 touch --no-dereference ${SSTATE_PKG} 2>/dev/null || true
895 [ ! -w ${SSTATE_PKG}.sig ] || [ ! -e ${SSTATE_PKG}.sig ] || touch --no-dereference ${SSTATE_PKG}.sig 895 [ ! -e ${SSTATE_PKG}.sig ] || touch --no-dereference ${SSTATE_PKG}.sig 2>/dev/null || true
896 [ ! -w ${SSTATE_PKG}.siginfo ] || [ ! -e ${SSTATE_PKG}.siginfo ] || touch --no-dereference ${SSTATE_PKG}.siginfo 896 [ ! -e ${SSTATE_PKG}.siginfo ] || touch --no-dereference ${SSTATE_PKG}.siginfo 2>/dev/null || true
897} 897}
898 898
899BB_HASHCHECK_FUNCTION = "sstate_checkhashes" 899BB_HASHCHECK_FUNCTION = "sstate_checkhashes"