diff --git a/include/h.h b/include/h.h index 83a57bb98..d2f805829 100644 --- a/include/h.h +++ b/include/h.h @@ -350,7 +350,6 @@ extern aClient *make_client(aClient *, aClient *); extern Member *find_channel_link(Member *, aChannel *); extern char *pretty_mask(char *); extern void add_client_to_list(aClient *); -extern void checklist(); extern void remove_client_from_list(aClient *); extern void initlists(); extern struct hostent *get_res(char *); diff --git a/include/struct.h b/include/struct.h index e2704de25..d99b1e6fc 100644 --- a/include/struct.h +++ b/include/struct.h @@ -231,14 +231,9 @@ typedef OperPermission (*OperClassEntryEvalCallback)(OperClassACLEntryVar* varia /* ** flags for bootup options (command line flags) */ -#define BOOT_CONSOLE 1 -#define BOOT_QUICK 2 -#define BOOT_DEBUG 4 -#define BOOT_INETD 8 -#define BOOT_TTY 16 -#define BOOT_OPER 32 -#define BOOT_AUTODIE 64 -#define BOOT_NOFORK 128 +#define BOOT_DEBUG 1 +#define BOOT_TTY 2 +#define BOOT_NOFORK 4 #define STAT_LOG -7 /* logfile for -x */ #define STAT_CONNECTING -6 diff --git a/src/bsd.c b/src/bsd.c index 6f975fab9..585b04c43 100644 --- a/src/bsd.c +++ b/src/bsd.c @@ -481,6 +481,9 @@ void check_user_limit(void) } #endif #endif +#ifdef _WIN32 + maxclients = MAXCONNECTIONS - CLIENTS_RESERVE; +#endif } void init_sys(void) diff --git a/src/ircd.c b/src/ircd.c index 9549a1a5c..bd1bae102 100644 --- a/src/ircd.c +++ b/src/ircd.c @@ -72,7 +72,6 @@ MODVAR char **myargv; #else LPCSTR cmdLine; #endif -int portnum = -1; /* Server port number, listening this */ char *configfile = CONFIGFILE; /* Server configuration file */ int debuglevel = 0; /* Server debug level */ int bootopt = 0; /* Server boot option flags */ @@ -622,18 +621,11 @@ static int bad_command(const char *argv0) argv0 = "unrealircd"; (void)printf - ("Usage: %s [-f ] [-h ] [-p ] [-x ] [-t] [-F]\n" + ("Usage: %s [-f ] [-F]\n" "\n" "UnrealIRCd\n" " -f Load configuration from instead of the default\n" " (%s).\n" - " -h Override the me::name configuration setting with\n" - " .\n" - " -p Listen on in addition to the ports specified by\n" - " the listen blocks.\n" - " -x Set the log level to .\n" - " -t Dump information to stdout as if you were a linked-in\n" - " server.\n" " -F Don't fork() when starting up. Use this when running\n" " UnrealIRCd under gdb or when playing around with settings\n" " on a non-production setup.\n" @@ -643,7 +635,7 @@ static int bad_command(const char *argv0) #else if (!IsService) { MessageBox(NULL, - "Usage: UnrealIRCd [-h servername] [-p portnumber] [-x loglevel]\n", + "Usage: UnrealIRCd [-f configfile]\n", "UnrealIRCD/32", MB_OK); } #endif @@ -924,7 +916,6 @@ int InitUnrealIRCd(int argc, char *argv[]) #ifdef HAVE_PSTAT union pstun pstats; #endif - int portarg = 0; #ifdef HAVE_SETRLIMIT struct rlimit corelim; #endif @@ -1026,40 +1017,22 @@ int InitUnrealIRCd(int argc, char *argv[]) } else p = ""; } - switch (flag) { + switch (flag) + { + case 'F': + bootopt |= BOOT_NOFORK; + break; + case 'f': #ifndef _WIN32 - case 'a': - bootopt |= BOOT_AUTODIE; - break; - case 'c': - bootopt |= BOOT_CONSOLE; - break; - case 'q': - bootopt |= BOOT_QUICK; - break; -#endif - case 'F': - bootopt |= BOOT_NOFORK; - break; -#ifndef _WIN32 - case 'f': - if ((uid == euid) && (gid == egid)) - configfile = strdup(p); - else - printf("ERROR: Command line config with a setuid/setgid ircd is not allowed"); - convert_to_absolute_path(&configfile, CONFDIR); - break; - case 'h': - if (!strchr(p, '.')) { - - (void)printf - ("ERROR: %s is not valid: Server names must contain at least 1 \".\"\n", - p); - exit(1); - } - strlcpy(me.name, p, sizeof(me.name)); - break; + if ((uid != euid) || (gid != egid)) + { + printf("ERROR: Command line config with a setuid/setgid ircd is not allowed"); + exit(1); + } #endif + configfile = strdup(p); + convert_to_absolute_path(&configfile, CONFDIR); + break; #ifndef _WIN32 case 'P':{ short type; @@ -1097,30 +1070,6 @@ int InitUnrealIRCd(int argc, char *argv[]) exit(0); } #endif - - case 'p': - if ((portarg = atoi(p)) > 0) - portnum = portarg; - break; - case 's': - (void)printf("sizeof(aClient) == %ld\n", - (long)sizeof(aClient)); - (void)printf("sizeof(aLocalClient) == %ld\n", - (long)sizeof(aLocalClient)); - (void)printf("sizeof(anUser) == %ld\n", - (long)sizeof(anUser)); - (void)printf("sizeof(aChannel) == %ld\n", - (long)sizeof(aChannel)); - (void)printf("sizeof(aServer) == %ld\n", - (long)sizeof(aServer)); - (void)printf("sizeof(Link) == %ld\n", - (long)sizeof(Link)); - (void)printf("sizeof(aTKline) == %ld\n", - (long)sizeof(aTKline)); - (void)printf("sizeof(struct ircstatsx) == %ld\n", - (long)sizeof(struct ircstatsx)); - exit(0); - break; #if 0 case 'S': charsys_dump_table(p ? p : "*"); @@ -1243,8 +1192,10 @@ int InitUnrealIRCd(int argc, char *argv[]) fprintf(stderr, "* %s\n", SSLeay_version(SSLEAY_VERSION)); #ifdef USE_LIBCURL fprintf(stderr, "* %s\n", curl_version()); +#endif #endif check_user_limit(); +#ifndef _WIN32 fprintf(stderr, "\n"); fprintf(stderr, "This server can handle %d concurrent sockets (%d clients + %d reserve)\n\n", maxclients+CLIENTS_RESERVE, maxclients, CLIENTS_RESERVE); @@ -1309,9 +1260,7 @@ int InitUnrealIRCd(int argc, char *argv[]) fprintf(stderr, "Dynamic configuration initialized.. booting IRCd.\n"); #endif open_debugfile(); - if (portnum < 0) - portnum = 6667; - me.local->port = portnum; + me.local->port = 6667; /* pointless? */ (void)init_sys(); applymeblock(); #ifdef HAVE_SYSLOG diff --git a/src/list.c b/src/list.c index ae757d78e..279f53ed6 100644 --- a/src/list.c +++ b/src/list.c @@ -360,7 +360,6 @@ void remove_client_from_list(aClient *cptr) if (!list_empty(&cptr->id_hash)) abort(); (void)free_client(cptr); - checklist(); numclients--; return; } diff --git a/src/misc.c b/src/misc.c index 5893775ae..9bf662b1d 100644 --- a/src/misc.c +++ b/src/misc.c @@ -674,17 +674,6 @@ int exit_client(aClient *cptr, aClient *sptr, aClient *from, MessageTag *recv_mt return cptr == sptr ? FLUSH_BUFFER : 0; } -void checklist(void) -{ - if (!(bootopt & BOOT_AUTODIE)) - return; - - if (!list_empty(&lclient_list)) - exit (0); - - return; -} - void initstats(void) { bzero((char *)&ircst, sizeof(ircst));