Skip to content

Commit

Permalink
Merge pull request martijnvanbrummelen#491 from PartialVolume/Fix_seg…
Browse files Browse the repository at this point in the history
…fault_on_logfile_write_permissions

Fix intermittent segfault when --logfile specified without insufficient permissions to write to directory
  • Loading branch information
PartialVolume authored Sep 29, 2023
2 parents 50951df + f1fe7d6 commit 65a3a45
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 0 additions & 1 deletion src/logging.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,7 +401,6 @@ void nwipe_log( nwipe_log_t level, const char* format, ... )
}
user_abort = 1;
terminate_signal = 1;
return;
}
}

Expand Down
6 changes: 4 additions & 2 deletions src/nwipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -185,8 +185,10 @@ int main( int argc, char** argv )
nwipe_enumerated = nwipe_device_get( &c1, argv, argc );
if( nwipe_enumerated == 0 )
{
nwipe_log( NWIPE_LOG_ERROR, "Devices not found. Check you're not excluding drives unnecessarily." );
printf( "No drives found\n" );
nwipe_log( NWIPE_LOG_ERROR, "Devices not found. Check you're not excluding drives unnecessarily," );
nwipe_log( NWIPE_LOG_ERROR, "and you are running nwipe as sudo or as root." );
printf( "Devices not found, check you're not excluding drives unnecessarily \n and you are running nwipe "
"as sudo or as root." );
cleanup();
exit( 1 );
}
Expand Down

0 comments on commit 65a3a45

Please sign in to comment.