summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorAlexander Barton <alex@barton.de>2015-06-06 22:19:47 +0200
committerAlexander Barton <alex@barton.de>2015-06-06 22:19:47 +0200
commit2fc61ce8a6a6c2ac8652b8cea33d57acd50681c2 (patch)
tree5f64ec05deff17924a5d8d34e5ef0fd218156651 /src
parent5c48d7e9c7f0181772c14b133030a3c0e978fdc5 (diff)
downloadngircd-2fc61ce8a6a6c2ac8652b8cea33d57acd50681c2.tar.gz
ngircd-2fc61ce8a6a6c2ac8652b8cea33d57acd50681c2.zip
Make setgroups(3) function optional
For example, Interix is missing this function, which prevented
ngIRCd to build on this platform. When setgroups(3) isn't available,
a warning message is issued when ngIRCd starts up.
Diffstat (limited to 'src')
-rw-r--r--src/ngircd/ngircd.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ngircd/ngircd.c b/src/ngircd/ngircd.c
index 1b20597d..0e8acb54 100644
--- a/src/ngircd/ngircd.c
+++ b/src/ngircd/ngircd.c
@@ -724,6 +724,7 @@ NGIRCd_Init(bool NGIRCd_NoDaemon)
 			if (real_errno != EPERM) 
 				goto out;
 		}
+#ifdef HAVE_SETGROUPS
 		if (setgroups(0, NULL) != 0) {
 			real_errno = errno;
 			Log(LOG_ERR, "Can't drop supplementary group IDs: %s!",
@@ -731,6 +732,10 @@ NGIRCd_Init(bool NGIRCd_NoDaemon)
 			if (real_errno != EPERM)
 				goto out;
 		}
+#else
+		Log(LOG_WARNING,
+		    "Can't drop supplementary group IDs: setgroups(3) missing!");
+#endif
 	}
 #endif