From 48a68ba237895c0c6c24ebd256ae6a9adec2628f Mon Sep 17 00:00:00 2001 From: Jeremy Rand Date: Sat, 22 Apr 2023 04:43:41 +0000 Subject: [PATCH] mmap-rnd-bits: Handle unwritable /etc/sysctl.d/ --- usr/libexec/security-misc/mmap-rnd-bits | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/usr/libexec/security-misc/mmap-rnd-bits b/usr/libexec/security-misc/mmap-rnd-bits index 88817a1..edb0fb7 100755 --- a/usr/libexec/security-misc/mmap-rnd-bits +++ b/usr/libexec/security-misc/mmap-rnd-bits @@ -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