Created
November 1, 2017 16:06
-
-
Save chantra/910305a456cbcf2a7fc8aeaa259036fe 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); | |
printf("sodium_set_misuse_handler\n"); | |
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