32 |
|
#include "fdlist.h" |
33 |
|
#include "hash.h" |
34 |
|
#include "irc_string.h" |
35 |
– |
#include "sprintf_irc.h" |
35 |
|
#include "s_bsd.h" |
36 |
|
#include "ircd.h" |
37 |
|
#include "listener.h" |
119 |
|
UMODE_BOTS, /* b */ |
120 |
|
UMODE_CCONN, /* c */ |
121 |
|
UMODE_DEBUG, /* d */ |
122 |
< |
0, /* e */ |
122 |
> |
UMODE_EXTERNAL, /* e */ |
123 |
|
UMODE_FULL, /* f */ |
124 |
|
UMODE_CALLERID, /* g */ |
125 |
|
0, /* h */ |
138 |
|
UMODE_UNAUTH, /* u */ |
139 |
|
0, /* v */ |
140 |
|
UMODE_WALLOP, /* w */ |
141 |
< |
UMODE_EXTERNAL, /* x */ |
141 |
> |
0, /* x */ |
142 |
|
UMODE_SPY, /* y */ |
143 |
|
UMODE_OPERWALL, /* z 0x7A */ |
144 |
|
0,0,0,0,0, /* 0x7B - 0x7F */ |
658 |
|
if (!IsHostChar(*p)) |
659 |
|
return 0; |
660 |
|
|
661 |
< |
return 1; |
661 |
> |
return p - hostname <= HOSTLEN; |
662 |
|
} |
663 |
|
|
664 |
|
/* valid_username() |
846 |
|
return; |
847 |
|
} |
848 |
|
|
850 |
– |
if (IsServer(source_p)) |
851 |
– |
{ |
852 |
– |
sendto_realops_flags(UMODE_ALL, L_ADMIN, SEND_NOTICE, |
853 |
– |
"*** Mode for User %s from %s", |
854 |
– |
parv[1], source_p->name); |
855 |
– |
return; |
856 |
– |
} |
857 |
– |
|
849 |
|
if (source_p != target_p) |
850 |
|
{ |
851 |
|
sendto_one(source_p, form_str(ERR_USERSDONTMATCH), |
1081 |
|
send_umode(client_p, source_p, old, 0xffffffff, buf); |
1082 |
|
} |
1083 |
|
|
1084 |
+ |
void |
1085 |
+ |
user_set_hostmask(struct Client *target_p, const char *hostname) |
1086 |
+ |
{ |
1087 |
+ |
if (!valid_hostname(hostname)) |
1088 |
+ |
return; |
1089 |
+ |
|
1090 |
+ |
if (IsUserHostIp(target_p)) |
1091 |
+ |
delete_user_host(target_p->username, target_p->host, !MyConnect(target_p)); |
1092 |
+ |
|
1093 |
+ |
strlcpy(target_p->host, hostname, sizeof(target_p->host)); |
1094 |
+ |
SetIPSpoof(target_p); |
1095 |
+ |
|
1096 |
+ |
add_user_host(target_p->username, target_p->host, !MyConnect(target_p)); |
1097 |
+ |
SetUserHost(target_p); |
1098 |
+ |
|
1099 |
+ |
if (MyClient(target_p)) |
1100 |
+ |
clear_ban_cache_client(target_p); |
1101 |
+ |
} |
1102 |
+ |
|
1103 |
|
/* user_welcome() |
1104 |
|
* |
1105 |
|
* inputs - client pointer to client to welcome |
1349 |
|
add_isupport("DEAF", "D", -1); |
1350 |
|
add_isupport("KICKLEN", NULL, KICKLEN); |
1351 |
|
add_isupport("MODES", NULL, MAXMODEPARAMS); |
1342 |
– |
add_isupport("NICKLEN", NULL, NICKLEN); |
1352 |
|
#ifdef HALFOPS |
1353 |
|
add_isupport("PREFIX", "(ohv)@%+", -1); |
1354 |
|
add_isupport("STATUSMSG", "@%+", -1); |
1356 |
|
add_isupport("PREFIX", "(ov)@+", -1); |
1357 |
|
add_isupport("STATUSMSG", "@+", -1); |
1358 |
|
#endif |
1350 |
– |
add_isupport("TOPICLEN", NULL, TOPICLEN); |
1359 |
|
} |
1360 |
|
|
1361 |
|
/* |
1451 |
|
{ |
1452 |
|
struct Isupport *support = ptr->data; |
1453 |
|
|
1454 |
< |
p += (n = ircsprintf(p, "%s", support->name)); |
1454 |
> |
p += (n = sprintf(p, "%s", support->name)); |
1455 |
|
len += n; |
1456 |
|
|
1457 |
|
if (support->options != NULL) |
1458 |
|
{ |
1459 |
< |
p += (n = ircsprintf(p, "=%s", support->options)); |
1459 |
> |
p += (n = sprintf(p, "=%s", support->options)); |
1460 |
|
len += n; |
1461 |
|
} |
1462 |
|
|
1463 |
|
if (support->number > 0) |
1464 |
|
{ |
1465 |
< |
p += (n = ircsprintf(p, "=%d", support->number)); |
1465 |
> |
p += (n = sprintf(p, "=%d", support->number)); |
1466 |
|
len += n; |
1467 |
|
} |
1468 |
|
|