projects
/
ircu2.10.12-pk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added gnutls backend and moved backend code into new files
[ircu2.10.12-pk.git]
/
ircd
/
gline.c
diff --git
a/ircd/gline.c
b/ircd/gline.c
index d25dbfaeab9a630bb2c4ef0e11093a081c85a526..9c3d2970e24df6a078e4c976cb94c64a2b7d8d36 100644
(file)
--- a/
ircd/gline.c
+++ b/
ircd/gline.c
@@
-24,6
+24,7
@@
#include "config.h"
#include "gline.h"
#include "config.h"
#include "gline.h"
+#include "channel.h"
#include "client.h"
#include "ircd.h"
#include "ircd_alloc.h"
#include "client.h"
#include "ircd.h"
#include "ircd_alloc.h"
@@
-371,7
+372,7
@@
count_users(char *mask, int flags)
continue;
ircd_snprintf(0, namebuf, sizeof(namebuf), "%s@%s",
continue;
ircd_snprintf(0, namebuf, sizeof(namebuf), "%s@%s",
- cli_user(acptr)->username, cli_user(acptr)->host);
+ cli_user(acptr)->username, cli_user(acptr)->
real
host);
ircd_snprintf(0, ipbuf, sizeof(ipbuf), "%s@%s", cli_user(acptr)->username,
ircd_ntoa(&cli_ip(acptr)));
ircd_snprintf(0, ipbuf, sizeof(ipbuf), "%s@%s", cli_user(acptr)->username,
ircd_ntoa(&cli_ip(acptr)));
@@
-448,13
+449,21
@@
gline_add(struct Client *cptr, struct Client *sptr, char *userhost,
if (*userhost == '#' || *userhost == '&') {
if ((flags & GLINE_LOCAL) && !HasPriv(sptr, PRIV_LOCAL_BADCHAN))
return send_reply(sptr, ERR_NOPRIVILEGES);
if (*userhost == '#' || *userhost == '&') {
if ((flags & GLINE_LOCAL) && !HasPriv(sptr, PRIV_LOCAL_BADCHAN))
return send_reply(sptr, ERR_NOPRIVILEGES);
+ /* Allow maximum channel name length, plus margin for wildcards. */
+ if (strlen(userhost+1) >= CHANNELLEN + 6)
+ return send_reply(sptr, ERR_LONGMASK);
flags |= GLINE_BADCHAN;
user = userhost;
host = NULL;
} else if (*userhost == '$') {
switch (userhost[1]) {
flags |= GLINE_BADCHAN;
user = userhost;
host = NULL;
} else if (*userhost == '$') {
switch (userhost[1]) {
- case 'R': flags |= GLINE_REALNAME; break;
+ case 'R':
+ /* Allow REALLEN for the real name, plus margin for wildcards. */
+ if (strlen(userhost+2) >= REALLEN + 6)
+ return send_reply(sptr, ERR_LONGMASK);
+ flags |= GLINE_REALNAME;
+ break;
default:
/* uh, what to do here? */
/* The answer, my dear Watson, is we throw a protocol_violation()
default:
/* uh, what to do here? */
/* The answer, my dear Watson, is we throw a protocol_violation()