29 |
|
#include "ircd_defs.h" |
30 |
|
#include "conf.h" |
31 |
|
#include "conf_cluster.h" |
32 |
+ |
#include "conf_gecos.h" |
33 |
|
#include "conf_pseudo.h" |
34 |
|
#include "conf_resv.h" |
35 |
|
#include "conf_service.h" |
73 |
|
/* general conf items link list root, other than k lines etc. */ |
74 |
|
dlink_list server_items; |
75 |
|
dlink_list operator_items; |
75 |
– |
dlink_list gecos_items; |
76 |
|
|
77 |
|
extern unsigned int lineno; |
78 |
|
extern char linebuf[]; |
134 |
|
{ |
135 |
|
switch (type) |
136 |
|
{ |
137 |
– |
case CONF_XLINE: |
138 |
– |
return &gecos_items; |
139 |
– |
break; |
137 |
|
case CONF_OPER: |
138 |
|
return &operator_items; |
139 |
|
break; |
541 |
|
|
542 |
|
switch (type) |
543 |
|
{ |
547 |
– |
case CONF_XLINE: |
548 |
– |
DLINK_FOREACH(node, list->head) |
549 |
– |
{ |
550 |
– |
conf = node->data; |
551 |
– |
|
552 |
– |
if (EmptyString(conf->name)) |
553 |
– |
continue; |
554 |
– |
if (name && !match(conf->name, name)) |
555 |
– |
{ |
556 |
– |
if ((user == NULL && (host == NULL))) |
557 |
– |
return conf; |
558 |
– |
if ((conf->modes & flags) != flags) |
559 |
– |
continue; |
560 |
– |
if (EmptyString(conf->user) || EmptyString(conf->host)) |
561 |
– |
return conf; |
562 |
– |
if (!match(conf->user, user) && !match(conf->host, host)) |
563 |
– |
return conf; |
564 |
– |
} |
565 |
– |
} |
566 |
– |
break; |
567 |
– |
|
544 |
|
case CONF_SERVER: |
545 |
|
DLINK_FOREACH(node, list->head) |
546 |
|
{ |
578 |
|
|
579 |
|
switch(type) |
580 |
|
{ |
605 |
– |
case CONF_XLINE: |
606 |
– |
DLINK_FOREACH(node, list->head) |
607 |
– |
{ |
608 |
– |
conf = node->data; |
609 |
– |
|
610 |
– |
if (EmptyString(conf->name)) |
611 |
– |
continue; |
612 |
– |
|
613 |
– |
if (irccmp(conf->name, name) == 0) |
614 |
– |
{ |
615 |
– |
if ((user == NULL && (host == NULL))) |
616 |
– |
return conf; |
617 |
– |
if (EmptyString(conf->user) || EmptyString(conf->host)) |
618 |
– |
return conf; |
619 |
– |
if (!match(conf->user, user) && !match(conf->host, host)) |
620 |
– |
return conf; |
621 |
– |
} |
622 |
– |
} |
623 |
– |
break; |
624 |
– |
|
581 |
|
case CONF_OPER: |
582 |
|
DLINK_FOREACH(node, list->head) |
583 |
|
{ |
886 |
|
return 0; |
887 |
|
} |
888 |
|
|
933 |
– |
/* expire_tklines() |
934 |
– |
* |
935 |
– |
* inputs - tkline list pointer |
936 |
– |
* output - NONE |
937 |
– |
* side effects - expire tklines |
938 |
– |
*/ |
939 |
– |
static void |
940 |
– |
expire_tklines(dlink_list *list) |
941 |
– |
{ |
942 |
– |
dlink_node *node = NULL, *node_next = NULL; |
943 |
– |
|
944 |
– |
DLINK_FOREACH_SAFE(node, node_next, list->head) |
945 |
– |
{ |
946 |
– |
struct MaskItem *conf = node->data; |
947 |
– |
|
948 |
– |
if (!conf->until || conf->until > CurrentTime) |
949 |
– |
continue; |
950 |
– |
|
951 |
– |
if (ConfigGeneral.tkline_expire_notices) |
952 |
– |
sendto_realops_flags(UMODE_SERVNOTICE, L_ALL, SEND_NOTICE, "Temporary %s for [%s] expired", |
953 |
– |
(conf->type == CONF_XLINE) ? "X-line" : "RESV", conf->name); |
954 |
– |
conf_free(conf); |
955 |
– |
} |
956 |
– |
} |
957 |
– |
|
889 |
|
/* cleanup_tklines() |
890 |
|
* |
891 |
|
* inputs - NONE |
897 |
|
cleanup_tklines(void *unused) |
898 |
|
{ |
899 |
|
hostmask_expire_temporary(); |
900 |
< |
expire_tklines(&gecos_items); |
900 |
> |
gecos_expire(); |
901 |
|
resv_expire(); |
902 |
|
} |
903 |
|
|
1014 |
|
{ |
1015 |
|
dlink_node *node = NULL, *node_next = NULL; |
1016 |
|
dlink_list *free_items [] = { |
1017 |
< |
&server_items, &operator_items, |
1087 |
< |
&gecos_items, NULL |
1017 |
> |
&server_items, &operator_items, NULL |
1018 |
|
}; |
1019 |
|
|
1020 |
|
dlink_list ** iterator = free_items; /* C is dumb */ |
1030 |
|
struct MaskItem *conf = node->data; |
1031 |
|
|
1032 |
|
conf->active = 0; |
1033 |
+ |
dlinkDelete(&conf->node, *iterator); |
1034 |
|
|
1035 |
< |
if (!IsConfDatabase(conf)) |
1036 |
< |
{ |
1106 |
< |
dlinkDelete(&conf->node, *iterator); |
1107 |
< |
|
1108 |
< |
if (!conf->ref_count) |
1109 |
< |
conf_free(conf); |
1110 |
< |
} |
1035 |
> |
if (!conf->ref_count) |
1036 |
> |
conf_free(conf); |
1037 |
|
} |
1038 |
|
} |
1039 |
|
|
1053 |
|
|
1054 |
|
cluster_clear(); /* Clear cluster {} items */ |
1055 |
|
|
1056 |
+ |
gecos_clear(); /* Clear gecos {} items */ |
1057 |
+ |
|
1058 |
|
resv_clear(); /* Clear resv {} items */ |
1059 |
|
|
1060 |
|
service_clear(); /* Clear service {} items */ |