From 345813c57c3fd10b66b10a1b544f7bd0f3950a7a Mon Sep 17 00:00:00 2001 From: Jeremy Katz Date: Thu, 27 Dec 2001 05:16:57 +0000 Subject: whee! merge the first bunch of changes from the 390 branch. this incorporates most of the python changes as well as the isys changes. email with what hasn't been applied coming later after I either finish merging the rest or decide to stop for the night --- isys/devnodes.c | 4 ++-- isys/probe.c | 6 ++++-- 2 files changed, 6 insertions(+), 4 deletions(-) (limited to 'isys') diff --git a/isys/devnodes.c b/isys/devnodes.c index a04e5e2b2..e8a76c62d 100644 --- a/isys/devnodes.c +++ b/isys/devnodes.c @@ -163,12 +163,12 @@ int devMakeInode(char * devName, char * path) { if (devName[3]) minor += devName[3] - '1'; #if defined (__s390__) || defined (__s390x__) - } else if (!strncmp(devName, "dasd", 4)) { + } else if (!strncmp(devName, "dasd", 4) && strlen(devName) > 4) { /* IBM Dasd Drives */ type = S_IFBLK; major = 94; minor = ( devName[4] - 'a' ) * 4; - if (devName[5]) + if (devName[5] && isdigit(devName[5]) ) minor += devName[5] - '0'; } else if (!strncmp(devName, "mnd", 4)) { /* IBM MiniDisk Drives */ diff --git a/isys/probe.c b/isys/probe.c index d3db6577d..a02c9a429 100644 --- a/isys/probe.c +++ b/isys/probe.c @@ -422,10 +422,12 @@ int kdFindDasdList(struct knownDevices * devices, int code) { /* Every line in this file is a harddisk */ while ((fgets(line, 190, fd)) != NULL) { - sscanf(line, "%*X %*[(A-Z)] at (%*d:%*d) is %[a-z0-9]:%s ", name, status); + int num; + num = sscanf(line, "%*X %*[(A-Z)] at (%*d:%*d) is %[a-z0-9] : %s ", + name, status); /* Take every dasd, formated and unformated */ - if (!deviceKnown(devices, name)) { + if ((num == 2) && (strlen(name) <= 6) && !deviceKnown(devices, name)) { snprintf(model, sizeof(model), "IBM DASD (%s)", status); device.class = CLASS_HD; device.name = strdup(name); -- cgit