summaryrefslogtreecommitdiff
path: root/usr.sbin
diff options
context:
space:
mode:
authorGilles Chehade <gilles@cvs.openbsd.org>2014-10-12 11:49:39 +0000
committerGilles Chehade <gilles@cvs.openbsd.org>2014-10-12 11:49:39 +0000
commitc3b2a120931e6132c1af935c9730d27678c7b4f9 (patch)
tree025b918f42cecb10274f0bf0b03c47caf658608b /usr.sbin
parent69a6547bf1d4c3e83e38cc976b5ff25af8c2c630 (diff)
local host is not "localhost", local host is env->sc_hostname
Diffstat (limited to 'usr.sbin')
-rw-r--r--usr.sbin/smtpd/smtp.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/usr.sbin/smtpd/smtp.c b/usr.sbin/smtpd/smtp.c
index 022bb996d31..cfa094d7918 100644
--- a/usr.sbin/smtpd/smtp.c
+++ b/usr.sbin/smtpd/smtp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: smtp.c,v 1.139 2014/07/08 14:38:17 eric Exp $ */
+/* $OpenBSD: smtp.c,v 1.140 2014/10/12 11:49:38 gilles Exp $ */
/*
* Copyright (c) 2008 Gilles Chehade <gilles@poolp.org>
@@ -222,7 +222,7 @@ smtp_enqueue(uid_t *euid)
(void)strlcpy(listener->tag, "local", sizeof(listener->tag));
listener->ss.ss_family = AF_LOCAL;
listener->ss.ss_len = sizeof(struct sockaddr *);
- (void)strlcpy(listener->hostname, "localhost",
+ (void)strlcpy(listener->hostname, env->sc_hostname,
sizeof(listener->hostname));
}
@@ -238,9 +238,9 @@ smtp_enqueue(uid_t *euid)
if (socketpair(AF_UNIX, SOCK_STREAM, PF_UNSPEC, fd))
fatal("socketpair");
- hostname = "localhost";
+ hostname = env->sc_hostname;
if (euid) {
- (void)snprintf(buf, sizeof(buf), "%d@localhost", *euid);
+ (void)snprintf(buf, sizeof(buf), "%d@%s", *euid, hostname);
hostname = buf;
}