diff options
author | Robin Lee <cheeselee@fedoraproject.org> | 2017-04-08 21:21:39 +0800 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2018-03-28 13:24:40 +0300 |
commit | 51c67dee8fa44fe2e214a996f5f8f9ededa21d37 (patch) | |
tree | 1a7a1c8c388e47766e8d9724eae4defbef4553f2 | |
parent | 5345bd0110a5cf2edbbd3bf5c2d1c7c421ef600d (diff) | |
download | rpm-51c67dee8fa44fe2e214a996f5f8f9ededa21d37.tar.gz |
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
-rwxr-xr-x[-rw-r--r--] | scripts/find-debuginfo.sh | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/find-debuginfo.sh b/scripts/find-debuginfo.sh index 4293261c9..e3f2ba2cc 100644..100755 --- 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 '(<internal>|<built-in>)$' | (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 |