FS#43224 - [hardening-wrapper] Incompatible with ccache

Attached to Project: Community Packages
Opened by Evangelos Foutras (foutrelis) - Thursday, 25 December 2014, 16:35 GMT
Last edited by Daniel Micay (thestinger) - Thursday, 25 December 2014, 22:44 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Daniel Micay (thestinger)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description:

The issue occurs when both /usr/lib/hardening-wrapper/bin and /usr/lib/ccache/bin appear before /usr/bin in $PATH. (Which is the usual case with the default profile.d/hardening-wrapper.sh and ccache enabled in BUILDENV in makepkg.conf.)

'strace -e execve cc' shows that hardening-wrapper and ccache keep calling each other:

==============================
execve("/usr/lib/ccache/bin/cc", ["cc"], [/* 48 vars */]) = 0
execve("/usr/lib/hardening-wrapper/bin/cc", ["/usr/lib/hardening-wrapper/bin/c"...], [/* 49 vars */]) = 0
execve("/usr/lib/ccache/bin/cc", ["/usr/lib/ccache/bin/cc", "-B/usr/lib/hardening-wrapper/bin", "-fPIE", "-pie", "-fstack-protector-strong"], [/* 47 vars */]) = 0
execve("/usr/lib/hardening-wrapper/bin/cc", ["/usr/lib/hardening-wrapper/bin/c"..., "-B/usr/lib/hardening-wrapper/bin", "-fPIE", "-pie", "-fstack-protector-strong"], [/* 47 vars */]) = 0
(...)
==============================

Additional info:
* package version(s): hardening-wrapper 6-1
This task depends upon

Closed by  Daniel Micay (thestinger)
Thursday, 25 December 2014, 22:44 GMT
Reason for closing:  Fixed
Comment by Daniel Micay (thestinger) - Thursday, 25 December 2014, 22:44 GMT
hardening-wrapper-7-1 fixes this by beginning the search through PATH after /usr/lib/hardening-wrapper/bin

It will now be compatible with wrappers preceding it in PATH like this case but wrappers succeeding it would need to perform the same workaround. In practice that won't be a problem because it ends up prepending itself to PATH before anything else and it's the fault of the other wrappers anyway :).

Loading...