]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - src/newconf.c
Add config options for owner and halfop.
[irc/rqf/shadowircd.git] / src / newconf.c
index f2ccf68db9363e9705a768fb4272b7893c9d1932..b84903355245563da45c7724c6a62e61fce616f3 100644 (file)
@@ -295,6 +295,7 @@ struct mode_table
 /* *INDENT-OFF* */
 static struct mode_table umode_table[] = {
        {"callerid",    UMODE_CALLERID  },
+       {"softcallerid", UMODE_SCALLERID        },
        {"deaf",        UMODE_DEAF      },
        {"invisible",   UMODE_INVISIBLE },
        {"locops",      UMODE_LOCOPS    },
@@ -303,6 +304,10 @@ static struct mode_table umode_table[] = {
        {"servnotice",  UMODE_SERVNOTICE},
        {"wallop",      UMODE_WALLOP    },
        {"operwall",    UMODE_OPERWALL  },
+       {"noctcp",      UMODE_NOCTCP    },
+       {"noinvite",    UMODE_NOINVITE  },
+       {"bot",         UMODE_BOT       },
+       {"override",    UMODE_OVERRIDE  },
        {NULL, 0}
 };
 
@@ -615,6 +620,12 @@ conf_set_oper_flags(void *data)
        set_modes_from_table(&yy_oper->flags, "flag", oper_table, args);
 }
 
+static void
+conf_set_oper_fingerprint(void *data)
+{
+       yy_oper->certfp = rb_strdup((char *) data);
+}
+
 static void
 conf_set_oper_privset(void *data)
 {
@@ -892,7 +903,7 @@ conf_begin_auth(struct TopConf *tc)
 static int
 conf_end_auth(struct TopConf *tc)
 {
-       struct ConfItem *yy_tmp;
+       struct ConfItem *yy_tmp, *found_conf;
        rb_dlink_node *ptr;
        rb_dlink_node *next_ptr;
 
@@ -910,7 +921,15 @@ conf_end_auth(struct TopConf *tc)
        collapse(yy_aconf->user);
        collapse(yy_aconf->host);
        conf_add_class_to_conf(yy_aconf);
-       add_conf_by_address(yy_aconf->host, CONF_CLIENT, yy_aconf->user, yy_aconf->spasswd, yy_aconf);
+       if ((found_conf = find_exact_conf_by_address("*", CONF_CLIENT, "*")) && found_conf->spasswd == NULL)
+               conf_report_error("Ignoring redundant auth block (after *@*)");
+       else if ((found_conf = find_exact_conf_by_address(yy_aconf->host, CONF_CLIENT, yy_aconf->user)) &&
+                       (!found_conf->spasswd || (yy_aconf->spasswd &&
+                           0 == irccmp(found_conf->spasswd, yy_aconf->spasswd))))
+               conf_report_error("Ignoring duplicate auth block for %s@%s",
+                               yy_aconf->user, yy_aconf->host);
+       else
+               add_conf_by_address(yy_aconf->host, CONF_CLIENT, yy_aconf->user, yy_aconf->spasswd, yy_aconf);
 
        RB_DLINK_FOREACH_SAFE(ptr, next_ptr, yy_aconf_list.head)
        {
@@ -936,7 +955,13 @@ conf_end_auth(struct TopConf *tc)
 
                conf_add_class_to_conf(yy_tmp);
 
-               add_conf_by_address(yy_tmp->host, CONF_CLIENT, yy_tmp->user, yy_tmp->spasswd, yy_tmp);
+               if (find_exact_conf_by_address("*", CONF_CLIENT, "*"))
+                       conf_report_error("Ignoring redundant auth block (after *@*)");
+               else if (find_exact_conf_by_address(yy_tmp->host, CONF_CLIENT, yy_tmp->user))
+                       conf_report_error("Ignoring duplicate auth block for %s@%s",
+                                       yy_tmp->user, yy_tmp->host);
+               else
+                       add_conf_by_address(yy_tmp->host, CONF_CLIENT, yy_tmp->user, yy_tmp->spasswd, yy_tmp);
                rb_dlinkDestroy(ptr, &yy_aconf_list);
        }
 
@@ -994,6 +1019,24 @@ conf_set_auth_passwd(void *data)
        yy_aconf->passwd = rb_strdup(data);
 }
 
+static void
+conf_set_auth_autojoin(void *data)
+{
+       if(yy_aconf->autojoin)
+               memset(yy_aconf->autojoin, 0, strlen(yy_aconf->autojoin));
+       rb_free(yy_aconf->autojoin);
+       yy_aconf->autojoin = rb_strdup(data);
+}
+
+static void
+conf_set_auth_autojoin_opers(void *data)
+{
+       if(yy_aconf->autojoin_opers)
+               memset(yy_aconf->autojoin_opers, 0, strlen(yy_aconf->autojoin));
+       rb_free(yy_aconf->autojoin_opers);
+       yy_aconf->autojoin_opers = rb_strdup(data);
+}
+
 static void
 conf_set_auth_spoof(void *data)
 {
@@ -1243,13 +1286,6 @@ conf_end_connect(struct TopConf *tc)
                yy_server->flags &= ~SERVER_COMPRESSED;
        }
 #endif
-       if(ServerConfCompressed(yy_server) && ServerConfSSL(yy_server))
-       {
-               conf_report_error("Ignoring compressed for connect block %s -- "
-                                      "ssl and compressed are mutually exclusive (OpenSSL does its own compression)", 
-                                      yy_server->name);
-               yy_server->flags &= ~SERVER_COMPRESSED;
-       }
 
        add_server_conf(yy_server);
        rb_dlinkAdd(yy_server, &yy_server->node, &server_conf_list);
@@ -1717,9 +1753,6 @@ conf_end_alias(struct TopConf *tc)
                return -1;
        }
 
