summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjacekm <jacekm@openbsd.org>2009-01-28 18:10:19 +0000
committerjacekm <jacekm@openbsd.org>2009-01-28 18:10:19 +0000
commit6481f2d940162fd83ece1efb8c339824b787caf1 (patch)
tree00ae1afb5e2e63d80d9e4b934acd5b103414ec90
parentAllow to specify ike and flow explicitly without peer. The any (diff)
downloadwireguard-openbsd-6481f2d940162fd83ece1efb8c339824b787caf1.tar.xz
wireguard-openbsd-6481f2d940162fd83ece1efb8c339824b787caf1.zip
reuse recipient_to_path; ok gilles@
-rw-r--r--usr.sbin/smtpd/smtp_session.c31
1 files changed, 2 insertions, 29 deletions
diff --git a/usr.sbin/smtpd/smtp_session.c b/usr.sbin/smtpd/smtp_session.c
index 0298da84b77..5055386dec9 100644
--- a/usr.sbin/smtpd/smtp_session.c
+++ b/usr.sbin/smtpd/smtp_session.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: smtp_session.c,v 1.42 2009/01/28 17:29:11 jacekm Exp $ */
+/* $OpenBSD: smtp_session.c,v 1.43 2009/01/28 18:10:19 jacekm Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@openbsd.org>
@@ -966,40 +966,13 @@ int
session_set_path(struct path *path, char *line)
{
size_t len;
- char *username;
- char *hostname;
len = strlen(line);
if (*line != '<' || line[len - 1] != '>')
return 0;
line[len - 1] = '\0';
- username = line + 1;
- hostname = strchr(username, '@');
-
- if (username[0] == '\0') {
- *path->user = '\0';
- *path->domain = '\0';
- return 1;
- }
-
- if (hostname == NULL) {
- if (strcasecmp(username, "postmaster") != 0)
- return 0;
- hostname = "localhost";
- } else {
- *hostname++ = '\0';
- }
-
- if (strlcpy(path->user, username, sizeof(path->user))
- >= MAX_LOCALPART_SIZE)
- return 0;
-
- if (strlcpy(path->domain, hostname, sizeof(path->domain))
- >= MAX_DOMAINPART_SIZE)
- return 0;
-
- return 1;
+ return recipient_to_path(path, line + 1);
}
void