/*
* ngIRCd -- The Next Generation IRC Daemon
- * Copyright (c)2001-2011 Alexander Barton (alex@barton.de) and Contributors.
+ * Copyright (c)2001-2014 Alexander Barton (alex@barton.de) and Contributors.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* Management of IRC lists: ban, invite, etc.
*/
-#include "imp.h"
#include <assert.h>
+#include <stdlib.h>
+#include <string.h>
+#include <strings.h>
+#include <time.h>
-#include "defines.h"
#include "conn.h"
-#include "channel.h"
#include "log.h"
#include "match.h"
-#include "messages.h"
-#include "irc-write.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include <strings.h>
-#include "exp.h"
#include "lists.h"
struct list_elem {
if (!at && !excl) {
/* Neither "!" nor "@" found: use string as nickname */
- strlcpy(mask, Pattern, len);
+ strlcpy(mask, Pattern, len - 5);
strlcat(mask, "!*@*", len);
} else if (!at && excl) {
/* Domain part is missing */
- strlcpy(mask, Pattern, len);
+ strlcpy(mask, Pattern, len - 3);
strlcat(mask, "@*", len);
} else if (at && !excl) {
/* User name is missing */
*at = '\0'; at++;
- strlcpy(mask, Pattern, len);
+ strlcpy(mask, Pattern, len - 5);
strlcat(mask, "!*@", len);
strlcat(mask, at, len);
+ at--; *at = '@';
} else {
/* All parts (nick, user and domain name) are given */
strlcpy(mask, Pattern, len);
while (e) {
next = e->next;
- if (Match(e->mask, Client_MaskCloaked(Client))) {
+ if (MatchCaseInsensitive(e->mask, Client_MaskCloaked(Client))) {
if (len && e->reason)
strlcpy(reason, e->reason, len);
if (e->valid_until == 1) {