diff options
author | John Southworth <john.southworth@vyatta.com> | 2011-05-06 13:33:58 -0500 |
---|---|---|
committer | John Southworth <john.southworth@vyatta.com> | 2011-05-06 13:33:58 -0500 |
commit | bfdab365e661577e96ced3c226a63244aa50609f (patch) | |
tree | 9929f03d3b2c4c51a1036f853ced803ad1666ba4 /templates | |
parent | 626296ae1aa7eff8ec9d47761f372a652e9ee9df (diff) | |
download | vyatta-op-bfdab365e661577e96ced3c226a63244aa50609f.tar.gz vyatta-op-bfdab365e661577e96ced3c226a63244aa50609f.zip |
Bugfix 7059 These commands weren't specified in the bug but they needed the same check
Diffstat (limited to 'templates')
4 files changed, 28 insertions, 4 deletions
diff --git a/templates/clone/system/config/node.tag/from/node.tag/node.def b/templates/clone/system/config/node.tag/from/node.tag/node.def index d099dc8..42ef94e 100644 --- a/templates/clone/system/config/node.tag/from/node.tag/node.def +++ b/templates/clone/system/config/node.tag/from/node.tag/node.def @@ -7,4 +7,10 @@ allowed: reply=( $(compgen -f /live/image/boot/ | grep -v grub) ) done reply+=( "running://" ) echo "${reply[*]}" -run: sudo ${vyatta_sbindir}/vyatta-image-tools.pl --update $4 $6 +run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ]; + then + sudo ${vyatta_sbindir}/vyatta-image-tools.pl --update $4 $6 + else + echo Must be an admin user to run this command. + fi + diff --git a/templates/clone/system/config/node.tag/node.def b/templates/clone/system/config/node.tag/node.def index 415b665..d54a4cf 100644 --- a/templates/clone/system/config/node.tag/node.def +++ b/templates/clone/system/config/node.tag/node.def @@ -7,4 +7,10 @@ allowed: reply=( $(compgen -f /live/image/boot/ | grep -v grub) ) done reply+=( "running://" ) echo "${reply[*]}" -run: sudo ${vyatta_sbindir}/vyatta-image-tools.pl --updateone $4 +run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ]; + then + sudo ${vyatta_sbindir}/vyatta-image-tools.pl --updateone $4 + else + echo Must be an admin user to run this command. + fi + diff --git a/templates/copy/file/node.tag/to/node.tag/node.def b/templates/copy/file/node.tag/to/node.tag/node.def index 75d4aff..0f03a23 100644 --- a/templates/copy/file/node.tag/to/node.tag/node.def +++ b/templates/copy/file/node.tag/to/node.tag/node.def @@ -4,4 +4,10 @@ help: Copy files to specified destination tftp://<host>/<file> comptype: imagefiles allowed: echo -n "<imagefiles>" -run: sudo ${vyatta_sbindir}/vyatta-image-tools.pl --copy $3 $5 +run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ]; + then + sudo ${vyatta_sbindir}/vyatta-image-tools.pl --copy $3 $5 + else + echo Must be an admin user to run this command. + fi + diff --git a/templates/delete/file/node.tag/node.def b/templates/delete/file/node.tag/node.def index 715ba48..0faf383 100644 --- a/templates/delete/file/node.tag/node.def +++ b/templates/delete/file/node.tag/node.def @@ -1,4 +1,10 @@ help: Delete files in the specified directory comptype: imagefiles allowed: echo -n "<imagefiles>" -run: sudo ${vyatta_sbindir}/vyatta-image-tools.pl --delete=$3 +run: if [ "$VYATTA_USER_LEVEL_DIR" == "/opt/vyatta/etc/shell/level/admin" ]; + then + sudo ${vyatta_sbindir}/vyatta-image-tools.pl --delete=$3 + else + echo Must be an admin user to run this command. + fi + |