* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
-DECLARE_MODULE_AV1(dline, NULL, NULL, dline_clist, NULL, NULL, "$Revision: 3051 $");
+DECLARE_MODULE_AV1(dline, NULL, NULL, dline_clist, NULL, NULL, "$Revision: 3225 $");
static int valid_comment(char *comment);
static int flush_write(struct Client *, FILE *, char *, char *);
static int valid_comment(char *comment);
static int flush_write(struct Client *, FILE *, char *, char *);
"Temporary D-line %d min. - %s (%s)",
(int) (tdline_time / 60), reason, current_date);
DupString(aconf->passwd, dlbuffer);
"Temporary D-line %d min. - %s (%s)",
(int) (tdline_time / 60), reason, current_date);
DupString(aconf->passwd, dlbuffer);
- ircsnprintf(dlbuffer, sizeof(dlbuffer), "%s (%s)", reason, current_date);
+ rb_snprintf(dlbuffer, sizeof(dlbuffer), "%s (%s)", reason, current_date);
DupString(aconf->passwd, dlbuffer);
add_conf_by_address(aconf->host, CONF_DLINE, NULL, aconf);
write_confitem(DLINE_TYPE, source_p, NULL, aconf->host, reason,
DupString(aconf->passwd, dlbuffer);
add_conf_by_address(aconf->host, CONF_DLINE, NULL, aconf);
write_confitem(DLINE_TYPE, source_p, NULL, aconf->host, reason,
char buf[BUFSIZE], buff[BUFSIZE], temppath[BUFSIZE], *p;
const char *filename, *found_cidr;
const char *cidr;
char buf[BUFSIZE], buff[BUFSIZE], temppath[BUFSIZE], *p;
const char *filename, *found_cidr;
const char *cidr;
- ircsnprintf(temppath, sizeof(temppath), "%s.tmp", ConfigFileEntry.dlinefile);
+ rb_snprintf(temppath, sizeof(temppath), "%s.tmp", ConfigFileEntry.dlinefile);
- sendto_one(source_p, ":%s NOTICE %s :Invalid D-Line",
- me.name, source_p->name);
+ sendto_one_notice(source_p, ":Invalid D-Line");
+ return 0;
+ }
+
+ aconf = find_exact_conf_by_address(cidr, CONF_DLINE, NULL);
+ if(aconf == NULL)
+ {
+ sendto_one_notice(source_p, ":No D-Line for %s", cidr);
sendto_realops_snomask(SNO_GENERAL, L_ALL,
"%s has removed the temporary D-Line for: [%s]",
sendto_realops_snomask(SNO_GENERAL, L_ALL,
"%s has removed the temporary D-Line for: [%s]",
- get_oper_name(source_p), cidr);
- ilog(L_KLINE, "UD %s %s", get_oper_name(source_p), cidr);
+ get_oper_name(source_p), buf);
+ ilog(L_KLINE, "UD %s %s", get_oper_name(source_p), buf);
- sendto_one(source_p, ":%s NOTICE %s :No D-Line for %s",
- me.name, parv[0], cidr);
+ sendto_one_notice(source_p, ":Cannot find D-Line for %s in file",
+ aconf->host);
-
- sendto_one(source_p, ":%s NOTICE %s :D-Line for [%s] is removed", me.name, parv[0], cidr);
+ sendto_one(source_p, ":%s NOTICE %s :D-Line for [%s] is removed", me.name, parv[0], aconf->host);
- "%s has removed the D-Line for: [%s]", get_oper_name(source_p), cidr);
- ilog(L_KLINE, "UD %s %s", get_oper_name(source_p), cidr);
+ "%s has removed the D-Line for: [%s]", get_oper_name(source_p), aconf->host);
+ ilog(L_KLINE, "UD %s %s", get_oper_name(source_p), aconf->host);
+
+ delete_one_address_conf(aconf->host, aconf);
- sendto_one(source_p, ":%s NOTICE %s :Unable to write to %s",
- me.name, source_p->name, temppath);
+ sendto_one_notice(source_p, ":Unable to write to %s", temppath);
- aconf = ptr->data;
-
- parse_netmask(aconf->host, (struct sockaddr *)&caddr, &cbits);
-
- if(comp_with_mask_sock((struct sockaddr *)&addr, (struct sockaddr *)&caddr, bits) && bits == cbits)
+ if (aconf == ptr->data)