diff options
author | An-Cheng Huang <ancheng@vyatta.com> | 2008-02-28 11:03:07 -0800 |
---|---|---|
committer | An-Cheng Huang <ancheng@vyatta.com> | 2008-02-28 11:03:07 -0800 |
commit | b31d2507b9ef7178f6acd3d5f3e00c881ff6944d (patch) | |
tree | e5ef9c7f1782b055fae5227e7b0f27327332c4b5 /scripts | |
parent | 9e85d04ebf37720954e66dbc129ee84b792eae05 (diff) | |
download | vyatta-op-b31d2507b9ef7178f6acd3d5f3e00c881ff6944d.tar.gz vyatta-op-b31d2507b9ef7178f6acd3d5f3e00c881ff6944d.zip |
fix for bug 2911: check log file name
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/vyatta-show-log-file | 7 |
1 files changed, 6 insertions, 1 deletions
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" |