to match explicitly.
+Wed Jun 26 10:38:11 EEST 2002 Pekka Riikonen <priikone@silcnet.org>
+
+ * Fixed a bug in silc_string_regexify which did not add '^'
+ at the start of each string, and thus the matching was
+ not explicit. For example ban list iikone@*!*@* would
+ match also "priikone", which is wrong, it would have to be
+ *iikone@*!*@* to match also "priikone". Affected
+ file lib/silcutil/unix/silcunixutil.c.
+
Tue Jun 25 18:47:39 EEST 2002 Pekka Riikonen <priikone@silcnet.org>
* Enable all local server connections before updating client
o Testing
+ o Close unconfigured client connections in rehash.
+
o Add a timeout to handling incoming JOIN commands. It should be
enforced that JOIN command is executed only once in a second or two
seconds. Now it is possible to accept n incoming JOIN commands
len = strlen(string);
count = 4;
- for (i = 0; i < len; i++)
+ for (i = 0; i < len; i++) {
if (string[i] == '*' || string[i] == '?')
- count++;
+ count++; /* Will add '.' */
+ if (string[i] == ',')
+ count += 2; /* Will add '|' and '^' */
+ }
- regex = silc_calloc(len + count, sizeof(*regex));
+ regex = silc_calloc(len + count + 1, sizeof(*regex));
count = 0;
- regex[count] = '(';
- count++;
+ regex[count++] = '(';
+ regex[count++] = '^';
for (i = 0; i < len; i++) {
if (string[i] == '*' || string[i] == '?') {
regex[count] = '.';
count++;
} else if (string[i] == ',') {
- if (i + 1 == len)
+ if (i + 2 == len)
continue;
- regex[count] = '|';
- count++;
+ regex[count++] = '|';
+ regex[count++] = '^';
continue;
}
- regex[count] = string[i];
- count++;
+ regex[count++] = string[i];
}
regex[count++] = ')';