]> jfr.im git - solanum.git/blobdiff - src/s_conf.c
ircs[n]printf -> rb_s[n]printf
[solanum.git] / src / s_conf.c
index 2db0c872b86647ca67a80adf578e0facb4a7914b..247ae6827d2afbc57e417b552aec56373f9b71fa 100644 (file)
@@ -173,8 +173,6 @@ check_client(struct Client *client_p, struct Client *source_p, const char *usern
 {
        int i;
 
-       ClearAccess(source_p);
-
        if((i = verify_access(source_p, username)))
        {
                ilog(L_FUSER, "Access denied: %s[%s]", 
@@ -281,13 +279,12 @@ 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,
                                source_p->localClient->listener->name, port);
-                       add_reject(client_p);
+                       add_reject(client_p, NULL, NULL);
                        exit_client(client_p, source_p, &me,
                                    "You are not authorised to use this server");
                        break;
                }
        case BANNED_CLIENT:
-               add_reject(client_p);
                exit_client(client_p, client_p, &me, "*** Banned ");
                ServerStats->is_ref++;
                break;
@@ -342,10 +339,6 @@ verify_access(struct Client *client_p, const char *username)
                        return (NOT_AUTHORISED);
                }
 
-
-               if(IsConfDoIdentd(aconf))
-                       SetNeedId(client_p);
-
                /* Thanks for spoof idea amm */
                if(IsConfDoSpoofIp(aconf))
                {
@@ -388,6 +381,7 @@ verify_access(struct Client *client_p, const char *username)
                                        form_str(ERR_YOUREBANNEDCREEP),
                                        me.name, client_p->name, aconf->passwd);
                }
+               add_reject(client_p, aconf->user, aconf->host);
                return (BANNED_CLIENT);
        }
        else if(aconf->status & CONF_GLINE)
@@ -399,6 +393,7 @@ verify_access(struct Client *client_p, const char *username)
                                        form_str(ERR_YOUREBANNEDCREEP),
                                        me.name, client_p->name, aconf->passwd);
 
+               add_reject(client_p, aconf->user, aconf->host);
                return (BANNED_CLIENT);
        }
 
@@ -604,7 +599,6 @@ attach_conf(struct Client *client_p, struct ConfItem *aconf)
                else
                {
                        sendto_one_notice(client_p, ":*** I: line is full, but you have an >I: line!");
-                       SetExemptLimits(client_p);
                }
 
        }
@@ -798,7 +792,6 @@ set_default_conf(void)
        ConfigFileEntry.gline_min_cidr6 = 48;
        ConfigFileEntry.hide_spoof_ips = YES;
        ConfigFileEntry.hide_error_messages = 1;
-       ConfigFileEntry.idletime = 0;
        ConfigFileEntry.dots_in_ident = 0;
        ConfigFileEntry.max_targets = MAX_TARGETS_DEFAULT;
        DupString(ConfigFileEntry.servlink_path, SLPATH);
@@ -851,7 +844,7 @@ set_default_conf(void)
        ConfigFileEntry.reject_duration = 120;
        ConfigFileEntry.max_unknown_ip = 2;
 
-       ServerInfo.max_clients = comm_get_maxconnections() - MAX_BUFFER;
+       ServerInfo.max_clients = rb_get_maxconnections() - MAX_BUFFER;
 }
 
 #undef YES
@@ -899,8 +892,6 @@ validate_conf(void)
           (ConfigFileEntry.client_flood > CLIENT_FLOOD_MAX))
                ConfigFileEntry.client_flood = CLIENT_FLOOD_MAX;
 
-       GlobalSetOptions.idletime = (ConfigFileEntry.idletime * 60);
-
        if(!split_users || !split_servers ||
           (!ConfigChannel.no_create_on_split && !ConfigChannel.no_join_on_split))
        {
@@ -1091,13 +1082,13 @@ get_oper_name(struct Client *client_p)
 
        if(MyOper(client_p))
        {
-               ircsnprintf(buffer, sizeof(buffer), "%s!%s@%s{%s}",
+               rb_snprintf(buffer, sizeof(buffer), "%s!%s@%s{%s}",
                                client_p->name, client_p->username,
                                client_p->host, client_p->localClient->opername);
                return buffer;
        }
 
-       ircsnprintf(buffer, sizeof(buffer), "%s!%s@%s{%s}",
+       rb_snprintf(buffer, sizeof(buffer), "%s!%s@%s{%s}",
                   client_p->name, client_p->username, 
                   client_p->host, client_p->servptr->name);
        return buffer;
@@ -1199,6 +1190,19 @@ read_conf_files(int cold)
        fclose(conf_fbfile_in);
 }
 
+/*
+ * free an alias{} entry.
+ */
+static void
+free_alias_cb(struct DictionaryElement *ptr, void *unused)
+{
+       struct alias_entry *aptr = ptr->data;
+
+       MyFree(aptr->name);
+       MyFree(aptr->target);
+       MyFree(aptr);
+}
+
 /*
  * clear_out_old_conf
  *
@@ -1212,7 +1216,6 @@ clear_out_old_conf(void)
        struct Class *cltmp;
        dlink_node *ptr;
        dlink_node *next_ptr;
-       int i;
 
        /*
         * don't delete the class table, rather mark all entries
@@ -1269,19 +1272,8 @@ clear_out_old_conf(void)
        }
 
        /* remove any aliases... -- nenolod */
-       for (i = 0; i < MAX_MSG_HASH; i++)
-       {
-               DLINK_FOREACH_SAFE(ptr, next_ptr, alias_hash_table[i].head)
-               {
-                       struct alias_entry *aptr = ptr->data;
-
-                       MyFree(aptr->name);
-                       MyFree(aptr->target);
-                       MyFree(aptr);
-
-                       dlinkDestroy(ptr, &alias_hash_table[i]);
-               }
-       }
+       irc_dictionary_destroy(alias_dict, free_alias_cb, NULL);
+       alias_dict = NULL;
 
        destroy_blacklists();
 
@@ -1387,20 +1379,20 @@ write_confitem(KlineType type, struct Client *source_p, char *user,
 
        if(type == KLINE_TYPE)
        {
-               ircsnprintf(buffer, sizeof(buffer),
+               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), CurrentTime);
        }
        else if(type == DLINE_TYPE)
        {
-               ircsnprintf(buffer, sizeof(buffer),
+               rb_snprintf(buffer, sizeof(buffer),
                           "\"%s\",\"%s\",\"%s\",\"%s\",\"%s\",%ld\n", host,
                           reason, oper_reason, current_date, get_oper_name(source_p), CurrentTime);
        }
        else if(type == RESV_TYPE)
        {
-               ircsnprintf(buffer, sizeof(buffer), "\"%s\",\"%s\",\"%s\",%ld\n",
+               rb_snprintf(buffer, sizeof(buffer), "\"%s\",\"%s\",\"%s\",%ld\n",
                           host, reason, get_oper_name(source_p), CurrentTime);
        }