From b95a63839ae3e46f948ca6a8a493cd215000e093 Mon Sep 17 00:00:00 2001 From: WANG Chao Date: Mon, 20 Oct 2014 12:48:06 +0800 Subject: [PATCH] kdump-lib: fix get_option_value() get_option_value() is used to get the value of $1 configured in /etc/kdump.conf. But when we use "get_option_value ssh", it can get the value of "sshkey" instead of "ssh". Fix the regexp pattern to get an exact match. Signed-off-by: WANG Chao Acked-by: Baoquan He --- kdump-lib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kdump-lib.sh b/kdump-lib.sh index a20c6e8..b9dec21 100755 --- a/kdump-lib.sh +++ b/kdump-lib.sh @@ -109,7 +109,7 @@ get_mntpoint_from_target() # get_option_value # retrieves value of option defined in kdump.conf get_option_value() { - echo $(strip_comments `grep ^$1 /etc/kdump.conf | tail -1 | cut -d\ -f2-`) + echo $(strip_comments `grep "^$1[[:space:]]\+" /etc/kdump.conf | tail -1 | cut -d\ -f2-`) } #This function compose a absolute path with the mount