summaryrefslogtreecommitdiff
path: root/templates/show
diff options
context:
space:
mode:
authorBob Gilligan <gilligan@vyatta.com>2008-10-29 16:32:30 -0700
committerBob Gilligan <gilligan@vyatta.com>2008-10-29 16:32:30 -0700
commit78e41fb517a63c4a9cc225975e4714f84918149d (patch)
tree5a490f5f62b8be03c18b230e50bb1f7c327d86a5 /templates/show
parent5304fabe0b0eb212936ca1f47e4cf98d73fd6b81 (diff)
downloadvyatta-op-78e41fb517a63c4a9cc225975e4714f84918149d.tar.gz
vyatta-op-78e41fb517a63c4a9cc225975e4714f84918149d.zip
Bugfix: 3841: Allow admin level users to run the RAID op mode commands.
Diffstat (limited to 'templates/show')
-rw-r--r--templates/show/disk/node.tag/format/node.def4
-rw-r--r--templates/show/raid/node.tag/node.def9
2 files changed, 11 insertions, 2 deletions
diff --git a/templates/show/disk/node.tag/format/node.def b/templates/show/disk/node.tag/format/node.def
index e05b4ad..e5829ca 100644
--- a/templates/show/disk/node.tag/format/node.def
+++ b/templates/show/disk/node.tag/format/node.def
@@ -7,6 +7,8 @@ run:
if [ -z "$is_a_disk" ]; then
echo "$disk_dev is not a disk device"
+ elif [ ! -r /dev/${disk_dev} ]; then
+ echo "Must be admin or root to display disk formating"
else
- fdisk -l /dev/${disk_dev}
+ /sbin/fdisk -l /dev/${disk_dev}
fi
diff --git a/templates/show/raid/node.tag/node.def b/templates/show/raid/node.tag/node.def
index bc83a73..4f9928d 100644
--- a/templates/show/raid/node.tag/node.def
+++ b/templates/show/raid/node.tag/node.def
@@ -12,5 +12,12 @@ run:
if [ -z $valid_set ]; then
echo "$raid_set_name is not a RAID set"
else
- mdadm --detail /dev/${raid_set_name}
+ if [ -r /dev/${raid_set_name} ]; then
+ # This should work without sudo because we have read
+ # access to the dev, but for some reason mdadm must be
+ # run as root in order to succeed.
+ sudo /sbin/mdadm --detail /dev/${raid_set_name}
+ else
+ echo "Must be administrator or root to display RAID status"
+ fi
fi \ No newline at end of file