repo: ngircd action: commit revision: path_from: revision_from: 88c3d4896af6c09de5d360d93ad8b02793aeb234: path_to: revision_to:
commit 88c3d4896af6c09de5d360d93ad8b02793aeb234 Author: Alexander BartonDate: Wed Mar 28 11:30:48 2012 +0200 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! diff --git a/src/ngircd/ngircd.c b/src/ngircd/ngircd.c
--- a/src/ngircd/ngircd.c
+++ b/src/ngircd/ngircd.c
@@ -642,12 +642,10 @@ NGIRCd_Init(bool NGIRCd_NoDaemon)
}
if (chroot(Conf_Chroot) != 0) {
- if (errno != EPERM) {
- Log(LOG_ERR,
- "Can't change root directory to \"%s\": %s",
- Conf_Chroot, strerror(errno));
- goto out;
- }
+ Log(LOG_ERR,
+ "Can't change root directory to \"%s\": %s",
+ Conf_Chroot, strerror(errno));
+ goto out;
} else {
chrooted = true;
Log(LOG_INFO,
-----END OF PAGE-----