X-Git-Url: https://jfr.im/git/irc/rqf/shadowircd.git/blobdiff_plain/94c0bd4abe20814f3fcf191706303f7aa0f85937..3c6fb31a4bb6580e3295fdec5d4687eafb487251:/modules/m_dline.c diff --git a/modules/m_dline.c b/modules/m_dline.c index f7f0945..e54bacf 100644 --- a/modules/m_dline.c +++ b/modules/m_dline.c @@ -100,6 +100,13 @@ mo_dline(struct Client *client_p, struct Client *source_p, if(parc >= loc+2 && !irccmp(parv[loc], "ON")) { + if(!IsOperRemoteBan(source_p)) + { + sendto_one(source_p, form_str(ERR_NOPRIVS), + me.name, source_p->name, "remoteban"); + return 0; + } + target_server = parv[loc+1]; loc += 2; } @@ -145,6 +152,13 @@ mo_undline(struct Client *client_p, struct Client *source_p, int parc, const cha if(parc >= 4 && !irccmp(parv[2], "ON")) { + if(!IsOperRemoteBan(source_p)) + { + sendto_one(source_p, form_str(ERR_NOPRIVS), + me.name, source_p->name, "remoteban"); + return 0; + } + target_server = parv[3]; sendto_match_servs(source_p, target_server, CAP_ENCAP, NOCAPS, @@ -249,16 +263,6 @@ apply_dline(struct Client *source_p, const char *dlhost, int tdline_time, char * return 0; } - /* Look for an oper reason */ - if((oper_reason = strchr(reason, '|')) != NULL) - { - *oper_reason = '\0'; - oper_reason++; - - if(!EmptyString(oper_reason)) - aconf->spasswd = rb_strdup(oper_reason); - } - if(ConfigFileEntry.non_redundant_klines) { if((aconf = find_dline((struct sockaddr *)&daddr, t)) != NULL) @@ -288,6 +292,16 @@ apply_dline(struct Client *source_p, const char *dlhost, int tdline_time, char * aconf->status = CONF_DLINE; aconf->host = rb_strdup(dlhost); + /* Look for an oper reason */ + if((oper_reason = strchr(reason, '|')) != NULL) + { + *oper_reason = '\0'; + oper_reason++; + + if(!EmptyString(oper_reason)) + aconf->spasswd = rb_strdup(oper_reason); + } + if(tdline_time > 0) { rb_snprintf(dlbuffer, sizeof(dlbuffer), @@ -325,7 +339,7 @@ apply_dline(struct Client *source_p, const char *dlhost, int tdline_time, char * { rb_snprintf(dlbuffer, sizeof(dlbuffer), "%s (%s)", reason, current_date); aconf->passwd = rb_strdup(dlbuffer); - add_conf_by_address(aconf->host, CONF_DLINE, NULL, aconf); + add_conf_by_address(aconf->host, CONF_DLINE, NULL, NULL, aconf); write_confitem(DLINE_TYPE, source_p, NULL, aconf->host, reason, oper_reason, current_date, 0); }