X-Git-Url: http://git.ipfire.org/?a=blobdiff_plain;ds=sidebyside;f=mapfile.c;h=c89d403f4e32b22c9a2e682c85617f354cf86e7c;hb=a8cb6604b606deaaa66979e84a6f1c6d2c044b3b;hp=4e7f24214b8ad8b4430855b186df3eaa1ce7163b;hpb=1011e8344a6b881883af57959cdd9ec7f9084407;p=thirdparty%2Fmdadm.git diff --git a/mapfile.c b/mapfile.c index 4e7f2421..c89d403f 100644 --- a/mapfile.c +++ b/mapfile.c @@ -176,7 +176,7 @@ void map_read(struct map_ent **melp) { FILE *f; char buf[8192]; - char path[200]; + char path[201]; int uuid[4]; char devnm[32]; char metadata[30]; @@ -374,7 +374,7 @@ void RebuildMap(void) char dn[30]; int dfd; int ok; - int devid; + dev_t devid; struct supertype *st; char *subarray = NULL; char *path; @@ -455,12 +455,19 @@ void RebuildMap(void) sep = ""; } } - if (strchr(name, ':')) - /* probably a uniquifying + if (strchr(name, ':')) { + /* Probably a uniquifying * hostname prefix. Allow - * without a suffix + * without a suffix, and strip + * hostname if it is us. */ + if (homehost && unum == -1 && + strncmp(name, homehost, + strlen(homehost)) == 0 && + name[strlen(homehost)] == ':') + name += strlen(homehost)+1; unum = -1; + } while (conflict) { if (unum >= 0)