-       if (!alias_dict)
-               alias_dict = irc_dictionary_create(strcasecmp);
-
        irc_dictionary_add(alias_dict, yy_alias->name, yy_alias);
 
        return 0;
@@ -2035,6 +2068,7 @@ static struct ConfEntry conf_operator_table[] =
        { "snomask",    CF_QSTRING, conf_set_oper_snomask,      0, NULL },
        { "user",       CF_QSTRING, conf_set_oper_user,         0, NULL },
        { "password",   CF_QSTRING, conf_set_oper_password,     0, NULL },
+       { "fingerprint",        CF_QSTRING, conf_set_oper_fingerprint,  0, NULL },
        { "\0", 0, NULL, 0, NULL }
 };
 
@@ -2069,6 +2103,8 @@ static struct ConfEntry conf_auth_table[] =
        { "password",   CF_QSTRING, conf_set_auth_passwd,       0, NULL },
        { "class",      CF_QSTRING, conf_set_auth_class,        0, NULL },
        { "spoof",      CF_QSTRING, conf_set_auth_spoof,        0, NULL },
+       { "autojoin",  CF_QSTRING, conf_set_auth_autojoin,              0, NULL },
+       { "autojoin_opers",     CF_QSTRING, conf_set_auth_autojoin_opers,       0, NULL },
        { "redirserv",  CF_QSTRING, conf_set_auth_redir_serv,   0, NULL },
        { "redirport",  CF_INT,     conf_set_auth_redir_port,   0, NULL },
        { "flags",      CF_STRING | CF_FLIST, conf_set_auth_flags,      0, NULL },
@@ -2143,6 +2179,7 @@ static struct ConfEntry conf_general_table[] =
        { "no_oper_flood",      CF_YESNO, NULL, 0, &ConfigFileEntry.no_oper_flood       },
        { "operspy_admin_only", CF_YESNO, NULL, 0, &ConfigFileEntry.operspy_admin_only  },
        { "operspy_dont_care_user_info", CF_YESNO, NULL, 0, &ConfigFileEntry.operspy_dont_care_user_info },
+       { "secret_channels_in_whois", CF_YESNO, NULL, 0, &ConfigFileEntry.secret_channels_in_whois },
        { "pace_wait",          CF_TIME,  NULL, 0, &ConfigFileEntry.pace_wait           },
        { "pace_wait_simple",   CF_TIME,  NULL, 0, &ConfigFileEntry.pace_wait_simple    },
        { "ping_cookie",        CF_YESNO, NULL, 0, &ConfigFileEntry.ping_cookie         },
@@ -2169,6 +2206,7 @@ static struct ConfEntry conf_general_table[] =
 
 static struct ConfEntry conf_channel_table[] =
 {
+       { "autochanmodes",      CF_QSTRING, NULL, 0, &ConfigChannel.autochanmodes       },
        { "default_split_user_count",   CF_INT,  NULL, 0, &ConfigChannel.default_split_user_count        },
        { "default_split_server_count", CF_INT,  NULL, 0, &ConfigChannel.default_split_server_count },
        { "burst_topicwho",     CF_YESNO, NULL, 0, &ConfigChannel.burst_topicwho        },
@@ -2180,10 +2218,17 @@ static struct ConfEntry conf_channel_table[] =
        { "max_chans_per_user", CF_INT,   NULL, 0, &ConfigChannel.max_chans_per_user    },
        { "no_create_on_split", CF_YESNO, NULL, 0, &ConfigChannel.no_create_on_split    },
        { "no_join_on_split",   CF_YESNO, NULL, 0, &ConfigChannel.no_join_on_split      },
+       { "only_ascii_channels", CF_YESNO, NULL, 0, &ConfigChannel.only_ascii_channels },
+       { "cycle_host_change",  CF_YESNO, NULL, 0, &ConfigChannel.cycle_host_change },
+       { "host_in_topic",      CF_YESNO, NULL, 0, &ConfigChannel.host_in_topic },
+       { "use_halfop",         CF_YESNO, NULL, 0, &ConfigChannel.use_halfop            },
+       { "use_owner",          CF_YESNO, NULL, 0, &ConfigChannel.use_owner             },
        { "use_except",         CF_YESNO, NULL, 0, &ConfigChannel.use_except            },
        { "use_invex",          CF_YESNO, NULL, 0, &ConfigChannel.use_invex             },
        { "use_knock",          CF_YESNO, NULL, 0, &ConfigChannel.use_knock             },
        { "use_forward",        CF_YESNO, NULL, 0, &ConfigChannel.use_forward           },
+       { "resv_forcepart",     CF_YESNO, NULL, 0, &ConfigChannel.resv_forcepart        },
+       { "kick_no_rejoin_time", CF_INT,  NULL, 0, &ConfigChannel.kick_no_rejoin_time   },
        { "\0",                 0,        NULL, 0, NULL }
 };