mmap-rnd-bits: Handle unwritable /etc/sysctl.d/

This commit is contained in:
Jeremy Rand 2023-04-22 04:43:41 +00:00
parent 434cfb427f
commit 48a68ba237
No known key found for this signature in database
GPG Key ID: EB03139A459DD06E

View File

@ -45,6 +45,9 @@ vm.mmap_rnd_bits=${BITS_MAX}
vm.mmap_rnd_compat_bits=${COMPAT_BITS_MAX}"
## Write the sysctl.d conf file.
echo "${SYSCTL}" > /etc/sysctl.d/30_security-misc_aslr-mmap.conf
if ! echo "${SYSCTL}" | tee /etc/sysctl.d/30_security-misc_aslr-mmap.conf > /dev/null
then
echo "Error writing ASLR map config"
fi
exit 0