From 2034306b73665cb1fe00e00d50b8f213caf49506 Mon Sep 17 00:00:00 2001 From: Sunil Nimmagadda Date: Mon, 27 Nov 2017 08:36:00 +0000 Subject: Show correct command execution status by checking against update operation return value. Issue reported by 'Zelest' (Jesper Wallin). Suggestions and ok eric@ gilles@. --- usr.sbin/smtpd/lka.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'usr.sbin/smtpd/lka.c') 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 @@ -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; } -- cgit v1.2.3