about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorAlexander Barton <alex@barton.de>2012-03-28 11:30:48 +0200
committerAlexander Barton <alex@barton.de>2012-03-28 11:30:48 +0200
commit88c3d4896af6c09de5d360d93ad8b02793aeb234 (patch)
tree25c24a23aeb98eac3e66d1c0ea10249851c9b44e /src
parent7b6ef3bc8eef8a084bc77155e4cd64a35198aad9 (diff)
downloadngircd-88c3d4896af6c09de5d360d93ad8b02793aeb234.tar.gz
ngircd-88c3d4896af6c09de5d360d93ad8b02793aeb234.zip
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!
Diffstat (limited to 'src')
-rw-r--r--src/ngircd/ngircd.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/ngircd/ngircd.c b/src/ngircd/ngircd.c
index 60d15a1f..f28ff05b 100644
--- 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,