Patrick Williams | 2390b1b | 2022-11-03 13:47:49 -0500 | [diff] [blame^] | 1 | lsof doesn't embed the username or hostname in the build if SOURCE_DATE_EPOCH is |
| 2 | defined, but this still embeds build paths. Delete all of the host details to |
| 3 | ensure that no host information is leaked into the binary. |
| 4 | |
| 5 | Upstream-Status: Inappropriate |
| 6 | Signed-off-by: Ross Burton <ross.burton@arm.com> |
| 7 | |
| 8 | diff --git a/dialects/linux/Makefile b/dialects/linux/Makefile |
| 9 | index 176a4c2..ef5a633 100644 |
| 10 | --- a/dialects/linux/Makefile |
| 11 | +++ b/dialects/linux/Makefile |
| 12 | @@ -83,64 +83,17 @@ ${LIB}: FRC |
| 13 | version.h: FRC |
| 14 | @echo Constructing version.h |
| 15 | @rm -f version.h |
| 16 | - @echo '#define LSOF_BLDCMT "${LSOF_BLDCMT}"' > version.h; |
| 17 | - @echo '#define LSOF_CC "${CC}"' >> version.h |
| 18 | - @echo '#define LSOF_CCV "${CCV}"' >> version.h |
| 19 | - @echo '#define LSOF_CCFLAGS "'`echo ${CFLAGS} | sed 's/\\\\(/\\(/g' | sed 's/\\\\)/\\)/g' | sed 's/"/\\\\"/g'`'"' >> version.h |
| 20 | - @echo '#define LSOF_CINFO "${CINFO}"' >> version.h |
| 21 | - @if [ "X${LSOF_HOST}" = "X" ]; then \ |
| 22 | - if [ "X${SOURCE_DATE_EPOCH}" = "X" ]; then \ |
| 23 | - echo '#define LSOF_HOST "'`uname -n`'"' >> version.h; \ |
| 24 | - else \ |
| 25 | - echo '#define LSOF_HOST ""' >> version.h; \ |
| 26 | - fi \ |
| 27 | - else \ |
| 28 | - if [ "${LSOF_HOST}" = "none" ]; then \ |
| 29 | - echo '#define LSOF_HOST ""' >> version.h; \ |
| 30 | - else \ |
| 31 | - echo '#define LSOF_HOST "${LSOF_HOST}"' >> version.h; \ |
| 32 | - fi \ |
| 33 | - fi |
| 34 | - @echo '#define LSOF_LDFLAGS "${CFGL}"' >> version.h |
| 35 | - @if [ "X${LSOF_LOGNAME}" = "X" ]; then \ |
| 36 | - if [ "X${SOURCE_DATE_EPOCH}" = "X" ]; then \ |
| 37 | - echo '#define LSOF_LOGNAME "${LOGNAME}"' >> version.h; \ |
| 38 | - else \ |
| 39 | - echo '#define LSOF_LOGNAME ""' >> version.h; \ |
| 40 | - fi \ |
| 41 | - else \ |
| 42 | - if [ "${LSOF_LOGNAME}" = "none" ]; then \ |
| 43 | - echo '#define LSOF_LOGNAME ""' >> version.h; \ |
| 44 | - else \ |
| 45 | - echo '#define LSOF_LOGNAME "${LSOF_LOGNAME}"' >> version.h; \ |
| 46 | - fi; \ |
| 47 | - fi |
| 48 | - @if [ "X${LSOF_SYSINFO}" = "X" ]; then \ |
| 49 | - if [ "X${SOURCE_DATE_EPOCH}" = "X" ]; then \ |
| 50 | - echo '#define LSOF_SYSINFO "'`uname -a`'"' >> version.h; \ |
| 51 | - else \ |
| 52 | - echo '#define LSOF_SYSINFO ""' >> version.h; \ |
| 53 | - fi \ |
| 54 | - else \ |
| 55 | - if [ "${LSOF_SYSINFO}" = "none" ]; then \ |
| 56 | - echo '#define LSOF_SYSINFO ""' >> version.h; \ |
| 57 | - else \ |
| 58 | - echo '#define LSOF_SYSINFO "${LSOF_SYSINFO}"' >> version.h; \ |
| 59 | - fi \ |
| 60 | - fi |
| 61 | - @if [ "X${LSOF_USER}" = "X" ]; then \ |
| 62 | - if [ "X${SOURCE_DATE_EPOCH}" = "X" ]; then \ |
| 63 | - echo '#define LSOF_USER "${USER}"' >> version.h; \ |
| 64 | - else \ |
| 65 | - echo '#define LSOF_USER ""' >> version.h; \ |
| 66 | - fi \ |
| 67 | - else \ |
| 68 | - if [ "${LSOF_USER}" = "none" ]; then \ |
| 69 | - echo '#define LSOF_USER ""' >> version.h; \ |
| 70 | - else \ |
| 71 | - echo '#define LSOF_USER "${LSOF_USER}"' >> version.h; \ |
| 72 | - fi \ |
| 73 | - fi |
| 74 | + |
| 75 | + @echo '#define LSOF_BLDCMT ""' > version.h; |
| 76 | + @echo '#define LSOF_CC ""' >> version.h |
| 77 | + @echo '#define LSOF_CCV ""' >> version.h |
| 78 | + @echo '#define LSOF_CCFLAGS ""' >> version.h |
| 79 | + @echo '#define LSOF_CINFO ""' >> version.h |
| 80 | + @echo '#define LSOF_HOST ""' >> version.h |
| 81 | + @echo '#define LSOF_LDFLAGS ""' >> version.h |
| 82 | + @echo '#define LSOF_LOGNAME ""' >> version.h |
| 83 | + @echo '#define LSOF_SYSINFO ""' >> version.h |
| 84 | + @echo '#define LSOF_USER ""' >> version.h |
| 85 | @sed '/VN/s/.ds VN \(.*\)/#define LSOF_VERSION "\1"/' < version >> version.h |
| 86 | |
| 87 | FRC: |