Skip to content

Commit

Permalink
Harden logger message input.
Browse files Browse the repository at this point in the history
  • Loading branch information
linrunner committed Jan 17, 2020
1 parent 7655562 commit 7cb2884
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tlp-func-base.in
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ echo_debug () { # write debug msg if tag matches -- $1: tag; $2: msg;
[ "$_nodebug" = "1" ] && return 0

if wordinlist "$1" "$TLP_DEBUG"; then
$LOGGER -p debug -t "tlp" --id=$$ "$2" > /dev/null 2>&1
$LOGGER -p debug -t "tlp" --id=$$ -- "$2" > /dev/null 2>&1
fi
}

Expand Down Expand Up @@ -110,7 +110,7 @@ wordinlist () { # test if word in list
check_sysfs () { # debug: check if sysfile exists -- $1: routine; $2: sysfs path
if wordinlist "sysfs" "$TLP_DEBUG"; then
if [ ! -e $2 ]; then
$LOGGER -p debug -t "tlp" --id=$$ "$1: $2 nonexistent" -- > /dev/null 2>&1
$LOGGER -p debug -t "tlp" --id=$$ -- "$1: $2 nonexistent" -- > /dev/null 2>&1
fi
fi
}
Expand Down

0 comments on commit 7cb2884

Please sign in to comment.