]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - src/s_conf.c
Add PASS selector:password from seven, put TS5 removal to 3.1
[irc/rqf/shadowircd.git] / src / s_conf.c
index e34a77e26144fda62c88614d008b353750c6588b..cc316e0ed2c91475e8f0257bc432af84c1300566 100644 (file)
 #include "hostmask.h"
 #include "modules.h"
 #include "numeric.h"
-#include "s_log.h"
+#include "logger.h"
 #include "send.h"
-#include "s_gline.h"
 #include "reject.h"
 #include "cache.h"
 #include "blacklist.h"
+#include "sslproc.h"
 
 struct config_server_hide ConfigServerHide;
 
@@ -194,7 +194,7 @@ check_client(struct Client *client_p, struct Client *source_p, const char *usern
                        source_p->name, IsGotId(source_p) ? "" : "~",
                        source_p->username, source_p->sockhost);        
 
-               ServerStats->is_ref++;
+               ServerStats.is_ref++;
                exit_client(client_p, source_p, &me, "Too many host connections (local)");
                break;
 
@@ -208,7 +208,7 @@ check_client(struct Client *client_p, struct Client *source_p, const char *usern
                        source_p->name, IsGotId(source_p) ? "" : "~",
                        source_p->username, source_p->sockhost);
 
-               ServerStats->is_ref++;
+               ServerStats.is_ref++;
                exit_client(client_p, source_p, &me, "Too many host connections (global)");
                break;
 
@@ -222,7 +222,7 @@ check_client(struct Client *client_p, struct Client *source_p, const char *usern
                        source_p->name, IsGotId(source_p) ? "" : "~",
                        source_p->username, source_p->sockhost);
 
-               ServerStats->is_ref++;
+               ServerStats.is_ref++;
                exit_client(client_p, source_p, &me, "Too many user connections (global)");
                break;
 
@@ -237,7 +237,7 @@ check_client(struct Client *client_p, struct Client *source_p, const char *usern
                        source_p->name, IsGotId(source_p) ? "" : "~",
                        source_p->username, source_p->sockhost);
 
-               ServerStats->is_ref++;
+               ServerStats.is_ref++;
                exit_client(client_p, source_p, &me,
                            "No more connections allowed in your connection class");
                break;
@@ -245,14 +245,14 @@ check_client(struct Client *client_p, struct Client *source_p, const char *usern
        case NOT_AUTHORISED:
                {
                        int port = -1;
-#ifdef IPV6
+#ifdef RB_IPV6
                        if(source_p->localClient->ip.ss_family == AF_INET6)
                                port = ntohs(((struct sockaddr_in6 *)&source_p->localClient->listener->addr)->sin6_port);
                        else
 #endif
                                port = ntohs(((struct sockaddr_in *)&source_p->localClient->listener->addr)->sin_port);
                        
-                       ServerStats->is_ref++;
+                       ServerStats.is_ref++;
                        /* jdc - lists server name & port connections are on */
                        /*       a purely cosmetical change */
                        /* why ipaddr, and not just source_p->sockhost? --fl */
@@ -280,7 +280,7 @@ check_client(struct Client *client_p, struct Client *source_p, const char *usern
                }
        case BANNED_CLIENT:
                exit_client(client_p, client_p, &me, "*** Banned ");
-               ServerStats->is_ref++;
+               ServerStats.is_ref++;
                break;
 
        case 0:
@@ -378,18 +378,6 @@ verify_access(struct Client *client_p, const char *username)
                add_reject(client_p, aconf->user, aconf->host);
                return (BANNED_CLIENT);
        }
-       else if(aconf->status & CONF_GLINE)
-       {
-               sendto_one_notice(client_p, ":*** G-lined");
-
-               if(ConfigFileEntry.kline_with_reason)
-                       sendto_one(client_p,
-                                       form_str(ERR_YOUREBANNEDCREEP),
-                                       me.name, client_p->name, aconf->passwd);
-
-               add_reject(client_p, aconf->user, aconf->host);
-               return (BANNED_CLIENT);
-       }
 
        return NOT_AUTHORISED;
 }
@@ -721,7 +709,7 @@ set_default_conf(void)
 
        memset(&ServerInfo.ip, 0, sizeof(ServerInfo.ip));
        ServerInfo.specific_ipv4_vhost = 0;
