From 88981a9faac5275cd54ea5e9f3d682a426eaf8e7 Mon Sep 17 00:00:00 2001 From: eric Date: Thu, 7 Jun 2018 11:31:51 +0000 Subject: [PATCH] use RELAY_* flags where appropriate ok gilles@ --- usr.sbin/smtpd/mta.c | 4 ++-- usr.sbin/smtpd/mta_session.c | 4 ++-- usr.sbin/smtpd/to.c | 26 +++++++++++++------------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/usr.sbin/smtpd/mta.c b/usr.sbin/smtpd/mta.c index e30fe1d33be..fe82a38e217 100644 --- a/usr.sbin/smtpd/mta.c +++ b/usr.sbin/smtpd/mta.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mta.c,v 1.218 2018/06/07 07:06:06 eric Exp $ */ +/* $OpenBSD: mta.c,v 1.219 2018/06/07 11:31:51 eric Exp $ */ /* * Copyright (c) 2008 Pierre-Yves Ritschard @@ -1735,7 +1735,7 @@ mta_relay(struct envelope *e, struct relayhost *relayh) if (dispatcher->u.remote.smarthost && dispatcher->u.remote.tls_noverify == 0) - key.flags |= F_TLS_VERIFY; + key.flags |= RELAY_TLS_VERIFY; if ((r = SPLAY_FIND(mta_relay_tree, &relays, &key)) == NULL) { r = xcalloc(1, sizeof *r); diff --git a/usr.sbin/smtpd/mta_session.c b/usr.sbin/smtpd/mta_session.c index 569802281d8..24d0a47c9cc 100644 --- a/usr.sbin/smtpd/mta_session.c +++ b/usr.sbin/smtpd/mta_session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mta_session.c,v 1.101 2018/06/04 21:46:56 gilles Exp $ */ +/* $OpenBSD: mta_session.c,v 1.102 2018/06/07 11:31:51 eric Exp $ */ /* * Copyright (c) 2008 Pierre-Yves Ritschard @@ -377,7 +377,7 @@ mta_session_imsg(struct mproc *p, struct imsg *imsg) if (resp_ca_vrfy->status == CA_OK) s->flags |= MTA_VERIFIED; - else if (s->relay->flags & F_TLS_VERIFY) { + else if (s->relay->flags & RELAY_TLS_VERIFY) { errno = 0; mta_error(s, "SSL certificate check failed"); mta_free(s); diff --git a/usr.sbin/smtpd/to.c b/usr.sbin/smtpd/to.c index 7f103a8ce21..e1d399d74f2 100644 --- a/usr.sbin/smtpd/to.c +++ b/usr.sbin/smtpd/to.c @@ -1,4 +1,4 @@ -/* $OpenBSD: to.c,v 1.30 2018/05/29 21:05:52 eric Exp $ */ +/* $OpenBSD: to.c,v 1.31 2018/06/07 11:31:51 eric Exp $ */ /* * Copyright (c) 2009 Jacek Masiulaniec @@ -311,14 +311,14 @@ text_to_relayhost(struct relayhost *relay, const char *s) * schema index needs to be updated later in this function. */ { "smtp://", 0 }, - { "lmtp://", F_LMTP }, - { "smtp+tls://", F_TLS_OPTIONAL }, - { "smtps://", F_SMTPS }, - { "tls://", F_STARTTLS }, - { "smtps+auth://", F_SMTPS|F_AUTH }, - { "tls+auth://", F_STARTTLS|F_AUTH }, - { "secure://", F_SMTPS|F_STARTTLS }, - { "secure+auth://", F_SMTPS|F_STARTTLS|F_AUTH } + { "lmtp://", RELAY_LMTP }, + { "smtp+tls://", RELAY_TLS_OPTIONAL }, + { "smtps://", RELAY_SMTPS }, + { "tls://", RELAY_STARTTLS }, + { "smtps+auth://", RELAY_SMTPS|RELAY_AUTH }, + { "tls+auth://", RELAY_STARTTLS|RELAY_AUTH }, + { "secure://", RELAY_SMTPS|RELAY_STARTTLS }, + { "secure+auth://", RELAY_SMTPS|RELAY_STARTTLS|RELAY_AUTH } }; const char *errstr = NULL; char *p, *q; @@ -351,7 +351,7 @@ text_to_relayhost(struct relayhost *relay, const char *s) relay->flags = schemas[i].flags; /* need to specify an explicit port for LMTP */ - if (relay->flags & F_LMTP) + if (relay->flags & RELAY_LMTP) relay->port = 0; /* first, we extract the label if any */ @@ -395,11 +395,11 @@ text_to_relayhost(struct relayhost *relay, const char *s) if (!valid_domainpart(relay->hostname)) return 0; - if ((relay->flags & F_LMTP) && (relay->port == 0)) + if ((relay->flags & RELAY_LMTP) && (relay->port == 0)) return 0; - if (relay->authlabel[0] == '\0' && relay->flags & F_AUTH) + if (relay->authlabel[0] == '\0' && relay->flags & RELAY_AUTH) return 0; - if (relay->authlabel[0] != '\0' && !(relay->flags & F_AUTH)) + if (relay->authlabel[0] != '\0' && !(relay->flags & RELAY_AUTH)) return 0; return 1; } -- 2.20.1