Strip inline comments from the kdump config file before use
From: Wade Mealing <wmealing@redhat.com> The RHEL 5 release of mkdumprd allowed for comments in the kdump config file as shown below: net 192.168.1.1 # this is the comment part This patch strips them out during processing, but leaves the configuration file in original condition. Signed-off-by: Wade Mealing <wmealing@redhat.com> Signed-off-by: Baoquan He <bhe@redhat.com> Acked-by: Vivek Goyal <vgoyal@redhat.com>
This commit is contained in:
parent
ee524473c8
commit
59e28ddf75
@ -226,6 +226,8 @@ read_kdump_conf()
|
||||
# first get the necessary variables
|
||||
while read config_opt config_val;
|
||||
do
|
||||
# remove inline comments after the end of a directive.
|
||||
config_val=$(strip_comments $config_val)
|
||||
case "$config_opt" in
|
||||
path)
|
||||
KDUMP_PATH="$config_val"
|
||||
@ -269,6 +271,8 @@ read_kdump_conf()
|
||||
# rescan for add code for dump target
|
||||
while read config_opt config_val;
|
||||
do
|
||||
# remove inline comments after the end of a directive.
|
||||
config_val=$(strip_comments $config_val)
|
||||
case "$config_opt" in
|
||||
ext[234]|xfs|btrfs|minix|nfs)
|
||||
add_dump_code "dump_fs $config_val"
|
||||
|
@ -245,6 +245,8 @@ kdump_install_conf() {
|
||||
|
||||
while read config_opt config_val;
|
||||
do
|
||||
# remove inline comments after the end of a directive.
|
||||
config_val=$(strip_comments $config_val)
|
||||
case "$config_opt" in
|
||||
ext[234]|xfs|btrfs|minix|raw)
|
||||
sed -i -e "s#$config_val#$(kdump_to_udev_name $config_val)#" /tmp/$$-kdump.conf
|
||||
|
6
kdumpctl
6
kdumpctl
@ -10,6 +10,8 @@ SAVE_PATH=/var/crash
|
||||
SSH_KEY_LOCATION="/root/.ssh/kdump_id_rsa"
|
||||
DUMP_TARGET=""
|
||||
|
||||
. /lib/kdump/kdump-lib.sh
|
||||
|
||||
standard_kexec_args="-p"
|
||||
|
||||
if [ -f /etc/sysconfig/kdump ]; then
|
||||
@ -106,6 +108,8 @@ function check_config()
|
||||
}
|
||||
|
||||
while read config_opt config_val; do
|
||||
# remove inline comments after the end of a directive.
|
||||
config_val=$(strip_comments $config_val)
|
||||
case "$config_opt" in
|
||||
\#* | "")
|
||||
;;
|
||||
@ -263,6 +267,8 @@ function load_kdump()
|
||||
function check_ssh_config()
|
||||
{
|
||||
while read config_opt config_val; do
|
||||
# remove inline comments after the end of a directive.
|
||||
config_val=$(strip_comments $config_val)
|
||||
case "$config_opt" in
|
||||
sshkey)
|
||||
if [ -f "$config_val" ]; then
|
||||
|
Loading…
Reference in New Issue
Block a user