diff options
author | millert <millert@openbsd.org> | 2020-09-14 18:32:11 +0000 |
---|---|---|
committer | Gilles Chehade <gilles@poolp.org> | 2020-11-20 11:13:21 +0100 |
commit | 8bbac06d82c9599538efe7fb03ec59fdb1c739c6 (patch) | |
tree | fdc21f77aef57dbc100ec9ee9f919d8cdac19075 | |
parent | Document "pki" option for relay delivery too; from Nick Gasson (diff) | |
download | OpenSMTPD-8bbac06d82c9599538efe7fb03ec59fdb1c739c6.tar.xz OpenSMTPD-8bbac06d82c9599538efe7fb03ec59fdb1c739c6.zip |
Fix handling of user names containing '@' symbols.
It is possible to have a user name of the form foo@bar in the URL.
When splitting user name from host name, split at the last '@', not
the first one. From Josh Rickmar
-rw-r--r-- | usr.sbin/smtpd/smtpc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/smtpd/smtpc.c b/usr.sbin/smtpd/smtpc.c index 59479703..c0f5d992 100644 --- a/usr.sbin/smtpd/smtpc.c +++ b/usr.sbin/smtpd/smtpc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smtpc.c,v 1.10 2019/09/21 09:04:08 semarie Exp $ */ +/* $OpenBSD: smtpc.c,v 1.11 2020/09/14 18:32:11 millert Exp $ */ /* * Copyright (c) 2018 Eric Faurot <eric@openbsd.org> @@ -193,7 +193,7 @@ parse_server(char *server) *p = '\0'; p += 3; /* check for credentials */ - c = strchr(p, '@'); + c = strrchr(p, '@'); if (c) { creds = p; *c = '\0'; |