]> git.ipfire.org Git - thirdparty/mdadm.git/blobdiff - mdadm.c
config: restore the possibility of a NULL homehost
[thirdparty/mdadm.git] / mdadm.c
diff --git a/mdadm.c b/mdadm.c
index ec05e6e85decc61ec1820cd7ac5d2af5401d61d1..96d32b53059f0f5dac98ab8ae4e103ae977e3b75 100644 (file)
--- 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) {