summaryrefslogtreecommitdiff
path: root/mdadm.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-12-23 07:42:23 +1100
committerNeilBrown <neilb@suse.de>2011-12-23 07:42:23 +1100
commitba3903d416524e0fb002eca971ce6026e5f2c3af (patch)
tree663c770b3fad42fc957968d6c90bf40a12a713eb /mdadm.c
parent3e9df86add05b3a759148a8a1760a44887654322 (diff)
allow --monitor to be run by non-privileged use.
Providing --no-sharing is given, monitoring should be permitted. Unfortunately the kernel current rejects GET_DISK_INFO and GET_ARRAY_INFO for non-privileged users which is unjustified. The info is available in sysfs and we could get it from there, but for now, require the kernel to be fixed. Reported-by: Raphael Hertzog <hertzog@debian.org> Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'mdadm.c')
-rw-r--r--mdadm.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mdadm.c b/mdadm.c
index c6a887a8..f07fac2a 100644
--- a/mdadm.c
+++ b/mdadm.c
@@ -1209,7 +1209,8 @@ int main(int argc, char *argv[])
require_homehost = 0;
}
- if ((mode != MISC || devmode != 'E') &&
+ if (!((mode == MISC && devmode == 'E')
+ || (mode == MONITOR && spare_sharing == 0)) &&
geteuid() != 0) {
fprintf(stderr, Name ": must be super-user to perform this action\n");
exit(1);