60 |
|
static char umode_buffer[IRCD_BUFSIZE]; |
61 |
|
|
62 |
|
static void user_welcome(struct Client *); |
63 |
< |
static void report_and_set_user_flags(struct Client *, const struct AccessItem *); |
63 |
> |
static void report_and_set_user_flags(struct Client *, const struct MaskItem *); |
64 |
|
static int check_xline(struct Client *); |
65 |
|
static void introduce_client(struct Client *); |
66 |
|
static const char *uid_get(void); |
280 |
|
register_local_user(struct Client *source_p) |
281 |
|
{ |
282 |
|
const char *id = NULL; |
283 |
< |
const struct AccessItem *aconf = NULL; |
284 |
< |
dlink_node *ptr = NULL; |
283 |
> |
const struct MaskItem *conf = NULL; |
284 |
|
|
285 |
|
assert(source_p != NULL); |
286 |
|
assert(source_p == source_p->from); |
322 |
|
sizeof(source_p->host)); |
323 |
|
} |
324 |
|
|
325 |
< |
ptr = source_p->localClient->confs.head; |
327 |
< |
aconf = map_to_conf(ptr->data); |
325 |
> |
conf = source_p->localClient->confs.head->data; |
326 |
|
|
327 |
|
if (!IsGotId(source_p)) |
328 |
|
{ |
330 |
|
const char *p = username; |
331 |
|
unsigned int i = 0; |
332 |
|
|
333 |
< |
if (IsNeedIdentd(aconf)) |
333 |
> |
if (IsNeedIdentd(conf)) |
334 |
|
{ |
335 |
|
++ServerStats.is_ref; |
336 |
|
sendto_one(source_p, ":%s NOTICE %s :*** Notice -- You need to install " |
341 |
|
|
342 |
|
strlcpy(username, source_p->username, sizeof(username)); |
343 |
|
|
344 |
< |
if (!IsNoTilde(aconf)) |
344 |
> |
if (!IsNoTilde(conf)) |
345 |
|
source_p->username[i++] = '~'; |
346 |
|
|
347 |
|
for (; *p && i < USERLEN; ++p) |
352 |
|
} |
353 |
|
|
354 |
|
/* password check */ |
355 |
< |
if (!EmptyString(aconf->passwd)) |
355 |
> |
if (!EmptyString(conf->passwd)) |
356 |
|
{ |
357 |
|
const char *pass = source_p->localClient->passwd; |
358 |
|
|
359 |
< |
if (!match_conf_password(pass, aconf)) |
359 |
> |
if (!match_conf_password(pass, conf)) |
360 |
|
{ |
361 |
|
++ServerStats.is_ref; |
362 |
|
sendto_one(source_p, form_str(ERR_PASSWDMISMATCH), |
372 |
|
*/ |
373 |
|
|
374 |
|
/* report if user has &^>= etc. and set flags as needed in source_p */ |
375 |
< |
report_and_set_user_flags(source_p, aconf); |
375 |
> |
report_and_set_user_flags(source_p, conf); |
376 |
|
|
377 |
|
if (IsDead(source_p)) |
378 |
|
return; |
425 |
|
source_p->name, source_p->username, source_p->host, |
426 |
|
ConfigFileEntry.hide_spoof_ips && IsIPSpoof(source_p) ? |
427 |
|
"255.255.255.255" : source_p->sockhost, |
428 |
< |
get_client_class(source_p), |
428 |
> |
get_client_class(&source_p->localClient->confs), |
429 |
|
source_p->info, source_p->id); |
430 |
|
|
431 |
|
sendto_realops_flags(UMODE_CCONN_FULL, L_ALL, SEND_NOTICE, |
433 |
|
source_p->name, source_p->username, source_p->host, |
434 |
|
ConfigFileEntry.hide_spoof_ips && IsIPSpoof(source_p) ? |
435 |
|
"255.255.255.255" : source_p->sockhost, |
436 |
< |
get_client_class(source_p), |
436 |
> |
get_client_class(&source_p->localClient->confs), |
437 |
|
ConfigFileEntry.hide_spoof_ips && IsIPSpoof(source_p) ? |
438 |
|
"<hidden>" : source_p->localClient->client_host, |
439 |
|
ConfigFileEntry.hide_spoof_ips && IsIPSpoof(source_p) ? |
735 |
|
/* report_and_set_user_flags() |
736 |
|
* |
737 |
|
* inputs - pointer to source_p |
738 |
< |
* - pointer to aconf for this user |
738 |
> |
* - pointer to conf for this user |
739 |
|
* output - NONE |
740 |
|
* side effects - Report to user any special flags |
741 |
|
* they are getting, and set them. |
742 |
|
*/ |
743 |
|
static void |
744 |
< |
report_and_set_user_flags(struct Client *source_p, const struct AccessItem *aconf) |
744 |
> |
report_and_set_user_flags(struct Client *source_p, const struct MaskItem *conf) |
745 |
|
{ |
746 |
|
/* If this user is being spoofed, tell them so */ |
747 |
< |
if (IsConfDoSpoofIp(aconf)) |
747 |
> |
if (IsConfDoSpoofIp(conf)) |
748 |
|
{ |
749 |
|
sendto_one(source_p, |
750 |
|
":%s NOTICE %s :*** Spoofing your IP. congrats.", |
752 |
|
} |
753 |
|
|
754 |
|
/* If this user is in the exception class, Set it "E lined" */ |
755 |
< |
if (IsConfExemptKline(aconf)) |
755 |
> |
if (IsConfExemptKline(conf)) |
756 |
|
{ |
757 |
|
SetExemptKline(source_p); |
758 |
|
sendto_one(source_p, |
763 |
|
/* The else here is to make sure that G line exempt users |
764 |
|
* do not get noticed twice. |
765 |
|
*/ |
766 |
< |
else if (IsConfExemptGline(aconf)) |
766 |
> |
else if (IsConfExemptGline(conf)) |
767 |
|
{ |
768 |
|
SetExemptGline(source_p); |
769 |
|
sendto_one(source_p, ":%s NOTICE %s :*** You are exempt from G lines.", |
770 |
|
me.name, source_p->name); |
771 |
|
} |
772 |
|
|
773 |
< |
if (IsConfExemptResv(aconf)) |
773 |
> |
if (IsConfExemptResv(conf)) |
774 |
|
{ |
775 |
|
SetExemptResv(source_p); |
776 |
|
sendto_one(source_p, ":%s NOTICE %s :*** You are exempt from resvs.", |
778 |
|
} |
779 |
|
|
780 |
|
/* If this user is exempt from user limits set it "F lined" */ |
781 |
< |
if (IsConfExemptLimits(aconf)) |
781 |
> |
if (IsConfExemptLimits(conf)) |
782 |
|
{ |
783 |
|
SetExemptLimits(source_p); |
784 |
|
sendto_one(source_p, |
786 |
|
me.name,source_p->name); |
787 |
|
} |
788 |
|
|
789 |
< |
if (IsConfCanFlood(aconf)) |
789 |
> |
if (IsConfCanFlood(conf)) |
790 |
|
{ |
791 |
|
SetCanFlood(source_p); |
792 |
|
sendto_one(source_p, ":%s NOTICE %s :*** You are exempt from flood " |
919 |
|
{ |
920 |
|
dlink_node *dm; |
921 |
|
|
922 |
< |
detach_conf(source_p, OPER_TYPE); |
922 |
> |
detach_conf(source_p, CONF_OPER); |
923 |
|
ClrOFlag(source_p); |
924 |
|
DelUMode(source_p, ConfigFileEntry.oper_only_umodes); |
925 |
|
|
1156 |
|
static int |
1157 |
|
check_xline(struct Client *source_p) |
1158 |
|
{ |
1159 |
< |
struct ConfItem *conf = NULL; |
1159 |
> |
struct MaskItem *conf = NULL; |
1160 |
|
const char *reason = NULL; |
1161 |
|
|
1162 |
< |
if ((conf = find_matching_name_conf(XLINE_TYPE, source_p->info, NULL, NULL, 0)) || |
1163 |
< |
(conf = find_matching_name_conf(RXLINE_TYPE, source_p->info, NULL, NULL, 0))) |
1162 |
> |
if ((conf = find_matching_name_conf(CONF_XLINE, source_p->info, NULL, NULL, 0)) || |
1163 |
> |
(conf = find_matching_name_conf(CONF_RXLINE, source_p->info, NULL, NULL, 0))) |
1164 |
|
{ |
1165 |
< |
struct MatchItem *reg = map_to_conf(conf); |
1168 |
< |
|
1169 |
< |
++reg->count; |
1165 |
> |
++conf->count; |
1166 |
|
|
1167 |
< |
if (reg->reason != NULL) |
1168 |
< |
reason = reg->reason; |
1167 |
> |
if (conf->reason != NULL) |
1168 |
> |
reason = conf->reason; |
1169 |
|
else |
1170 |
|
reason = "No Reason"; |
1171 |
|
|
1187 |
|
* |
1188 |
|
* inputs - pointer to given client to oper |
1189 |
|
* output - NONE |
1190 |
< |
* side effects - Blindly opers up given source_p, using aconf info |
1190 |
> |
* side effects - Blindly opers up given source_p, using conf info |
1191 |
|
* all checks on passwords have already been done. |
1192 |
|
* This could also be used by rsa oper routines. |
1193 |
|
*/ |
1195 |
|
oper_up(struct Client *source_p) |
1196 |
|
{ |
1197 |
|
const unsigned int old = source_p->umodes; |
1198 |
< |
const struct AccessItem *oconf = NULL; |
1198 |
> |
const struct MaskItem *conf = NULL; |
1199 |
|
|
1200 |
|
assert(source_p->localClient->confs.head); |
1201 |
< |
oconf = map_to_conf((source_p->localClient->confs.head)->data); |
1201 |
> |
conf = source_p->localClient->confs.head->data; |
1202 |
|
|
1203 |
|
++Count.oper; |
1204 |
|
SetOper(source_p); |
1205 |
|
|
1206 |
< |
if (oconf->modes) |
1207 |
< |
AddUMode(source_p, oconf->modes); |
1206 |
> |
if (conf->modes) |
1207 |
> |
AddUMode(source_p, conf->modes); |
1208 |
|
else if (ConfigFileEntry.oper_umodes) |
1209 |
|
AddUMode(source_p, ConfigFileEntry.oper_umodes); |
1210 |
|
|
1216 |
|
assert(dlinkFind(&oper_list, source_p) == NULL); |
1217 |
|
dlinkAdd(source_p, make_dlink_node(), &oper_list); |
1218 |
|
|
1219 |
< |
AddOFlag(source_p, oconf->port); |
1219 |
> |
AddOFlag(source_p, conf->port); |
1220 |
|
|
1221 |
|
if (HasOFlag(source_p, OPER_FLAG_ADMIN)) |
1222 |
|
AddUMode(source_p, UMODE_ADMIN); |