fatal_exit("Could not chdir to %s: %s",
cfg->directory, strerror(errno));
}
- if(cfg->chrootdir && cfg->chrootdir[0])
- if(chroot(cfg->chrootdir))
- fatal_exit("unable to chroot to %s: %s",
- cfg->chrootdir, strerror(errno));
if(cfg->username && cfg->username[0]) {
struct passwd *pwd;
if((pwd = getpwnam(cfg->username)) == NULL)
fatal_exit("unable to set user id: %s", strerror(errno));
endpwent();
}
+ if(cfg->chrootdir && cfg->chrootdir[0])
+ if(chroot(cfg->chrootdir))
+ fatal_exit("unable to chroot to %s: %s",
+ cfg->chrootdir, strerror(errno));
/* check old pid file before forking */
if(cfg->pidfile && cfg->pidfile[0]) {
checkoldpid(cfg);
1 November 2007: Wouter
- Fixup of crash on reload, due to anchors in env not NULLed after
dealloc during deinit.
+ - Fixup of chroot call. Happens after privileges are dropped, so
+ that checking the passwd entry still works.
31 October 2007: Wouter
- cache-max-ttl config option.