]> jfr.im git - solanum.git/blobdiff - src/client.c
can_kick hook, based on the ircd-seven one.
[solanum.git] / src / client.c
index 8e8dd6810ec2b8e6d590bb2c4a3d488fe1ec5448..2aa84520c51417d6641758e5cf28a6768e0a991c 100644 (file)
@@ -235,8 +235,14 @@ free_local_client(struct Client *client_p)
        rb_free(client_p->localClient->fullcaps);
        rb_free(client_p->localClient->opername);
        rb_free(client_p->localClient->mangledhost);
+       if (client_p->localClient->privset)
+               privilegeset_unref(client_p->localClient->privset);
 
-       ssld_decrement_clicount(client_p->localClient->ssl_ctl);
+       if(IsSSL(client_p))
+           ssld_decrement_clicount(client_p->localClient->ssl_ctl);
+           
+       if(IsCapable(client_p, CAP_ZIP))
+           ssld_decrement_clicount(client_p->localClient->z_ctl);
 
        rb_bh_free(lclient_heap, client_p->localClient);
        client_p->localClient = NULL;
@@ -453,11 +459,8 @@ check_banned_lines(void)
                        continue;
 
                /* if there is a returned struct ConfItem then kill it */
-               if((aconf = find_dline((struct sockaddr *)&client_p->localClient->ip, client_p->localClient->ip.ss_family)))
+               if((aconf = find_dline((struct sockaddr *)&client_p->localClient->ip, client_p->localClient->ip.ss_family)) && !(aconf->status & CONF_EXEMPTDLINE))
                {
-                       if(aconf->status & CONF_EXEMPTDLINE)
-                               continue;
-
                        sendto_realops_snomask(SNO_GENERAL, L_ALL,
                                             "DLINE active for %s",
                                             get_client_name(client_p, HIDE_IP));
@@ -560,8 +563,9 @@ check_klines(void)
                        if(IsExemptKline(client_p))
                        {
                                sendto_realops_snomask(SNO_GENERAL, L_ALL,
-                                                    "KLINE over-ruled for %s, client is kline_exempt",
-                                                    get_client_name(client_p, HIDE_IP));
+                                                    "KLINE over-ruled for %s, client is kline_exempt [%s@%s]",
+                                                    get_client_name(client_p, HIDE_IP),
+                                                    aconf->user, aconf->host);
                                continue;
                        }
 
@@ -651,8 +655,9 @@ check_xlines(void)
                        if(IsExemptKline(client_p))
                        {
                                sendto_realops_snomask(SNO_GENERAL, L_ALL,
-                                                    "XLINE over-ruled for %s, client is kline_exempt",
-                                                    get_client_name(client_p, HIDE_IP));
+                                                    "XLINE over-ruled for %s, client is kline_exempt [%s]",
+                                                    get_client_name(client_p, HIDE_IP),
+                                                    aconf->name);
                                continue;
                        }
 
@@ -1361,15 +1366,12 @@ static int
 qs_server(struct Client *client_p, struct Client *source_p, struct Client *from, 
                  const char *comment)
 {
-       struct Client *target_p;
-
        if(source_p->servptr && source_p->servptr->serv)
                rb_dlinkDelete(&source_p->lnode, &source_p->servptr->serv->servers);
        else
                s_assert(0);
 
        rb_dlinkFindDestroy(source_p, &global_serv_list);
-       target_p = source_p->from;
        
        if(has_id(source_p))
                del_from_id_hash(source_p->id, source_p);
@@ -1487,10 +1489,11 @@ exit_local_client(struct Client *client_p, struct Client *source_p, struct Clien
 
        on_for = rb_current_time() - source_p->localClient->firsttime;
 
-       ilog(L_USER, "%s (%3lu:%02lu:%02lu): %s!%s@%s %d/%d",
+       ilog(L_USER, "%s (%3lu:%02lu:%02lu): %s!%s@%s %s %d/%d",
                rb_ctime(rb_current_time(), tbuf, sizeof(tbuf)), on_for / 3600,
                (on_for % 3600) / 60, on_for % 60,
                source_p->name, source_p->username, source_p->host,
+               source_p->sockhost,
                source_p->localClient->sendK, source_p->localClient->receiveK);
 
        sendto_one(source_p, "ERROR :Closing Link: %s (%s)", source_p->host, comment);
@@ -1884,7 +1887,7 @@ close_connection(struct Client *client_p)
                ServerStats.is_sv++;
                ServerStats.is_sbs += client_p->localClient->sendB;
                ServerStats.is_sbr += client_p->localClient->receiveB;
-               ServerStats.is_sti += rb_current_time() - client_p->localClient->firsttime;
+               ServerStats.is_sti += (unsigned long long)(rb_current_time() - client_p->localClient->firsttime);
 
                /*
                 * If the connection has been up for a long amount of time, schedule
@@ -1910,7 +1913,7 @@ close_connection(struct Client *client_p)
                ServerStats.is_cl++;
                ServerStats.is_cbs += client_p->localClient->sendB;
                ServerStats.is_cbr += client_p->localClient->receiveB;
-               ServerStats.is_cti += rb_current_time() - client_p->localClient->firsttime;
+               ServerStats.is_cti += (unsigned long long)(rb_current_time() - client_p->localClient->firsttime);
        }
        else
                ServerStats.is_ni++;