mirror of
https://github.com/amadvance/snapraid.git
synced 2026-10-26 02:49:02 -04:00
Fix importing of serial from smartctl
This commit is contained in:
parent
ef3572ea73
commit
2b6281cd81
2 changed files with 9 additions and 1 deletions
|
|
@ -2569,6 +2569,12 @@ static void devattr_property(HANDLE h, char* serial, char* model, char* inter)
|
|||
}
|
||||
|
||||
if (serial && *serial == 0 && desc->SerialNumberOffset) {
|
||||
/*
|
||||
* This is the RAW serial, maybe HEX encoded, maybe BYTES SWAPPED
|
||||
* but we don't care because we just need any identifier
|
||||
*
|
||||
* If smartctl was not able to read it, we now accept anything
|
||||
*/
|
||||
snprintf(serial, SMART_MAX, "%s", (char*)(buffer + desc->SerialNumberOffset));
|
||||
strtrim(serial);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1985,7 +1985,9 @@ int smartctl_attribute(FILE* f, const char* file, const char* name, struct smart
|
|||
strtrim(family);
|
||||
} else if (sscanf(s, "Device Model: %63[^\n]", model) == 1) {
|
||||
strtrim(model);
|
||||
} else if (sscanf(s, "Serial number: %63s", serial) == 1) {
|
||||
} else if (sscanf(s, "Serial number: %63s", serial) == 1) { /* SCSI */
|
||||
strtrim(serial);
|
||||
} else if (sscanf(s, "Serial Number: %63s", serial) == 1) { /*ATA / NVMe */
|
||||
strtrim(serial);
|
||||
/* SCSI */
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue