add support for /etc/exec / /usr/local/etc/exec

to allow enabling exec on a per VM basis
This commit is contained in:
Patrick Schleizer 2019-12-21 08:03:33 -05:00
parent 1c99b56c9b
commit b2260f48f4
No known key found for this signature in database
GPG Key ID: CB8D50BB77BB3C48

View File

@ -23,11 +23,16 @@ if [ -e /etc/remount-disable ] || [ -e /usr/local/etc/remount-disable ]; then
exit 0 exit 0
fi fi
if [ -e /etc/noexec ] || [ -e /usr/local/etc/noexec ]; then if [ -e /etc/exec ] || [ -e /usr/local/etc/exec ]; then
noexec=true noexec=false
echo "INFO: Will remount with noexec because file /etc/noexec exists." echo "INFO: Will remount with exec because file /etc/exec or /usr/local/etc/exec exists."
else else
echo "INFO: Will not remount with noexec because file /etc/noexec does not exist." if [ -e /etc/noexec ] || [ -e /usr/local/etc/noexec ]; then
noexec=true
echo "INFO: Will remount with noexec because file /etc/noexec or /usr/local/etc/noexec exists."
else
echo "INFO: Will not remount with noexec because file /etc/noexec or /usr/local/etc/noexec does not exist."
fi
fi fi
mkdir --parents "/var/run/remount-secure" mkdir --parents "/var/run/remount-secure"