From 104ba047ba7842b310ef97a75d5023f455672e6f Mon Sep 17 00:00:00 2001 From: Paul Cammish Date: Tue, 2 Jul 2019 16:47:56 +0100 Subject: [PATCH 1/3] Don't enforce the hostname, but warn on install script --- core/debian/postinst | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/core/debian/postinst b/core/debian/postinst index 3d989405..ce110bea 100755 --- a/core/debian/postinst +++ b/core/debian/postinst @@ -97,23 +97,23 @@ fi # partially mangled hosts files, but will deal with someone changing the # hostname but not also changing /etc/hosts # -if [ $( grep -c $_HOSTNAME '/etc/hosts' ) == 0 ]; then - echo "I: Updating hostname configuration with complete name." - if hostname -i > /dev/null ; then - hostname_ips="$( hostname -i )" - else - hostname_ips="127.0.1.1" - fi - sed -i "s|^$hostname_ips|# $hostname_ips|" '/etc/hosts' - sed -i "1i$hostname_ips\t$_HOSTNAME $( echo $_HOSTNAME | cut -d '.' -f 1 )" '/etc/hosts' - export HOSTNAME="$_HOSTNAME" - hostname -b "$_HOSTNAME" -fi +#if [ $( grep -c $_HOSTNAME '/etc/hosts' ) == 0 ]; then +# echo "I: Updating hostname configuration with complete name." +# if hostname -i > /dev/null ; then +# hostname_ips="$( hostname -i )" +# else +# hostname_ips="127.0.1.1" +# fi +# sed -i "s|^$hostname_ips|# $hostname_ips|" '/etc/hosts' +# sed -i "1i$hostname_ips\t$_HOSTNAME $( echo $_HOSTNAME | cut -d '.' -f 1 )" '/etc/hosts' +# export HOSTNAME="$_HOSTNAME" +# hostname -b "$_HOSTNAME" +#fi # # Enforce using the full hostname # -echo "I: Checking hostname configuration files." +#echo "I: Checking hostname configuration files." if [ "$HOSTNAME" != "$_HOSTNAME" ]; then export HOSTNAME="$_HOSTNAME"; fi if [ "$( hostname )" != "$_HOSTNAME" ]; then hostname -b "$_HOSTNAME" ; fi if [ "$( cat /etc/hostname )" != "$_HOSTNAME" ]; then echo "$_HOSTNAME" > "/etc/hostname" ; fi -- GitLab From 480ca89ad9d3a031be56b4908bf3eed3ea8c3d7a Mon Sep 17 00:00:00 2001 From: Paul Cammish Date: Tue, 2 Jul 2019 16:57:38 +0100 Subject: [PATCH 2/3] Disable remainder of hostname enforcement --- core/debian/postinst | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/debian/postinst b/core/debian/postinst index ce110bea..4f9fe83a 100755 --- a/core/debian/postinst +++ b/core/debian/postinst @@ -114,10 +114,10 @@ fi # Enforce using the full hostname # #echo "I: Checking hostname configuration files." -if [ "$HOSTNAME" != "$_HOSTNAME" ]; then export HOSTNAME="$_HOSTNAME"; fi -if [ "$( hostname )" != "$_HOSTNAME" ]; then hostname -b "$_HOSTNAME" ; fi -if [ "$( cat /etc/hostname )" != "$_HOSTNAME" ]; then echo "$_HOSTNAME" > "/etc/hostname" ; fi -if [ -f "/etc/mailname" ] && [ "$( cat "/etc/mailname" )" != "$_HOSTNAME" ]; then echo "$_HOSTNAME" > "/etc/mailname" ; fi +#if [ "$HOSTNAME" != "$_HOSTNAME" ]; then export HOSTNAME="$_HOSTNAME"; fi +#if [ "$( hostname )" != "$_HOSTNAME" ]; then hostname -b "$_HOSTNAME" ; fi +#if [ "$( cat /etc/hostname )" != "$_HOSTNAME" ]; then echo "$_HOSTNAME" > "/etc/hostname" ; fi +#if [ -f "/etc/mailname" ] && [ "$( cat "/etc/mailname" )" != "$_HOSTNAME" ]; then echo "$_HOSTNAME" > "/etc/mailname" ; fi # # If there are no existing directories beneath /srv/ create the defaults. -- GitLab From b700e5e06c1fa9080dc673a3e294687d6f61f747 Mon Sep 17 00:00:00 2001 From: Paul Cammish Date: Tue, 2 Jul 2019 16:59:25 +0100 Subject: [PATCH 3/3] Updated changelog --- core/debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/core/debian/changelog b/core/debian/changelog index b0861b5e..693606bb 100644 --- a/core/debian/changelog +++ b/core/debian/changelog @@ -1,3 +1,9 @@ +sympl-core (10.0.190702.1) stable; urgency=medium + + * Disabled hostname enforcement + + -- Paul Cammish Tue, 02 Jul 2019 17:00:58 +0100 + sympl-core (10.0.190702.0) stable; urgency=medium * Adjusted security permissions for domains Exim config files -- GitLab