}
gl->flags |= GLINE_REALNAME;
- gl->user = getsstring(mask + 2, REALLEN);
+
+ if (strcmp(mask + 2, "*") != 0)
+ gl->user = getsstring(mask + 2, REALLEN);
+
return gl;
}
strncpy(dupmask, mask, sizeof(dupmask));
canon_userhost(dupmask, &nick, &user, &host, "*");
- /* Make sure it's not too long */
- if (strlen(nick) + strlen(user) + strlen(host) > NICKLEN + USERLEN + HOSTLEN) {
- freegline(gl);
- return NULL;
- }
-
if (ipmask_parse(host, &gl->ip, &gl->bits))
gl->flags |= GLINE_IPMASK;
else
count++;
if (count >= 8) {
- controlwall(NO_OPER, NL_GLINES, "Warning: Parsed invalid IPv6 G-Line: %s", mask);
+ controlwall(NO_OPER, NL_GLINES_AUTO, "Warning: Parsed invalid IPv6 G-Line: %s", mask);
freegline(gl);
return NULL;
}
static char mask[512]; /* check */
if (gl->flags & GLINE_REALNAME) {
- if (gl->user)
- snprintf(mask, sizeof(mask), "$R%s", gl->user->content);
- else
- strncpy(mask, "$R*", sizeof(mask));
-
+ snprintf(mask, sizeof(mask), "$R%s", (gl->user) ? gl->user->content : "*");
return mask;
}