#include "parse.h"
#include "modules.h"
#include "bandbi.h"
+#include "operhash.h"
static int mo_dline(struct Client *, struct Client *, int, const char **);
static int me_dline(struct Client *, struct Client *, int, const char **);
DECLARE_MODULE_AV1(dline, NULL, NULL, dline_clist, NULL, NULL, "$Revision$");
-static int valid_comment(char *comment);
static int remove_temp_dline(struct ConfItem *);
static int apply_dline(struct Client *, const char *, int, char *);
static int apply_undline(struct Client *, const char *);
dlhost = parv[loc];
rb_strlcpy(cidr_form_host, dlhost, sizeof(cidr_form_host));
-
loc++;
+ /* would break the protocol */
+ if (*dlhost == ':')
+ {
+ sendto_one_notice(source_p, ":Invalid D-Line");
+ return 0;
+ }
+
if(parc >= loc + 2 && !irccmp(parv[loc], "ON"))
{
if(!IsOperRemoteBan(source_p))
{
struct ConfItem *aconf;
char *oper_reason;
- char dlbuffer[IRCD_BUFSIZE];
struct rb_sockaddr_storage daddr;
int t = AF_INET, ty, b;
const char *creason;
}
}
- if(!valid_comment(reason))
- {
- sendto_one(source_p,
- ":%s NOTICE %s :Invalid character '\"' in comment",
- me.name, source_p->name);
- return 0;
- }
-
if(ConfigFileEntry.non_redundant_klines)
{
if((aconf = find_dline((struct sockaddr *) &daddr, t)) != NULL)
aconf->status = CONF_DLINE;
aconf->created = rb_current_time();
aconf->host = rb_strdup(dlhost);
+ aconf->passwd = rb_strdup(reason);
+ aconf->info.oper = operhash_add(get_oper_name(source_p));
+
+ if(strlen(reason) > BANREASONLEN)
+ reason[BANREASONLEN] = '\0';
/* Look for an oper reason */
if((oper_reason = strchr(reason, '|')) != NULL)
if(tdline_time > 0)
{
- rb_snprintf(dlbuffer, sizeof(dlbuffer),
- "Temporary D-line %d min. - %s",
- (int) (tdline_time / 60), reason);
- aconf->passwd = rb_strdup(dlbuffer);
aconf->hold = rb_current_time() + tdline_time;
add_temp_dline(aconf);
}
else
{
- aconf->passwd = rb_strdup(reason);
add_conf_by_address(aconf->host, CONF_DLINE, NULL, NULL, aconf);
bandb_add(BANDB_DLINE, source_p, aconf->host, NULL,
return 0;
}
-/*
- * valid_comment
- * inputs - pointer to client
- * - pointer to comment
- * output - 0 if no valid comment, 1 if valid
- * side effects - NONE
- */
-static int
-valid_comment(char *comment)
-{
- if(strchr(comment, '"'))
- return 0;
-
- if(strlen(comment) > BANREASONLEN)
- comment[BANREASONLEN] = '\0';
-
- return 1;
-}
-
/* remove_temp_dline()
*
* inputs - confitem to undline