summaryrefslogtreecommitdiffstats
path: root/match.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-27 08:42:40 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-09-27 08:42:40 +0000
commit54880067830dddd9611bc8c6145a396f208b76ca (patch)
tree1d40eb981a691b14df7881fca6408ccf42fa1b9f /match.c
parentReleasing progress-linux version 1:9.8p1-3~progress7.99u1. (diff)
downloadopenssh-54880067830dddd9611bc8c6145a396f208b76ca.tar.xz
openssh-54880067830dddd9611bc8c6145a396f208b76ca.zip
Merging upstream version 1:9.9p1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'match.c')
-rw-r--r--match.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/match.c b/match.c
index d6af256..3ef5369 100644
--- a/match.c
+++ b/match.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: match.c,v 1.44 2023/04/06 03:19:32 djm Exp $ */
+/* $OpenBSD: match.c,v 1.45 2024/09/06 02:30:44 djm Exp $ */
/*
* Author: Tatu Ylonen <ylo@cs.hut.fi>
* Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -241,7 +241,7 @@ match_user(const char *user, const char *host, const char *ipaddr,
/* test mode */
if (user == NULL && host == NULL && ipaddr == NULL) {
- if ((p = strchr(pattern, '@')) != NULL &&
+ if ((p = strrchr(pattern, '@')) != NULL &&
match_host_and_ip(NULL, NULL, p + 1) < 0)
return -1;
return 0;
@@ -250,11 +250,11 @@ match_user(const char *user, const char *host, const char *ipaddr,
if (user == NULL)
return 0; /* shouldn't happen */
- if ((p = strchr(pattern, '@')) == NULL)
+ if (strrchr(pattern, '@') == NULL)
return match_pattern(user, pattern);
pat = xstrdup(pattern);
- p = strchr(pat, '@');
+ p = strrchr(pat, '@');
*p++ = '\0';
if ((ret = match_pattern(user, pat)) == 1)