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/openssh-server.config | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'debian/openssh-server.config') 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 } -- cgit v1.2.3