Merge pull request #514 from PartialVolume/Add_check_for_root_execution

Add_check_for_root_execution
This commit is contained in:
PartialVolume
2023-11-02 20:19:21 +00:00
committed by GitHub

View File

@@ -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 **