]> arthur.barton.de Git - ngircd-alex.git/commitdiff
Don't ignore "permission denied" errors when enabling chroot
authorAlexander Barton <alex@barton.de>
Wed, 28 Mar 2012 09:30:48 +0000 (11:30 +0200)
committerAlexander Barton <alex@barton.de>
Wed, 28 Mar 2012 09:30:48 +0000 (11:30 +0200)
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!

src/ngircd/ngircd.c

index 60d15a1f8a7be1afe807d192f52223e4dffac50a..f28ff05bcfb778065dc99a50e7459472eee8a68f 100644 (file)
@@ -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,