get_config();
/*
- * Bind the server to our favourite port.
- */
- CtdlRegisterServiceHook(config.c_port_number,
- citproto_begin_session,
- do_command_loop);
-
- /*
- * Now that we've bound the socket, change to the BBS user id and its
- * corresponding group ids
+ * Do non system dependent startup functions.
*/
- if (drop_root_perms) {
- if ((pw = getpwuid(BBSUID)) == NULL)
- lprintf(1, "WARNING: getpwuid(%d): %s\n"
- "Group IDs will be incorrect.\n", BBSUID,
- strerror(errno));
- else {
- initgroups(pw->pw_name, pw->pw_gid);
- if (setgid(pw->pw_gid))
- lprintf(3, "setgid(%d): %s\n", pw->pw_gid,
- strerror(errno));
- }
- lprintf(7, "Changing uid to %d\n", BBSUID);
- if (setuid(BBSUID) != 0) {
- lprintf(3, "setuid() failed: %s\n", strerror(errno));
- }
- }
+ master_startup();
/*
- * Do non system dependent startup functions.
+ * Bind the server to our favorite ports.
*/
- master_startup();
+ CtdlRegisterServiceHook(config.c_port_number,
+ citproto_begin_session,
+ do_command_loop);
/*
* Load any server-side modules (plugins) available here.
}
+ /*
+ * Now that we've bound the sockets, change to the BBS user id and its
+ * corresponding group ids
+ */
+ if (drop_root_perms) {
+ if ((pw = getpwuid(BBSUID)) == NULL)
+ lprintf(1, "WARNING: getpwuid(%d): %s\n"
+ "Group IDs will be incorrect.\n", BBSUID,
+ strerror(errno));
+ else {
+ initgroups(pw->pw_name, pw->pw_gid);
+ if (setgid(pw->pw_gid))
+ lprintf(3, "setgid(%d): %s\n", pw->pw_gid,
+ strerror(errno));
+ }
+ lprintf(7, "Changing uid to %d\n", BBSUID);
+ if (setuid(BBSUID) != 0) {
+ lprintf(3, "setuid() failed: %s\n", strerror(errno));
+ }
+ }
+
/*
* Now create a bunch of worker threads.
*/