diff options
author | Robin Lee <cheeselee@fedoraproject.org> | 2017-04-08 21:21:39 +0800 |
---|---|---|
committer | Panu Matilainen <pmatilai@redhat.com> | 2017-04-10 08:40:51 +0300 |
commit | c707ab26362e795d3f9dba4eb87dc7ed99a28bcb (patch) | |
tree | 65497e372949876f89c1a5120eba374c85342006 | |
parent | 40efa628a513fa43e47b0151d69c9fa8c8a56ba4 (diff) | |
download | rpm-c707ab26362e795d3f9dba4eb87dc7ed99a28bcb.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
-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 547dbd9c3..6f38e191b 100644..100755 --- a/scripts/find-debuginfo.sh +++ b/scripts/find-debuginfo.sh @@ -490,9 +490,10 @@ if [ -s "$SOURCEFILE" ]; then mkdir -p "${RPM_BUILD_ROOT}${debug_dest_name}" LC_ALL=C sort -z -u "$SOURCEFILE" | grep -E -v -z '(<internal>|<built-in>)$' | (cd "${debug_base_name}"; cpio -pd0mL "${RPM_BUILD_ROOT}${debug_dest_name}") - # 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}${debug_dest_name}" -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 |