summaryrefslogtreecommitdiff
path: root/usr.sbin/smtpd/lka.c
diff options
context:
space:
mode:
authorSunil Nimmagadda <sunil@cvs.openbsd.org>2017-11-27 08:36:00 +0000
committerSunil Nimmagadda <sunil@cvs.openbsd.org>2017-11-27 08:36:00 +0000
commit2034306b73665cb1fe00e00d50b8f213caf49506 (patch)
tree5616c67d7bc83ff952ea0dccbfef719877a392db /usr.sbin/smtpd/lka.c
parentd0eb47a2f6a6ea75161637f9dfd8bd93ec5d2bad (diff)
Show correct command execution status by checking against update
operation return value. Issue reported by 'Zelest' (Jesper Wallin). Suggestions and ok eric@ gilles@.
Diffstat (limited to 'usr.sbin/smtpd/lka.c')
-rw-r--r--usr.sbin/smtpd/lka.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/usr.sbin/smtpd/lka.c b/usr.sbin/smtpd/lka.c
index e09be22788a..b73bd0131e6 100644
--- a/usr.sbin/smtpd/lka.c
+++ b/usr.sbin/smtpd/lka.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lka.c,v 1.200 2017/11/21 12:20:34 eric Exp $ */
+/* $OpenBSD: lka.c,v 1.201 2017/11/27 08:35:59 sunil Exp $ */
/*
* Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org>
@@ -345,13 +345,17 @@ lka_imsg(struct mproc *p, struct imsg *imsg)
return;
case IMSG_CTL_UPDATE_TABLE:
+ ret = 0;
table = table_find(imsg->data, NULL);
if (table == NULL) {
log_warnx("warn: Lookup table not found: "
"\"%s\"", (char *)imsg->data);
- return;
- }
- table_update(table);
+ } else
+ ret = table_update(table);
+
+ m_compose(p_control,
+ (ret == 1) ? IMSG_CTL_OK : IMSG_CTL_FAIL,
+ imsg->hdr.peerid, 0, -1, NULL, 0);
return;
}