From 03291945fd1c7bf5dcfcc61415b9ae749ffe962f Mon Sep 17 00:00:00 2001 From: Deepti Kulkarni Date: Thu, 24 Jun 2010 02:08:02 +0000 Subject: Blocked user operator from using show tech-support. Added new show commands. --- templates/show/tech-support/brief/node.def | 7 ++++++- templates/show/tech-support/brief/save-uncompressed/node.def | 7 ++++++- .../tech-support/brief/save-uncompressed/node.tag/node.def | 10 +++++++--- templates/show/tech-support/brief/save/node.def | 7 ++++++- templates/show/tech-support/brief/save/node.tag/node.def | 10 +++++++--- 5 files changed, 32 insertions(+), 9 deletions(-) (limited to 'templates/show/tech-support/brief') diff --git a/templates/show/tech-support/brief/node.def b/templates/show/tech-support/brief/node.def index 800574c..23f588e 100644 --- a/templates/show/tech-support/brief/node.def +++ b/templates/show/tech-support/brief/node.def @@ -1,2 +1,7 @@ help: Show brief tech-support report -run: source ${vyatta_datadir}/vyatta-op/functions/tech-support-brief +run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ]; + then + source ${vyatta_datadir}/vyatta-op/functions/tech-support-brief + else + echo Must be an admin user to run this command + fi diff --git a/templates/show/tech-support/brief/save-uncompressed/node.def b/templates/show/tech-support/brief/save-uncompressed/node.def index cc271de..7d36614 100644 --- a/templates/show/tech-support/brief/save-uncompressed/node.def +++ b/templates/show/tech-support/brief/save-uncompressed/node.def @@ -1,2 +1,7 @@ help: Save uncompressed brief tech-support report -run: source ${vyatta_datadir}/vyatta-op/functions/tech-support-brief save-uncompressed +run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ]; + then + source ${vyatta_datadir}/vyatta-op/functions/tech-support-brief save-uncompressed + else + echo Must be an admin user to run this command + fi diff --git a/templates/show/tech-support/brief/save-uncompressed/node.tag/node.def b/templates/show/tech-support/brief/save-uncompressed/node.tag/node.def index 523a340..f90ecd4 100644 --- a/templates/show/tech-support/brief/save-uncompressed/node.tag/node.def +++ b/templates/show/tech-support/brief/save-uncompressed/node.tag/node.def @@ -1,4 +1,8 @@ help: Save uncompressed brief tech-support report to specified file/path -allowed: echo -n 'file scp://:@/ ftp://:@/' -run: source ${vyatta_datadir}/vyatta-op/functions/tech-support-brief save-uncompressed $5 - +allowed: echo -n ' :@/> :@/>' +run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ]; + then + source ${vyatta_datadir}/vyatta-op/functions/tech-support-brief save-uncompressed $5 + else + echo Must be an admin user to run this command + fi diff --git a/templates/show/tech-support/brief/save/node.def b/templates/show/tech-support/brief/save/node.def index c738a0a..966a984 100644 --- a/templates/show/tech-support/brief/save/node.def +++ b/templates/show/tech-support/brief/save/node.def @@ -1,2 +1,7 @@ help: Save brief tech-support report -run: source ${vyatta_datadir}/vyatta-op/functions/tech-support-brief save +run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ]; + then + source ${vyatta_datadir}/vyatta-op/functions/tech-support-brief save + else + echo Must be an admin user to run this command + fi diff --git a/templates/show/tech-support/brief/save/node.tag/node.def b/templates/show/tech-support/brief/save/node.tag/node.def index 95aaa87..97ebdf6 100644 --- a/templates/show/tech-support/brief/save/node.tag/node.def +++ b/templates/show/tech-support/brief/save/node.tag/node.def @@ -1,4 +1,8 @@ help: Save compressed brief tech-support report to specified file/path -allowed: echo -n 'file scp://:@/ ftp://:@/' -run: source ${vyatta_datadir}/vyatta-op/functions/tech-support-brief save $5 - +allowed: echo -n ' :@/> :@/>' +run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ]; + then + source ${vyatta_datadir}/vyatta-op/functions/tech-support-brief save $5 + else + echo Must be an admin user to run this command + fi -- cgit v1.2.3