diff options
author | sethg <none@none> | 2006-06-20 19:18:16 -0700 |
---|---|---|
committer | sethg <none@none> | 2006-06-20 19:18:16 -0700 |
commit | 545e5dad7996785cfebf226c5ef410c1b154740f (patch) | |
tree | 404c2342a23f20746c267cb3b601fbf58b1eae97 /usr/src/lib/cfgadm_plugins | |
parent | 092954728e04e1b05a0c815116aa5f4acfb46373 (diff) | |
download | illumos-gate-545e5dad7996785cfebf226c5ef410c1b154740f.tar.gz |
6441262 sata cfgadm plugin erroneously truncates logical disk name
Diffstat (limited to 'usr/src/lib/cfgadm_plugins')
-rw-r--r-- | usr/src/lib/cfgadm_plugins/sata/common/cfga_sata.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/usr/src/lib/cfgadm_plugins/sata/common/cfga_sata.c b/usr/src/lib/cfgadm_plugins/sata/common/cfga_sata.c index 09fefb0b8c..0973818b28 100644 --- a/usr/src/lib/cfgadm_plugins/sata/common/cfga_sata.c +++ b/usr/src/lib/cfgadm_plugins/sata/common/cfga_sata.c @@ -1150,6 +1150,7 @@ sata_make_dyncomp(const char *ap_id, char **dyncomp) struct stat sb; struct dirent *dep = NULL; struct dirent *newdep = NULL; + char *p; assert(dyncomp != NULL); @@ -1241,10 +1242,16 @@ sata_make_dyncomp(const char *ap_id, char **dyncomp) /* postprocess and copy logical name here */ if (devlink != NULL) { /* - * For disks, remove partition info + * For disks, remove partition/slice info */ if ((cp = strstr(devlink, "dsk/")) != NULL) { - cp[strlen(cp) - 2] = 0; + /* cXtYdZ[(s[0..15])|(p[0..X])] */ + if ((p = strchr(cp + 4, 'd')) != NULL) { + p++; /* Skip the 'd' */ + while (*p != 0 && isdigit(*p)) + p++; + *p = 0; + } *dyncomp = strdup(cp); } |