diff options
author | Norman Stetter <norman.stetter@garz-fricke.com> | 2020-09-25 13:49:43 +0200 |
---|---|---|
committer | Steve Sakoman <steve@sakoman.com> | 2020-09-30 04:35:15 -1000 |
commit | 8e7bb01564d5b06bcbda402cf4d29d7a0ff170c5 (patch) | |
tree | 6f9dcf11dd2cd272e714c9057f909eee1b410f6d /meta/classes/sstate.bbclass | |
parent | ff61cf5777c63a7ebecde5ada1cf01d7bafe265d (diff) | |
download | openembedded-core-contrib-8e7bb01564d5b06bcbda402cf4d29d7a0ff170c5.tar.gz |
sstate.bbclass: Check file ownership before doing 'touch -a'
In contrast to 'touching' a file without parameters 'touch -a' can only be
performed by the file owner. In case of a shared sstate-cache served
locally (e.g. over NFS), where the user running bitbake is not the
owner of sstate-cache files, even if he has write access on group level,
the sstate_unpack_package task will fail.
Checking if the file is owned by the user before attempting to run
'touch -a' on it solves this.
Signed-off-by: Norman Stetter <norman.stetter@garz-fricke.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
(cherry picked from commit f1554e8bd40c640fd58daac18ecf7b458e754109)
Signed-off-by: Steve Sakoman <steve@sakoman.com>
Diffstat (limited to 'meta/classes/sstate.bbclass')
-rw-r--r-- | meta/classes/sstate.bbclass | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass index 375196ef21..66a96a7603 100644 --- a/meta/classes/sstate.bbclass +++ b/meta/classes/sstate.bbclass @@ -847,7 +847,7 @@ python sstate_report_unihash() { sstate_unpack_package () { tar -xvzf ${SSTATE_PKG} # update .siginfo atime on local/NFS mirror - [ -w ${SSTATE_PKG}.siginfo ] && [ -h ${SSTATE_PKG}.siginfo ] && touch -a ${SSTATE_PKG}.siginfo + [ -O ${SSTATE_PKG}.siginfo ] && [ -w ${SSTATE_PKG}.siginfo ] && [ -h ${SSTATE_PKG}.siginfo ] && touch -a ${SSTATE_PKG}.siginfo # Use "! -w ||" to return true for read only files [ ! -w ${SSTATE_PKG} ] || touch --no-dereference ${SSTATE_PKG} [ ! -w ${SSTATE_PKG}.sig ] || [ ! -e ${SSTATE_PKG}.sig ] || touch --no-dereference ${SSTATE_PKG}.sig |