diff options
author | NeilBrown <neilb@suse.de> | 2011-05-10 16:17:12 +1000 |
---|---|---|
committer | NeilBrown <neilb@suse.de> | 2011-05-10 16:17:12 +1000 |
commit | 0f23aa88f81127eae744d60eedd4884f021562d0 (patch) | |
tree | ba1e8d2580b719277f0df8b98beea0a859b5dd08 /mdadm.c | |
parent | 815c8a7e0b11b69331211b59b880ba50f3ed2b5e (diff) | |
download | mdadm-0f23aa88f81127eae744d60eedd4884f021562d0.tar.gz |
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.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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) { |