From c8677af0a175438926c1f7d163d05acbff261837 Mon Sep 17 00:00:00 2001 From: Jim MacArthur Date: Fri, 28 Sep 2018 17:57:27 +0100 Subject: _process_list: Make files readable before copying/linking --- buildstream/utils.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/buildstream/utils.py b/buildstream/utils.py index 1e04a31ed..28ba0fb25 100644 --- a/buildstream/utils.py +++ b/buildstream/utils.py @@ -831,8 +831,18 @@ def _process_list(srcdir, destdir, filelist, actionfunc, result, result.ignored.append(path) continue + if not file_stat.st_mode & stat.S_IRUSR: + os.chmod(srcpath, file_stat.st_mode | stat.S_IRUSR) + actionfunc(srcpath, destpath, result=result) + if not file_stat.st_mode & stat.S_IRUSR: + # actionfunc would normally preserve permissions, but + # if we changed them before copying, we need to reset + # the permissions on both. + os.chmod(destpath, file_stat.st_mode) + os.chmod(srcpath, file_stat.st_mode) + elif stat.S_ISCHR(mode) or stat.S_ISBLK(mode): # Block or character device. Put contents of st_dev in a mknod. if not safe_remove(destpath): -- cgit v1.2.1