Opened 15 years ago
Closed 15 years ago
#123 closed defect (fixed)
Option DEVISCAN does not work on OpenBSD >= 4.8
| Reported by: | gbechis | Owned by: | Christian Franke |
|---|---|---|---|
| Priority: | major | Milestone: | Release 5.41 |
| Component: | smartd | Version: | 5.40 |
| Keywords: | openbsd | Cc: |
Description
With OpenBSD 4.8 the format of sysctl hw.disknames has changed, a patch is needed to handle the new format.
Attachments (1)
Change History (5)
by , 15 years ago
| Attachment: | patch-os_openbsd_cpp added |
|---|
comment:1 by , 15 years ago
| Keywords: | openbsd added |
|---|---|
| Milestone: | → Release 5.41 |
| Owner: | changed from to |
| Status: | new → accepted |
comment:2 by , 15 years ago
Note:
See TracTickets
for help on using tickets.

Did you test the patch with more than one device present?
The
strtok(...":")from the patch destroys the saved state of thestrtok(...",")from the outer loop:for (p = strtok(disknames, ","); p; p = strtok(NULL, ",")) { // <<------- if (strncmp(p, prefix, strlen(prefix))) { continue; } + for (u = strtok(p, ":"); u; u = strtok(NULL, ":")); // <<------- mp[n] = (char *)malloc(strlen(net_dev_prefix) + strlen(p) + 2);The following may work:
for (p = strtok(disknames, ","); p; p = strtok(NULL, ",")) { if (strncmp(p, prefix, strlen(prefix))) { continue; } + char * u = strchr(p, ':'); + if (u) + *u = 0; mp[n] = (char *)malloc(strlen(net_dev_prefix) + strlen(p) + 2);