Skip to content

Commit

Permalink
Merge pull request #514 from PartialVolume/Add_check_for_root_execution
Browse files Browse the repository at this point in the history
Add_check_for_root_execution
  • Loading branch information
PartialVolume authored Nov 2, 2023
2 parents cad05c6 + edfd982 commit 63c64b9
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/nwipe.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,12 @@ int main( int argc, char** argv )
/* Initialised and populated in device scan. */
nwipe_context_t** c1 = 0;

if( geteuid() != 0 )
{
printf( "nwipe must run with root permissions, which is not the case.\nAborting\n" );
exit( 99 );
}

int wipe_threads_started = 0;

/** NOTE ** NOTE ** NOTE ** NOTE ** NOTE ** NOTE ** NOTE ** NOTE ** NOTE **
Expand Down

0 comments on commit 63c64b9

Please sign in to comment.