X-Git-Url: https://jfr.im/git/irc/rqf/shadowircd.git/blobdiff_plain/35f6f850b62d10299bdd2b6125aa659016c68127..13ae2f4b6904ebf7b8160902f9ffeb80f7585ed2:/modules/m_xline.c diff --git a/modules/m_xline.c b/modules/m_xline.c index a13d46f..fba0a13 100644 --- a/modules/m_xline.c +++ b/modules/m_xline.c @@ -31,7 +31,6 @@ */ #include "stdinc.h" -#include "tools.h" #include "send.h" #include "channel.h" #include "client.h" @@ -40,12 +39,10 @@ #include "class.h" #include "ircd.h" #include "numeric.h" -#include "memory.h" -#include "s_log.h" +#include "logger.h" #include "s_serv.h" #include "whowas.h" -#include "irc_string.h" -#include "sprintf_irc.h" +#include "match.h" #include "hash.h" #include "msg.h" #include "parse.h" @@ -154,7 +151,7 @@ mo_xline(struct Client *client_p, struct Client *source_p, int parc, const char if(!match(target_server, me.name)) return 0; } - else if(dlink_list_length(&cluster_conf_list) > 0) + else if(rb_dlink_list_length(&cluster_conf_list) > 0) cluster_xline(source_p, temp_time, name, reason); if((aconf = find_xline_mask(name)) != NULL) @@ -313,17 +310,17 @@ apply_xline(struct Client *source_p, const char *name, const char *reason, } *new = '\0'; - DupString(aconf->name, tmp); + aconf->name = rb_strdup(tmp); } else - DupString(aconf->name, name); + aconf->name = rb_strdup(name); - DupString(aconf->passwd, reason); + aconf->passwd = rb_strdup(reason); collapse(aconf->name); if(temp_time > 0) { - aconf->hold = CurrentTime + temp_time; + aconf->hold = rb_current_time() + temp_time; sendto_realops_snomask(SNO_GENERAL, L_ALL, "%s added temporary %d min. X-Line for [%s] [%s]", @@ -347,7 +344,7 @@ apply_xline(struct Client *source_p, const char *name, const char *reason, get_oper_name(source_p), name, reason); } - dlinkAddAlloc(aconf, &xline_conf_list); + rb_dlinkAddAlloc(aconf, &xline_conf_list); check_xlines(); } @@ -373,9 +370,9 @@ write_xline(struct Client *source_p, struct ConfItem *aconf) return; } - ircsprintf(buffer, "\"%s\",\"0\",\"%s\",\"%s\",%ld\n", + rb_sprintf(buffer, "\"%s\",\"0\",\"%s\",\"%s\",%ld\n", aconf->name, aconf->passwd, - get_oper_name(source_p), CurrentTime); + get_oper_name(source_p), (long) rb_current_time()); if(fputs(buffer, out) == -1) { @@ -418,9 +415,9 @@ cluster_xline(struct Client *source_p, int temp_time, const char *name, const char *reason) { struct remote_conf *shared_p; - dlink_node *ptr; + rb_dlink_node *ptr; - DLINK_FOREACH(ptr, cluster_conf_list.head) + RB_DLINK_FOREACH(ptr, cluster_conf_list.head) { shared_p = ptr->data; @@ -475,7 +472,7 @@ mo_unxline(struct Client *client_p, struct Client *source_p, int parc, const cha if(match(parv[3], me.name) == 0) return 0; } - else if(dlink_list_length(&cluster_conf_list)) + else if(rb_dlink_list_length(&cluster_conf_list)) cluster_generic(source_p, "UNXLINE", SHARED_UNXLINE, CAP_CLUSTER, "%s", parv[1]); @@ -534,9 +531,9 @@ static void remove_xline(struct Client *source_p, const char *name) { struct ConfItem *aconf; - dlink_node *ptr; + rb_dlink_node *ptr; - DLINK_FOREACH(ptr, xline_conf_list.head) + RB_DLINK_FOREACH(ptr, xline_conf_list.head) { aconf = ptr->data; @@ -561,7 +558,7 @@ remove_xline(struct Client *source_p, const char *name) remove_reject_mask(aconf->name, NULL); free_conf(aconf); - dlinkDestroy(ptr, &xline_conf_list); + rb_dlinkDestroy(ptr, &xline_conf_list); return; } } @@ -593,7 +590,7 @@ remove_xline_from_file(struct Client *source_p, const char *huntgecos) int found_xline = 0; filename = ConfigFileEntry.xlinefile; - ircsnprintf(temppath, sizeof(temppath), + rb_snprintf(temppath, sizeof(temppath), "%s.tmp", ConfigFileEntry.xlinefile); if((in = fopen(filename, "r")) == NULL) @@ -624,7 +621,7 @@ remove_xline_from_file(struct Client *source_p, const char *huntgecos) break; } - strlcpy(buff, buf, sizeof(buff)); + rb_strlcpy(buff, buf, sizeof(buff)); if((p = strchr(buff, '\n')) != NULL) *p = '\0';