-#ifdef IPV6
+#ifdef RB_IPV6
        memset(&ServerInfo.ip6, 0, sizeof(ServerInfo.ip6));
        ServerInfo.specific_ipv6_vhost = 0;
 #endif
@@ -775,15 +763,10 @@ set_default_conf(void)
        ConfigFileEntry.fname_operlog = NULL;
        ConfigFileEntry.fname_foperlog = NULL;
        ConfigFileEntry.fname_serverlog = NULL;
-       ConfigFileEntry.fname_glinelog = NULL;
        ConfigFileEntry.fname_klinelog = NULL;
        ConfigFileEntry.fname_operspylog = NULL;
        ConfigFileEntry.fname_ioerrorlog = NULL;
-       ConfigFileEntry.glines = NO;
        ConfigFileEntry.use_egd = NO;
-       ConfigFileEntry.gline_time = 12 * 3600;
-       ConfigFileEntry.gline_min_cidr = 16;
-       ConfigFileEntry.gline_min_cidr6 = 48;
        ConfigFileEntry.hide_spoof_ips = YES;
        ConfigFileEntry.hide_error_messages = 1;
        ConfigFileEntry.dots_in_ident = 0;
@@ -838,7 +821,7 @@ set_default_conf(void)
        ConfigFileEntry.reject_duration = 120;
        ConfigFileEntry.max_unknown_ip = 2;
 
-       ServerInfo.max_clients = maxconnections - MAX_BUFFER;
+       ServerInfo.default_max_clients = MAXCONNECTIONS;
 }
 
 #undef YES
@@ -882,6 +865,26 @@ validate_conf(void)
        if(ServerInfo.network_desc == NULL)
                ServerInfo.network_desc = rb_strdup(NETWORK_DESC_DEFAULT);
 
+       if(ServerInfo.ssld_count < 1)\r
+               ServerInfo.ssld_count = 1;
+
+       if(!rb_setup_ssl_server(ServerInfo.ssl_cert, ServerInfo.ssl_private_key, ServerInfo.ssl_dh_params))\r
+       {\r
+               ilog(L_MAIN, "WARNING: Unable to setup SSL.");\r
+               ssl_ok = 0;\r
+       } else {\r
+               ssl_ok = 1;\r
+               send_new_ssl_certs(ServerInfo.ssl_cert, ServerInfo.ssl_private_key, ServerInfo.ssl_dh_params);\r
+       }\r
+\r
+       if(ServerInfo.ssld_count > get_ssld_count())\r
+       {\r
+               int start = ServerInfo.ssld_count - get_ssld_count();\r
+               /* start up additional ssld if needed */\r
+               start_ssldaemon(start, ServerInfo.ssl_cert, ServerInfo.ssl_private_key, ServerInfo.ssl_dh_params);\r
+                               \r
+       }
+
        if((ConfigFileEntry.client_flood < CLIENT_FLOOD_MIN) ||
           (ConfigFileEntry.client_flood > CLIENT_FLOOD_MAX))
                ConfigFileEntry.client_flood = CLIENT_FLOOD_MAX;
@@ -1240,6 +1243,8 @@ clear_out_old_conf(void)
        rb_free(ServerInfo.network_desc);
        ServerInfo.network_desc = NULL;
 
+       ServerInfo.ssld_count = 1;
+
        /* clean out AdminInfo */
        rb_free(AdminInfo.name);
        AdminInfo.name = NULL;
@@ -1377,18 +1382,18 @@ write_confitem(KlineType type, struct Client *source_p, char *user,
                rb_snprintf(buffer, sizeof(buffer),
                           "\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",%ld\n",
                           user, host, reason, oper_reason, current_date,
-                          get_oper_name(source_p), rb_current_time());
+                          get_oper_name(source_p), (long int)rb_current_time());
        }
        else if(type == DLINE_TYPE)
        {
                rb_snprintf(buffer, sizeof(buffer),
                           "\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",%ld\n", host,
-                          reason, oper_reason, current_date, get_oper_name(source_p), rb_current_time());
+                          reason, oper_reason, current_date, get_oper_name(source_p), (long int)rb_current_time());
        }
        else if(type == RESV_TYPE)
        {
                rb_snprintf(buffer, sizeof(buffer), "\"%s\",\"%s\",\"%s\",%ld\n",
-                          host, reason, get_oper_name(source_p), rb_current_time());
+                          host, reason, get_oper_name(source_p), (long int)rb_current_time());
        }
 
        if(fputs(buffer, out) == -1)