This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Undernet IRC Server Source Code.".
The branch, u2_10_12_branch has been updated
via de343d67ff8e67606d6a638222316f6059a6849a (commit)
via 44176378f04b5fcdb939be0da3b0bfdefb3a83bc (commit)
via 85f4db01a38f90453815909d461ec63c76e5efbc (commit)
via 7a36588ae6bbb9536abbfeec17634d588c794142 (commit)
via 06423d19b2c20db56253061a3a35739ffa4f6369 (commit)
from 22c02d118eea034bcefea11f416fe1adec8bfd23 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit de343d67ff8e67606d6a638222316f6059a6849a
Author: Michael Poole <[email protected]>
Date: Mon Aug 30 22:08:06 2021 -0400
Fix some corner cases in match()
Along with previous revert, fixes #gh-12
diff --git a/ircd/match.c b/ircd/match.c
index bab1faa4..cb3db430 100644
--- a/ircd/match.c
+++ b/ircd/match.c
@@ -227,12 +227,14 @@ int match(const char *mask, const char *name)
if (!*m)
return 1;
for (n_tmp = n; *n && *n != *m; n++) ;
+ if (!*n || *n++ != *m++)
+ return 1;
} else {
m_tmp = m;
for (n_tmp = n; *n && ToLower(*n) != ToLower(*m); n++) ;
}
}
- /* and fall through */
+ continue;
default:
if (!*n)
return *m != '\0';
diff --git a/ircd/test/ircd_match_t.c b/ircd/test/ircd_match_t.c
index 4f907969..5f724615 100644
--- a/ircd/test/ircd_match_t.c
+++ b/ircd/test/ircd_match_t.c
@@ -53,6 +53,12 @@ const struct match_test match_tests[] = {
{ "\\?",
"?\0",
"a\0" },
+ { "*\\*",
+ "foo*\0",
+ "bar\\\0" },
+ { "???\\?",
+ "you?\0",
+ "no? \0" },
{ "*\\\\[*!~*",
"har\\[dy!~boy\0",
"dark\\s|de!pimp\0joe\\[mama\0" },
commit 44176378f04b5fcdb939be0da3b0bfdefb3a83bc
Author: Michael Poole <[email protected]>
Date: Mon Aug 30 21:43:12 2021 -0400
Revert "match(): Only treat \ as an escape when it is before * or ?."
This reverts commit aaa00fb6edcf84b99f8ed210408103630e1f4c39.
diff --git a/ircd/match.c b/ircd/match.c
index 99e06efe..bab1faa4 100644
--- a/ircd/match.c
+++ b/ircd/match.c
@@ -205,9 +205,11 @@ int match(const char *mask, const char *name)
return 1;
break;
case '\\':
- if ((m[1] == '*') || (m[1] == '?'))
- m++;
- goto normal_character;
+ m++;
+ /* allow escaping to force capitalization */
+ if (*m++ != *n++)
+ goto backtrack;
+ break;
case '*': case '?':
for (star_p = 0; ; m++) {
if (*m == '*')
@@ -220,12 +222,18 @@ int match(const char *mask, const char *name)
if (star_p) {
if (!*m)
return 0;
- m_tmp = m;
- for (n_tmp = n; *n && ToLower(*n) != ToLower(*m); n++) ;
+ else if (*m == '\\') {
+ m_tmp = ++m;
+ if (!*m)
+ return 1;
+ for (n_tmp = n; *n && *n != *m; n++) ;
+ } else {
+ m_tmp = m;
+ for (n_tmp = n; *n && ToLower(*n) != ToLower(*m); n++) ;
+ }
}
/* and fall through */
default:
- normal_character:
if (!*n)
return *m != '\0';
if (ToLower(*m) != ToLower(*n))
diff --git a/ircd/test/ircd_match_t.c b/ircd/test/ircd_match_t.c
index a446803a..4f907969 100644
--- a/ircd/test/ircd_match_t.c
+++ b/ircd/test/ircd_match_t.c
@@ -53,7 +53,7 @@ const struct match_test match_tests[] = {
{ "\\?",
"?\0",
"a\0" },
- { "*\\[*!~*",
+ { "*\\\\[*!~*",
"har\\[dy!~boy\0",
"dark\\s|de!pimp\0joe\\[mama\0" },
{ NULL, NULL, NULL }
commit 85f4db01a38f90453815909d461ec63c76e5efbc
Author: Michael Poole <[email protected]>
Date: Thu Apr 1 11:26:37 2021 -0400
check_auth_finished: Trust webirc's username
diff --git a/ircd/s_auth.c b/ircd/s_auth.c
index 84f4720c..5bb58f36 100644
--- a/ircd/s_auth.c
+++ b/ircd/s_auth.c
@@ -448,6 +448,10 @@ static int check_auth_finished(struct AuthRequest *auth,
int bitclr)
{
clean_username(user->username, cli_username(sptr));
}
+ else if (cli_wline(sptr)) /* trust USER if we trusted WEBIRC */
+ {
+ ircd_strncpy(cli_username(sptr), user->username, USERLEN);
+ }
else if (DoIdentLookups)
{
/* Prepend ~ to user->username. */
commit 7a36588ae6bbb9536abbfeec17634d588c794142
Author: Michael Poole <[email protected]>
Date: Thu Apr 1 11:17:22 2021 -0400
auth_spoof_user: Avoid sending "<id> u " to iauth
From WEBIRC, username == NULL, and so cli_username(sptr)
might be empty.
diff --git a/ircd/s_auth.c b/ircd/s_auth.c
index 85b91dcd..84f4720c 100644
--- a/ircd/s_auth.c
+++ b/ircd/s_auth.c
@@ -1330,7 +1330,7 @@ int auth_spoof_user(struct AuthRequest *auth, const char
*username, const char *
}
start_iauth_query(auth);
- if (IAuthHas(iauth, IAUTH_UNDERNET))
+ if (username && IAuthHas(iauth, IAUTH_UNDERNET))
sendto_iauth(sptr, "u %s", cli_username(sptr));
return check_auth_finished(auth, 0);
commit 06423d19b2c20db56253061a3a35739ffa4f6369
Author: Michael Poole <[email protected]>
Date: Sun Feb 21 15:50:49 2021 -0500
ircd_match_t: Run all globbing tests
diff --git a/ircd/test/ircd_match_t.c b/ircd/test/ircd_match_t.c
index 8eb7cdf9..a446803a 100644
--- a/ircd/test/ircd_match_t.c
+++ b/ircd/test/ircd_match_t.c
@@ -122,11 +122,13 @@ int test_match(const char glob[], const char name[])
return match(test_glob, test_name);
}
-void do_match_test(const struct match_test *test)
+int do_match_test(const struct match_test *test)
{
const char *candidate;
unsigned int matched, not_matched;
- int res;
+ int res, any_failed;
+
+ any_failed = 0;
for (candidate = test->should_match, matched = 0;
*candidate;
@@ -134,7 +136,7 @@ void do_match_test(const struct match_test *test)
res = test_match(test->glob, candidate);
if (res != 0) {
fprintf(stderr, "\"%s\" failed to match \"%s\".\n", test->glob,
candidate);
- assert(0);
+ any_failed = 1;
}
}
@@ -144,18 +146,27 @@ void do_match_test(const struct match_test *test)
res = test_match(test->glob, candidate);
if (res == 0) {
fprintf(stderr, "\"%s\" incorrectly matched \"%s\".\n", test->glob,
candidate);
- assert(0);
+ any_failed = 1;
}
}
- printf("Passed: %s (%u matches, %u non-matches)\n",
- test->glob, matched, not_matched);
+ if (!any_failed) {
+ printf("Passed: %s (%u matches, %u non-matches)\n",
+ test->glob, matched, not_matched);
+ }
+
+ return any_failed;
}
int main(int argc, char *argv[])
{
const struct match_test *match;
+ int any_failed;
+
+ any_failed = 0;
+
for (match = match_tests; match->glob; ++match)
- do_match_test(match);
- return 0;
+ any_failed = do_match_test(match) || any_failed;
+
+ return any_failed ? EXIT_FAILURE : EXIT_SUCCESS;
}
-----------------------------------------------------------------------
Summary of changes:
ircd/match.c | 24 +++++++++++++++++-------
ircd/s_auth.c | 6 +++++-
ircd/test/ircd_match_t.c | 35 ++++++++++++++++++++++++++---------
3 files changed, 48 insertions(+), 17 deletions(-)
hooks/post-receive
--
Undernet IRC Server Source Code.
--
You received this message because you are subscribed to the Google Groups
"Undernet Mailing List - [email protected]" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].