Commit cf34d549 authored by Tom Anderson's avatar Tom Anderson Committed by Commit Bot

Linux packager: Make sure ELF binaries live exclusively in /opt

BUG=768020
R=thestig@chromium.org

Change-Id: Iaf520e6f064cdc44977607fdac8be7137648bbfd
Reviewed-on: https://chromium-review.googlesource.com/685506Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Commit-Queue: Thomas Anderson <thomasanderson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#504460}
parent 301efd00
......@@ -295,6 +295,16 @@ stage_install_common() {
exit 1
fi
# Make sure ELF binaries live in INSTALLDIR exclusively.
ELF_OUTSIDE_INSTALLDIR=$(find "${STAGEDIR}/" -not -path \
"${STAGEDIR}${INSTALLDIR}/*" -type f | xargs file -b |
grep -ce "^ELF" || true)
if [ "${ELF_OUTSIDE_INSTALLDIR}" -ne 0 ]; then
echo "ERROR: Found ${ELF_OUTSIDE_INSTALLDIR} ELF binaries" \
"outside of ${INSTALLDIR}" 1>&2
exit 1
fi
# Verify file permissions.
for file in $(find "${STAGEDIR}" -mindepth 1); do
local actual_perms=$(stat -c "%a" "${file}")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment