summaryrefslogtreecommitdiffstats
path: root/usr.sbin/mfiutil/mfi_config.c
diff options
context:
space:
mode:
authoreadler <eadler@FreeBSD.org>2012-06-19 06:18:37 +0000
committereadler <eadler@FreeBSD.org>2012-06-19 06:18:37 +0000
commita60d1f6e5a0fe73d35acfcd458741ca308c560d9 (patch)
tree04fe97cef2b87eaef65b55c81e107b964cdab5d0 /usr.sbin/mfiutil/mfi_config.c
parent1edc5fff530bcba6af1ed5f9906050641833c0e9 (diff)
downloadFreeBSD-src-a60d1f6e5a0fe73d35acfcd458741ca308c560d9.zip
FreeBSD-src-a60d1f6e5a0fe73d35acfcd458741ca308c560d9.tar.gz
Allow users with RO privilege to the device to read the RO attributes.
PR: bin/167302 Submitted by: markham breitbach <markham@ssimicro.com> Discussed with: pjd (briefly) Approved by: cperciva MFC after: 1 week
Diffstat (limited to 'usr.sbin/mfiutil/mfi_config.c')
-rw-r--r--usr.sbin/mfiutil/mfi_config.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/usr.sbin/mfiutil/mfi_config.c b/usr.sbin/mfiutil/mfi_config.c
index feb285d..b3ac982 100644
--- a/usr.sbin/mfiutil/mfi_config.c
+++ b/usr.sbin/mfiutil/mfi_config.c
@@ -35,6 +35,7 @@
#endif
#include <err.h>
#include <errno.h>
+#include <fcntl.h>
#include <libutil.h>
#ifdef DEBUG
#include <stdint.h>
@@ -157,7 +158,7 @@ clear_config(int ac, char **av)
int ch, error, fd;
u_int i;
- fd = mfi_open(mfi_unit);
+ fd = mfi_open(mfi_unit, O_RDWR);
if (fd < 0) {
error = errno;
warn("mfi_open");
@@ -575,7 +576,7 @@ create_volume(int ac, char **av)
narrays = 0;
error = 0;
- fd = mfi_open(mfi_unit);
+ fd = mfi_open(mfi_unit, O_RDWR);
if (fd < 0) {
error = errno;
warn("mfi_open");
@@ -857,7 +858,7 @@ delete_volume(int ac, char **av)
return (EINVAL);
}
- fd = mfi_open(mfi_unit);
+ fd = mfi_open(mfi_unit, O_RDWR);
if (fd < 0) {
error = errno;
warn("mfi_open");
@@ -925,7 +926,7 @@ add_spare(int ac, char **av)
return (EINVAL);
}
- fd = mfi_open(mfi_unit);
+ fd = mfi_open(mfi_unit, O_RDWR);
if (fd < 0) {
error = errno;
warn("mfi_open");
@@ -1050,7 +1051,7 @@ remove_spare(int ac, char **av)
return (EINVAL);
}
- fd = mfi_open(mfi_unit);
+ fd = mfi_open(mfi_unit, O_RDWR);
if (fd < 0) {
error = errno;
warn("mfi_open");
@@ -1196,7 +1197,7 @@ debug_config(int ac, char **av)
return (EINVAL);
}
- fd = mfi_open(mfi_unit);
+ fd = mfi_open(mfi_unit, O_RDWR);
if (fd < 0) {
error = errno;
warn("mfi_open");
@@ -1233,7 +1234,7 @@ dump(int ac, char **av)
return (EINVAL);
}
- fd = mfi_open(mfi_unit);
+ fd = mfi_open(mfi_unit, O_RDWR);
if (fd < 0) {
error = errno;
warn("mfi_open");
OpenPOWER on IntegriCloud