diff options
author | Stig Thormodsrud <stig@vyatta.com> | 2010-06-11 11:06:30 -0700 |
---|---|---|
committer | Stig Thormodsrud <stig@vyatta.com> | 2010-06-11 11:06:30 -0700 |
commit | d4fe2b1e313f1733a233c9774fd9193a200661e2 (patch) | |
tree | 184202494dbcb5a0f9a97d960d55cc3454eaf803 /templates | |
parent | 7761d8913a30141699b555efa3aac30aa3a41594 (diff) | |
download | vyatta-op-d4fe2b1e313f1733a233c9774fd9193a200661e2.tar.gz vyatta-op-d4fe2b1e313f1733a233c9774fd9193a200661e2.zip |
Block operator user from running "show configuration *"
Diffstat (limited to 'templates')
-rw-r--r-- | templates/show/configuration/all/node.def | 7 | ||||
-rw-r--r-- | templates/show/configuration/cmds/node.def | 7 | ||||
-rw-r--r-- | templates/show/configuration/files/node.def | 7 | ||||
-rw-r--r-- | templates/show/configuration/node.def | 7 |
4 files changed, 24 insertions, 4 deletions
diff --git a/templates/show/configuration/all/node.def b/templates/show/configuration/all/node.def index 12431ce..77c3e04 100644 --- a/templates/show/configuration/all/node.def +++ b/templates/show/configuration/all/node.def @@ -1,2 +1,7 @@ help: Show running configuration (including default values) -run: ${vyatta_sbindir}/vyatta-output-config.pl -all -active +run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ]; + then + ${vyatta_sbindir}/vyatta-output-config.pl -all -active + else + echo Must be an admin user to run this command. + fi diff --git a/templates/show/configuration/cmds/node.def b/templates/show/configuration/cmds/node.def index 03f9f4c..a2d55cf 100644 --- a/templates/show/configuration/cmds/node.def +++ b/templates/show/configuration/cmds/node.def @@ -1,2 +1,7 @@ help: Show running configuration as set commands -run: ${vyatta_sbindir}/vyatta-config-gen-sets.pl +run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ]; + then + ${vyatta_sbindir}/vyatta-config-gen-sets.pl + else + echo Must be an admin user to run this command. + fi diff --git a/templates/show/configuration/files/node.def b/templates/show/configuration/files/node.def index b13bc6d..698ba14 100644 --- a/templates/show/configuration/files/node.def +++ b/templates/show/configuration/files/node.def @@ -1,5 +1,10 @@ help: Show available saved configurations -run: find ${vyatta_sysconfdir}/config/ -type f -not -name ".*" -not -name "config.boot.*" -printf "%f\t(%Tc)\t%T@\n" | sort -r -k3 | awk -F"\t" '{printf ("%-20s\t%s\n", $1,$2) ;}' +run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ]; + then + find ${vyatta_sysconfdir}/config/ -type f -not -name ".*" -not -name "config.boot.*" -printf "%f\t(%Tc)\t%T@\n" | sort -r -k3 | awk -F"\t" '{printf ("%-20s\t%s\n", $1,$2) ;}' + else + echo Must be an admin user to run this command. + fi diff --git a/templates/show/configuration/node.def b/templates/show/configuration/node.def index d3a36e0..3c2c7e7 100644 --- a/templates/show/configuration/node.def +++ b/templates/show/configuration/node.def @@ -1,2 +1,7 @@ help: Show running configuration -run: ${vyatta_sbindir}/vyatta-output-config.pl -active +run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ]; + then + ${vyatta_sbindir}/vyatta-output-config.pl -active + else + echo Must be an admin user to run this command. + fi |