From 51c67dee8fa44fe2e214a996f5f8f9ededa21d37 Mon Sep 17 00:00:00 2001 From: Robin Lee Date: Sat, 8 Apr 2017 21:21:39 +0800 Subject: Fix non-standard inherented modes of directories in debuginfo In case that binary compiled from source generated in /tmp, a /usr/src/debug/tmp directory will be created with the same mode as /tmp, a.k.a 777, which should be avoided. Fixes: rhbz#641022 Backported from commit c707ab26362e795d3f9dba4eb87dc7ed99a28bcb --- scripts/find-debuginfo.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) mode change 100644 => 100755 scripts/find-debuginfo.sh diff --git a/scripts/find-debuginfo.sh b/scripts/find-debuginfo.sh old mode 100644 new mode 100755 index 4293261c9..e3f2ba2cc --- a/scripts/find-debuginfo.sh +++ b/scripts/find-debuginfo.sh @@ -396,9 +396,10 @@ if [ -s "$SOURCEFILE" ]; then mkdir -p "${RPM_BUILD_ROOT}/usr/src/debug" LC_ALL=C sort -z -u "$SOURCEFILE" | grep -E -v -z '(|)$' | (cd "$RPM_BUILD_DIR"; cpio -pd0mL "${RPM_BUILD_ROOT}/usr/src/debug") - # stupid cpio creates new directories in mode 0700, fixup + # stupid cpio creates new directories in mode 0700, + # and non-standard modes may be inherented from original directories, fixup find "${RPM_BUILD_ROOT}/usr/src/debug" -type d -print0 | - xargs --no-run-if-empty -0 chmod a+rx + xargs --no-run-if-empty -0 chmod 0755 fi if [ -d "${RPM_BUILD_ROOT}/usr/lib" -o -d "${RPM_BUILD_ROOT}/usr/src" ]; then -- cgit v1.2.1