From b6323c752c9eb254c2330f369479cf039ed54c05 Mon Sep 17 00:00:00 2001 From: Jeremy Harris Date: Sun, 16 Jul 2017 17:21:35 +0100 Subject: [PATCH 1/1] Tidying --- src/Makefile | 3 +-- src/exim_monitor/em_queue.c | 14 +++++++++----- src/src/verify.c | 14 +++++++------- 3 files changed, 17 insertions(+), 14 deletions(-) diff --git a/src/Makefile b/src/Makefile index 2a100bbdd..b262a7b53 100644 --- a/src/Makefile +++ b/src/Makefile @@ -105,11 +105,10 @@ cscope.files: FRC echo "-q" > $@ echo "-p3" >> $@ find src Local OS exim_monitor -name "*.[cshyl]" -print \ - -o -name "os.h*" -print \ + -o -name "os.[ch]*" -print \ -o -name "*akefile*" -print \ -o -name config.h.defaults -print \ -o -name EDITME -print >> $@ - ls OS/* >> $@ FRC: diff --git a/src/exim_monitor/em_queue.c b/src/exim_monitor/em_queue.c index 4bdc57ab9..cb284eb48 100644 --- a/src/exim_monitor/em_queue.c +++ b/src/exim_monitor/em_queue.c @@ -63,7 +63,8 @@ if it is dest_remove, remove if present and return NULL. The address is lowercased to start with, unless it begins with "*", which it does for error messages. */ -dest_item *find_dest(queue_item *q, uschar *name, int action, BOOL caseless) +dest_item * +find_dest(queue_item *q, uschar *name, int action, BOOL caseless) { dest_item *dd; dest_item **d = &(q->destinations); @@ -108,7 +109,8 @@ return dd; * Clean up a dead queue item * *************************************************/ -static void clean_up(queue_item *p) +static void +clean_up(queue_item *p) { dest_item *dd = p->destinations; while (dd != NULL) @@ -149,7 +151,8 @@ return node; * Set up new queue item * *************************************************/ -static queue_item *set_up(uschar *name, int dir_char) +static queue_item * +set_up(uschar *name, int dir_char) { int i, rc, save_errno; struct stat statdata; @@ -162,7 +165,7 @@ uschar buffer[256]; q->next = q->prev = NULL; q->destinations = NULL; -Ustrcpy(q->name, name); +Ustrncpy(q->name, name, sizeof(q->name)); q->seen = TRUE; q->frozen = FALSE; q->dir_char = dir_char; @@ -331,7 +334,8 @@ while (p != NULL) -queue_item *find_queue(uschar *name, int action, int dir_char) +queue_item * +find_queue(uschar *name, int action, int dir_char) { int first = 0; int last = queue_index_size - 1; diff --git a/src/src/verify.c b/src/src/verify.c index 6c71d7feb..4f7d9380d 100644 --- a/src/src/verify.c +++ b/src/src/verify.c @@ -68,9 +68,7 @@ int length, expire; time_t now; dbdata_callout_cache *cache_record; -cache_record = dbfn_read_with_length(dbm_file, key, &length); - -if (cache_record == NULL) +if (!(cache_record = dbfn_read_with_length(dbm_file, key, &length))) { HDEBUG(D_verify) debug_printf("callout cache: no %s record found for %s\n", type, key); return NULL; @@ -797,12 +795,12 @@ tls_retry_connection: if (smtp_write_mail_and_rcpt_cmds(&sx, &yield) == 0) switch(addr->transport_return) { - case PENDING_OK: + case PENDING_OK: /* random was accepted, unfortunately */ new_domain_record.random_result = ccache_accept; - yield = OK; /* Only usable result we can return */ + yield = OK; /* Only usable verify result we can return */ done = TRUE; goto no_conn; - case FAIL: /* the preferred result */ + case FAIL: /* rejected: the preferred result */ new_domain_record.random_result = ccache_reject; sx.avoid_option = 0; @@ -836,6 +834,8 @@ tls_retry_connection: sx.send_rset = TRUE; sx.completed_addr = FALSE; goto tls_retry_connection; + case DEFER: /* 4xx response to random */ + break; /* Just to be clear. ccache_unknown, !done. */ } /* Re-setup for main verify, or for the error message when failing */ @@ -993,7 +993,7 @@ no_conn: if (*sx.buffer == 0) Ustrcpy(sx.buffer, US"connection dropped"); /*XXX test here is ugly; seem to have a split of responsibility for - building this message. Need to reationalise. Where is it done + building this message. Need to rationalise. Where is it done before here, and when not? Not == 5xx resp to MAIL on main-verify */ -- 2.30.2