Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- char resolvedpath[MAXPATHLEN];
- char resolvedpath2[MAXPATHLEN];
- getcwd(resolvedpath,2000);
- if (!realpath(resolvedpath,resolvedpath2) == 0) {
- if (-1 == chroot(resolvedpath)) {
- printf("__CHROOT_ERROR__\n");
- return;
- }
- if (-1 == chdir("/")) {
- printf("__CHDIR_ERROR__\n");
- return;
- }
- } else {
- printf("___ERROR__\n");
Add Comment
Please, Sign In to add comment