Not all systems have initgroups.
authoraland <aland>
Sun, 16 May 2004 12:53:19 +0000 (12:53 +0000)
committeraland <aland>
Sun, 16 May 2004 12:53:19 +0000 (12:53 +0000)
Don't use C++ style comments

src/main/mainconfig.c

index b399ee8..530ca0c 100644 (file)
@@ -319,14 +319,14 @@ static int switch_users(void)
                        exit(1);
                }
                server_uid = pw->pw_uid;
+#ifdef HAVE_INITGROUPS
                if (initgroups(mainconfig.uid_name, server_gid) < 0) {
-                       if (errno == EPERM) {
-//                             radlog(L_INFO|L_CONS, "Cannot setup supplementary groups for User %s: %s", mainconfig.uid_name, strerror(errno));
-                       } else {
+                       if (errno != EPERM) {
                                radlog(L_ERR|L_CONS, "Failed setting supplementary groups for User %s: %s", mainconfig.uid_name, strerror(errno));
                                exit(1);
                        }
                }
+#endif
                if (setuid(server_uid) < 0) {
                        radlog(L_ERR|L_CONS, "Failed setting User to %s: %s", mainconfig.uid_name, strerror(errno));
                        exit(1);