Red Hat Bugzilla – Bug 1441098
rpmbuild might create world writeable /usr/src/debug/tmp directory in debuginfo packages
Last modified: 2018-04-10 11:59:42 EDT
rpm used to have a bug that caused it to sometimes add a world writeable directory to a debuginfo package. Specifically if a (generated) source file was found in /tmp it would add /usr/src/debug/tmp to the debuginfo package. The directory would have the same mode as /tmp: drwxrwxrwt. 2 root root 6 Aug 2 2016 /usr/src/debug/tmp A fix is already upstream: commit c707ab26362e795d3f9dba4eb87dc7ed99a28bcb Author: Robin Lee <cheeselee@fedoraproject.org> Date: Sat Apr 8 21:21:39 2017 +0800 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 This impacts at last the following packages in RHEL 7.3 (x86_64): dhcp-debuginfo-4.2.5-47.el7.x86_64.rpm glib2-debuginfo-2.46.2-4.el7.x86_64.rpm libmemcached-debuginfo-1.0.16-5.el7.x86_64.rpm libvirt-debuginfo-2.0.0-10.el7.x86_64.rpm mariadb-debuginfo-5.5.52-1.el7.x86_64.rpm pcp-debuginfo-3.11.3-4.el7.x86_64.rpm perl-debuginfo-5.16.3-291.el7.x86_64.rpm postgresql-debuginfo-9.2.18-1.el7.x86_64.rpm python-debuginfo-2.7.5-48.el7.x86_64.rpm qemu-guest-agent-debuginfo-2.5.0-3.el7.x86_64.rpm qemu-kvm-debuginfo-1.5.3-126.el7.x86_64.rpm ruby-debuginfo-2.0.0.648-29.el7.x86_64.rpm sssd-debuginfo-1.14.0-43.el7.x86_64.rpm tcl-debuginfo-8.5.13-8.el7.x86_64.rpm Once the fix is backported it would be nice to rebuild at least the above debuginfo packages. As a special case it might make sense to explicitly remove /usr/src/debug/tmp from a package if it is empty (in general empty directories under /usr/src/debug/<package-nvr>/ are a feature, not a bug). When multiple packages contain the same directory they will conflict when the directory has different modes in different packages.
See also https://bugzilla.redhat.com/show_bug.cgi?id=641022 the rpm-4.13.x-writable-tmp-dir.patch backport for f26 should apply to rhel too.
Since the problem described in this bug report should be resolved in a recent advisory, it has been closed with a resolution of ERRATA. For information on the advisory, and where to find the updated files, follow the link below. If the solution does not work for you, open a new bug report. https://access.redhat.com/errata/RHBA-2018:0877