mirror of
https://github.com/martijnvanbrummelen/nwipe.git
synced 2026-02-20 13:42:14 +00:00
bustype detection with smartctl works (again?)
This commit is contained in:
@@ -57,7 +57,7 @@ int nwipe_conf_init()
|
||||
root = config_root_setting( &nwipe_cfg );
|
||||
char nwipe_customers_initial_content[] =
|
||||
"\"Customer Name\";\"Contact Name\";\"Customer Address\";\"Contact Phone\"\n"
|
||||
"\"Not Applicable\";\"Not Applicable\";\"Not Applicable\";\"Not Applicable\"";
|
||||
"\"Not Applicable\";\"Not Applicable\";\"Not Applicable\";\"Not Applicable\"\n";
|
||||
|
||||
/* Read /etc/nwipe/nwipe.conf. If there is an error, determine whether
|
||||
* it's because it doesn't exist. If it doesn't exist create it and
|
||||
|
||||
11
src/device.c
11
src/device.c
@@ -26,6 +26,7 @@
|
||||
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include "nwipe.h"
|
||||
#include "context.h"
|
||||
@@ -711,7 +712,7 @@ int nwipe_get_device_bus_type_and_serialno( char* device, nwipe_device_t* bus, c
|
||||
/* If upper case alpha character, change to lower case */
|
||||
if( result[idx] >= 'A' && result[idx] <= 'Z' )
|
||||
{
|
||||
result[idx] += 32;
|
||||
result[idx] = tolower( result[idx] );
|
||||
}
|
||||
|
||||
idx++;
|
||||
@@ -775,6 +776,10 @@ int nwipe_get_device_bus_type_and_serialno( char* device, nwipe_device_t* bus, c
|
||||
{
|
||||
/* strip any leading or trailing spaces and left justify, +4 is the length of "bus type:" */
|
||||
trim( &result[19] );
|
||||
for( idx = 19; result[idx]; idx++ )
|
||||
{
|
||||
result[idx] = tolower( result[idx] );
|
||||
}
|
||||
|
||||
if( strncmp( &result[19], "sas", 3 ) == 0 )
|
||||
{
|
||||
@@ -787,6 +792,10 @@ int nwipe_get_device_bus_type_and_serialno( char* device, nwipe_device_t* bus, c
|
||||
|
||||
/* strip any leading or trailing spaces and left justify, +4 is the length of "bus type:" */
|
||||
trim( &result[16] );
|
||||
for( idx = 16; result[idx]; idx++ )
|
||||
{
|
||||
result[idx] = tolower( result[idx] );
|
||||
}
|
||||
|
||||
if( strncmp( &result[16], "sata", 4 ) == 0 )
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user