]> jfr.im git - solanum.git/blobdiff - src/client.c
capability: change CapabilityIndex.orphaned to (CapabilityIndex.flags & CAP_ORPHANED)
[solanum.git] / src / client.c
index b372e881ca35543abe2950e058bb5c73116ccfde..4f8012778d2fc97cd5eb1a77536149d0ea67f9f9 100644 (file)
@@ -231,6 +231,7 @@ free_local_client(struct Client *client_p)
                rb_free(client_p->localClient->passwd);
        }
 
+       rb_free(client_p->localClient->auth_user);
        rb_free(client_p->localClient->challenge);
        rb_free(client_p->localClient->fullcaps);
        rb_free(client_p->localClient->opername);
@@ -255,6 +256,7 @@ free_client(struct Client *client_p)
        s_assert(&me != client_p);
        free_local_client(client_p);
        free_pre_client(client_p);
+       rb_free(client_p->certfp);
        rb_bh_free(client_heap, client_p);
 }
 
@@ -416,10 +418,10 @@ notify_banned_client(struct Client *client_p, struct ConfItem *aconf, int ban)
        const char *reason = NULL;
        const char *exit_reason = conn_closed;
 
-       if(ConfigFileEntry.kline_with_reason && !EmptyString(aconf->passwd))
+       if(ConfigFileEntry.kline_with_reason)
        {
-               reason = aconf->passwd;
-               exit_reason = aconf->passwd;
+               reason = get_user_ban_reason(aconf);
+               exit_reason = reason;
        }
        else
        {
@@ -585,7 +587,7 @@ check_xlines(void)
                                sendto_realops_snomask(SNO_GENERAL, L_ALL,
                                                     "XLINE over-ruled for %s, client is kline_exempt [%s]",
                                                     get_client_name(client_p, HIDE_IP),
-                                                    aconf->name);
+                                                    aconf->host);
                                continue;
                        }
 
@@ -1105,7 +1107,7 @@ exit_aborted_clients(void *unused)
  *
  */
 void
-dead_link(struct Client *client_p)
+dead_link(struct Client *client_p, int sendqex)
 {
        struct abort_client *abt;
 
@@ -1115,7 +1117,7 @@ dead_link(struct Client *client_p)
 
        abt = (struct abort_client *) rb_malloc(sizeof(struct abort_client));
 
-       if(client_p->flags & FLAGS_SENDQEX)
+       if(sendqex)
                rb_strlcpy(abt->notice, "Max SendQ exceeded", sizeof(abt->notice));
        else
                rb_snprintf(abt->notice, sizeof(abt->notice), "Write error: %s", strerror(errno));
@@ -1138,7 +1140,7 @@ exit_generic_client(struct Client *client_p, struct Client *source_p, struct Cli
        if(IsOper(source_p))
                rb_dlinkFindDestroy(source_p, &oper_list);
 
-       sendto_common_channels_local(source_p, ":%s!%s@%s QUIT :%s",
+       sendto_common_channels_local(source_p, NOCAPS, ":%s!%s@%s QUIT :%s",
                                     source_p->name,
                                     source_p->username, source_p->host, comment);
 
@@ -1324,7 +1326,6 @@ exit_local_server(struct Client *client_p, struct Client *source_p, struct Clien
        rb_dlinkDelete(&source_p->localClient->tnode, &serv_list);
        rb_dlinkFindDestroy(source_p, &global_serv_list);
        
-       unset_chcap_usage_counts(source_p);
        sendk = source_p->localClient->sendK;
        recvk = source_p->localClient->receiveK;
 
@@ -1657,10 +1658,8 @@ make_user(struct Client *client_p)
        {
                user = (struct User *) rb_bh_alloc(user_heap);
                user->refcnt = 1;
-               user->metadata = irc_dictionary_create(irccmp);
                client_p->user = user;
        }
-
        return user;
 }
 
@@ -1672,14 +1671,14 @@ make_user(struct Client *client_p)
  * side effects - add's an Server information block to a client
  *                if it was not previously allocated.
  */
-server_t *
+struct Server *
 make_server(struct Client *client_p)
 {
-       server_t *serv = client_p->serv;
+       struct Server *serv = client_p->serv;
 
        if(!serv)
        {
-               serv = (server_t *) rb_malloc(sizeof(server_t));
+               serv = (struct Server *) rb_malloc(sizeof(struct Server));
                client_p->serv = serv;
        }
        return client_p->serv;