summaryrefslogtreecommitdiffstats
path: root/mdadm.c
diff options
context:
space:
mode:
Diffstat (limited to 'mdadm.c')
-rw-r--r--mdadm.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/mdadm.c b/mdadm.c
index be4fbf6..eb124d5 100644
--- a/mdadm.c
+++ b/mdadm.c
@@ -1046,6 +1046,12 @@ int main(int argc, char *argv[])
}
}
+ if ((mode != MISC || devmode != 'E') &&
+ geteuid() != 0) {
+ fprintf(stderr, Name ": must be super-user to perform this action\n");
+ exit(1);
+ }
+
ident.autof = autof;
rv = 0;