Skip to content

Commit

Permalink
refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
adrelanos committed Jan 15, 2022
1 parent 9141f1f commit 949b4c7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions debian/hardened-malloc-light-enable.postinst
Expand Up @@ -18,7 +18,7 @@ true "
## feature request: /etc/ld.so.preload.d drop-in configuration folder support
## https://sourceware.org/bugzilla/show_bug.cgi?id=24913

create_hardened_malloc_kicksecure_enabled_status_file() {
create_hardened_malloc_light_enabled_status_file() {
mkdir --parents /var/lib/hardened-malloc-kicksecure-enable
touch /var/lib/hardened-malloc-kicksecure-enable/enabled
}
Expand All @@ -34,13 +34,13 @@ fi
if test -r /usr/lib/libhardened_malloc.so/libhardened_malloc-light.so ; then
if grep -q /usr/lib/libhardened_malloc.so/libhardened_malloc-light.so /etc/ld.so.preload ; then
echo "INFO: $0: /usr/lib/libhardened_malloc.so/libhardened_malloc-light.so already enabled in /etc/ld.so.preload, OK."
create_hardened_malloc_kicksecure_enabled_status_file
create_hardened_malloc_light_enabled_status_file
else
if test -f /var/lib/hardened-malloc-kicksecure-enable/enabled ; then
echo "INFO: $0: /usr/lib/libhardened_malloc.so/libhardened_malloc-light.so was already previously enabled by this package, but currently is disabled. Leaving it as is, OK."
elif echo "/usr/lib/libhardened_malloc.so/libhardened_malloc-light.so" | tee "/etc/ld.so.preload" >/dev/null ; then
echo "INFO: $0: enabled /usr/lib/libhardened_malloc.so/libhardened_malloc-light.so in /etc/ld.so.preload, OK."
create_hardened_malloc_kicksecure_enabled_status_file
create_hardened_malloc_light_enabled_status_file
else
echo "ERROR: $0: could not write /usr/lib/libhardened_malloc.so/libhardened_malloc-light.so to /etc/ld.so.preload." >&2
fi
Expand Down

0 comments on commit 949b4c7

Please sign in to comment.