Skip to content

Commit

Permalink
HACK: log violations
Browse files Browse the repository at this point in the history
  • Loading branch information
dsseng committed Feb 21, 2025
1 parent 8a6a3a4 commit 42d7a97
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions base/fhs-validator.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ check_dir() {
local RELATIVE_DIR=$(basename "$DIR")

if ! echo "${ALLOWED_DIRS}" | grep -wq "${RELATIVE_DIR}"; then
[[ -d "${DIR}" ]] && echo "${DIR} is not an allowed directory" || echo "${DIR} is not an allowed file"
exit 1
[[ -d "${DIR}" ]] && echo "FHSVALID ${DIR} is not an allowed directory" || echo "FHSVALID ${DIR} is not an allowed file"
exit 0
fi
done
}
Expand All @@ -36,7 +36,7 @@ check_dir "$ROOTDIR/usr" "$ALLOWED_USR_DIRS"

# Do not install man pages and locale info for optimal image size
for DIR in $ROOTDIR/usr/share/man $ROOTDIR/usr/local/man $ROOTDIR/usr/local/share/man $ROOTDIR/usr/share/info $ROOTDIR/usr/share/doc $ROOTDIR/usr/share/locale $ROOTDIR/usr/lib/locale; do
[[ -e ${DIR} ]] && echo "${DIR} is not an allowed directory" && exit 1
[[ -e ${DIR} ]] && echo "FHSVALID ${DIR} is not an allowed directory" && exit 0
done

echo "Validated /usr"

0 comments on commit 42d7a97

Please sign in to comment.