1
0
Fork 0

Adding upstream version 4.2+20230901.

Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
Daniel Baumann 2025-02-14 06:31:42 +01:00
parent 14fbe53fb1
commit f48db6685a
Signed by: daniel
GPG key ID: FBB4F0E80A80222F
15 changed files with 418 additions and 196 deletions

View file

@ -193,14 +193,14 @@ int create_mddev(char *dev, char *name, int autof, int trustworthy,
if (dev) {
if (strncmp(dev, DEV_MD_DIR, DEV_MD_DIR_LEN) == 0) {
strcpy(cname, dev + DEV_MD_DIR_LEN);
snprintf(cname, MD_NAME_MAX, "%s", dev + DEV_MD_DIR_LEN);
} else if (strncmp(dev, "/dev/", 5) == 0) {
char *e = dev + strlen(dev);
while (e > dev && isdigit(e[-1]))
e--;
if (e[0])
num = strtoul(e, NULL, 10);
strcpy(cname, dev+5);
snprintf(cname, MD_NAME_MAX, "%s", dev + 5);
cname[e-(dev+5)] = 0;
/* name *must* be mdXX or md_dXX in this context */
if (num < 0 ||