From 5c0d1a95447b14f81a69530c44db768f9a3daddd Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Sat, 28 Jun 2014 14:44:18 +0100 Subject: Make get_config_option more robust against trailing whitespace (thanks, LaMont Jones). --- debian/changelog | 2 ++ debian/openssh-server.config | 4 +++- debian/openssh-server.postinst | 4 +++- 3 files changed, 8 insertions(+), 2 deletions(-) (limited to 'debian') diff --git a/debian/changelog b/debian/changelog index 4daa26ebb..d4f7ebcb1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -2,6 +2,8 @@ openssh (1:6.6p1-6) UNRELEASED; urgency=medium * Upgrade to debhelper v9. * Only use pam_keyinit on Linux architectures (closes: #747245). + * Make get_config_option more robust against trailing whitespace (thanks, + LaMont Jones). * Debconf translations: - Czech (thanks, Michal Šimůnek; closes: #751419). diff --git a/debian/openssh-server.config b/debian/openssh-server.config index 883dbf41b..dbde2cbb0 100644 --- a/debian/openssh-server.config +++ b/debian/openssh-server.config @@ -10,7 +10,9 @@ get_config_option() { [ -f /etc/ssh/sshd_config ] || return # TODO: actually only one '=' allowed after option - perl -ne 'print if s/^[[:space:]]*'"$option"'[[:space:]=]+//i' \ + perl -lne ' + s/[[:space:]]+/ /g; s/[[:space:]]+$//; + print if s/^[[:space:]]*'"$option"'[[:space:]=]+//i' \ /etc/ssh/sshd_config 2>/dev/null } diff --git a/debian/openssh-server.postinst b/debian/openssh-server.postinst index daa0f6796..90bad6285 100644 --- a/debian/openssh-server.postinst +++ b/debian/openssh-server.postinst @@ -16,7 +16,9 @@ get_config_option() { [ -f /etc/ssh/sshd_config ] || return # TODO: actually only one '=' allowed after option - perl -lne 's/\s+/ /g; print if s/^\s*'"$option"'[[:space:]=]+//i' \ + perl -lne ' + s/[[:space:]]+/ /g; s/[[:space:]]+$//; + print if s/^[[:space:]]*'"$option"'[[:space:]=]+//i' \ /etc/ssh/sshd_config } -- cgit v1.2.3