use RELAY_* flags where appropriate
authoreric <eric@openbsd.org>
Thu, 7 Jun 2018 11:31:51 +0000 (11:31 +0000)
committereric <eric@openbsd.org>
Thu, 7 Jun 2018 11:31:51 +0000 (11:31 +0000)
ok gilles@

usr.sbin/smtpd/mta.c
usr.sbin/smtpd/mta_session.c
usr.sbin/smtpd/to.c

index e30fe1d..fe82a38 100644 (file)
@@ -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 <pyr@openbsd.org>
@@ -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);
index 5698022..24d0a47 100644 (file)
@@ -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 <pyr@openbsd.org>
@@ -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);
index 7f103a8..e1d399d 100644 (file)
@@ -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 <jacekm@dobremiasto.net>
@@ -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;
 }