summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/conf.h16
-rw-r--r--include/resv.h2
-rw-r--r--modules/m_dline.c32
-rw-r--r--modules/m_gline.c9
-rw-r--r--modules/m_kline.c43
-rw-r--r--modules/m_resv.c14
-rw-r--r--modules/m_stats.c13
-rw-r--r--modules/m_testline.c8
-rw-r--r--modules/m_xline.c7
-rw-r--r--src/conf.c45
-rw-r--r--src/conf_db.c235
-rw-r--r--src/conf_parser.c310
-rw-r--r--src/conf_parser.y6
-rw-r--r--src/hostmask.c28
-rw-r--r--src/resv.c13
15 files changed, 351 insertions, 430 deletions
diff --git a/include/conf.h b/include/conf.h
index 42fb871..ac5766b 100644
--- a/include/conf.h
+++ b/include/conf.h
@@ -107,6 +107,7 @@ struct MatchItem
int count; /* How many times this matchitem has been matched */
int ref_count; /* How many times is this matchitem in use */
int illegal; /* Should it be deleted when possible? */
+ unsigned int flags;
time_t hold; /* Hold action until this time (calendar time) */
time_t setat;
};
@@ -227,7 +228,7 @@ struct CidrItem
/* server flags */
#define CONF_FLAGS_ALLOW_AUTO_CONN 0x00002000
#define CONF_FLAGS_ENCRYPTED 0x00004000
-#define CONF_FLAGS_TEMPORARY 0x00008000
+#define CONF_FLAGS_IN_DATABASE 0x00008000
#define CONF_FLAGS_EXEMPTRESV 0x00010000
#define CONF_FLAGS_SSL 0x00020000
#define CONF_FLAGS_MAINCONF 0x00040000
@@ -252,15 +253,13 @@ struct CidrItem
#define IsConfAllowAutoConn(x) ((x)->flags & CONF_FLAGS_ALLOW_AUTO_CONN)
#define SetConfAllowAutoConn(x) ((x)->flags |= CONF_FLAGS_ALLOW_AUTO_CONN)
#define ClearConfAllowAutoConn(x) ((x)->flags &= ~CONF_FLAGS_ALLOW_AUTO_CONN)
-#define IsConfTemporary(x) ((x)->flags & CONF_FLAGS_TEMPORARY)
-#define SetConfTemporary(x) ((x)->flags |= CONF_FLAGS_TEMPORARY)
#define IsConfRedir(x) ((x)->flags & CONF_FLAGS_REDIR)
#define IsConfSSL(x) ((x)->flags & CONF_FLAGS_SSL)
#define SetConfSSL(x) ((x)->flags |= CONF_FLAGS_SSL)
#define ClearConfSSL(x) ((x)->flags &= ~CONF_FLAGS_SSL)
-#define IsConfMain(x) ((x)->flags & CONF_FLAGS_MAINCONF)
-#define SetConfMain(x) ((x)->flags |= CONF_FLAGS_MAINCONF)
-#define ClearConfMain(x) ((x)->flags &= ~CONF_FLAGS_MAINCONF)
+#define IsConfDatabase(x) ((x)->flags & CONF_FLAGS_IN_DATABASE)
+#define SetConfDatabase(x) ((x)->flags |= CONF_FLAGS_IN_DATABASE)
+
/* shared/cluster server entry types
* These defines are used for both shared and cluster.
@@ -455,11 +454,6 @@ extern struct ConfItem *find_exact_name_conf(ConfType, const struct Client *, co
extern void delete_conf_item(struct ConfItem *);
extern void report_confitem_types(struct Client *, ConfType);
extern void yyerror(const char *);
-extern void write_conf_line(struct Client *, struct ConfItem *,
- const char *, time_t);
-extern int remove_conf_line(ConfType, struct Client *, const char *,
- const char *);
-extern void add_temp_line(struct ConfItem *);
extern void cleanup_tklines(void *);
extern int rehash(int);
extern int conf_add_server(struct ConfItem *, const char *);
diff --git a/include/resv.h b/include/resv.h
index d40c2ea..2bba49a 100644
--- a/include/resv.h
+++ b/include/resv.h
@@ -33,7 +33,7 @@ struct ResvChannel
time_t setat;
char name[CHANNELLEN + 1];
char *reason;
- int conf; /* 1 if set from ircd.conf, 0 if from elsewhere */
+ unsigned int flags;
};
extern dlink_list nresv_items;
diff --git a/modules/m_dline.c b/modules/m_dline.c
index a4396e9..f66917c 100644
--- a/modules/m_dline.c
+++ b/modules/m_dline.c
@@ -57,7 +57,6 @@ apply_dline(struct Client *source_p, struct AccessItem *aconf,
if (tkline_time)
{
aconf->hold = CurrentTime + tkline_time;
- SetConfTemporary(aconf);
sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
"%s added temporary %d min. D-Line for [%s] [%s]",
get_oper_name(source_p), tkline_time/60,
@@ -81,6 +80,7 @@ apply_dline(struct Client *source_p, struct AccessItem *aconf,
}
+ SetConfDatabase(aconf);
aconf->setat = CurrentTime;
add_conf_by_address(CONF_DLINE, aconf);
rehashed_klines = 1;
@@ -116,7 +116,7 @@ remove_dline_match(const char *host)
if ((aconf = find_conf_by_address(host, piphost, CONF_DLINE, t, NULL, NULL, 0)))
{
- if (!IsConfMain(aconf))
+ if (IsConfDatabase(aconf))
{
delete_one_address_conf(host, aconf);
return 1;
@@ -146,7 +146,6 @@ mo_dline(struct Client *client_p, struct Client *source_p,
const char *creason;
const struct Client *target_p = NULL;
struct irc_ssaddr daddr;
- struct ConfItem *conf=NULL;
struct AccessItem *aconf=NULL;
time_t tkline_time=0;
int bits, t;
@@ -259,24 +258,17 @@ mo_dline(struct Client *client_p, struct Client *source_p,
if (!valid_comment(source_p, reason, 1))
return;
- conf = make_conf_item(DLINE_TYPE);
- aconf = map_to_conf(conf);
+ aconf = map_to_conf(make_conf_item(DLINE_TYPE));
DupString(aconf->host, dlhost);
if (tkline_time != 0)
- {
snprintf(buffer, sizeof(buffer), "Temporary D-line %d min. - %s (%s)",
(int)(tkline_time/60), reason, current_date);
- DupString(aconf->reason, buffer);
- apply_dline(source_p, aconf, tkline_time);
- }
else
- {
snprintf(buffer, sizeof(buffer), "%s (%s)", reason, current_date);
- DupString(aconf->reason, buffer);
- apply_dline(source_p, aconf, 0);
- }
+ DupString(aconf->reason, buffer);
+ apply_dline(source_p, aconf, tkline_time);
rehashed_klines = 1;
}
@@ -289,7 +281,6 @@ ms_dline(struct Client *client_p, struct Client *source_p,
const char *creason;
const struct Client *target_p = NULL;
struct irc_ssaddr daddr;
- struct ConfItem *conf=NULL;
struct AccessItem *aconf=NULL;
time_t tkline_time=0;
int bits, t;
@@ -386,24 +377,17 @@ ms_dline(struct Client *client_p, struct Client *source_p,
if (!valid_comment(source_p, reason, 1))
return;
- conf = make_conf_item(DLINE_TYPE);
- aconf = map_to_conf(conf);
+ aconf = map_to_conf(make_conf_item(DLINE_TYPE));
DupString(aconf->host, dlhost);
if (tkline_time != 0)
- {
snprintf(buffer, sizeof(buffer), "Temporary D-line %d min. - %s (%s)",
(int)(tkline_time/60), reason, current_date);
- DupString(aconf->reason, buffer);
- apply_dline(source_p, aconf, tkline_time);
- }
else
- {
snprintf(buffer, sizeof(buffer), "%s (%s)", reason, current_date);
- DupString(aconf->reason, buffer);
- apply_dline(source_p, aconf, 0);
- }
+ DupString(aconf->reason, buffer);
+ apply_dline(source_p, aconf, tkline_time);
rehashed_klines = 1;
}
}
diff --git a/modules/m_gline.c b/modules/m_gline.c
index b748bec..6e6b894 100644
--- a/modules/m_gline.c
+++ b/modules/m_gline.c
@@ -71,7 +71,7 @@ set_local_gline(const struct Client *source_p, const char *user,
aconf->setat = CurrentTime;
aconf->hold = CurrentTime + ConfigFileEntry.gline_time;
- SetConfTemporary(aconf);
+ SetConfDatabase(aconf);
sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
"%s added G-Line for [%s@%s] [%s]",
@@ -114,8 +114,11 @@ remove_gline_match(const char *user, const char *host)
if ((aconf = find_conf_by_address(host, piphost, CONF_GLINE, t, user, NULL, 0)))
{
- delete_one_address_conf(host, aconf);
- return 1;
+ if (IsConfDatabase(aconf))
+ {
+ delete_one_address_conf(host, aconf);
+ return 1;
+ }
}
return 0;
diff --git a/modules/m_kline.c b/modules/m_kline.c
index 78c790a..0964f93 100644
--- a/modules/m_kline.c
+++ b/modules/m_kline.c
@@ -70,7 +70,6 @@ mo_kline(struct Client *client_p, struct Client *source_p,
char *host = NULL;
const char *current_date;
char *target_server = NULL;
- struct ConfItem *conf;
struct AccessItem *aconf;
time_t tkline_time = 0;
time_t cur_time;
@@ -118,27 +117,19 @@ mo_kline(struct Client *client_p, struct Client *source_p,
cur_time = CurrentTime;
current_date = smalldate(cur_time);
- conf = make_conf_item(KLINE_TYPE);
- aconf = map_to_conf(conf);
+ aconf = map_to_conf(make_conf_item(KLINE_TYPE));
DupString(aconf->host, host);
DupString(aconf->user, user);
if (tkline_time != 0)
- {
snprintf(buffer, sizeof(buffer), "Temporary K-line %d min. - %s (%s)",
(int)(tkline_time/60), reason, current_date);
- DupString(aconf->reason, buffer);
-
- m_kline_add_kline(source_p, aconf, tkline_time);
- }
else
- {
snprintf(buffer, sizeof(buffer), "%s (%s)", reason, current_date);
- DupString(aconf->reason, buffer);
- m_kline_add_kline(source_p, aconf, 0);
- }
+ DupString(aconf->reason, buffer);
+ m_kline_add_kline(source_p, aconf, tkline_time);
}
/* me_kline - handle remote kline. no propagation */
@@ -146,9 +137,8 @@ static void
me_kline(struct Client *client_p, struct Client *source_p,
int parc, char *parv[])
{
- struct ConfItem *conf=NULL;
- struct AccessItem *aconf=NULL;
- int tkline_time;
+ struct AccessItem *aconf = NULL;
+ int tkline_time = 0;
const char* current_date;
time_t cur_time;
char *kuser, *khost, *kreason;
@@ -175,26 +165,18 @@ me_kline(struct Client *client_p, struct Client *source_p,
already_placed_kline(source_p, kuser, khost, 1))
return;
- conf = make_conf_item(KLINE_TYPE);
- aconf = map_to_conf(conf);
+ aconf = map_to_conf(make_conf_item(KLINE_TYPE));
DupString(aconf->host, khost);
DupString(aconf->user, kuser);
if (tkline_time != 0)
- {
snprintf(buffer, sizeof(buffer), "Temporary K-line %d min. - %s (%s)",
(int)(tkline_time/60), kreason, current_date);
- DupString(aconf->reason, buffer);
-
- m_kline_add_kline(source_p, aconf, tkline_time);
- }
else
- {
snprintf(buffer, sizeof(buffer), "%s (%s)", kreason, current_date);
- DupString(aconf->reason, buffer);
- m_kline_add_kline(source_p, aconf, 0);
- }
+ DupString(aconf->reason, buffer);
+ m_kline_add_kline(source_p, aconf, tkline_time);
}
}
@@ -224,13 +206,9 @@ static void
m_kline_add_kline(struct Client *source_p, struct AccessItem *aconf,
time_t tkline_time)
{
- aconf->setat = CurrentTime;
-
if (tkline_time)
{
aconf->hold = CurrentTime + tkline_time;
- SetConfTemporary(aconf);
-
sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
"%s added temporary %d min. K-Line for [%s@%s] [%s]",
get_oper_name(source_p), tkline_time/60,
@@ -256,6 +234,9 @@ m_kline_add_kline(struct Client *source_p, struct AccessItem *aconf,
source_p->name, aconf->user, aconf->host, aconf->reason);
}
+ aconf->setat = CurrentTime;
+ SetConfDatabase(aconf);
+
add_conf_by_address(CONF_KLINE, aconf);
rehashed_klines = 1;
}
@@ -468,7 +449,7 @@ remove_kline_match(const char *host, const char *user)
if ((aconf = find_conf_by_address(host, piphost, CONF_KLINE, t, user, NULL, 0)))
{
- if (!IsConfMain(aconf))
+ if (IsConfDatabase(aconf))
{
delete_one_address_conf(host, aconf);
return 1;
diff --git a/modules/m_resv.c b/modules/m_resv.c
index e2546b7..efe700e 100644
--- a/modules/m_resv.c
+++ b/modules/m_resv.c
@@ -233,6 +233,7 @@ parse_resv(struct Client *source_p, char *name, int tkline_time, char *reason)
resv_p = map_to_conf(conf);
resv_p->setat = CurrentTime;
+ SetConfDatabase(resv_p);
if (tkline_time != 0)
{
@@ -251,7 +252,6 @@ parse_resv(struct Client *source_p, char *name, int tkline_time, char *reason)
source_p->name, (int)tkline_time/60,
conf->name, resv_p->reason);
resv_p->hold = CurrentTime + tkline_time;
- add_temp_line(conf);
}
else
{
@@ -264,7 +264,6 @@ parse_resv(struct Client *source_p, char *name, int tkline_time, char *reason)
get_oper_name(source_p),
(MyClient(source_p) ? "local" : "remote"),
resv_p->name, resv_p->reason);
- write_conf_line(source_p, conf, NULL /* not used */, 0 /* not used */);
}
}
else
@@ -295,6 +294,7 @@ parse_resv(struct Client *source_p, char *name, int tkline_time, char *reason)
resv_p = map_to_conf(conf);
resv_p->setat = CurrentTime;
+ SetConfDatabase(resv_p);
if (tkline_time != 0)
{
@@ -314,7 +314,6 @@ parse_resv(struct Client *source_p, char *name, int tkline_time, char *reason)
source_p->name, (int)tkline_time/60,
conf->name, resv_p->reason);
resv_p->hold = CurrentTime + tkline_time;
- add_temp_line(conf);
}
else
{
@@ -328,7 +327,6 @@ parse_resv(struct Client *source_p, char *name, int tkline_time, char *reason)
get_oper_name(source_p),
(MyClient(source_p) ? "local" : "remote"),
conf->name, resv_p->reason);
- write_conf_line(source_p, conf, NULL /* not used */, 0 /* not used */);
}
}
}
@@ -351,7 +349,7 @@ remove_resv(struct Client *source_p, const char *name)
return;
}
- if (resv_p->conf)
+ if (!IsConfDatabase(resv_p))
{
sendto_one(source_p,
":%s NOTICE %s :The RESV for channel: %s is in ircd.conf and must be removed by hand.",
@@ -360,8 +358,6 @@ remove_resv(struct Client *source_p, const char *name)
}
delete_channel_resv(resv_p);
- remove_conf_line(CRESV_TYPE, source_p, name, NULL);
-
sendto_one(source_p,
":%s NOTICE %s :The RESV has been removed on channel: %s",
me.name, source_p->name, name);
@@ -382,7 +378,7 @@ remove_resv(struct Client *source_p, const char *name)
resv_p = map_to_conf(conf);
- if (resv_p->action)
+ if (IsConfDatabase(resv_p))
{
sendto_one(source_p,
":%s NOTICE %s :The RESV for nick: %s is in ircd.conf and must be removed by hand.",
@@ -391,8 +387,6 @@ remove_resv(struct Client *source_p, const char *name)
}
delete_conf_item(conf);
- remove_conf_line(NRESV_TYPE, source_p, name, NULL);
-
sendto_one(source_p, ":%s NOTICE %s :The RESV has been removed on nick: %s",
me.name, source_p->name, name);
sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
diff --git a/modules/m_stats.c b/modules/m_stats.c
index e995d4f..2fd31ba 100644
--- a/modules/m_stats.c
+++ b/modules/m_stats.c
@@ -410,7 +410,7 @@ stats_deny(struct Client *source_p, int parc, char *parv[])
aconf = arec->aconf;
/* dont report a tdline as a dline */
- if (aconf->flags & CONF_FLAGS_TEMPORARY)
+ if (aconf->hold)
continue;
conf = unmap_conf_item(aconf);
@@ -448,7 +448,7 @@ stats_tdeny(struct Client *source_p, int parc, char *parv[])
aconf = arec->aconf;
/* dont report a permanent dline as a tdline */
- if (!(aconf->flags & CONF_FLAGS_TEMPORARY))
+ if (!aconf->hold)
continue;
conf = unmap_conf_item(aconf);
@@ -803,8 +803,9 @@ report_Klines(struct Client *client_p, int tkline)
if (arec->type == CONF_KLINE)
{
- if ((tkline && !((aconf = arec->aconf)->flags & CONF_FLAGS_TEMPORARY)) ||
- (!tkline && ((aconf = arec->aconf)->flags & CONF_FLAGS_TEMPORARY)))
+ aconf = arec->aconf;
+
+ if (!tkline && aconf->hold)
continue;
if (HasUMode(client_p, UMODE_OPER))
@@ -847,7 +848,7 @@ stats_tklines(struct Client *source_p, int parc, char *parv[])
return;
/* dont report a permanent kline as a tkline */
- if (!(aconf->flags & CONF_FLAGS_TEMPORARY))
+ if (!aconf->hold)
return;
sendto_one(source_p, form_str(RPL_STATSKLINE), from,
@@ -887,7 +888,7 @@ stats_klines(struct Client *source_p, int parc, char *parv[])
return;
/* dont report a tkline as a kline */
- if (aconf->flags & CONF_FLAGS_TEMPORARY)
+ if (aconf->hold)
return;
sendto_one(source_p, form_str(RPL_STATSKLINE), from,
diff --git a/modules/m_testline.c b/modules/m_testline.c
index 2d26658..36c0cd3 100644
--- a/modules/m_testline.c
+++ b/modules/m_testline.c
@@ -122,8 +122,8 @@ mo_testline(struct Client *client_p, struct Client *source_p,
else
sendto_one(source_p, form_str(RPL_TESTLINE),
me.name, source_p->name,
- IsConfTemporary(aconf) ? 'd' : 'D',
- IsConfTemporary(aconf) ? ((aconf->hold - CurrentTime) / 60)
+ aconf->hold ? 'd' : 'D',
+ aconf->hold ? ((aconf->hold - CurrentTime) / 60)
: 0L,
aconf->host, aconf->reason);
}
@@ -155,8 +155,8 @@ mo_testline(struct Client *client_p, struct Client *source_p,
{
sendto_one(source_p, form_str(RPL_TESTLINE),
me.name, source_p->name,
- IsConfTemporary(aconf) ? 'k' : 'K',
- IsConfTemporary(aconf) ? ((aconf->hold - CurrentTime) / 60)
+ aconf->hold ? 'k' : 'K',
+ aconf->hold ? ((aconf->hold - CurrentTime) / 60)
: 0L,
userhost, aconf->reason? aconf->reason : "No reason");
++matches;
diff --git a/modules/m_xline.c b/modules/m_xline.c
index c97215d..9f1acc6 100644
--- a/modules/m_xline.c
+++ b/modules/m_xline.c
@@ -345,6 +345,8 @@ write_xline(struct Client *source_p, char *gecos, char *reason,
current_date = smalldate(cur_time);
xconf->setat = CurrentTime;
+ SetConfDatabase(xconf);
+
if (tkline_time != 0)
{
sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
@@ -358,7 +360,6 @@ write_xline(struct Client *source_p, char *gecos, char *reason,
source_p->name, (int)tkline_time/60,
conf->name, xconf->reason);
xconf->hold = CurrentTime + tkline_time;
- SetConfTemporary(conf);
}
else
{
@@ -412,13 +413,13 @@ remove_xline_match(const char *gecos)
DLINK_FOREACH_SAFE(ptr, next_ptr, xconf_items.head)
{
conf = ptr->data;
+ struct MatchItem *xconf = map_to_conf(conf);
- if (IsConfMain(conf))
+ if (!IsConfDatabase(xconf))
continue;
if (!irccmp(gecos, conf->name))
{
- free_dlink_node(ptr);
delete_conf_item(conf);
return 1;
}
diff --git a/src/conf.c b/src/conf.c
index 961cb43..8c92889 100644
--- a/src/conf.c
+++ b/src/conf.c
@@ -452,11 +452,6 @@ delete_conf_item(struct ConfItem *conf)
MyFree(match_item->host);
MyFree(match_item->reason);
dlinkDelete(&conf->node, &nresv_items);
-
- if (conf->flags & CONF_FLAGS_TEMPORARY)
- if ((m = dlinkFindDelete(&temporary_resv, conf)) != NULL)
- free_dlink_node(m);
-
MyFree(conf);
break;
@@ -466,10 +461,6 @@ delete_conf_item(struct ConfItem *conf)
break;
case CRESV_TYPE:
- if (conf->flags & CONF_FLAGS_TEMPORARY)
- if ((m = dlinkFindDelete(&temporary_resv, conf)) != NULL)
- free_dlink_node(m);
-
MyFree(conf);
break;
@@ -2008,23 +1999,6 @@ find_gline(struct Client *client_p)
return aconf;
}
-/* add_temp_line()
- *
- * inputs - pointer to struct ConfItem
- * output - none
- * Side effects - links in given struct ConfItem into
- * temporary *line link list
- */
-void
-add_temp_line(struct ConfItem *conf)
-{
- if ((conf->type == NRESV_TYPE) || (conf->type == CRESV_TYPE))
- {
- conf->flags |= CONF_FLAGS_TEMPORARY;
- dlinkAdd(conf, make_dlink_node(), &temporary_resv);
- }
-}
-
/* cleanup_tklines()
*
* inputs - NONE
@@ -2037,7 +2011,8 @@ cleanup_tklines(void *notused)
{
hostmask_expire_temporary();
expire_tklines(&xconf_items);
- expire_tklines(&temporary_resv);
+ expire_tklines(&nresv_items);
+ expire_tklines(&resv_channel_list);
}
/* expire_tklines()
@@ -2062,11 +2037,8 @@ expire_tklines(dlink_list *tklist)
if (conf->type == XLINE_TYPE)
{
- if (!IsConfTemporary(conf))
- continue;
-
xconf = (struct MatchItem *)map_to_conf(conf);
- if (xconf->hold <= CurrentTime)
+ if (xconf->hold && xconf->hold <= CurrentTime)
{
if (ConfigFileEntry.tkline_expire_notices)
sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
@@ -2077,20 +2049,18 @@ expire_tklines(dlink_list *tklist)
else if (conf->type == NRESV_TYPE)
{
nconf = (struct MatchItem *)map_to_conf(conf);
- if (nconf->hold <= CurrentTime)
+ if (nconf->hold && nconf->hold <= CurrentTime)
{
if (ConfigFileEntry.tkline_expire_notices)
sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
"Temporary RESV for [%s] expired", conf->name);
- dlinkDelete(ptr, tklist);
- free_dlink_node(ptr);
delete_conf_item(conf);
}
}
else if (conf->type == CRESV_TYPE)
{
- cconf = (struct ResvChannel *)map_to_conf(conf);
- if (cconf->hold <= CurrentTime)
+ cconf = ptr->data;
+ if (cconf->hold && cconf->hold <= CurrentTime)
{
if (ConfigFileEntry.tkline_expire_notices)
sendto_realops_flags(UMODE_ALL, L_ALL, SEND_NOTICE,
@@ -2325,7 +2295,8 @@ clear_out_old_conf(void)
{
/* temporary (r)xlines are also on
* the (r)xconf items list */
- if (conf->flags & CONF_FLAGS_TEMPORARY)
+ aconf = map_to_conf(conf);
+ if (aconf->hold)
continue;
delete_conf_item(conf);
diff --git a/src/conf_db.c b/src/conf_db.c
index c635777..31725dc 100644
--- a/src/conf_db.c
+++ b/src/conf_db.c
@@ -613,8 +613,8 @@ write_string(const char *s, struct dbFILE *f)
void
save_kline_database(void)
{
- unsigned int i = 0;
- uint32_t cnt = 0, version = 0;
+ uint32_t i = 0;
+ uint32_t records = 0;
struct dbFILE *f = NULL;
dlink_node *ptr = NULL;
@@ -627,12 +627,12 @@ save_kline_database(void)
{
struct AddressRec *arec = ptr->data;
- if (arec->type == CONF_KLINE && !IsConfMain(arec->aconf))
- ++cnt;
+ if (arec->type == CONF_KLINE && IsConfDatabase(arec->aconf))
+ ++records;
}
}
- SAFE_WRITE(write_uint32(cnt, f), KPATH);
+ SAFE_WRITE(write_uint32(records, f), KPATH);
for (i = 0; i < ATABLE_SIZE; ++i)
{
@@ -640,7 +640,7 @@ save_kline_database(void)
{
struct AddressRec *arec = ptr->data;
- if (arec->type == CONF_KLINE && !IsConfMain(arec->aconf))
+ if (arec->type == CONF_KLINE && IsConfDatabase(arec->aconf))
{
SAFE_WRITE(write_string(arec->aconf->user, f), KPATH);
SAFE_WRITE(write_string(arec->aconf->host, f), KPATH);
@@ -657,39 +657,42 @@ save_kline_database(void)
void
load_kline_database(void)
{
- unsigned int i = 0;
- uint32_t cnt = 0, version = 0;
- uint64_t tmp64 = 0;
struct dbFILE *f = NULL;
- dlink_node *ptr = NULL, *ptr_next = NULL;
+ struct AccessItem *aconf = NULL;
+ char *field_1 = NULL;
+ char *field_2 = NULL;
+ char *field_3 = NULL;
+ uint32_t i = 0;
+ uint32_t records = 0;
+ uint64_t field_4 = 0;
+ uint64_t field_5 = 0;
if (!(f = open_db("kline", KPATH, "r", KLINE_DB_VERSION)))
return;
- if ((version = get_file_version(f) < 1))
+ if (get_file_version(f) < 1)
{
close_db(f);
return;
}
- read_uint32(&cnt, f);
+ read_uint32(&records, f);
- for (i = 0; i < cnt; ++i)
+ for (i = 0; i < records; ++i)
{
- struct AccessItem *aconf = map_to_conf(make_conf_item(KLINE_TYPE));
-
- SAFE_READ(read_string(&aconf->user, f));
- SAFE_READ(read_string(&aconf->host, f));
- SAFE_READ(read_string(&aconf->reason, f));
-
- SAFE_READ(read_uint64(&tmp64, f));
- aconf->setat = tmp64;
-
- SAFE_READ(read_uint64(&tmp64, f));
- aconf->hold = tmp64;
-
- if (aconf->hold)
- SetConfTemporary(aconf);
+ SAFE_READ(read_string(&field_1, f));
+ SAFE_READ(read_string(&field_2, f));
+ SAFE_READ(read_string(&field_3, f));
+ SAFE_READ(read_uint64(&field_4, f));
+ SAFE_READ(read_uint64(&field_5, f));
+
+ aconf = map_to_conf(make_conf_item(KLINE_TYPE));
+ aconf->user = field_1;
+ aconf->host = field_2;
+ aconf->reason = field_3;
+ aconf->setat = field_4;
+ aconf->hold = field_5;
+ SetConfDatabase(aconf);
add_conf_by_address(CONF_KLINE, aconf);
}
@@ -700,8 +703,8 @@ load_kline_database(void)
void
save_dline_database(void)
{
- unsigned int i = 0;
- uint32_t cnt = 0, version = 0;
+ uint32_t i = 0;
+ uint32_t records = 0;
struct dbFILE *f = NULL;
dlink_node *ptr = NULL;
@@ -714,12 +717,12 @@ save_dline_database(void)
{
struct AddressRec *arec = ptr->data;
- if (arec->type == CONF_DLINE && !IsConfMain(arec->aconf))
- ++cnt;
+ if (arec->type == CONF_DLINE && IsConfDatabase(arec->aconf))
+ ++records;
}
}
- SAFE_WRITE(write_uint32(cnt, f), DLPATH);
+ SAFE_WRITE(write_uint32(records, f), DLPATH);
for (i = 0; i < ATABLE_SIZE; ++i)
{
@@ -727,7 +730,7 @@ save_dline_database(void)
{
struct AddressRec *arec = ptr->data;
- if (arec->type == CONF_DLINE && !IsConfMain(arec->aconf))
+ if (arec->type == CONF_DLINE && IsConfDatabase(arec->aconf))
{
SAFE_WRITE(write_string(arec->aconf->host, f), DLPATH);
SAFE_WRITE(write_string(arec->aconf->reason, f), DLPATH);
@@ -743,38 +746,39 @@ save_dline_database(void)
void
load_dline_database(void)
{
- unsigned int i = 0;
- uint32_t cnt = 0, version = 0;
- uint64_t tmp64 = 0;
struct dbFILE *f = NULL;
- dlink_node *ptr = NULL, *ptr_next = NULL;
+ struct AccessItem *aconf = NULL;
+ char *field_1 = NULL;
+ char *field_2 = NULL;
+ uint32_t i = 0;
+ uint32_t records = 0;
+ uint64_t field_3 = 0;
+ uint64_t field_4 = 0;
if (!(f = open_db("dline", DLPATH, "r", KLINE_DB_VERSION)))
return;
- if ((version = get_file_version(f) < 1))
+ if (get_file_version(f) < 1)
{
close_db(f);
return;
}
- read_uint32(&cnt, f);
+ read_uint32(&records, f);
- for (i = 0; i < cnt; ++i)
+ for (i = 0; i < records; ++i)
{
- struct AccessItem *aconf = map_to_conf(make_conf_item(DLINE_TYPE));
-
- SAFE_READ(read_string(&aconf->host, f));
- SAFE_READ(read_string(&aconf->reason, f));
-
- SAFE_READ(read_uint64(&tmp64, f));
- aconf->setat = tmp64;
-
- SAFE_READ(read_uint64(&tmp64, f));
- aconf->hold = tmp64;
-
- if (aconf->hold)
- SetConfTemporary(aconf);
+ SAFE_READ(read_string(&field_1, f));
+ SAFE_READ(read_string(&field_2, f));
+ SAFE_READ(read_uint64(&field_3, f));
+ SAFE_READ(read_uint64(&field_4, f));
+
+ aconf = map_to_conf(make_conf_item(DLINE_TYPE));
+ aconf->host = field_1;
+ aconf->reason = field_2;
+ aconf->setat = field_3;
+ aconf->hold = field_4;
+ SetConfDatabase(aconf);
add_conf_by_address(CONF_DLINE, aconf);
}
@@ -785,8 +789,8 @@ load_dline_database(void)
void
save_gline_database(void)
{
- unsigned int i = 0;
- uint32_t cnt = 0, version = 0;
+ uint32_t i = 0;
+ uint32_t records = 0, version = 0;
struct dbFILE *f = NULL;
dlink_node *ptr = NULL;
@@ -799,12 +803,12 @@ save_gline_database(void)
{
struct AddressRec *arec = ptr->data;
- if (arec->type == CONF_GLINE && !IsConfMain(arec->aconf))
- ++cnt;
+ if (arec->type == CONF_GLINE && IsConfDatabase(arec->aconf))
+ ++records;
}
}
- SAFE_WRITE(write_uint32(cnt, f), GPATH);
+ SAFE_WRITE(write_uint32(records, f), GPATH);
for (i = 0; i < ATABLE_SIZE; ++i)
{
@@ -812,7 +816,7 @@ save_gline_database(void)
{
struct AddressRec *arec = ptr->data;
- if (arec->type == CONF_GLINE && !IsConfMain(arec->aconf))
+ if (arec->type == CONF_GLINE && IsConfDatabase(arec->aconf))
{
SAFE_WRITE(write_string(arec->aconf->user, f), GPATH);
SAFE_WRITE(write_string(arec->aconf->host, f), GPATH);
@@ -829,39 +833,42 @@ save_gline_database(void)
void
load_gline_database(void)
{
- unsigned int i = 0;
- uint32_t cnt = 0, version = 0;
- uint64_t tmp64 = 0;
struct dbFILE *f = NULL;
- dlink_node *ptr = NULL, *ptr_next = NULL;
+ struct AccessItem *aconf = NULL;
+ char *field_1 = NULL;
+ char *field_2 = NULL;
+ char *field_3 = NULL;
+ uint32_t i = 0;
+ uint32_t records = 0;
+ uint64_t field_4 = 0;
+ uint64_t field_5 = 0;
if (!(f = open_db("gline", GPATH, "r", KLINE_DB_VERSION)))
return;
- if ((version = get_file_version(f) < 1))
+ if (get_file_version(f) < 1)
{
close_db(f);
return;
}
- read_uint32(&cnt, f);
+ read_uint32(&records, f);
- for (i = 0; i < cnt; ++i)
+ for (i = 0; i < records; ++i)
{
- struct AccessItem *aconf = map_to_conf(make_conf_item(GLINE_TYPE));
-
- SAFE_READ(read_string(&aconf->user, f));
- SAFE_READ(read_string(&aconf->host, f));
- SAFE_READ(read_string(&aconf->reason, f));
-
- SAFE_READ(read_uint64(&tmp64, f));
- aconf->setat = tmp64;
-
- SAFE_READ(read_uint64(&tmp64, f));
- aconf->hold = tmp64;
-
- if (aconf->hold)
- SetConfTemporary(aconf);
+ SAFE_READ(read_string(&field_1, f));
+ SAFE_READ(read_string(&field_2, f));
+ SAFE_READ(read_string(&field_3, f));
+ SAFE_READ(read_uint64(&field_4, f));
+ SAFE_READ(read_uint64(&field_5, f));
+
+ aconf = map_to_conf(make_conf_item(KLINE_TYPE));
+ aconf->user = field_1;
+ aconf->host = field_2;
+ aconf->reason = field_3;
+ aconf->setat = field_4;
+ aconf->hold = field_5;
+ SetConfDatabase(aconf);
add_conf_by_address(CONF_GLINE, aconf);
}
@@ -872,8 +879,7 @@ load_gline_database(void)
void
save_resv_database(void)
{
- unsigned int i = 0;
- uint32_t cnt = 0, version = 0;
+ uint32_t records = 0;
struct dbFILE *f = NULL;
dlink_node *ptr = NULL;
struct ConfItem *conf;
@@ -887,25 +893,27 @@ save_resv_database(void)
{
resv_cp = ptr->data;
- if (!resv_cp->conf)
- ++cnt;
+ if (IsConfDatabase(resv_cp))
+ ++records;
}
DLINK_FOREACH(ptr, nresv_items.head)
{
resv_np = map_to_conf(ptr->data);
- if (!resv_np->action)
- ++cnt;
+ if (IsConfDatabase(resv_np))
+ ++records;
}
- SAFE_WRITE(write_uint32(cnt, f), RESVPATH);
-
+ SAFE_WRITE(write_uint32(records, f), RESVPATH);
DLINK_FOREACH(ptr, resv_channel_list.head)
{
resv_cp = ptr->data;
+ if (!IsConfDatabase(resv_cp))
+ continue;
+
SAFE_WRITE(write_string(resv_cp->name, f), RESVPATH);
SAFE_WRITE(write_string(resv_cp->reason, f), RESVPATH);
SAFE_WRITE(write_uint64(resv_cp->setat, f), RESVPATH);
@@ -917,6 +925,9 @@ save_resv_database(void)
conf = ptr->data;
resv_np = map_to_conf(conf);
+ if (!IsConfDatabase(resv_np))
+ continue;
+
SAFE_WRITE(write_string(conf->name, f), RESVPATH);
SAFE_WRITE(write_string(resv_np->reason, f), RESVPATH);
SAFE_WRITE(write_uint64(resv_np->setat, f), RESVPATH);
@@ -929,11 +940,10 @@ save_resv_database(void)
void
load_resv_database(void)
{
- unsigned int i = 0;
- uint32_t cnt = 0, version = 0;
+ uint32_t i = 0;
+ uint32_t records = 0;
uint64_t tmp64_hold = 0, tmp64_setat = 0;
struct dbFILE *f = NULL;
- dlink_node *ptr = NULL, *ptr_next = NULL;
char *name = NULL;
char *reason = NULL;
struct ConfItem *conf;
@@ -943,15 +953,15 @@ load_resv_database(void)
if (!(f = open_db("resv", RESVPATH, "r", KLINE_DB_VERSION)))
return;
- if ((version = get_file_version(f) < 1))
+ if (get_file_version(f) < 1)
{
close_db(f);
return;
}
- read_uint32(&cnt, f);
+ read_uint32(&records, f);
- for (i = 0; i < cnt; ++i)
+ for (i = 0; i < records; ++i)
{
SAFE_READ(read_string(&name, f));
SAFE_READ(read_string(&reason, f));
@@ -966,9 +976,7 @@ load_resv_database(void)
resv_cp = map_to_conf(conf);
resv_cp->setat = tmp64_setat;
resv_cp->hold = tmp64_hold;
-
- if (resv_cp->hold)
- add_temp_line(conf);
+ SetConfDatabase(resv_cp);
}
else
{
@@ -978,9 +986,7 @@ load_resv_database(void)
resv_np = map_to_conf(conf);
resv_np->setat = tmp64_setat;
resv_np->hold = tmp64_hold;
-
- if (resv_np->hold)
- add_temp_line(conf);
+ SetConfDatabase(resv_np);
}
MyFree(name);
@@ -993,8 +999,7 @@ load_resv_database(void)
void
save_xline_database(void)
{
- unsigned int i = 0;
- uint32_t cnt = 0, version = 0;
+ uint32_t records = 0;
struct dbFILE *f = NULL;
dlink_node *ptr = NULL;
struct ConfItem *conf = NULL;
@@ -1007,18 +1012,20 @@ save_xline_database(void)
{
conf = ptr->data;
- if (!IsConfMain(conf))
- ++cnt;
+ if (IsConfDatabase(xconf))
+ ++records;
}
- SAFE_WRITE(write_uint32(cnt, f), XPATH);
-
+ SAFE_WRITE(write_uint32(records, f), XPATH);
DLINK_FOREACH(ptr, xconf_items.head)
{
conf = ptr->data;
xconf = map_to_conf(conf);
+ if (!IsConfDatabase(xconf))
+ continue;
+
SAFE_WRITE(write_string(conf->name, f), XPATH);
SAFE_WRITE(write_string(xconf->reason, f), XPATH);
SAFE_WRITE(write_uint64(xconf->setat, f), XPATH);
@@ -1031,11 +1038,10 @@ save_xline_database(void)
void
load_xline_database(void)
{
- unsigned int i = 0;
- uint32_t cnt = 0, version = 0;
+ uint32_t i = 0;
+ uint32_t records = 0;
uint64_t tmp64_hold = 0, tmp64_setat = 0;
struct dbFILE *f = NULL;
- dlink_node *ptr = NULL, *ptr_next = NULL;
char *name = NULL;
char *reason = NULL;
struct ConfItem *conf = NULL;
@@ -1044,15 +1050,15 @@ load_xline_database(void)
if (!(f = open_db("xline", XPATH, "r", KLINE_DB_VERSION)))
return;
- if ((version = get_file_version(f) < 1))
+ if (get_file_version(f) < 1)
{
close_db(f);
return;
}
- read_uint32(&cnt, f);
+ read_uint32(&records, f);
- for (i = 0; i < cnt; ++i)
+ for (i = 0; i < records; ++i)
{
SAFE_READ(read_string(&name, f));
SAFE_READ(read_string(&reason, f));
@@ -1062,13 +1068,12 @@ load_xline_database(void)
conf = make_conf_item(XLINE_TYPE);
xconf = map_to_conf(conf);
+ SetConfDatabase(xconf);
+
conf->name = name;
xconf->reason = reason;
xconf->setat = tmp64_setat;
xconf->hold = tmp64_hold;
-
- if (xconf->hold)
- SetConfTemporary(conf);
}
close_db(f);
diff --git a/src/conf_parser.c b/src/conf_parser.c
index ae5874f..ae2d2e3 100644
--- a/src/conf_parser.c
+++ b/src/conf_parser.c
@@ -1251,31 +1251,31 @@ static const yytype_uint16 yyrline[] =
2059, 2059, 2060, 2060, 2060, 2061, 2061, 2062, 2062, 2062,
2063, 2063, 2063, 2064, 2064, 2065, 2067, 2076, 2085, 2111,
2129, 2147, 2153, 2157, 2166, 2165, 2169, 2169, 2170, 2174,
- 2180, 2191, 2202, 2213, 2222, 2241, 2240, 2308, 2307, 2311,
- 2311, 2312, 2318, 2318, 2319, 2319, 2319, 2319, 2321, 2340,
- 2350, 2349, 2373, 2373, 2374, 2374, 2374, 2376, 2382, 2391,
- 2393, 2393, 2394, 2394, 2396, 2415, 2414, 2463, 2462, 2466,
- 2466, 2467, 2473, 2473, 2474, 2474, 2474, 2474, 2476, 2482,
- 2491, 2494, 2494, 2495, 2495, 2496, 2496, 2497, 2497, 2498,
- 2498, 2499, 2499, 2500, 2501, 2502, 2502, 2503, 2503, 2504,
- 2504, 2505, 2505, 2506, 2506, 2507, 2507, 2508, 2509, 2509,
- 2510, 2510, 2511, 2511, 2512, 2512, 2513, 2513, 2514, 2515,
- 2515, 2516, 2517, 2518, 2518, 2519, 2519, 2520, 2521, 2522,
- 2523, 2523, 2524, 2527, 2532, 2538, 2544, 2550, 2555, 2560,
- 2565, 2570, 2575, 2580, 2585, 2590, 2595, 2600, 2605, 2610,
- 2615, 2620, 2626, 2637, 2642, 2647, 2652, 2657, 2662, 2665,
- 2670, 2673, 2678, 2683, 2688, 2693, 2698, 2703, 2708, 2713,
- 2718, 2729, 2734, 2739, 2744, 2753, 2762, 2767, 2772, 2778,
- 2777, 2782, 2782, 2783, 2786, 2789, 2792, 2795, 2798, 2801,
- 2804, 2807, 2810, 2813, 2816, 2819, 2822, 2825, 2828, 2831,
- 2834, 2837, 2840, 2846, 2845, 2850, 2850, 2851, 2854, 2857,
- 2860, 2863, 2866, 2869, 2872, 2875, 2878, 2881, 2884, 2887,
- 2890, 2893, 2896, 2899, 2902, 2905, 2908, 2913, 2918, 2923,
- 2932, 2935, 2935, 2936, 2937, 2937, 2938, 2938, 2939, 2939,
- 2940, 2941, 2941, 2942, 2943, 2943, 2944, 2944, 2946, 2951,
- 2956, 2961, 2966, 2971, 2976, 2981, 2986, 2991, 2996, 3001,
- 3006, 3011, 3019, 3022, 3022, 3023, 3023, 3024, 3025, 3025,
- 3026, 3027, 3029, 3035, 3041, 3050, 3064, 3070
+ 2180, 2191, 2202, 2213, 2222, 2241, 2240, 2304, 2303, 2307,
+ 2307, 2308, 2314, 2314, 2315, 2315, 2315, 2315, 2317, 2336,
+ 2346, 2345, 2368, 2368, 2369, 2369, 2369, 2371, 2377, 2386,
+ 2388, 2388, 2389, 2389, 2391, 2410, 2409, 2457, 2456, 2460,
+ 2460, 2461, 2467, 2467, 2468, 2468, 2468, 2468, 2470, 2476,
+ 2485, 2488, 2488, 2489, 2489, 2490, 2490, 2491, 2491, 2492,
+ 2492, 2493, 2493, 2494, 2495, 2496, 2496, 2497, 2497, 2498,
+ 2498, 2499, 2499, 2500, 2500, 2501, 2501, 2502, 2503, 2503,
+ 2504, 2504, 2505, 2505, 2506, 2506, 2507, 2507, 2508, 2509,
+ 2509, 2510, 2511, 2512, 2512, 2513, 2513, 2514, 2515, 2516,
+ 2517, 2517, 2518, 2521, 2526, 2532, 2538, 2544, 2549, 2554,
+ 2559, 2564, 2569, 2574, 2579, 2584, 2589, 2594, 2599, 2604,
+ 2609, 2614, 2620, 2631, 2636, 2641, 2646, 2651, 2656, 2659,
+ 2664, 2667, 2672, 2677, 2682, 2687, 2692, 2697, 2702, 2707,
+ 2712, 2723, 2728, 2733, 2738, 2747, 2756, 2761, 2766, 2772,
+ 2771, 2776, 2776, 2777, 2780, 2783, 2786, 2789, 2792, 2795,
+ 2798, 2801, 2804, 2807, 2810, 2813, 2816, 2819, 2822, 2825,
+ 2828, 2831, 2834, 2840, 2839, 2844, 2844, 2845, 2848, 2851,
+ 2854, 2857, 2860, 2863, 2866, 2869, 2872, 2875, 2878, 2881,
+ 2884, 2887, 2890, 2893, 2896, 2899, 2902, 2907, 2912, 2917,
+ 2926, 2929, 2929, 2930, 2931, 2931, 2932, 2932, 2933, 2933,
+ 2934, 2935, 2935, 2936, 2937, 2937, 2938, 2938, 2940, 2945,
+ 2950, 2955, 2960, 2965, 2970, 2975, 2980, 2985, 2990, 2995,
+ 3000, 3005, 3013, 3016, 3016, 3017, 3017, 3018, 3019, 3019,
+ 3020, 3021, 3023, 3029, 3035, 3044, 3058, 3064
};
#endif
@@ -5682,8 +5682,6 @@ yyreduce:
yy_aconf->regexuser = exp_user;
yy_aconf->regexhost = exp_host;
- SetConfMain(yy_aconf);
-
DupString(yy_aconf->user, userbuf);
DupString(yy_aconf->host, hostbuf);
@@ -5700,8 +5698,6 @@ yyreduce:
{
yy_aconf = map_to_conf(make_conf_item(KLINE_TYPE));
- SetConfMain(yy_aconf);
-
DupString(yy_aconf->user, userbuf);
DupString(yy_aconf->host, hostbuf);
@@ -5720,14 +5716,14 @@ yyreduce:
case 387:
/* Line 1813 of yacc.c */
-#line 2308 "conf_parser.y"
+#line 2304 "conf_parser.y"
{
}
break;
case 391:
/* Line 1813 of yacc.c */
-#line 2313 "conf_parser.y"
+#line 2309 "conf_parser.y"
{
if (conf_parser_ctx.pass == 2)
regex_ban = 1;
@@ -5736,7 +5732,7 @@ yyreduce:
case 398:
/* Line 1813 of yacc.c */
-#line 2322 "conf_parser.y"
+#line 2318 "conf_parser.y"
{
if (conf_parser_ctx.pass == 2)
{
@@ -5758,7 +5754,7 @@ yyreduce:
case 399:
/* Line 1813 of yacc.c */
-#line 2341 "conf_parser.y"
+#line 2337 "conf_parser.y"
{
if (conf_parser_ctx.pass == 2)
strlcpy(reasonbuf, yylval.string, sizeof(reasonbuf));
@@ -5767,7 +5763,7 @@ yyreduce:
case 400:
/* Line 1813 of yacc.c */
-#line 2350 "conf_parser.y"
+#line 2346 "conf_parser.y"
{
if (conf_parser_ctx.pass == 2)
hostbuf[0] = reasonbuf[0] = '\0';
@@ -5776,7 +5772,7 @@ yyreduce:
case 401:
/* Line 1813 of yacc.c */
-#line 2354 "conf_parser.y"
+#line 2350 "conf_parser.y"
{
if (conf_parser_ctx.pass == 2)
{
@@ -5784,7 +5780,6 @@ yyreduce:
{
yy_aconf = map_to_conf(make_conf_item(DLINE_TYPE));
DupString(yy_aconf->host, hostbuf);
- SetConfMain(yy_aconf);
if (reasonbuf[0])
DupString(yy_aconf->reason, reasonbuf);
@@ -5799,7 +5794,7 @@ yyreduce:
case 407:
/* Line 1813 of yacc.c */
-#line 2377 "conf_parser.y"
+#line 2372 "conf_parser.y"
{
if (conf_parser_ctx.pass == 2)
strlcpy(hostbuf, yylval.string, sizeof(hostbuf));
@@ -5808,7 +5803,7 @@ yyreduce:
case 408:
/* Line 1813 of yacc.c */
-#line 2383 "conf_parser.y"
+#line 2378 "conf_parser.y"
{
if (conf_parser_ctx.pass == 2)
strlcpy(reasonbuf, yylval.string, sizeof(reasonbuf));
@@ -5817,7 +5812,7 @@ yyreduce:
case 414:
/* Line 1813 of yacc.c */
-#line 2397 "conf_parser.y"
+#line 2392 "conf_parser.y"
{
if (conf_parser_ctx.pass == 2)
{
@@ -5835,7 +5830,7 @@ yyreduce:
case 415:
/* Line 1813 of yacc.c */
-#line 2415 "conf_parser.y"
+#line 2410 "conf_parser.y"
{
if (conf_parser_ctx.pass == 2)
{
@@ -5847,7 +5842,7 @@ yyreduce:
case 416:
/* Line 1813 of yacc.c */
-#line 2422 "conf_parser.y"
+#line 2417 "conf_parser.y"
{
if (conf_parser_ctx.pass == 2)
{
@@ -5876,7 +5871,6 @@ yyreduce:
else
yy_conf = make_conf_item(XLINE_TYPE);
- SetConfMain(yy_conf);
yy_match_item = map_to_conf(yy_conf);
DupString(yy_conf->name, gecos_name);
@@ -5891,14 +5885,14 @@ yyreduce:
case 417:
/* Line 1813 of yacc.c */
-#line 2463 "conf_parser.y"
+#line 2457 "conf_parser.y"
{
}
break;
case 421:
/* Line 1813 of yacc.c */
-#line 2468 "conf_parser.y"
+#line 2462 "conf_parser.y"
{
if (conf_parser_ctx.pass == 2)
regex_ban = 1;
@@ -5907,7 +5901,7 @@ yyreduce:
case 428:
/* Line 1813 of yacc.c */
-#line 2477 "conf_parser.y"
+#line 2471 "conf_parser.y"
{
if (conf_parser_ctx.pass == 2)
strlcpy(gecos_name, yylval.string, sizeof(gecos_name));
@@ -5916,7 +5910,7 @@ yyreduce:
case 429:
/* Line 1813 of yacc.c */
-#line 2483 "conf_parser.y"
+#line 2477 "conf_parser.y"
{
if (conf_parser_ctx.pass == 2)
strlcpy(reasonbuf, yylval.string, sizeof(reasonbuf));
@@ -5925,7 +5919,7 @@ yyreduce:
case 483:
/* Line 1813 of yacc.c */
-#line 2528 "conf_parser.y"
+#line 2522 "conf_parser.y"
{
ConfigFileEntry.max_watch = (yyvsp[(3) - (4)].number);
}
@@ -5933,7 +5927,7 @@ yyreduce:
case 484:
/* Line 1813 of yacc.c */
-#line 2533 "conf_parser.y"
+#line 2527 "conf_parser.y"
{
if (conf_parser_ctx.pass == 2)
ConfigFileEntry.glines = yylval.number;
@@ -5942,7 +5936,7 @@ yyreduce:
case 485:
/* Line 1813 of yacc.c */
-#line 2539 "conf_parser.y"
+#line 2533 "conf_parser.y"
{
if (conf_parser_ctx.pass == 2)
ConfigFileEntry.gline_time = (yyvsp[(3) - (4)].number);
@@ -5951,7 +5945,7 @@ yyreduce:
case 486:
/* Line 1813 of yacc.c */
-#line 2545 "conf_parser.y"
+#line 2539 "conf_parser.y"
{
if (conf_parser_ctx.pass == 2)
ConfigFileEntry.gline_request_time = (yyvsp[(3) - (4)].number);
@@ -5960,7 +5954,7 @@ yyreduce:
case 487:
/* Line 1813 of yacc.c */
-#line 2551 "conf_parser.y"
+#line 2545 "conf_parser.y"
{
ConfigFileEntry.gline_min_cidr = (yyvsp[(3) - (4)].number);
}
@@ -5968,7 +5962,7 @@ yyreduce:
case 488:
/* Line 1813 of yacc.c */
-#line 2556 "conf_parser.y"
+#line 2550 "conf_parser.y"
{
ConfigFileEntry.gline_min_cidr6 = (yyvsp[(3) - (4)].number);
}
@@ -5976,7 +5970,7 @@ yyreduce:
case 489:
/* Line 1813 of yacc.c */
-#line 2561 "conf_parser.y"
+#line 2555 "conf_parser.y"
{
ConfigFileEntry.tkline_expire_notices = yylval.number;
}
@@ -5984,7 +5978,7 @@ yyreduce:
case 490:
/* Line 1813 of yacc.c */
-#line 2566 "conf_parser.y"
+#line 2560 "conf_parser.y"
{
ConfigFileEntry.kill_chase_time_limit = (yyvsp[(3) - (4)].number);
}
@@ -5992,7 +5986,7 @@ yyreduce:
case 491:
/* Line 1813 of yacc.c */
-#line 2571 "conf_parser.y"
+#line 2565 "conf_parser.y"
{
ConfigFileEntry.hide_spoof_ips = yylval.number;
}
@@ -6000,7 +5994,7 @@ yyreduce:
case 492:
/* Line 1813 of yacc.c */
-#line 2576 "conf_parser.y"
+#line 2570 "conf_parser.y"
{
ConfigFileEntry.ignore_bogus_ts = yylval.number;
}
@@ -6008,7 +6002,7 @@ yyreduce:
case 493:
/* Line 1813 of yacc.c */
-#line 2581 "conf_parser.y"
+#line 2575 "conf_parser.y"
{
ConfigFileEntry.disable_remote = yylval.number;
}
@@ -6016,7 +6010,7 @@ yyreduce:
case 494:
/* Line 1813 of yacc.c */
-#line 2586 "conf_parser.y"
+#line 2580 "conf_parser.y"
{
ConfigFileEntry.failed_oper_notice = yylval.number;
}
@@ -6024,7 +6018,7 @@ yyreduce:
case 495:
/* Line 1813 of yacc.c */
-#line 2591 "conf_parser.y"
+#line 2585 "conf_parser.y"
{
ConfigFileEntry.anti_nick_flood = yylval.number;
}
@@ -6032,7 +6026,7 @@ yyreduce:
case 496:
/* Line 1813 of yacc.c */
-#line 2596 "conf_parser.y"
+#line 2590 "conf_parser.y"
{
ConfigFileEntry.max_nick_time = (yyvsp[(3) - (4)].number);
}
@@ -6040,7 +6034,7 @@ yyreduce:
case 497:
/* Line 1813 of yacc.c */
-#line 2601 "conf_parser.y"
+#line 2595 "conf_parser.y"
{
ConfigFileEntry.max_nick_changes = (yyvsp[(3) - (4)].number);
}
@@ -6048,7 +6042,7 @@ yyreduce:
case 498:
/* Line 1813 of yacc.c */
-#line 2606 "conf_parser.y"
+#line 2600 "conf_parser.y"
{
ConfigFileEntry.max_accept = (yyvsp[(3) - (4)].number);
}
@@ -6056,7 +6050,7 @@ yyreduce:
case 499:
/* Line 1813 of yacc.c */
-#line 2611 "conf_parser.y"
+#line 2605 "conf_parser.y"
{
ConfigFileEntry.anti_spam_exit_message_time = (yyvsp[(3) - (4)].number);
}
@@ -6064,7 +6058,7 @@ yyreduce:
case 500:
/* Line 1813 of yacc.c */
-#line 2616 "conf_parser.y"
+#line 2610 "conf_parser.y"
{
ConfigFileEntry.ts_warn_delta = (yyvsp[(3) - (4)].number);
}
@@ -6072,7 +6066,7 @@ yyreduce:
case 501:
/* Line 1813 of yacc.c */
-#line 2621 "conf_parser.y"
+#line 2615 "conf_parser.y"
{
if (conf_parser_ctx.pass == 2)
ConfigFileEntry.ts_max_delta = (yyvsp[(3) - (4)].number);
@@ -6081,7 +6075,7 @@ yyreduce:
case 502:
/* Line 1813 of yacc.c */
-#line 2627 "conf_parser.y"
+#line 2621 "conf_parser.y"
{
if (((yyvsp[(3) - (4)].number) > 0) && conf_parser_ctx.pass == 1)
{
@@ -6095,7 +6089,7 @@ yyreduce:
case 503:
/* Line 1813 of yacc.c */
-#line 2638 "conf_parser.y"
+#line 2632 "conf_parser.y"
{
ConfigFileEntry.invisible_on_connect = yylval.number;
}
@@ -6103,7 +6097,7 @@ yyreduce:
case 504:
/* Line 1813 of yacc.c */
-#line 2643 "conf_parser.y"
+#line 2637 "conf_parser.y"
{
ConfigFileEntry.warn_no_nline = yylval.number;
}
@@ -6111,7 +6105,7 @@ yyreduce:
case 505:
/* Line 1813 of yacc.c */
-#line 2648 "conf_parser.y"
+#line 2642 "conf_parser.y"
{
ConfigFileEntry.stats_e_disabled = yylval.number;
}
@@ -6119,7 +6113,7 @@ yyreduce:
case 506:
/* Line 1813 of yacc.c */
-#line 2653 "conf_parser.y"
+#line 2647 "conf_parser.y"
{
ConfigFileEntry.stats_o_oper_only = yylval.number;
}
@@ -6127,7 +6121,7 @@ yyreduce:
case 507:
/* Line 1813 of yacc.c */
-#line 2658 "conf_parser.y"
+#line 2652 "conf_parser.y"
{
ConfigFileEntry.stats_P_oper_only = yylval.number;
}
@@ -6135,7 +6129,7 @@ yyreduce:
case 508:
/* Line 1813 of yacc.c */
-#line 2663 "conf_parser.y"
+#line 2657 "conf_parser.y"
{
ConfigFileEntry.stats_k_oper_only = 2 * yylval.number;
}
@@ -6143,7 +6137,7 @@ yyreduce:
case 509:
/* Line 1813 of yacc.c */
-#line 2666 "conf_parser.y"
+#line 2660 "conf_parser.y"
{
ConfigFileEntry.stats_k_oper_only = 1;
}
@@ -6151,7 +6145,7 @@ yyreduce:
case 510:
/* Line 1813 of yacc.c */
-#line 2671 "conf_parser.y"
+#line 2665 "conf_parser.y"
{
ConfigFileEntry.stats_i_oper_only = 2 * yylval.number;
}
@@ -6159,7 +6153,7 @@ yyreduce:
case 511:
/* Line 1813 of yacc.c */
-#line 2674 "conf_parser.y"
+#line 2668 "conf_parser.y"
{
ConfigFileEntry.stats_i_oper_only = 1;
}
@@ -6167,7 +6161,7 @@ yyreduce:
case 512:
/* Line 1813 of yacc.c */
-#line 2679 "conf_parser.y"
+#line 2673 "conf_parser.y"
{
ConfigFileEntry.pace_wait = (yyvsp[(3) - (4)].number);
}
@@ -6175,7 +6169,7 @@ yyreduce:
case 513:
/* Line 1813 of yacc.c */
-#line 2684 "conf_parser.y"
+#line 2678 "conf_parser.y"
{
ConfigFileEntry.caller_id_wait = (yyvsp[(3) - (4)].number);
}
@@ -6183,7 +6177,7 @@ yyreduce:
case 514:
/* Line 1813 of yacc.c */
-#line 2689 "conf_parser.y"
+#line 2683 "conf_parser.y"
{
ConfigFileEntry.opers_bypass_callerid = yylval.number;
}
@@ -6191,7 +6185,7 @@ yyreduce:
case 515:
/* Line 1813 of yacc.c */
-#line 2694 "conf_parser.y"
+#line 2688 "conf_parser.y"
{
ConfigFileEntry.pace_wait_simple = (yyvsp[(3) - (4)].number);
}
@@ -6199,7 +6193,7 @@ yyreduce:
case 516:
/* Line 1813 of yacc.c */
-#line 2699 "conf_parser.y"
+#line 2693 "conf_parser.y"
{
ConfigFileEntry.short_motd = yylval.number;
}
@@ -6207,7 +6201,7 @@ yyreduce:
case 517:
/* Line 1813 of yacc.c */
-#line 2704 "conf_parser.y"
+#line 2698 "conf_parser.y"
{
ConfigFileEntry.no_oper_flood = yylval.number;
}
@@ -6215,7 +6209,7 @@ yyreduce:
case 518:
/* Line 1813 of yacc.c */
-#line 2709 "conf_parser.y"
+#line 2703 "conf_parser.y"
{
ConfigFileEntry.true_no_oper_flood = yylval.number;
}
@@ -6223,7 +6217,7 @@ yyreduce:
case 519:
/* Line 1813 of yacc.c */
-#line 2714 "conf_parser.y"
+#line 2708 "conf_parser.y"
{
ConfigFileEntry.oper_pass_resv = yylval.number;
}
@@ -6231,7 +6225,7 @@ yyreduce:
case 520:
/* Line 1813 of yacc.c */
-#line 2719 "conf_parser.y"
+#line 2713 "conf_parser.y"
{
if (conf_parser_ctx.pass == 2)
{
@@ -6245,7 +6239,7 @@ yyreduce:
case 521:
/* Line 1813 of yacc.c */
-#line 2730 "conf_parser.y"
+#line 2724 "conf_parser.y"
{
ConfigFileEntry.dots_in_ident = (yyvsp[(3) - (4)].number);
}
@@ -6253,7 +6247,7 @@ yyreduce:
case 522:
/* Line 1813 of yacc.c */
-#line 2735 "conf_parser.y"
+#line 2729 "conf_parser.y"
{
ConfigFileEntry.max_targets = (yyvsp[(3) - (4)].number);
}
@@ -6261,7 +6255,7 @@ yyreduce:
case 523:
/* Line 1813 of yacc.c */
-#line 2740 "conf_parser.y"
+#line 2734 "conf_parser.y"
{
ConfigFileEntry.use_egd = yylval.number;
}
@@ -6269,7 +6263,7 @@ yyreduce:
case 524:
/* Line 1813 of yacc.c */
-#line 2745 "conf_parser.y"
+#line 2739 "conf_parser.y"
{
if (conf_parser_ctx.pass == 2)
{
@@ -6281,7 +6275,7 @@ yyreduce:
case 525:
/* Line 1813 of yacc.c */
-#line 2754 "conf_parser.y"
+#line 2748 "conf_parser.y"
{
if (conf_parser_ctx.pass == 2 && valid_servname(yylval.string))
{
@@ -6293,7 +6287,7 @@ yyreduce:
case 526:
/* Line 1813 of yacc.c */
-#line 2763 "conf_parser.y"
+#line 2757 "conf_parser.y"
{
ConfigFileEntry.ping_cookie = yylval.number;
}
@@ -6301,7 +6295,7 @@ yyreduce:
case 527:
/* Line 1813 of yacc.c */
-#line 2768 "conf_parser.y"
+#line 2762 "conf_parser.y"
{
ConfigFileEntry.disable_auth = yylval.number;
}
@@ -6309,7 +6303,7 @@ yyreduce:
case 528:
/* Line 1813 of yacc.c */
-#line 2773 "conf_parser.y"
+#line 2767 "conf_parser.y"
{
ConfigFileEntry.throttle_time = yylval.number;
}
@@ -6317,7 +6311,7 @@ yyreduce:
case 529:
/* Line 1813 of yacc.c */
-#line 2778 "conf_parser.y"
+#line 2772 "conf_parser.y"
{
ConfigFileEntry.oper_umodes = 0;
}
@@ -6325,7 +6319,7 @@ yyreduce:
case 533:
/* Line 1813 of yacc.c */
-#line 2784 "conf_parser.y"
+#line 2778 "conf_parser.y"
{
ConfigFileEntry.oper_umodes |= UMODE_BOTS;
}
@@ -6333,7 +6327,7 @@ yyreduce:
case 534:
/* Line 1813 of yacc.c */
-#line 2787 "conf_parser.y"
+#line 2781 "conf_parser.y"
{
ConfigFileEntry.oper_umodes |= UMODE_CCONN;
}
@@ -6341,7 +6335,7 @@ yyreduce:
case 535:
/* Line 1813 of yacc.c */
-#line 2790 "conf_parser.y"
+#line 2784 "conf_parser.y"
{
ConfigFileEntry.oper_umodes |= UMODE_CCONN_FULL;
}
@@ -6349,7 +6343,7 @@ yyreduce:
case 536:
/* Line 1813 of yacc.c */
-#line 2793 "conf_parser.y"
+#line 2787 "conf_parser.y"
{
ConfigFileEntry.oper_umodes |= UMODE_DEAF;
}
@@ -6357,7 +6351,7 @@ yyreduce:
case 537:
/* Line 1813 of yacc.c */
-#line 2796 "conf_parser.y"
+#line 2790 "conf_parser.y"
{
ConfigFileEntry.oper_umodes |= UMODE_DEBUG;
}
@@ -6365,7 +6359,7 @@ yyreduce:
case 538:
/* Line 1813 of yacc.c */
-#line 2799 "conf_parser.y"
+#line 2793 "conf_parser.y"
{
ConfigFileEntry.oper_umodes |= UMODE_FULL;
}
@@ -6373,7 +6367,7 @@ yyreduce:
case 539:
/* Line 1813 of yacc.c */
-#line 2802 "conf_parser.y"
+#line 2796 "conf_parser.y"
{
ConfigFileEntry.oper_umodes |= UMODE_HIDDEN;
}
@@ -6381,7 +6375,7 @@ yyreduce:
case 540:
/* Line 1813 of yacc.c */
-#line 2805 "conf_parser.y"
+#line 2799 "conf_parser.y"
{
ConfigFileEntry.oper_umodes |= UMODE_SKILL;
}
@@ -6389,7 +6383,7 @@ yyreduce:
case 541:
/* Line 1813 of yacc.c */
-#line 2808 "conf_parser.y"
+#line 2802 "conf_parser.y"
{
ConfigFileEntry.oper_umodes |= UMODE_NCHANGE;
}
@@ -6397,7 +6391,7 @@ yyreduce:
case 542:
/* Line 1813 of yacc.c */
-#line 2811 "conf_parser.y"
+#line 2805 "conf_parser.y"
{
ConfigFileEntry.oper_umodes |= UMODE_REJ;
}
@@ -6405,7 +6399,7 @@ yyreduce:
case 543:
/* Line 1813 of yacc.c */
-#line 2814 "conf_parser.y"
+#line 2808 "conf_parser.y"
{
ConfigFileEntry.oper_umodes |= UMODE_UNAUTH;
}
@@ -6413,7 +6407,7 @@ yyreduce:
case 544:
/* Line 1813 of yacc.c */
-#line 2817 "conf_parser.y"
+#line 2811 "conf_parser.y"
{
ConfigFileEntry.oper_umodes |= UMODE_SPY;
}
@@ -6421,7 +6415,7 @@ yyreduce:
case 545:
/* Line 1813 of yacc.c */
-#line 2820 "conf_parser.y"
+#line 2814 "conf_parser.y"
{
ConfigFileEntry.oper_umodes |= UMODE_EXTERNAL;
}
@@ -6429,7 +6423,7 @@ yyreduce:
case 546:
/* Line 1813 of yacc.c */
-#line 2823 "conf_parser.y"
+#line 2817 "conf_parser.y"
{
ConfigFileEntry.oper_umodes |= UMODE_OPERWALL;
}
@@ -6437,7 +6431,7 @@ yyreduce:
case 547:
/* Line 1813 of yacc.c */
-#line 2826 "conf_parser.y"
+#line 2820 "conf_parser.y"
{
ConfigFileEntry.oper_umodes |= UMODE_SERVNOTICE;
}
@@ -6445,7 +6439,7 @@ yyreduce:
case 548:
/* Line 1813 of yacc.c */
-#line 2829 "conf_parser.y"
+#line 2823 "conf_parser.y"
{
ConfigFileEntry.oper_umodes |= UMODE_INVISIBLE;
}
@@ -6453,7 +6447,7 @@ yyreduce:
case 549:
/* Line 1813 of yacc.c */
-#line 2832 "conf_parser.y"
+#line 2826 "conf_parser.y"
{
ConfigFileEntry.oper_umodes |= UMODE_WALLOP;
}
@@ -6461,7 +6455,7 @@ yyreduce:
case 550:
/* Line 1813 of yacc.c */
-#line 2835 "conf_parser.y"
+#line 2829 "conf_parser.y"
{
ConfigFileEntry.oper_umodes |= UMODE_SOFTCALLERID;
}
@@ -6469,7 +6463,7 @@ yyreduce:
case 551:
/* Line 1813 of yacc.c */
-#line 2838 "conf_parser.y"
+#line 2832 "conf_parser.y"
{
ConfigFileEntry.oper_umodes |= UMODE_CALLERID;
}
@@ -6477,7 +6471,7 @@ yyreduce:
case 552:
/* Line 1813 of yacc.c */
-#line 2841 "conf_parser.y"
+#line 2835 "conf_parser.y"
{
ConfigFileEntry.oper_umodes |= UMODE_LOCOPS;
}
@@ -6485,7 +6479,7 @@ yyreduce:
case 553:
/* Line 1813 of yacc.c */
-#line 2846 "conf_parser.y"
+#line 2840 "conf_parser.y"
{
ConfigFileEntry.oper_only_umodes = 0;
}
@@ -6493,7 +6487,7 @@ yyreduce:
case 557:
/* Line 1813 of yacc.c */
-#line 2852 "conf_parser.y"
+#line 2846 "conf_parser.y"
{
ConfigFileEntry.oper_only_umodes |= UMODE_BOTS;
}
@@ -6501,7 +6495,7 @@ yyreduce:
case 558:
/* Line 1813 of yacc.c */
-#line 2855 "conf_parser.y"
+#line 2849 "conf_parser.y"
{
ConfigFileEntry.oper_only_umodes |= UMODE_CCONN;
}
@@ -6509,7 +6503,7 @@ yyreduce:
case 559:
/* Line 1813 of yacc.c */
-#line 2858 "conf_parser.y"
+#line 2852 "conf_parser.y"
{
ConfigFileEntry.oper_only_umodes |= UMODE_CCONN_FULL;
}
@@ -6517,7 +6511,7 @@ yyreduce:
case 560:
/* Line 1813 of yacc.c */
-#line 2861 "conf_parser.y"
+#line 2855 "conf_parser.y"
{
ConfigFileEntry.oper_only_umodes |= UMODE_DEAF;
}
@@ -6525,7 +6519,7 @@ yyreduce:
case 561:
/* Line 1813 of yacc.c */
-#line 2864 "conf_parser.y"
+#line 2858 "conf_parser.y"
{
ConfigFileEntry.oper_only_umodes |= UMODE_DEBUG;
}
@@ -6533,7 +6527,7 @@ yyreduce:
case 562:
/* Line 1813 of yacc.c */
-#line 2867 "conf_parser.y"
+#line 2861 "conf_parser.y"
{
ConfigFileEntry.oper_only_umodes |= UMODE_FULL;
}
@@ -6541,7 +6535,7 @@ yyreduce:
case 563:
/* Line 1813 of yacc.c */
-#line 2870 "conf_parser.y"
+#line 2864 "conf_parser.y"
{
ConfigFileEntry.oper_only_umodes |= UMODE_SKILL;
}
@@ -6549,7 +6543,7 @@ yyreduce:
case 564:
/* Line 1813 of yacc.c */
-#line 2873 "conf_parser.y"
+#line 2867 "conf_parser.y"
{
ConfigFileEntry.oper_only_umodes |= UMODE_HIDDEN;
}
@@ -6557,7 +6551,7 @@ yyreduce:
case 565:
/* Line 1813 of yacc.c */
-#line 2876 "conf_parser.y"
+#line 2870 "conf_parser.y"
{
ConfigFileEntry.oper_only_umodes |= UMODE_NCHANGE;
}
@@ -6565,7 +6559,7 @@ yyreduce:
case 566:
/* Line 1813 of yacc.c */
-#line 2879 "conf_parser.y"
+#line 2873 "conf_parser.y"
{
ConfigFileEntry.oper_only_umodes |= UMODE_REJ;
}
@@ -6573,7 +6567,7 @@ yyreduce:
case 567:
/* Line 1813 of yacc.c */
-#line 2882 "conf_parser.y"
+#line 2876 "conf_parser.y"
{
ConfigFileEntry.oper_only_umodes |= UMODE_UNAUTH;
}
@@ -6581,7 +6575,7 @@ yyreduce:
case 568:
/* Line 1813 of yacc.c */
-#line 2885 "conf_parser.y"
+#line 2879 "conf_parser.y"
{
ConfigFileEntry.oper_only_umodes |= UMODE_SPY;
}
@@ -6589,7 +6583,7 @@ yyreduce:
case 569:
/* Line 1813 of yacc.c */
-#line 2888 "conf_parser.y"
+#line 2882 "conf_parser.y"
{
ConfigFileEntry.oper_only_umodes |= UMODE_EXTERNAL;
}
@@ -6597,7 +6591,7 @@ yyreduce:
case 570:
/* Line 1813 of yacc.c */
-#line 2891 "conf_parser.y"
+#line 2885 "conf_parser.y"
{
ConfigFileEntry.oper_only_umodes |= UMODE_OPERWALL;
}
@@ -6605,7 +6599,7 @@ yyreduce:
case 571:
/* Line 1813 of yacc.c */
-#line 2894 "conf_parser.y"
+#line 2888 "conf_parser.y"
{
ConfigFileEntry.oper_only_umodes |= UMODE_SERVNOTICE;
}
@@ -6613,7 +6607,7 @@ yyreduce:
case 572:
/* Line 1813 of yacc.c */
-#line 2897 "conf_parser.y"
+#line 2891 "conf_parser.y"
{
ConfigFileEntry.oper_only_umodes |= UMODE_INVISIBLE;
}
@@ -6621,7 +6615,7 @@ yyreduce:
case 573:
/* Line 1813 of yacc.c */
-#line 2900 "conf_parser.y"
+#line 2894 "conf_parser.y"
{
ConfigFileEntry.oper_only_umodes |= UMODE_WALLOP;
}
@@ -6629,7 +6623,7 @@ yyreduce:
case 574:
/* Line 1813 of yacc.c */
-#line 2903 "conf_parser.y"
+#line 2897 "conf_parser.y"
{
ConfigFileEntry.oper_only_umodes |= UMODE_SOFTCALLERID;
}
@@ -6637,7 +6631,7 @@ yyreduce:
case 575:
/* Line 1813 of yacc.c */
-#line 2906 "conf_parser.y"
+#line 2900 "conf_parser.y"
{
ConfigFileEntry.oper_only_umodes |= UMODE_CALLERID;
}
@@ -6645,7 +6639,7 @@ yyreduce:
case 576:
/* Line 1813 of yacc.c */
-#line 2909 "conf_parser.y"
+#line 2903 "conf_parser.y"
{
ConfigFileEntry.oper_only_umodes |= UMODE_LOCOPS;
}
@@ -6653,7 +6647,7 @@ yyreduce:
case 577:
/* Line 1813 of yacc.c */
-#line 2914 "conf_parser.y"
+#line 2908 "conf_parser.y"
{
ConfigFileEntry.min_nonwildcard = (yyvsp[(3) - (4)].number);
}
@@ -6661,7 +6655,7 @@ yyreduce:
case 578:
/* Line 1813 of yacc.c */
-#line 2919 "conf_parser.y"
+#line 2913 "conf_parser.y"
{
ConfigFileEntry.min_nonwildcard_simple = (yyvsp[(3) - (4)].number);
}
@@ -6669,7 +6663,7 @@ yyreduce:
case 579:
/* Line 1813 of yacc.c */
-#line 2924 "conf_parser.y"
+#line 2918 "conf_parser.y"
{
ConfigFileEntry.default_floodcount = (yyvsp[(3) - (4)].number);
}
@@ -6677,7 +6671,7 @@ yyreduce:
case 598:
/* Line 1813 of yacc.c */
-#line 2947 "conf_parser.y"
+#line 2941 "conf_parser.y"
{
ConfigChannel.disable_fake_channels = yylval.number;
}
@@ -6685,7 +6679,7 @@ yyreduce:
case 599:
/* Line 1813 of yacc.c */
-#line 2952 "conf_parser.y"
+#line 2946 "conf_parser.y"
{
ConfigChannel.restrict_channels = yylval.number;
}
@@ -6693,7 +6687,7 @@ yyreduce:
case 600:
/* Line 1813 of yacc.c */
-#line 2957 "conf_parser.y"
+#line 2951 "conf_parser.y"
{
ConfigChannel.knock_delay = (yyvsp[(3) - (4)].number);
}
@@ -6701,7 +6695,7 @@ yyreduce:
case 601:
/* Line 1813 of yacc.c */
-#line 2962 "conf_parser.y"
+#line 2956 "conf_parser.y"
{
ConfigChannel.knock_delay_channel = (yyvsp[(3) - (4)].number);
}
@@ -6709,7 +6703,7 @@ yyreduce:
case 602:
/* Line 1813 of yacc.c */
-#line 2967 "conf_parser.y"
+#line 2961 "conf_parser.y"
{
ConfigChannel.max_chans_per_user = (yyvsp[(3) - (4)].number);
}
@@ -6717,7 +6711,7 @@ yyreduce:
case 603:
/* Line 1813 of yacc.c */
-#line 2972 "conf_parser.y"
+#line 2966 "conf_parser.y"
{
ConfigChannel.max_chans_per_oper = (yyvsp[(3) - (4)].number);
}
@@ -6725,7 +6719,7 @@ yyreduce:
case 604:
/* Line 1813 of yacc.c */
-#line 2977 "conf_parser.y"
+#line 2971 "conf_parser.y"
{
ConfigChannel.quiet_on_ban = yylval.number;
}
@@ -6733,7 +6727,7 @@ yyreduce:
case 605:
/* Line 1813 of yacc.c */
-#line 2982 "conf_parser.y"
+#line 2976 "conf_parser.y"
{
ConfigChannel.max_bans = (yyvsp[(3) - (4)].number);
}
@@ -6741,7 +6735,7 @@ yyreduce:
case 606:
/* Line 1813 of yacc.c */
-#line 2987 "conf_parser.y"
+#line 2981 "conf_parser.y"
{
ConfigChannel.default_split_user_count = (yyvsp[(3) - (4)].number);
}
@@ -6749,7 +6743,7 @@ yyreduce:
case 607:
/* Line 1813 of yacc.c */
-#line 2992 "conf_parser.y"
+#line 2986 "conf_parser.y"
{
ConfigChannel.default_split_server_count = (yyvsp[(3) - (4)].number);
}
@@ -6757,7 +6751,7 @@ yyreduce:
case 608:
/* Line 1813 of yacc.c */
-#line 2997 "conf_parser.y"
+#line 2991 "conf_parser.y"
{
ConfigChannel.no_create_on_split = yylval.number;
}
@@ -6765,7 +6759,7 @@ yyreduce:
case 609:
/* Line 1813 of yacc.c */
-#line 3002 "conf_parser.y"
+#line 2996 "conf_parser.y"
{
ConfigChannel.no_join_on_split = yylval.number;
}
@@ -6773,7 +6767,7 @@ yyreduce:
case 610:
/* Line 1813 of yacc.c */
-#line 3007 "conf_parser.y"
+#line 3001 "conf_parser.y"
{
GlobalSetOptions.joinfloodcount = yylval.number;
}
@@ -6781,7 +6775,7 @@ yyreduce:
case 611:
/* Line 1813 of yacc.c */
-#line 3012 "conf_parser.y"
+#line 3006 "conf_parser.y"
{
GlobalSetOptions.joinfloodtime = yylval.number;
}
@@ -6789,7 +6783,7 @@ yyreduce:
case 622:
/* Line 1813 of yacc.c */
-#line 3030 "conf_parser.y"
+#line 3024 "conf_parser.y"
{
if (conf_parser_ctx.pass == 2)
ConfigServerHide.flatten_links = yylval.number;
@@ -6798,7 +6792,7 @@ yyreduce:
case 623:
/* Line 1813 of yacc.c */
-#line 3036 "conf_parser.y"
+#line 3030 "conf_parser.y"
{
if (conf_parser_ctx.pass == 2)
ConfigServerHide.hide_servers = yylval.number;
@@ -6807,7 +6801,7 @@ yyreduce:
case 624:
/* Line 1813 of yacc.c */
-#line 3042 "conf_parser.y"
+#line 3036 "conf_parser.y"
{
if (conf_parser_ctx.pass == 2)
{
@@ -6819,7 +6813,7 @@ yyreduce:
case 625:
/* Line 1813 of yacc.c */
-#line 3051 "conf_parser.y"
+#line 3045 "conf_parser.y"
{
if (conf_parser_ctx.pass == 2)
{
@@ -6836,7 +6830,7 @@ yyreduce:
case 626:
/* Line 1813 of yacc.c */
-#line 3065 "conf_parser.y"
+#line 3059 "conf_parser.y"
{
if (conf_parser_ctx.pass == 2)
ConfigServerHide.hidden = yylval.number;
@@ -6845,7 +6839,7 @@ yyreduce:
case 627:
/* Line 1813 of yacc.c */
-#line 3071 "conf_parser.y"
+#line 3065 "conf_parser.y"
{
if (conf_parser_ctx.pass == 2)
ConfigServerHide.hide_server_ips = yylval.number;
@@ -6854,7 +6848,7 @@ yyreduce:
/* Line 1813 of yacc.c */
-#line 6858 "conf_parser.c"
+#line 6852 "conf_parser.c"
default: break;
}
/* User semantic actions sometimes alter yychar, and that requires
diff --git a/src/conf_parser.y b/src/conf_parser.y
index a36cbaa..293376e 100644
--- a/src/conf_parser.y
+++ b/src/conf_parser.y
@@ -2269,8 +2269,6 @@ kill_entry: KILL
yy_aconf->regexuser = exp_user;
yy_aconf->regexhost = exp_host;
- SetConfMain(yy_aconf);
-
DupString(yy_aconf->user, userbuf);
DupString(yy_aconf->host, hostbuf);
@@ -2287,8 +2285,6 @@ kill_entry: KILL
{
yy_aconf = map_to_conf(make_conf_item(KLINE_TYPE));
- SetConfMain(yy_aconf);
-
DupString(yy_aconf->user, userbuf);
DupString(yy_aconf->host, hostbuf);
@@ -2358,7 +2354,6 @@ deny_entry: DENY
{
yy_aconf = map_to_conf(make_conf_item(DLINE_TYPE));
DupString(yy_aconf->host, hostbuf);
- SetConfMain(yy_aconf);
if (reasonbuf[0])
DupString(yy_aconf->reason, reasonbuf);
@@ -2447,7 +2442,6 @@ gecos_entry: GECOS
else
yy_conf = make_conf_item(XLINE_TYPE);
- SetConfMain(yy_conf);
yy_match_item = map_to_conf(yy_conf);
DupString(yy_conf->name, gecos_name);
diff --git a/src/hostmask.c b/src/hostmask.c
index 2c74463..e7d014d 100644
--- a/src/hostmask.c
+++ b/src/hostmask.c
@@ -744,23 +744,19 @@ clear_out_address_conf(void)
{
struct AddressRec *arec = ptr->data;
- /* We keep the temporary K-lines and destroy the
- * permanent ones, just to be confusing :) -A1kmm
- */
- if (!(arec->aconf->flags & CONF_FLAGS_TEMPORARY))
- {
- /* XXX HACK */
- if (arec->type == CONF_KLINE && !IsConfMain(arec->aconf))
- continue;
+ /*
+ * We keep the temporary K-lines and destroy the permanent ones,
+ * just to be confusing :) -A1kmm
+ */
+ if (arec->aconf->hold || IsConfDatabase(arec->aconf))
+ continue;
- dlinkDelete(&arec->node, &atable[i]);
- /* unlink it from link list - Dianora */
- arec->aconf->status |= CONF_ILLEGAL;
+ dlinkDelete(&arec->node, &atable[i]);
+ arec->aconf->status |= CONF_ILLEGAL;
- if (!arec->aconf->clients)
- free_access_item(arec->aconf);
- MyFree(arec);
- }
+ if (!arec->aconf->clients)
+ free_access_item(arec->aconf);
+ MyFree(arec);
}
}
}
@@ -804,7 +800,7 @@ hostmask_expire_temporary(void)
{
struct AddressRec *arec = ptr->data;
- if (!IsConfTemporary(arec->aconf) || arec->aconf->hold > CurrentTime)
+ if (!arec->aconf->hold || arec->aconf->hold > CurrentTime)
continue;
switch (arec->type)
diff --git a/src/resv.c b/src/resv.c
index 6f5130b..1998386 100644
--- a/src/resv.c
+++ b/src/resv.c
@@ -68,7 +68,6 @@ create_channel_resv(char *name, char *reason, int in_conf)
strlcpy(resv_p->name, name, sizeof(resv_p->name));
DupString(conf->name, name);
DupString(resv_p->reason, reason);
- resv_p->conf = in_conf;
dlinkAdd(resv_p, &resv_p->node, &resv_channel_list);
hash_add_resv(resv_p);
@@ -104,7 +103,6 @@ create_nick_resv(char *name, char *reason, int in_conf)
DupString(conf->name, name);
DupString(resv_p->reason, reason);
- resv_p->action = in_conf;
return conf;
}
@@ -121,7 +119,12 @@ clear_conf_resv(void)
dlink_node *ptr = NULL, *next_ptr = NULL;
DLINK_FOREACH_SAFE(ptr, next_ptr, resv_channel_list.head)
- delete_channel_resv(ptr->data);
+ {
+ struct ResvChannel *resv_p = ptr->data;
+
+ if (!IsConfDatabase(resv_p))
+ delete_channel_resv(resv_p);
+ }
}
/* delete_channel_resv()
@@ -190,7 +193,7 @@ report_resv(struct Client *source_p)
resv_cp = ptr->data;
sendto_one(source_p, form_str(RPL_STATSQLINE),
me.name, source_p->name,
- resv_cp->conf ? 'Q' : 'q',
+ resv_cp->hold ? 'q' : 'Q',
resv_cp->name, resv_cp->reason);
}
@@ -201,7 +204,7 @@ report_resv(struct Client *source_p)
sendto_one(source_p, form_str(RPL_STATSQLINE),
me.name, source_p->name,
- resv_np->action ? 'Q' : 'q',
+ resv_np->hold ? 'q' : 'Q',
conf->name, resv_np->reason);
}
}