use chdir() before calling chroot()