Created
October 31, 2017 23:31
-
-
Save chantra/df4f94992aea0109bd21d6646d4de208 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <sodium.h> | |
#include <unistd.h> | |
#include <stdlib.h> | |
static void misuse(void){ | |
printf("Misused handler!\n"); | |
exit(2); | |
} | |
int main(){ | |
if(chroot("/tmp") != 0){ | |
printf("Failed to chroot\n"); | |
return 1; | |
} | |
sodium_set_misuse_handler(misuse); | |
if(sodium_init() < 0) { | |
printf("Failed to init libsodium\n"); | |
return 1; | |
} | |
printf("Hello world,\n"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment