Don't ignore "permission denied" errors when enabling chroot
Up to now, ngIRCd silently ignored permission denied errors when trying to enable a chroot setup: only the "not running chrooted" message became logged later on. This patch lets ngIRCd exit with a fatal error when the chroot can't be enabled on startup -- this is the much safer bevahiour!
This commit is contained in:
parent
7b6ef3bc8e
commit
88c3d4896a
|
@ -642,12 +642,10 @@ NGIRCd_Init(bool NGIRCd_NoDaemon)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (chroot(Conf_Chroot) != 0) {
|
if (chroot(Conf_Chroot) != 0) {
|
||||||
if (errno != EPERM) {
|
Log(LOG_ERR,
|
||||||
Log(LOG_ERR,
|
"Can't change root directory to \"%s\": %s",
|
||||||
"Can't change root directory to \"%s\": %s",
|
Conf_Chroot, strerror(errno));
|
||||||
Conf_Chroot, strerror(errno));
|
goto out;
|
||||||
goto out;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
chrooted = true;
|
chrooted = true;
|
||||||
Log(LOG_INFO,
|
Log(LOG_INFO,
|
||||||
|
|
Loading…
Reference in New Issue