summaryrefslogtreecommitdiffstats
path: root/ssh-add.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2024-09-06 04:30:44 +0200
committerDamien Miller <djm@mindrot.org>2024-09-06 04:31:19 +0200
commita8ad7a2952111c6ce32949a775df94286550af6b (patch)
tree21faa3d72559a7a5121b8287a2f8dab31bec5a68 /ssh-add.c
parentupstream: be more strict in parsing key type names. Only allow (diff)
downloadopenssh-a8ad7a2952111c6ce32949a775df94286550af6b.tar.xz
openssh-a8ad7a2952111c6ce32949a775df94286550af6b.zip
upstream: make parsing user@host consistently look for the last '@' in
the string rather than the first. This makes it possible to use usernames that contain '@' characters. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Prompted by Max Zettlmeißl; feedback/ok millert@ OpenBSD-Commit-ID: 0b16eec246cda15469ebdcf3b1e2479810e394c5
Diffstat (limited to '')
-rw-r--r--ssh-add.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ssh-add.c b/ssh-add.c
index e532d5ce1..0035cb84a 100644
--- a/ssh-add.c
+++ b/ssh-add.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ssh-add.c,v 1.172 2024/01/11 01:45:36 djm Exp $ */
+/* $OpenBSD: ssh-add.c,v 1.173 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
@@ -698,7 +698,7 @@ parse_dest_constraint_hop(const char *s, struct dest_constraint_hop *dch,
memset(dch, '\0', sizeof(*dch));
os = xstrdup(s);
- if ((host = strchr(os, '@')) == NULL)
+ if ((host = strrchr(os, '@')) == NULL)
host = os;
else {
*host++ = '\0';