From b31d2507b9ef7178f6acd3d5f3e00c881ff6944d Mon Sep 17 00:00:00 2001 From: An-Cheng Huang Date: Thu, 28 Feb 2008 11:03:07 -0800 Subject: fix for bug 2911: check log file name --- scripts/vyatta-show-log-file | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/vyatta-show-log-file b/scripts/vyatta-show-log-file index 1f8a0ef..caf8ac9 100755 --- a/scripts/vyatta-show-log-file +++ b/scripts/vyatta-show-log-file @@ -1,6 +1,11 @@ #!/bin/bash -if [ -f /var/log/user/$1 ]; then +if [[ "$1" == */* ]]; then + echo "Invalid log file name" + exit 1 +fi + +if [ -f "/var/log/user/$1" ]; then cat /var/log/user/$1 else echo "No such log file" -- cgit v1.2.3