From ace804cafcf33d9452774666bb47840ac1899bd0 Mon Sep 17 00:00:00 2001 From: Gilles Chehade Date: Thu, 24 May 2018 11:38:25 +0000 Subject: switch smtpd to new grammar ok eric@ --- usr.sbin/smtpd/table.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'usr.sbin/smtpd/table.c') diff --git a/usr.sbin/smtpd/table.c b/usr.sbin/smtpd/table.c index afb71788feb..ca4318e7bb6 100644 --- a/usr.sbin/smtpd/table.c +++ b/usr.sbin/smtpd/table.c @@ -1,4 +1,4 @@ -/* $OpenBSD: table.c,v 1.24 2017/05/01 09:29:07 gilles Exp $ */ +/* $OpenBSD: table.c,v 1.25 2018/05/24 11:38:24 gilles Exp $ */ /* * Copyright (c) 2013 Eric Faurot @@ -621,6 +621,11 @@ table_parse_lookup(enum table_service service, const char *key, return (-1); return (1); + case K_RELAYHOST: + if (!text_to_relayhost(&lk->relayhost, line)) + return (-1); + return (1); + default: return (-1); } @@ -693,6 +698,13 @@ table_dump_lookup(enum table_service s, union lookup *lk) goto err; break; + case K_RELAYHOST: + ret = snprintf(buf, sizeof(buf), "%s", + relayhost_to_text(&lk->relayhost)); + if (ret == -1 || (size_t)ret >= sizeof (buf)) + goto err; + break; + default: (void)strlcpy(buf, "???", sizeof(buf)); break; -- cgit v1.2.3