From 9af64b27983915c7bede9d3c444e1fe3f72098c4 Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Thu, 18 Apr 2019 14:25:46 +0200 Subject: [SSPS/SSUS] Install remap file for tftpd This works around buggy PXE clients that pad the filename with a lot of FF bytes. --- satellit_installer/includes/10-configurations.inc | 10 ++++++---- satellit_installer/static_files/tftpd/tftpd-hpa.service | 2 +- satellit_installer/static_files/tftpd/tftpd-remap | 1 + satellit_upgrader/pack-update.sh | 1 + satellit_upgrader/updater.template.sh | 1 + 5 files changed, 10 insertions(+), 5 deletions(-) create mode 100644 satellit_installer/static_files/tftpd/tftpd-remap diff --git a/satellit_installer/includes/10-configurations.inc b/satellit_installer/includes/10-configurations.inc index ea2d9fa..b6fe243 100644 --- a/satellit_installer/includes/10-configurations.inc +++ b/satellit_installer/includes/10-configurations.inc @@ -1,10 +1,12 @@ patch_tftpd-hpa_config() { - echo -n "# Stopping tftpd-hpa server in case it's not managed by inetd... " - [ "$SYSTEMD" ] && systemctl stop tftpd-hpa || /etc/init.d/tftpd-hpa stop 2>/dev/null 1>&2 - echo "ok." + echo "# Stopping tftpd-hpa server in case it's not managed by inetd... " + systemctl stop tftpd-hpa || perror "Failed" # No sense in patching, we will drop this little entry. - echo "# Patching tftpd-hpa configuration... " + echo "# Copying tftpd-hpa configuration... " cp -p "$BASEDIR/static_files/tftpd/tftpd-hpa" "/etc/default/tftpd-hpa" || perror "failed" + echo "# Copying remap file... " + mkdir -p "/opt/openslx" + cp -p "$BASEDIR/static_files/tftpd/tftpd-remap" "/opt/openslx/tftpd-remap" || perror "failed" # sometimes a tftp stating line remains in /etc/inetd.conf. Let's have a look and kill this interesting line: echo -n "# Checking /etc/inetd.conf for a tftp entry... " if [ -f /etc/inetd.conf ]; then diff --git a/satellit_installer/static_files/tftpd/tftpd-hpa.service b/satellit_installer/static_files/tftpd/tftpd-hpa.service index d825d57..b92254a 100644 --- a/satellit_installer/static_files/tftpd/tftpd-hpa.service +++ b/satellit_installer/static_files/tftpd/tftpd-hpa.service @@ -3,7 +3,7 @@ Description=tftpd-hpa (OpenSLX Config) After=network.target [Service] -ExecStart=/usr/sbin/in.tftpd --user tftp --foreground --address :69 --secure /srv/openslx/tftp +ExecStart=/usr/sbin/in.tftpd --map-file /opt/openslx/tftpd-remap --user tftp --foreground --address :69 --secure /srv/openslx/tftp #User=tftp Restart=on-failure diff --git a/satellit_installer/static_files/tftpd/tftpd-remap b/satellit_installer/static_files/tftpd/tftpd-remap new file mode 100644 index 0000000..1650e92 --- /dev/null +++ b/satellit_installer/static_files/tftpd/tftpd-remap @@ -0,0 +1 @@ +re (.)ÿ+ \1 diff --git a/satellit_upgrader/pack-update.sh b/satellit_upgrader/pack-update.sh index a44265e..64f7000 100755 --- a/satellit_upgrader/pack-update.sh +++ b/satellit_upgrader/pack-update.sh @@ -225,6 +225,7 @@ if [ -z "$LEAN" ]; then addinstallfile "tftpd/tftpd-hpa.service" addinstallfile "tftpd/tftpd-hpa" + addinstallfile "tftpd/tftpd-remap" # TODO: Unify more source ../satellit_installer/includes/10-sudo_config.inc diff --git a/satellit_upgrader/updater.template.sh b/satellit_upgrader/updater.template.sh index faf05f5..ea302e4 100644 --- a/satellit_upgrader/updater.template.sh +++ b/satellit_upgrader/updater.template.sh @@ -569,6 +569,7 @@ fi diffcp "tftpd/tftpd-hpa" "/etc/default/tftpd-hpa" && chg=true diffcp "tftpd/tftpd-hpa.service" "/etc/systemd/system/tftpd-hpa.service" && chg=true +diffcp "tftpd/tftpd-remap" "/opt/openslx/tftpd-remap" && chg=true if "$chg"; then ln -s -f "../tftpd-hpa.service" "/etc/systemd/system/multi-user.target.wants/" systemctl daemon-reload -- cgit v1.2.3-55-g7522