]> jfr.im git - solanum.git/blobdiff - src/s_user.c
blacklist: Make the snote more like the +c one.
[solanum.git] / src / s_user.c
index 9297317298301d554a687adfbd68773b98de83db..4b3976598f5ac7e0c66b185115d5c603bac77541 100644 (file)
@@ -54,6 +54,7 @@
 #include "blacklist.h"
 #include "substitution.h"
 #include "chmode.h"
+#include "s_assert.h"
 
 static void report_and_set_user_flags(struct Client *, struct ConfItem *);
 void user_welcome(struct Client *source_p);
@@ -147,7 +148,7 @@ show_lusers(struct Client *source_p)
 
        if((rb_dlink_list_length(&lclient_list) + rb_dlink_list_length(&serv_list)) >
           (unsigned long)MaxConnectionCount)
-               MaxConnectionCount = rb_dlink_list_length(&lclient_list) + 
+               MaxConnectionCount = rb_dlink_list_length(&lclient_list) +
                                        rb_dlink_list_length(&serv_list);
 
        sendto_one_numeric(source_p, RPL_LUSERCLIENT, form_str(RPL_LUSERCLIENT),
@@ -156,16 +157,17 @@ show_lusers(struct Client *source_p)
                           (int)rb_dlink_list_length(&global_serv_list));
 
        if(rb_dlink_list_length(&oper_list) > 0)
-               sendto_one_numeric(source_p, RPL_LUSEROP, 
-                                  form_str(RPL_LUSEROP), rb_dlink_list_length(&oper_list));
+               sendto_one_numeric(source_p, RPL_LUSEROP,
+                                  form_str(RPL_LUSEROP),
+                                  (int)rb_dlink_list_length(&oper_list));
 
        if(rb_dlink_list_length(&unknown_list) > 0)
-               sendto_one_numeric(source_p, RPL_LUSERUNKNOWN, 
+               sendto_one_numeric(source_p, RPL_LUSERUNKNOWN,
                                   form_str(RPL_LUSERUNKNOWN),
                                   (int)rb_dlink_list_length(&unknown_list));
 
        if(rb_dlink_list_length(&global_channel_list) > 0)
-               sendto_one_numeric(source_p, RPL_LUSERCHANNELS, 
+               sendto_one_numeric(source_p, RPL_LUSERCHANNELS,
                                   form_str(RPL_LUSERCHANNELS),
                                   rb_dlink_list_length(&global_channel_list));
 
@@ -173,7 +175,7 @@ show_lusers(struct Client *source_p)
                           (int)rb_dlink_list_length(&lclient_list),
                           (int)rb_dlink_list_length(&serv_list));
 
-       sendto_one_numeric(source_p, RPL_LOCALUSERS, 
+       sendto_one_numeric(source_p, RPL_LOCALUSERS,
                           form_str(RPL_LOCALUSERS),
                           (int)rb_dlink_list_length(&lclient_list),
                           Count.max_loc,
@@ -186,7 +188,7 @@ show_lusers(struct Client *source_p)
 
        sendto_one_numeric(source_p, RPL_STATSCONN,
                           form_str(RPL_STATSCONN),
-                          MaxConnectionCount, MaxClientCount, 
+                          MaxConnectionCount, MaxClientCount,
                           Count.totalrestartcount);
 
        return 0;
@@ -303,7 +305,7 @@ register_local_user(struct Client *client_p, struct Client *source_p, const char
 
                rb_strlcpy(source_p->host, source_p->sockhost, sizeof(source_p->host));
        }
+
 
        aconf = source_p->localClient->att_conf;
 
@@ -432,6 +434,14 @@ register_local_user(struct Client *client_p, struct Client *source_p, const char
                                        source_p->sockhost, source_p->preClient->dnsbl_listed->host);
                else
                {
+                       sendto_realops_snomask(SNO_REJ, L_NETWIDE,
+                               "Listed on DNSBL %s: %s (%s@%s) [%s] [%s]",
+                               source_p->preClient->dnsbl_listed->host,
+                               source_p->name,
+                               source_p->username, source_p->host,
+                               IsIPSpoof(source_p) ? "255.255.255.255" : source_p->sockhost,
+                               source_p->info);
+
                        rb_dlink_list varlist = { NULL, NULL, 0 };
 
                        substitution_append_var(&varlist, "nick", source_p->name);
@@ -609,7 +619,7 @@ introduce_client(struct Client *client_p, struct Client *source_p, struct User *
                rb_strlcat(sockhost, source_p->sockhost, sizeof(sockhost));
        } else
                strcpy(sockhost, source_p->sockhost);
-               
+
        if (use_euid)
                sendto_server(client_p, NULL, CAP_EUID | CAP_TS6, NOCAPS,
                                ":%s EUID %s %d %ld %s %s %s %s %s %s %s :%s",
@@ -703,7 +713,7 @@ introduce_client(struct Client *client_p, struct Client *source_p, struct User *
        return 0;
 }
 
-/* 
+/*
  * valid_hostname - check hostname for validity
  *
  * Inputs       - pointer to user
@@ -750,13 +760,13 @@ valid_hostname(const char *hostname)
        return YES;
 }
 
-/* 
+/*
  * valid_username - check username for validity
  *
  * Inputs       - pointer to user
  * Output       - YES if valid, NO if not
  * Side effects - NONE
- * 
+ *
  * Absolutely always reject any '*' '!' '?' '@' in an user name
  * reject any odd control characters names.
  * Allow '.' in username to allow for "first.last"
@@ -997,7 +1007,7 @@ user_mode(struct Client *client_p, struct Client *source_p, int parc, const char
                        else
                        {
                                /* Only decrement the oper counts if an oper to begin with
-                                * found by Pat Szuta, Perly , perly@xnet.com 
+                                * found by Pat Szuta, Perly , perly@xnet.com
                                 */
 
                                if(!IsOper(source_p))
@@ -1203,7 +1213,7 @@ send_umode(struct Client *client_p, struct Client *source_p, int old, int sendma
  *
  * inputs      -
  * output      - NONE
- * side effects - 
+ * side effects -
  */
 void
 send_umode_out(struct Client *client_p, struct Client *source_p, int old)
@@ -1221,7 +1231,7 @@ send_umode_out(struct Client *client_p, struct Client *source_p, int old)
                if((target_p != client_p) && (target_p != source_p) && (*buf))
                {
                        sendto_one(target_p, ":%s MODE %s :%s",
-                                  get_id(source_p, target_p), 
+                                  get_id(source_p, target_p),
                                   get_id(source_p, target_p), buf);
                }
        }
@@ -1230,7 +1240,7 @@ send_umode_out(struct Client *client_p, struct Client *source_p, int old)
                send_umode(client_p, source_p, old, 0, buf);
 }
 
-/* 
+/*
  * user_welcome
  *
  * inputs      - client pointer to client to welcome
@@ -1255,7 +1265,7 @@ user_welcome(struct Client *source_p)
                sendto_one_notice(source_p, ":*** Notice -- motd was last changed at %s", user_motd_changed);
                sendto_one_notice(source_p, ":*** Notice -- Please read the motd if you haven't read it");
 
-               sendto_one(source_p, form_str(RPL_MOTDSTART), 
+               sendto_one(source_p, form_str(RPL_MOTDSTART),
                           me.name, source_p->name, me.name);
 
                sendto_one(source_p, form_str(RPL_MOTD),
@@ -1413,7 +1423,7 @@ change_nick_user_host(struct Client *target_p,    const char *nick, const char *use
        va_list ap;
 
        modeval[0] = '\0';
-       
+
        if(changed)
        {
                target_p->tsinfo = newts;