summaryrefslogtreecommitdiff
path: root/mdadm.c
diff options
context:
space:
mode:
authorNeilBrown <neilb@suse.de>2011-05-10 16:17:12 +1000
committerNeilBrown <neilb@suse.de>2011-05-10 16:17:12 +1000
commit0f23aa88f81127eae744d60eedd4884f021562d0 (patch)
treeba1e8d2580b719277f0df8b98beea0a859b5dd08 /mdadm.c
parent815c8a7e0b11b69331211b59b880ba50f3ed2b5e (diff)
config: restore the possibility of a NULL homehost
As homehost defaults to the system name it is not possible to specify a NULL homehost. This patch restored this ability with either --homehost="" or --homehost="<none>". This allows the creation of v1.x arrays without a "hostname:" prefix in the name. Signed-off-by: NeilBrown <neilb@suse.de>
Diffstat (limited to 'mdadm.c')
-rw-r--r--mdadm.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/mdadm.c b/mdadm.c
index ec05e6e8..96d32b53 100644
--- a/mdadm.c
+++ b/mdadm.c
@@ -1167,12 +1167,16 @@ int main(int argc, char *argv[])
if (homehost == NULL)
homehost = conf_get_homehost(&require_homehost);
- if (homehost == NULL || strcmp(homehost, "<system>")==0) {
+ if (homehost == NULL || strcasecmp(homehost, "<system>")==0) {
if (gethostname(sys_hostname, sizeof(sys_hostname)) == 0) {
sys_hostname[sizeof(sys_hostname)-1] = 0;
homehost = sys_hostname;
}
}
+ if (homehost && (!homehost[0] || strcasecmp(homehost, "<none>") == 0)) {
+ homehost = NULL;
+ require_homehost = 0;
+ }
if ((mode != MISC || devmode != 'E') &&
geteuid() != 0) {