#!/bin/sh # Installed in the image as /usr/local/bin/{unsquashfs,sasquatch,sasquatch-v4be} # (symlinks to this script), in front of the real tools in /usr/bin. # # As the unprivileged container user these tools can't restore security.* # xattrs (SELinux labels, file capabilities) that firmware images often # carry: they extract every file but print "not superuser" errors and exit 2, # which reads as a failed extraction. Pass -no-xattrs unless the caller # already chose an xattr option (-xattrs, -user-xattrs, -xattrs-include, ...). tool="/usr/bin/$(basename "$0")" for arg in "$@"; do case "$arg" in -*xattrs*) exec "$tool" "$@" ;; esac done exec "$tool" -no-xattrs "$@"