29 |
#include "ircd_defs.h" |
#include "ircd_defs.h" |
30 |
#include "conf.h" |
#include "conf.h" |
31 |
#include "conf_cluster.h" |
#include "conf_cluster.h" |
32 |
|
#include "conf_gecos.h" |
33 |
#include "conf_pseudo.h" |
#include "conf_pseudo.h" |
34 |
#include "conf_resv.h" |
#include "conf_resv.h" |
35 |
#include "conf_service.h" |
#include "conf_service.h" |
73 |
/* general conf items link list root, other than k lines etc. */ |
/* general conf items link list root, other than k lines etc. */ |
74 |
dlink_list server_items; |
dlink_list server_items; |
75 |
dlink_list operator_items; |
dlink_list operator_items; |
|
dlink_list gecos_items; |
|
76 |
|
|
77 |
extern unsigned int lineno; |
extern unsigned int lineno; |
78 |
extern char linebuf[]; |
extern char linebuf[]; |
134 |
{ |
{ |
135 |
switch (type) |
switch (type) |
136 |
{ |
{ |
|
case CONF_XLINE: |
|
|
return &gecos_items; |
|
|
break; |
|
137 |
case CONF_OPER: |
case CONF_OPER: |
138 |
return &operator_items; |
return &operator_items; |
139 |
break; |
break; |
541 |
|
|
542 |
switch (type) |
switch (type) |
543 |
{ |
{ |
|
case CONF_XLINE: |
|
|
DLINK_FOREACH(node, list->head) |
|
|
{ |
|
|
conf = node->data; |
|
|
|
|
|
if (EmptyString(conf->name)) |
|
|
continue; |
|
|
if (name && !match(conf->name, name)) |
|
|
{ |
|
|
if ((user == NULL && (host == NULL))) |
|
|
return conf; |
|
|
if ((conf->modes & flags) != flags) |
|
|
continue; |
|
|
if (EmptyString(conf->user) || EmptyString(conf->host)) |
|
|
return conf; |
|
|
if (!match(conf->user, user) && !match(conf->host, host)) |
|
|
return conf; |
|
|
} |
|
|
} |
|
|
break; |
|
|
|
|
544 |
case CONF_SERVER: |
case CONF_SERVER: |
545 |
DLINK_FOREACH(node, list->head) |
DLINK_FOREACH(node, list->head) |
546 |
{ |
{ |
578 |
|
|
579 |
switch(type) |
switch(type) |
580 |
{ |
{ |
|
case CONF_XLINE: |
|
|
DLINK_FOREACH(node, list->head) |
|
|
{ |
|
|
conf = node->data; |
|
|
|
|
|
if (EmptyString(conf->name)) |
|
|
continue; |
|
|
|
|
|
if (irccmp(conf->name, name) == 0) |
|
|
{ |
|
|
if ((user == NULL && (host == NULL))) |
|
|
return conf; |
|
|
if (EmptyString(conf->user) || EmptyString(conf->host)) |
|
|
return conf; |
|
|
if (!match(conf->user, user) && !match(conf->host, host)) |
|
|
return conf; |
|
|
} |
|
|
} |
|
|
break; |
|
|
|
|
581 |
case CONF_OPER: |
case CONF_OPER: |
582 |
DLINK_FOREACH(node, list->head) |
DLINK_FOREACH(node, list->head) |
583 |
{ |
{ |
886 |
return 0; |
return 0; |
887 |
} |
} |
888 |
|
|
|
/* expire_tklines() |
|
|
* |
|
|
* inputs - tkline list pointer |
|
|
* output - NONE |
|
|
* side effects - expire tklines |
|
|
*/ |
|
|
static void |
|
|
expire_tklines(dlink_list *list) |
|
|
{ |
|
|
dlink_node *node = NULL, *node_next = NULL; |
|
|
|
|
|
DLINK_FOREACH_SAFE(node, node_next, list->head) |
|
|
{ |
|
|
struct MaskItem *conf = node->data; |
|
|
|
|
|
if (!conf->until || conf->until > CurrentTime) |
|
|
continue; |
|
|
|
|
|
if (ConfigGeneral.tkline_expire_notices) |
|
|
sendto_realops_flags(UMODE_SERVNOTICE, L_ALL, SEND_NOTICE, "Temporary %s for [%s] expired", |
|
|
(conf->type == CONF_XLINE) ? "X-line" : "RESV", conf->name); |
|
|
conf_free(conf); |
|
|
} |
|
|
} |
|
|
|
|
889 |
/* cleanup_tklines() |
/* cleanup_tklines() |
890 |
* |
* |
891 |
* inputs - NONE |
* inputs - NONE |
897 |
cleanup_tklines(void *unused) |
cleanup_tklines(void *unused) |
898 |
{ |
{ |
899 |
hostmask_expire_temporary(); |
hostmask_expire_temporary(); |
900 |
expire_tklines(&gecos_items); |
gecos_expire(); |
901 |
resv_expire(); |
resv_expire(); |
902 |
} |
} |
903 |
|
|
1014 |
{ |
{ |
1015 |
dlink_node *node = NULL, *node_next = NULL; |
dlink_node *node = NULL, *node_next = NULL; |
1016 |
dlink_list *free_items [] = { |
dlink_list *free_items [] = { |
1017 |
&server_items, &operator_items, |
&server_items, &operator_items, NULL |
|
&gecos_items, NULL |
|
1018 |
}; |
}; |
1019 |
|
|
1020 |
dlink_list ** iterator = free_items; /* C is dumb */ |
dlink_list ** iterator = free_items; /* C is dumb */ |
1030 |
struct MaskItem *conf = node->data; |
struct MaskItem *conf = node->data; |
1031 |
|
|
1032 |
conf->active = 0; |
conf->active = 0; |
1033 |
|
dlinkDelete(&conf->node, *iterator); |
1034 |
|
|
1035 |
if (!IsConfDatabase(conf)) |
if (!conf->ref_count) |
1036 |
{ |
conf_free(conf); |
|
dlinkDelete(&conf->node, *iterator); |
|
|
|
|
|
if (!conf->ref_count) |
|
|
conf_free(conf); |
|
|
} |
|
1037 |
} |
} |
1038 |
} |
} |
1039 |
|
|
1053 |
|
|
1054 |
cluster_clear(); /* Clear cluster {} items */ |
cluster_clear(); /* Clear cluster {} items */ |
1055 |
|
|
1056 |
|
gecos_clear(); /* Clear gecos {} items */ |
1057 |
|
|
1058 |
resv_clear(); /* Clear resv {} items */ |
resv_clear(); /* Clear resv {} items */ |
1059 |
|
|
1060 |
service_clear(); /* Clear service {} items */ |
service_clear(); /* Clear service {} items */ |