Guest User

Untitled

a guest
Jun 20th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. char resolvedpath[MAXPATHLEN];
  2. char resolvedpath2[MAXPATHLEN];
  3. getcwd(resolvedpath,2000);
  4. if (!realpath(resolvedpath,resolvedpath2) == 0) {
  5. if (-1 == chroot(resolvedpath)) {
  6. printf("__CHROOT_ERROR__\n");
  7. return;
  8. }
  9. if (-1 == chdir("/")) {
  10. printf("__CHDIR_ERROR__\n");
  11. return;
  12. }
  13. } else {
  14. printf("___ERROR__\n");
Add Comment
Please, Sign In to add comment