diff options
author | Joerg Jung <jung@cvs.openbsd.org> | 2015-12-28 22:08:31 +0000 |
---|---|---|
committer | Joerg Jung <jung@cvs.openbsd.org> | 2015-12-28 22:08:31 +0000 |
commit | 3e921c7dd8d131d23866c66897ecbc8d31ed8cfd (patch) | |
tree | 2eac5faa44ffaf675263cdaf9edc9253e1966c40 /usr.sbin | |
parent | 2b7e45a9f71e83195c6a0adf68237584f51e58a7 (diff) |
remove spaces after '!'
no binary change
ok millert
Diffstat (limited to 'usr.sbin')
31 files changed, 191 insertions, 191 deletions
diff --git a/usr.sbin/smtpd/aliases.c b/usr.sbin/smtpd/aliases.c index cb60d2cd150..29d2b0e5e6c 100644 --- a/usr.sbin/smtpd/aliases.c +++ b/usr.sbin/smtpd/aliases.c @@ -1,4 +1,4 @@ -/* $OpenBSD: aliases.c,v 1.68 2015/11/30 10:56:25 gilles Exp $ */ +/* $OpenBSD: aliases.c,v 1.69 2015/12/28 22:08:30 jung Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@poolp.org> @@ -108,9 +108,9 @@ aliases_virtual_get(struct expand *expand, const struct mailaddr *maddr) mapping = expand->rule->r_mapping; userbase = expand->rule->r_userbase; - if (! bsnprintf(user, sizeof(user), "%s", maddr->user)) + if (!bsnprintf(user, sizeof(user), "%s", maddr->user)) return 0; - if (! bsnprintf(domain, sizeof(domain), "%s", maddr->domain)) + if (!bsnprintf(domain, sizeof(domain), "%s", maddr->domain)) return 0; xlowercase(user, user, sizeof(user)); xlowercase(domain, domain, sizeof(domain)); @@ -118,7 +118,7 @@ aliases_virtual_get(struct expand *expand, const struct mailaddr *maddr) memset(tag, '\0', sizeof tag); pbuf = strchr(user, TAG_CHAR); if (pbuf) { - if (! bsnprintf(tag, sizeof(tag), "%s", pbuf + 1)) + if (!bsnprintf(tag, sizeof(tag), "%s", pbuf + 1)) return 0; xlowercase(tag, tag, sizeof(tag)); *pbuf = '\0'; @@ -126,7 +126,7 @@ aliases_virtual_get(struct expand *expand, const struct mailaddr *maddr) /* first, check if entry has a user-part tag */ if (tag[0]) { - if (! bsnprintf(buf, sizeof(buf), "%s+%s@%s", + if (!bsnprintf(buf, sizeof(buf), "%s+%s@%s", user, tag, domain)) return 0; ret = table_lookup(mapping, NULL, buf, K_ALIAS, &lk); @@ -137,7 +137,7 @@ aliases_virtual_get(struct expand *expand, const struct mailaddr *maddr) } /* then, check if entry exists without user-part tag */ - if (! bsnprintf(buf, sizeof(buf), "%s@%s", user, domain)) + if (!bsnprintf(buf, sizeof(buf), "%s@%s", user, domain)) return 0; ret = table_lookup(mapping, NULL, buf, K_ALIAS, &lk); if (ret < 0) @@ -147,7 +147,7 @@ aliases_virtual_get(struct expand *expand, const struct mailaddr *maddr) if (tag[0]) { /* Failed ? We lookup for username + user-part tag */ - if (! bsnprintf(buf, sizeof(buf), "%s+%s", user, tag)) + if (!bsnprintf(buf, sizeof(buf), "%s+%s", user, tag)) return 0; ret = table_lookup(mapping, NULL, buf, K_ALIAS, &lk); if (ret < 0) @@ -157,7 +157,7 @@ aliases_virtual_get(struct expand *expand, const struct mailaddr *maddr) } /* Failed ? We lookup for username only */ - if (! bsnprintf(buf, sizeof(buf), "%s", user)) + if (!bsnprintf(buf, sizeof(buf), "%s", user)) return 0; ret = table_lookup(mapping, NULL, buf, K_ALIAS, &lk); if (ret < 0) @@ -165,7 +165,7 @@ aliases_virtual_get(struct expand *expand, const struct mailaddr *maddr) if (ret) goto expand; - if (! bsnprintf(buf, sizeof(buf), "@%s", domain)) + if (!bsnprintf(buf, sizeof(buf), "@%s", domain)) return 0; /* Failed ? We lookup for catch all for virtual domain */ ret = table_lookup(mapping, NULL, buf, K_ALIAS, &lk); diff --git a/usr.sbin/smtpd/ca.c b/usr.sbin/smtpd/ca.c index ad0bf9a50de..9e9fa44ad32 100644 --- a/usr.sbin/smtpd/ca.c +++ b/usr.sbin/smtpd/ca.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ca.c,v 1.19 2015/12/05 13:14:21 claudio Exp $ */ +/* $OpenBSD: ca.c,v 1.20 2015/12/28 22:08:30 jung Exp $ */ /* * Copyright (c) 2014 Reyk Floeter <reyk@openbsd.org> @@ -213,7 +213,7 @@ ca_X509_verify(void *certificate, void *chain, const char *CAfile, if ((store = X509_STORE_new()) == NULL) goto end; - if (! X509_STORE_load_locations(store, CAfile, NULL)) { + if (!X509_STORE_load_locations(store, CAfile, NULL)) { log_warn("warn: unable to load CA file %s", CAfile); goto end; } diff --git a/usr.sbin/smtpd/compress_gzip.c b/usr.sbin/smtpd/compress_gzip.c index f71a6cf3287..e7421cec076 100644 --- a/usr.sbin/smtpd/compress_gzip.c +++ b/usr.sbin/smtpd/compress_gzip.c @@ -1,4 +1,4 @@ -/* $OpenBSD: compress_gzip.c,v 1.9 2015/12/14 10:22:11 jung Exp $ */ +/* $OpenBSD: compress_gzip.c,v 1.10 2015/12/28 22:08:30 jung Exp $ */ /* * Copyright (c) 2012 Gilles Chehade <gilles@poolp.org> @@ -143,7 +143,7 @@ compress_gzip_file(FILE *in, FILE *out) if ((w = gzwrite(gzf, ibuf, r)) != r) goto end; } - if (! feof(in)) + if (!feof(in)) goto end; ret = 1; @@ -173,7 +173,7 @@ uncompress_gzip_file(FILE *in, FILE *out) if ((w = fwrite(obuf, r, 1, out)) != 1) goto end; } - if (! gzeof(gzf)) + if (!gzeof(gzf)) goto end; ret = 1; diff --git a/usr.sbin/smtpd/control.c b/usr.sbin/smtpd/control.c index 3b8a41962cd..a34becfdc2a 100644 --- a/usr.sbin/smtpd/control.c +++ b/usr.sbin/smtpd/control.c @@ -1,4 +1,4 @@ -/* $OpenBSD: control.c,v 1.108 2015/11/05 09:14:31 sunil Exp $ */ +/* $OpenBSD: control.c,v 1.109 2015/12/28 22:08:30 jung Exp $ */ /* * Copyright (c) 2012 Gilles Chehade <gilles@poolp.org> @@ -510,7 +510,7 @@ control_dispatch_ext(struct mproc *p, struct imsg *imsg) if (c->euid) goto badcred; kvp = imsg->data; - if (! stat_backend->iter(&kvp->iter, &key, &val)) + if (!stat_backend->iter(&kvp->iter, &key, &val)) kvp->iter = NULL; else { (void)strlcpy(kvp->key, key, sizeof kvp->key); @@ -675,7 +675,7 @@ control_dispatch_ext(struct mproc *p, struct imsg *imsg) if (c->euid) goto badcred; - if (! (env->sc_flags & SMTPD_MDA_PAUSED)) { + if (!(env->sc_flags & SMTPD_MDA_PAUSED)) { m_compose(p, IMSG_CTL_FAIL, 0, 0, -1, NULL, 0); return; } diff --git a/usr.sbin/smtpd/crypto.c b/usr.sbin/smtpd/crypto.c index 2b9f264e2c5..2648dbe6d15 100644 --- a/usr.sbin/smtpd/crypto.c +++ b/usr.sbin/smtpd/crypto.c @@ -1,4 +1,4 @@ -/* $OpenBSD: crypto.c,v 1.4 2013/12/26 17:25:32 eric Exp $ */ +/* $OpenBSD: crypto.c,v 1.5 2015/12/28 22:08:30 jung Exp $ */ /* * Copyright (c) 2013 Gilles Chehade <gilles@openbsd.org> @@ -322,7 +322,7 @@ main(int argc, char *argv[]) return 1; } - if (! crypto_setup(argv[1], strlen(argv[1]))) { + if (!crypto_setup(argv[1], strlen(argv[1]))) { printf("crypto_setup failed\n"); return 1; } diff --git a/usr.sbin/smtpd/delivery_maildir.c b/usr.sbin/smtpd/delivery_maildir.c index bb03c003135..83ab82ec037 100644 --- a/usr.sbin/smtpd/delivery_maildir.c +++ b/usr.sbin/smtpd/delivery_maildir.c @@ -1,4 +1,4 @@ -/* $OpenBSD: delivery_maildir.c,v 1.16 2015/01/20 17:37:54 deraadt Exp $ */ +/* $OpenBSD: delivery_maildir.c,v 1.17 2015/12/28 22:08:30 jung Exp $ */ /* * Copyright (c) 2011 Gilles Chehade <gilles@poolp.org> @@ -89,11 +89,11 @@ delivery_maildir_open(struct deliver *deliver) setproctitle("maildir delivery"); memset(&maddr, 0, sizeof maddr); - if (! text_to_mailaddr(&maddr, deliver->dest)) + if (!text_to_mailaddr(&maddr, deliver->dest)) error("cannot parse destination address"); memset(tag, 0, sizeof tag); - if (! mailaddr_tag(&maddr, tag, sizeof tag)) + if (!mailaddr_tag(&maddr, tag, sizeof tag)) error("cannot extract tag from destination address"); if (mkdirs(deliver->to, 0700) < 0 && errno != EEXIST) diff --git a/usr.sbin/smtpd/enqueue.c b/usr.sbin/smtpd/enqueue.c index 5fe958d2436..e515971fa62 100644 --- a/usr.sbin/smtpd/enqueue.c +++ b/usr.sbin/smtpd/enqueue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: enqueue.c,v 1.108 2015/12/14 10:22:11 jung Exp $ */ +/* $OpenBSD: enqueue.c,v 1.109 2015/12/28 22:08:30 jung Exp $ */ /* * Copyright (c) 2005 Henning Brauer <henning@bulabula.org> @@ -153,7 +153,7 @@ qp_encoded_write(FILE *fp, char *buf, size_t len) else fprintf(fp, "%c", *buf & 0xff); } - else if (! isprint((unsigned char)*buf) && *buf != '\n') + else if (!isprint((unsigned char)*buf) && *buf != '\n') fprintf(fp, "=%2X", *buf & 0xff); else fprintf(fp, "%c", *buf); @@ -310,11 +310,11 @@ enqueue(int argc, char *argv[], FILE *ofp) */ /* banner */ - if (! get_responses(fout, 1)) + if (!get_responses(fout, 1)) goto fail; send_line(fout, verbose, "EHLO localhost\n"); - if (! get_responses(fout, 1)) + if (!get_responses(fout, 1)) goto fail; if (msg.dsn_envid != NULL) @@ -326,7 +326,7 @@ enqueue(int argc, char *argv[], FILE *ofp) msg.dsn_ret ? msg.dsn_ret : "", envid_sz ? "ENVID=" : "", envid_sz ? msg.dsn_envid : ""); - if (! get_responses(fout, 1)) + if (!get_responses(fout, 1)) goto fail; for (i = 0; i < msg.rcpt_cnt; i++) { @@ -334,12 +334,12 @@ enqueue(int argc, char *argv[], FILE *ofp) msg.rcpts[i], msg.dsn_notify ? "NOTIFY=" : "", msg.dsn_notify ? msg.dsn_notify : ""); - if (! get_responses(fout, 1)) + if (!get_responses(fout, 1)) goto fail; } send_line(fout, verbose, "DATA\n"); - if (! get_responses(fout, 1)) + if (!get_responses(fout, 1)) goto fail; /* add From */ @@ -425,11 +425,11 @@ enqueue(int argc, char *argv[], FILE *ofp) } free(buf); send_line(fout, verbose, ".\n"); - if (! get_responses(fout, 1)) + if (!get_responses(fout, 1)) goto fail; send_line(fout, verbose, "QUIT\n"); - if (! get_responses(fout, 1)) + if (!get_responses(fout, 1)) goto fail; fclose(fp); diff --git a/usr.sbin/smtpd/envelope.c b/usr.sbin/smtpd/envelope.c index ee983a8c437..539efda6fe3 100644 --- a/usr.sbin/smtpd/envelope.c +++ b/usr.sbin/smtpd/envelope.c @@ -1,4 +1,4 @@ -/* $OpenBSD: envelope.c,v 1.35 2015/12/14 10:35:29 sunil Exp $ */ +/* $OpenBSD: envelope.c,v 1.36 2015/12/28 22:08:30 jung Exp $ */ /* * Copyright (c) 2013 Eric Faurot <eric@openbsd.org> @@ -102,7 +102,7 @@ envelope_buffer_to_dict(struct dict *d, const char *ibuf, size_t buflen) field = buf; while (*buf && (isalnum((unsigned char)*buf) || *buf == '-')) buf++; - if (! *buf) + if (!*buf) goto err; /* skip whitespaces before separator */ @@ -136,7 +136,7 @@ envelope_load_buffer(struct envelope *ep, const char *ibuf, size_t buflen) int ret = 0; dict_init(&d); - if (! envelope_buffer_to_dict(&d, ibuf, buflen)) { + if (!envelope_buffer_to_dict(&d, ibuf, buflen)) { log_debug("debug: cannot parse envelope to dict"); goto end; } @@ -359,7 +359,7 @@ ascii_load_mda_method(enum action_type *dest, char *buf) static int ascii_load_mailaddr(struct mailaddr *dest, char *buf) { - if (! text_to_mailaddr(dest, buf)) + if (!text_to_mailaddr(dest, buf)) return 0; return 1; } @@ -387,7 +387,7 @@ ascii_load_flags(enum envelope_flags *dest, char *buf) static int ascii_load_mta_relay_url(struct relayhost *relay, char *buf) { - if (! text_to_relayhost(relay, buf)) + if (!text_to_relayhost(relay, buf)) return 0; return 1; } @@ -499,7 +499,7 @@ ascii_load_field(const char *field, struct envelope *ep, char *buf) int ret; uint16_t flags = ep->agent.mta.relay.flags; ret = ascii_load_mta_relay_url(&ep->agent.mta.relay, buf); - if (! ret) + if (!ret) return (0); ep->agent.mta.relay.flags |= flags; return ret; @@ -589,7 +589,7 @@ envelope_ascii_load(struct envelope *ep, struct dict *d) hdl = NULL; while (dict_iter(d, &hdl, &field, (void **)&value)) - if (! ascii_load_field(field, ep, value)) + if (!ascii_load_field(field, ep, value)) goto err; return (1); @@ -936,7 +936,7 @@ envelope_ascii_dump(const struct envelope *ep, char **dest, size_t *len, return; memset(buf, 0, sizeof buf); - if (! ascii_dump_field(field, ep, buf, sizeof buf)) + if (!ascii_dump_field(field, ep, buf, sizeof buf)) goto err; if (buf[0] == '\0') return; @@ -976,13 +976,13 @@ envelope_upgrade_v1(struct dict *d) */ if ((val = dict_get(d, "mta-relay"))) { if (strncasecmp("ssl://", val, 6) == 0) { - if (! bsnprintf(buf_relay, sizeof(buf_relay), + if (!bsnprintf(buf_relay, sizeof(buf_relay), "secure://%s", val+6)) return (0); dict_set(d, "mta-relay", buf_relay); } else if (strncasecmp("ssl+auth://", val, 11) == 0) { - if (! bsnprintf(buf_relay, sizeof(buf_relay), + if (!bsnprintf(buf_relay, sizeof(buf_relay), "secure+auth://%s", val+11)) return (0); dict_set(d, "mta-relay", buf_relay); diff --git a/usr.sbin/smtpd/expand.c b/usr.sbin/smtpd/expand.c index 2b0b1b79d11..55c043ec3d5 100644 --- a/usr.sbin/smtpd/expand.c +++ b/usr.sbin/smtpd/expand.c @@ -1,4 +1,4 @@ -/* $OpenBSD: expand.c,v 1.28 2015/01/20 17:37:54 deraadt Exp $ */ +/* $OpenBSD: expand.c,v 1.29 2015/12/28 22:08:30 jung Exp $ */ /* * Copyright (c) 2009 Gilles Chehade <gilles@poolp.org> @@ -251,9 +251,9 @@ expand_line(struct expand *expand, const char *s, int do_includes) subrcpt = strip(subrcpt); if (subrcpt[0] == '\0') continue; - if (! text_to_expandnode(&xn, subrcpt)) + if (!text_to_expandnode(&xn, subrcpt)) return 0; - if (! do_includes) + if (!do_includes) if (xn.type == EXPAND_INCLUDE) continue; expand_insert(expand, &xn); diff --git a/usr.sbin/smtpd/forward.c b/usr.sbin/smtpd/forward.c index fc50a41d360..d30d55e941a 100644 --- a/usr.sbin/smtpd/forward.c +++ b/usr.sbin/smtpd/forward.c @@ -1,4 +1,4 @@ -/* $OpenBSD: forward.c,v 1.38 2015/12/05 21:27:42 mmcc Exp $ */ +/* $OpenBSD: forward.c,v 1.39 2015/12/28 22:08:30 jung Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@poolp.org> @@ -74,7 +74,7 @@ forwards_get(int fd, struct expand *expand) lineno = 0; save = expand->nb_nodes; while ((line = fparseln(fp, &len, &lineno, NULL, 0)) != NULL) { - if (! expand_line(expand, line, 0)) { + if (!expand_line(expand, line, 0)) { log_info("info: parse error in forward file"); goto end; } diff --git a/usr.sbin/smtpd/ioev.c b/usr.sbin/smtpd/ioev.c index ad337b78273..437bdae3b69 100644 --- a/usr.sbin/smtpd/ioev.c +++ b/usr.sbin/smtpd/ioev.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ioev.c,v 1.23 2015/12/22 07:54:57 sunil Exp $ */ +/* $OpenBSD: ioev.c,v 1.24 2015/12/28 22:08:30 jung Exp $ */ /* * Copyright (c) 2012 Eric Faurot <eric@openbsd.org> * @@ -898,7 +898,7 @@ io_reload_ssl(struct io *io) ev = EV_WRITE; dispatch = io_dispatch_write_ssl; } - if (! ev) + if (!ev) return; /* paused */ break; default: diff --git a/usr.sbin/smtpd/lka.c b/usr.sbin/smtpd/lka.c index 7c30c48f3a0..099e617199a 100644 --- a/usr.sbin/smtpd/lka.c +++ b/usr.sbin/smtpd/lka.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lka.c,v 1.189 2015/12/14 10:22:12 jung Exp $ */ +/* $OpenBSD: lka.c,v 1.190 2015/12/28 22:08:30 jung Exp $ */ /* * Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org> @@ -616,7 +616,7 @@ lka_mailaddrmap(const char *tablename, const char *username, const struct mailad default: found = 0; TAILQ_FOREACH(mn, &lk.maddrmap->queue, entries) { - if (! mailaddr_match(maddr, &mn->mailaddr)) + if (!mailaddr_match(maddr, &mn->mailaddr)) continue; found = 1; break; @@ -661,7 +661,7 @@ lka_X509_verify(struct ca_vrfy_req_msg *vrfy, x509_tmp = NULL; } } - if (! ca_X509_verify(x509, x509_chain, CAfile, NULL, &errstr)) + if (!ca_X509_verify(x509, x509_chain, CAfile, NULL, &errstr)) log_debug("debug: lka: X509 verify: %s", errstr); else ret = 1; @@ -700,7 +700,7 @@ lka_certificate_verify_resume(enum imsg_type type, struct ca_vrfy_req_msg *req) if (sca == NULL && !req->fallback) resp.status = CA_FAIL; - else if (! lka_X509_verify(req, cafile, NULL)) + else if (!lka_X509_verify(req, cafile, NULL)) resp.status = CA_FAIL; else resp.status = CA_OK; diff --git a/usr.sbin/smtpd/lka_session.c b/usr.sbin/smtpd/lka_session.c index 316a35620c3..87ff4641192 100644 --- a/usr.sbin/smtpd/lka_session.c +++ b/usr.sbin/smtpd/lka_session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lka_session.c,v 1.78 2015/12/14 10:22:12 jung Exp $ */ +/* $OpenBSD: lka_session.c,v 1.79 2015/12/28 22:08:30 jung Exp $ */ /* * Copyright (c) 2011 Gilles Chehade <gilles@poolp.org> @@ -644,41 +644,41 @@ lka_expand_token(char *dest, size_t len, const char *token, } /* token -> expanded token */ - if (! strcasecmp("sender", rtoken)) { + if (!strcasecmp("sender", rtoken)) { if (snprintf(tmp, sizeof tmp, "%s@%s", ep->sender.user, ep->sender.domain) >= (int)sizeof tmp) return 0; string = tmp; } - else if (! strcasecmp("dest", rtoken)) { + else if (!strcasecmp("dest", rtoken)) { if (snprintf(tmp, sizeof tmp, "%s@%s", ep->dest.user, ep->dest.domain) >= (int)sizeof tmp) return 0; string = tmp; } - else if (! strcasecmp("rcpt", rtoken)) { + else if (!strcasecmp("rcpt", rtoken)) { if (snprintf(tmp, sizeof tmp, "%s@%s", ep->rcpt.user, ep->rcpt.domain) >= (int)sizeof tmp) return 0; string = tmp; } - else if (! strcasecmp("sender.user", rtoken)) + else if (!strcasecmp("sender.user", rtoken)) string = ep->sender.user; - else if (! strcasecmp("sender.domain", rtoken)) + else if (!strcasecmp("sender.domain", rtoken)) string = ep->sender.domain; - else if (! strcasecmp("user.username", rtoken)) + else if (!strcasecmp("user.username", rtoken)) string = ui->username; - else if (! strcasecmp("user.directory", rtoken)) { + else if (!strcasecmp("user.directory", rtoken)) { string = ui->directory; replace = 0; } - else if (! strcasecmp("dest.user", rtoken)) + else if (!strcasecmp("dest.user", rtoken)) string = ep->dest.user; - else if (! strcasecmp("dest.domain", rtoken)) + else if (!strcasecmp("dest.domain", rtoken)) string = ep->dest.domain; - else if (! strcasecmp("rcpt.user", rtoken)) + else if (!strcasecmp("rcpt.user", rtoken)) string = ep->rcpt.user; - else if (! strcasecmp("rcpt.domain", rtoken)) + else if (!strcasecmp("rcpt.domain", rtoken)) string = ep->rcpt.domain; else return 0; @@ -695,12 +695,12 @@ lka_expand_token(char *dest, size_t len, const char *token, if ((sep = strchr(mods, '|')) != NULL) *sep++ = '\0'; for (i = 0; (size_t)i < nitems(token_modifiers); ++i) { - if (! strcasecmp(token_modifiers[i].name, mods)) { + if (!strcasecmp(token_modifiers[i].name, mods)) { if (token_modifiers[i].f == NULL) { raw = 1; break; } - if (! token_modifiers[i].f(tmp, sizeof tmp)) + if (!token_modifiers[i].f(tmp, sizeof tmp)) return 0; /* modifier error */ break; } @@ -710,7 +710,7 @@ lka_expand_token(char *dest, size_t len, const char *token, } while ((mods = sep) != NULL); } - if (! raw && replace) + if (!raw && replace) for (i = 0; (size_t)i < strlen(tmp); ++i) if (strchr(MAILADDR_ESCAPE, tmp[i])) tmp[i] = ':'; @@ -848,7 +848,7 @@ mod_lowercase(char *buf, size_t len) { char tmp[EXPAND_BUFFER]; - if (! lowercase(tmp, buf, sizeof tmp)) + if (!lowercase(tmp, buf, sizeof tmp)) return 0; if (strlcpy(buf, tmp, len) >= len) return 0; @@ -860,7 +860,7 @@ mod_uppercase(char *buf, size_t len) { char tmp[EXPAND_BUFFER]; - if (! uppercase(tmp, buf, sizeof tmp)) + if (!uppercase(tmp, buf, sizeof tmp)) return 0; if (strlcpy(buf, tmp, len) >= len) return 0; diff --git a/usr.sbin/smtpd/log.c b/usr.sbin/smtpd/log.c index 8c20f3f5c02..ec30321df32 100644 --- a/usr.sbin/smtpd/log.c +++ b/usr.sbin/smtpd/log.c @@ -1,4 +1,4 @@ -/* $OpenBSD: log.c,v 1.16 2014/07/08 10:30:52 eric Exp $ */ +/* $OpenBSD: log.c,v 1.17 2015/12/28 22:08:30 jung Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org> @@ -48,7 +48,7 @@ log_init(int n_foreground) extern char *__progname; foreground = n_foreground; - if (! foreground) + if (!foreground) openlog(__progname, LOG_PID | LOG_NDELAY, LOG_MAIL); tzset(); diff --git a/usr.sbin/smtpd/mailaddr.c b/usr.sbin/smtpd/mailaddr.c index 98a3436b83e..e48f729d7cd 100644 --- a/usr.sbin/smtpd/mailaddr.c +++ b/usr.sbin/smtpd/mailaddr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mailaddr.c,v 1.1 2015/10/28 14:30:03 gilles Exp $ */ +/* $OpenBSD: mailaddr.c,v 1.2 2015/12/28 22:08:30 jung Exp $ */ /* * Copyright (c) 2015 Gilles Chehade <gilles@poolp.org> @@ -93,7 +93,7 @@ mailaddr_line(struct maddrmap *maddrmap, const char *s) subrcpt = strip(subrcpt); if (subrcpt[0] == '\0') continue; - if (! text_to_mailaddr(&mn.mailaddr, subrcpt)) + if (!text_to_mailaddr(&mn.mailaddr, subrcpt)) return 0; log_debug("subrcpt: [%s]", subrcpt); maddrmap_insert(maddrmap, &mn); diff --git a/usr.sbin/smtpd/makemap.c b/usr.sbin/smtpd/makemap.c index 96e3b5da25c..da0718c5590 100644 --- a/usr.sbin/smtpd/makemap.c +++ b/usr.sbin/smtpd/makemap.c @@ -1,4 +1,4 @@ -/* $OpenBSD: makemap.c,v 1.60 2015/12/15 06:05:15 guenther Exp $ */ +/* $OpenBSD: makemap.c,v 1.61 2015/12/28 22:08:30 jung Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@poolp.org> @@ -148,7 +148,7 @@ makemap(int argc, char *argv[]) p = strstr(argv[1], ".db"); if (p == NULL || strcmp(p, ".db") != 0) { - if (! bsnprintf(dbname, sizeof dbname, "%s.db", + if (!bsnprintf(dbname, sizeof dbname, "%s.db", argv[1])) errx(1, "database name too long"); } @@ -186,7 +186,7 @@ makemap(int argc, char *argv[]) if (stat(source, &sb) == -1) err(1, "stat: %s", source); - if (! bsnprintf(dbname, sizeof(dbname), "%s.XXXXXXXXXXX", oflag)) + if (!bsnprintf(dbname, sizeof(dbname), "%s.XXXXXXXXXXX", oflag)) errx(1, "path too long"); if ((fd = mkstemp(dbname)) == -1) err(1, "mkstemp"); @@ -205,7 +205,7 @@ makemap(int argc, char *argv[]) goto bad; } - if (! parse_map(db, &dbputs, source)) + if (!parse_map(db, &dbputs, source)) goto bad; if (db->close(db) == -1) { @@ -271,7 +271,7 @@ parse_map(DB *db, int *dbputs, char *filename) while ((line = fparseln(fp, &len, &lineno, NULL, FPARSELN_UNESCCOMM)) != NULL) { - if (! parse_entry(db, dbputs, line, len, lineno)) { + if (!parse_entry(db, dbputs, line, len, lineno)) { free(line); fclose(fp); return 0; @@ -330,11 +330,11 @@ parse_mapentry(DB *db, int *dbputs, char *line, size_t len, size_t lineno) } if (type == T_PLAIN) { - if (! make_plain(&val, valp)) + if (!make_plain(&val, valp)) goto bad; } else if (type == T_ALIASES) { - if (! make_aliases(&val, valp)) + if (!make_aliases(&val, valp)) goto bad; } @@ -416,7 +416,7 @@ make_aliases(DBT *val, char *text) if (*subrcpt == '\0') goto error; - if (! text_to_expandnode(&xn, subrcpt)) + if (!text_to_expandnode(&xn, subrcpt)) goto error; } diff --git a/usr.sbin/smtpd/mta.c b/usr.sbin/smtpd/mta.c index 67322ec109a..dc4e7bfa19b 100644 --- a/usr.sbin/smtpd/mta.c +++ b/usr.sbin/smtpd/mta.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mta.c,v 1.198 2015/12/14 10:22:12 jung Exp $ */ +/* $OpenBSD: mta.c,v 1.199 2015/12/28 22:08:30 jung Exp $ */ /* * Copyright (c) 2008 Pierre-Yves Ritschard <pyr@openbsd.org> @@ -2434,7 +2434,7 @@ mta_hoststat_update(const char *host, const char *error) char buf[HOST_NAME_MAX+1]; time_t tm; - if (! lowercase(buf, host, sizeof buf)) + if (!lowercase(buf, host, sizeof buf)) return; tm = time(NULL); @@ -2460,7 +2460,7 @@ mta_hoststat_cache(const char *host, uint64_t evpid) struct hoststat *hs = NULL; char buf[HOST_NAME_MAX+1]; - if (! lowercase(buf, host, sizeof buf)) + if (!lowercase(buf, host, sizeof buf)) return; hs = dict_get(&hoststat, buf); @@ -2479,7 +2479,7 @@ mta_hoststat_uncache(const char *host, uint64_t evpid) struct hoststat *hs = NULL; char buf[HOST_NAME_MAX+1]; - if (! lowercase(buf, host, sizeof buf)) + if (!lowercase(buf, host, sizeof buf)) return; hs = dict_get(&hoststat, buf); @@ -2496,7 +2496,7 @@ mta_hoststat_reschedule(const char *host) char buf[HOST_NAME_MAX+1]; uint64_t evpid; - if (! lowercase(buf, host, sizeof buf)) + if (!lowercase(buf, host, sizeof buf)) return; hs = dict_get(&hoststat, buf); diff --git a/usr.sbin/smtpd/parse.y b/usr.sbin/smtpd/parse.y index 58ec5d6679b..1ae9b789db3 100644 --- a/usr.sbin/smtpd/parse.y +++ b/usr.sbin/smtpd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.177 2015/12/12 20:02:31 gilles Exp $ */ +/* $OpenBSD: parse.y,v 1.178 2015/12/28 22:08:30 jung Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@poolp.org> @@ -588,7 +588,7 @@ opt_listen : INET4 { } listen_opts.options |= LO_HOSTNAMES; - if (! table_check_use(t, T_DYNAMIC|T_HASH, K_ADDRNAME)) { + if (!table_check_use(t, T_DYNAMIC|T_HASH, K_ADDRNAME)) { yyerror("invalid use of table \"%s\" as " "HOSTNAMES parameter", t->t_name); YYERROR; @@ -628,7 +628,7 @@ opt_listen : INET4 { } listen_opts.options |= LO_SENDERS; - if (! table_check_use(t, T_DYNAMIC|T_HASH, K_MAILADDRMAP)) { + if (!table_check_use(t, T_DYNAMIC|T_HASH, K_MAILADDRMAP)) { yyerror("invalid use of table \"%s\" as " "SENDERS parameter", t->t_name); YYERROR; @@ -644,7 +644,7 @@ opt_listen : INET4 { } listen_opts.options |= LO_SENDERS|LO_MASQUERADE; - if (! table_check_use(t, T_DYNAMIC|T_HASH, K_MAILADDRMAP)) { + if (!table_check_use(t, T_DYNAMIC|T_HASH, K_MAILADDRMAP)) { yyerror("invalid use of table \"%s\" as " "SENDERS parameter", t->t_name); YYERROR; @@ -660,7 +660,7 @@ listen : opt_listen listen opt_relay_common: AS STRING { struct mailaddr maddr, *maddrp; - if (! text_to_mailaddr(&maddr, $2)) { + if (!text_to_mailaddr(&maddr, $2)) { yyerror("invalid parameter to AS: %s", $2); free($2); YYERROR; @@ -684,7 +684,7 @@ opt_relay_common: AS STRING { } | SOURCE tables { struct table *t = $2; - if (! table_check_use(t, T_DYNAMIC|T_LIST, K_SOURCE)) { + if (!table_check_use(t, T_DYNAMIC|T_LIST, K_SOURCE)) { yyerror("invalid use of table \"%s\" as " "SOURCE parameter", t->t_name); YYERROR; @@ -699,7 +699,7 @@ opt_relay_common: AS STRING { } | HOSTNAMES tables { struct table *t = $2; - if (! table_check_use(t, T_DYNAMIC|T_HASH, K_ADDRNAME)) { + if (!table_check_use(t, T_DYNAMIC|T_HASH, K_ADDRNAME)) { yyerror("invalid use of table \"%s\" as " "HOSTNAMES parameter", t->t_name); YYERROR; @@ -708,7 +708,7 @@ opt_relay_common: AS STRING { sizeof rule->r_value.relayhost.helotable); } | PKI STRING { - if (! lowercase(rule->r_value.relayhost.pki_name, $2, + if (!lowercase(rule->r_value.relayhost.pki_name, $2, sizeof(rule->r_value.relayhost.pki_name))) { yyerror("pki name too long: %s", $2); free($2); @@ -723,7 +723,7 @@ opt_relay_common: AS STRING { free($2); } | CA STRING { - if (! lowercase(rule->r_value.relayhost.ca_name, $2, + if (!lowercase(rule->r_value.relayhost.ca_name, $2, sizeof(rule->r_value.relayhost.ca_name))) { yyerror("ca name too long: %s", $2); free($2); @@ -772,7 +772,7 @@ relay : opt_relay_common relay opt_relay_via : AUTH tables { struct table *t = $2; - if (! table_check_use(t, T_DYNAMIC|T_HASH, K_CREDENTIALS)) { + if (!table_check_use(t, T_DYNAMIC|T_HASH, K_CREDENTIALS)) { yyerror("invalid use of table \"%s\" as AUTH parameter", t->t_name); YYERROR; @@ -889,7 +889,7 @@ main : BOUNCEWARN { /* if not catchall, check that it is a valid domain */ if (strcmp($2, "*") != 0) { - if (! res_hnok($2)) { + if (!res_hnok($2)) { yyerror("not a valid domain name: %s", $2); free($2); YYERROR; @@ -909,7 +909,7 @@ main : BOUNCEWARN { /* if not catchall, check that it is a valid domain */ if (strcmp($2, "*") != 0) { - if (! res_hnok($2)) { + if (!res_hnok($2)) { yyerror("not a valid domain name: %s", $2); free($2); YYERROR; @@ -1048,7 +1048,7 @@ tables : tablenew { $$ = $1; } alias : ALIAS tables { struct table *t = $2; - if (! table_check_use(t, T_DYNAMIC|T_HASH, K_ALIAS)) { + if (!table_check_use(t, T_DYNAMIC|T_HASH, K_ALIAS)) { yyerror("invalid use of table \"%s\" as ALIAS parameter", t->t_name); YYERROR; @@ -1061,7 +1061,7 @@ alias : ALIAS tables { virtual : VIRTUAL tables { struct table *t = $2; - if (! table_check_use(t, T_DYNAMIC|T_HASH, K_ALIAS)) { + if (!table_check_use(t, T_DYNAMIC|T_HASH, K_ALIAS)) { yyerror("invalid use of table \"%s\" as VIRTUAL parameter", t->t_name); YYERROR; @@ -1095,7 +1095,7 @@ userbase : USERBASE tables { yyerror("userbase specified multiple times"); YYERROR; } - if (! table_check_use(t, T_DYNAMIC|T_HASH, K_USERINFO)) { + if (!table_check_use(t, T_DYNAMIC|T_HASH, K_USERINFO)) { yyerror("invalid use of table \"%s\" as USERBASE parameter", t->t_name); YYERROR; @@ -1177,7 +1177,7 @@ relay_action : RELAY relay { } | RELAY VIA STRING { rule->r_action = A_RELAYVIA; - if (! text_to_relayhost(&rule->r_value.relayhost, $3)) { + if (!text_to_relayhost(&rule->r_value.relayhost, $3)) { yyerror("error: invalid url: %s", $3); free($3); YYERROR; @@ -1205,7 +1205,7 @@ from : FROM negation SOURCE tables { yyerror("from specified multiple times"); YYERROR; } - if (! table_check_use(t, T_DYNAMIC|T_LIST, K_NETADDR)) { + if (!table_check_use(t, T_DYNAMIC|T_LIST, K_NETADDR)) { yyerror("invalid use of table \"%s\" as FROM parameter", t->t_name); YYERROR; @@ -1238,7 +1238,7 @@ for : FOR negation DOMAIN tables { yyerror("for specified multiple times"); YYERROR; } - if (! table_check_use(t, T_DYNAMIC|T_LIST, K_DOMAIN)) { + if (!table_check_use(t, T_DYNAMIC|T_LIST, K_DOMAIN)) { yyerror("invalid use of table \"%s\" as DOMAIN parameter", t->t_name); YYERROR; @@ -1272,7 +1272,7 @@ sender : SENDER negation tables { YYERROR; } - if (! table_check_use(t, T_DYNAMIC|T_LIST, K_MAILADDR)) { + if (!table_check_use(t, T_DYNAMIC|T_LIST, K_MAILADDR)) { yyerror("invalid use of table \"%s\" as SENDER parameter", t->t_name); YYERROR; @@ -1290,7 +1290,7 @@ recipient : RECIPIENT negation tables { YYERROR; } - if (! table_check_use(t, T_DYNAMIC|T_LIST, K_MAILADDR)) { + if (!table_check_use(t, T_DYNAMIC|T_LIST, K_MAILADDR)) { yyerror("invalid use of table \"%s\" as RECIPIENT parameter", t->t_name); YYERROR; @@ -1361,11 +1361,11 @@ rule : ACCEPT { rule->r_desttype = DEST_DOM; rule->r_qexpire = -1; } decision lookup action accept_params { - if (! rule->r_sources) + if (!rule->r_sources) rule->r_sources = table_find("<localhost>", NULL); - if (! rule->r_destination) + if (!rule->r_destination) rule->r_destination = table_find("<localnames>", NULL); - if (! rule->r_userbase) + if (!rule->r_userbase) rule->r_userbase = table_find("<getpwnam>", NULL); if (rule->r_qexpire == -1) rule->r_qexpire = conf->sc_qexpire; @@ -1391,9 +1391,9 @@ rule : ACCEPT { rule->r_decision = R_REJECT; rule->r_desttype = DEST_DOM; } decision { - if (! rule->r_sources) + if (!rule->r_sources) rule->r_sources = table_find("<localhost>", NULL); - if (! rule->r_destination) + if (!rule->r_destination) rule->r_destination = table_find("<localnames>", NULL); TAILQ_INSERT_TAIL(conf->sc_rules, rule, r_entry); rule = NULL; @@ -1836,7 +1836,7 @@ parse_config(struct smtpd *x_conf, const char *filename, int opts) char hostname[HOST_NAME_MAX+1]; char hostname_copy[HOST_NAME_MAX+1]; - if (! getmailname(hostname, sizeof hostname)) + if (!getmailname(hostname, sizeof hostname)) return (-1); conf = x_conf; @@ -2066,7 +2066,7 @@ create_listener(struct listenerlist *ll, struct listen_opts *lo) if (lo->port) { lo->flags = lo->ssl|lo->auth|flags; lo->port = htons(lo->port); - if (! interface(ll, lo)) + if (!interface(ll, lo)) if (host(ll, lo) <= 0) errx(1, "invalid virtual ip or interface: %s", lo->ifx); } @@ -2074,17 +2074,17 @@ create_listener(struct listenerlist *ll, struct listen_opts *lo) if (lo->ssl & F_SMTPS) { lo->port = htons(465); lo->flags = F_SMTPS|lo->auth|flags; - if (! interface(ll, lo)) + if (!interface(ll, lo)) if (host(ll, lo) <= 0) errx(1, "invalid virtual ip or interface: %s", lo->ifx); } - if (! lo->ssl || (lo->ssl & F_STARTTLS)) { + if (!lo->ssl || (lo->ssl & F_STARTTLS)) { lo->port = htons(25); lo->flags = lo->auth|flags; if (lo->ssl & F_STARTTLS) lo->flags |= F_STARTTLS; - if (! interface(ll, lo)) + if (!interface(ll, lo)) if (host(ll, lo) <= 0) errx(1, "invalid virtual ip or interface: %s", lo->ifx); } @@ -2114,7 +2114,7 @@ config_listener(struct listener *h, struct listen_opts *lo) if (lo->authtable != NULL) (void)strlcpy(h->authtable, lo->authtable->t_name, sizeof(h->authtable)); if (lo->pki != NULL) { - if (! lowercase(h->pki_name, lo->pki, sizeof(h->pki_name))) { + if (!lowercase(h->pki_name, lo->pki, sizeof(h->pki_name))) { log_warnx("pki name too long: %s", lo->pki); fatalx(NULL); } @@ -2125,7 +2125,7 @@ config_listener(struct listener *h, struct listen_opts *lo) } if (lo->ca != NULL) { - if (! lowercase(h->ca_name, lo->ca, sizeof(h->ca_name))) { + if (!lowercase(h->ca_name, lo->ca, sizeof(h->ca_name))) { log_warnx("ca name too long: %s", lo->ca); fatalx(NULL); } @@ -2291,7 +2291,7 @@ interface(struct listenerlist *al, struct listen_opts *lo) if (p->ifa_addr == NULL) continue; if (strcmp(p->ifa_name, lo->ifx) != 0 && - ! is_if_in_group(p->ifa_name, lo->ifx)) + !is_if_in_group(p->ifa_name, lo->ifx)) continue; if (lo->family != AF_UNSPEC && lo->family != p->ifa_addr->sa_family) continue; diff --git a/usr.sbin/smtpd/queue.c b/usr.sbin/smtpd/queue.c index 66a8ab22a39..ec3096d90c3 100644 --- a/usr.sbin/smtpd/queue.c +++ b/usr.sbin/smtpd/queue.c @@ -1,4 +1,4 @@ -/* $OpenBSD: queue.c,v 1.174 2015/12/14 10:22:12 jung Exp $ */ +/* $OpenBSD: queue.c,v 1.175 2015/12/28 22:08:30 jung Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@poolp.org> @@ -708,7 +708,7 @@ queue(void) log_info("queue: queue compression enabled"); if (env->sc_queue_key) { - if (! crypto_setup(env->sc_queue_key, strlen(env->sc_queue_key))) + if (!crypto_setup(env->sc_queue_key, strlen(env->sc_queue_key))) fatalx("crypto_setup: invalid key for queue encryption"); log_info("queue: queue encryption enabled"); } diff --git a/usr.sbin/smtpd/queue_backend.c b/usr.sbin/smtpd/queue_backend.c index 8c536199ff9..f0a37903c3b 100644 --- a/usr.sbin/smtpd/queue_backend.c +++ b/usr.sbin/smtpd/queue_backend.c @@ -1,4 +1,4 @@ -/* $OpenBSD: queue_backend.c,v 1.60 2015/12/14 10:22:12 jung Exp $ */ +/* $OpenBSD: queue_backend.c,v 1.61 2015/12/28 22:08:30 jung Exp $ */ /* * Copyright (c) 2011 Gilles Chehade <gilles@poolp.org> @@ -225,7 +225,7 @@ queue_message_commit(uint32_t msgid) ofp = fopen(tmppath, "w+"); if (ifp == NULL || ofp == NULL) goto err; - if (! compress_file(ifp, ofp)) + if (!compress_file(ifp, ofp)) goto err; fclose(ifp); fclose(ofp); @@ -247,7 +247,7 @@ queue_message_commit(uint32_t msgid) ofp = fopen(tmppath, "w+"); if (ifp == NULL || ofp == NULL) goto err; - if (! crypto_encrypt_file(ifp, ofp)) + if (!crypto_encrypt_file(ifp, ofp)) goto err; fclose(ifp); fclose(ofp); @@ -333,7 +333,7 @@ queue_message_fd_r(uint32_t msgid) if ((ofp = fdopen(fdout, "w+")) == NULL) goto err; - if (! crypto_decrypt_file(ifp, ofp)) + if (!crypto_decrypt_file(ifp, ofp)) goto err; fclose(ifp); @@ -355,7 +355,7 @@ queue_message_fd_r(uint32_t msgid) if ((ofp = fdopen(fdout, "w+")) == NULL) goto err; - if (! uncompress_file(ifp, ofp)) + if (!uncompress_file(ifp, ofp)) goto err; fclose(ifp); diff --git a/usr.sbin/smtpd/queue_fs.c b/usr.sbin/smtpd/queue_fs.c index cd1a3215b6b..0751e7c2589 100644 --- a/usr.sbin/smtpd/queue_fs.c +++ b/usr.sbin/smtpd/queue_fs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: queue_fs.c,v 1.12 2015/12/14 10:22:12 jung Exp $ */ +/* $OpenBSD: queue_fs.c,v 1.13 2015/12/28 22:08:30 jung Exp $ */ /* * Copyright (c) 2011 Gilles Chehade <gilles@poolp.org> @@ -80,7 +80,7 @@ queue_fs_message_create(uint32_t *msgid) char rootdir[PATH_MAX]; struct stat sb; - if (! fsqueue_check_space()) + if (!fsqueue_check_space()) return 0; again: @@ -258,7 +258,7 @@ queue_fs_message_uncorrupt(uint32_t msgid) return (0); } - if (! bsnprintf(bucketdir, sizeof bucketdir, "%s/%02x", PATH_QUEUE, + if (!bsnprintf(bucketdir, sizeof bucketdir, "%s/%02x", PATH_QUEUE, (msgid & 0xff000000) >> 24)) { log_warnx("warn: queue-fs: path too long"); return (0); @@ -403,7 +403,7 @@ queue_fs_message_walk(uint64_t *evpid, char *buf, size_t len, if (*done) return (-1); - if (! bsnprintf(path, sizeof path, "%s/%02x/%08x", + if (!bsnprintf(path, sizeof path, "%s/%02x/%08x", PATH_QUEUE, (msgid & 0xff000000) >> 24, msgid)) fatalx("queue_fs_message_walk: path does not fit buffer"); @@ -538,7 +538,7 @@ fsqueue_check_space(void) static void fsqueue_envelope_path(uint64_t evpid, char *buf, size_t len) { - if (! bsnprintf(buf, len, "%s/%02x/%08x/%016" PRIx64, + if (!bsnprintf(buf, len, "%s/%02x/%08x/%016" PRIx64, PATH_QUEUE, (evpid_to_msgid(evpid) & 0xff000000) >> 24, evpid_to_msgid(evpid), @@ -549,7 +549,7 @@ fsqueue_envelope_path(uint64_t evpid, char *buf, size_t len) static void fsqueue_envelope_incoming_path(uint64_t evpid, char *buf, size_t len) { - if (! bsnprintf(buf, len, "%s/%08x/%016" PRIx64, + if (!bsnprintf(buf, len, "%s/%08x/%016" PRIx64, PATH_INCOMING, evpid_to_msgid(evpid), evpid)) @@ -615,7 +615,7 @@ tempfail: static void fsqueue_message_path(uint32_t msgid, char *buf, size_t len) { - if (! bsnprintf(buf, len, "%s/%02x/%08x", + if (!bsnprintf(buf, len, "%s/%02x/%08x", PATH_QUEUE, (msgid & 0xff000000) >> 24, msgid)) @@ -625,7 +625,7 @@ fsqueue_message_path(uint32_t msgid, char *buf, size_t len) static void fsqueue_message_corrupt_path(uint32_t msgid, char *buf, size_t len) { - if (! bsnprintf(buf, len, "%s/%08x", + if (!bsnprintf(buf, len, "%s/%08x", PATH_CORRUPT, msgid)) fatalx("fsqueue_message_corrupt_path: path does not fit buffer"); @@ -634,7 +634,7 @@ fsqueue_message_corrupt_path(uint32_t msgid, char *buf, size_t len) static void fsqueue_message_incoming_path(uint32_t msgid, char *buf, size_t len) { - if (! bsnprintf(buf, len, "%s/%08x", + if (!bsnprintf(buf, len, "%s/%08x", PATH_INCOMING, msgid)) fatalx("fsqueue_message_incoming_path: path does not fit buffer"); diff --git a/usr.sbin/smtpd/rfc2822.c b/usr.sbin/smtpd/rfc2822.c index 14605d5aaa0..06f3ec71b59 100644 --- a/usr.sbin/smtpd/rfc2822.c +++ b/usr.sbin/smtpd/rfc2822.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rfc2822.c,v 1.5 2015/11/05 08:55:09 gilles Exp $ */ +/* $OpenBSD: rfc2822.c,v 1.6 2015/12/28 22:08:30 jung Exp $ */ /* * Copyright (c) 2014 Gilles Chehade <gilles@poolp.org> @@ -93,7 +93,7 @@ parser_feed_header(struct rfc2822_parser *rp, char *line) char *pos; /* new header */ - if (! isspace(*line) && *line != '\0') { + if (!isspace(*line) && *line != '\0') { rp->in_hdr = 1; if ((pos = strchr(line, ':')) == NULL) return 0; @@ -108,7 +108,7 @@ parser_feed_header(struct rfc2822_parser *rp, char *line) } /* continuation */ - if (! rp->in_hdr) + if (!rp->in_hdr) return 0; /* append line to header */ @@ -142,7 +142,7 @@ rfc2822_parser_init(struct rfc2822_parser *rp) void rfc2822_parser_flush(struct rfc2822_parser *rp) { - if (! rp->in_hdrs) + if (!rp->in_hdrs) return; header_callback(rp); diff --git a/usr.sbin/smtpd/scheduler.c b/usr.sbin/smtpd/scheduler.c index 94c0a608610..5636a4cdddb 100644 --- a/usr.sbin/smtpd/scheduler.c +++ b/usr.sbin/smtpd/scheduler.c @@ -1,4 +1,4 @@ -/* $OpenBSD: scheduler.c,v 1.50 2015/10/29 10:25:36 sunil Exp $ */ +/* $OpenBSD: scheduler.c,v 1.51 2015/12/28 22:08:30 jung Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@poolp.org> @@ -155,7 +155,7 @@ scheduler_imsg(struct mproc *p, struct imsg *imsg) "scheduler: queue requested removal of evp:%016" PRIx64, evpid); stat_decrement("scheduler.envelope", 1); - if (! inflight) + if (!inflight) backend->remove(evpid); else { backend->delete(evpid); diff --git a/usr.sbin/smtpd/smtp.c b/usr.sbin/smtpd/smtp.c index b4c00d8f034..b7286bf250d 100644 --- a/usr.sbin/smtpd/smtp.c +++ b/usr.sbin/smtpd/smtp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smtp.c,v 1.150 2015/12/13 09:52:44 gilles Exp $ */ +/* $OpenBSD: smtp.c,v 1.151 2015/12/28 22:08:30 jung Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@poolp.org> @@ -180,7 +180,7 @@ smtp_setup_events(void) iter = NULL; while (dict_iter(env->sc_pki_dict, &iter, &k, (void **)&pki)) { - if (! ssl_setup((SSL_CTX **)&ssl_ctx, pki, smtp_sni_callback, + if (!ssl_setup((SSL_CTX **)&ssl_ctx, pki, smtp_sni_callback, env->sc_tls_ciphers)) fatal("smtp_setup_events: ssl_setup failure"); dict_xset(env->sc_ssl_dict, k, ssl_ctx); @@ -275,7 +275,7 @@ smtp_accept(int fd, short event, void *p) if (env->sc_flags & SMTPD_SMTP_PAUSED) fatalx("smtp_session: unexpected client"); - if (! smtp_can_accept()) { + if (!smtp_can_accept()) { log_warnx("warn: Disabling incoming SMTP connections: " "Client limit reached"); goto pause; diff --git a/usr.sbin/smtpd/smtp_session.c b/usr.sbin/smtpd/smtp_session.c index 86aeffe48a5..9152e1ddbb1 100644 --- a/usr.sbin/smtpd/smtp_session.c +++ b/usr.sbin/smtpd/smtp_session.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smtp_session.c,v 1.263 2015/12/14 10:22:12 jung Exp $ */ +/* $OpenBSD: smtp_session.c,v 1.264 2015/12/28 22:08:30 jung Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@poolp.org> @@ -1186,7 +1186,7 @@ smtp_filter_fd(uint64_t id, int fd) io_init(&s->oev, fd, s, smtp_data_io, &s->obuf); iobuf_fqueue(&s->obuf, "Received: "); - if (! (s->listener->flags & F_MASK_SOURCE)) { + if (!(s->listener->flags & F_MASK_SOURCE)) { iobuf_fqueue(&s->obuf, "from %s (%s [%s])", s->evp.helo, s->hostname, @@ -1330,7 +1330,7 @@ smtp_io(struct io *io, int evt) s->skiphdr = 0; /* BCC should be stripped from headers */ - if (! s->hdrdone) { + if (!s->hdrdone) { if (strncasecmp("bcc:", line, 4) == 0) { s->skiphdr = 1; goto nextline; diff --git a/usr.sbin/smtpd/smtpctl.c b/usr.sbin/smtpd/smtpctl.c index 7fff385ff60..f0a2d72a202 100644 --- a/usr.sbin/smtpd/smtpctl.c +++ b/usr.sbin/smtpd/smtpctl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smtpctl.c,v 1.143 2015/12/22 21:50:22 gilles Exp $ */ +/* $OpenBSD: smtpctl.c,v 1.144 2015/12/28 22:08:30 jung Exp $ */ /* * Copyright (c) 2013 Eric Faurot <eric@openbsd.org> @@ -140,7 +140,7 @@ offline_file(void) int fd; FILE *fp; - if (! bsnprintf(path, sizeof(path), "%s%s/%lld.XXXXXXXXXX", PATH_SPOOL, + if (!bsnprintf(path, sizeof(path), "%s%s/%lld.XXXXXXXXXX", PATH_SPOOL, PATH_OFFLINE, (long long int) time(NULL))) err(EX_UNAVAILABLE, "snprintf"); @@ -620,7 +620,7 @@ do_show_envelope(int argc, struct parameter *argv) { char buf[PATH_MAX]; - if (! bsnprintf(buf, sizeof(buf), "%s%s/%02x/%08x/%016" PRIx64, + if (!bsnprintf(buf, sizeof(buf), "%s%s/%02x/%08x/%016" PRIx64, PATH_SPOOL, PATH_QUEUE, (evpid_to_msgid(argv[0].u.u_evpid) & 0xff000000) >> 24, @@ -652,7 +652,7 @@ do_show_message(int argc, struct parameter *argv) else msgid = argv[0].u.u_msgid; - if (! bsnprintf(buf, sizeof(buf), "%s%s/%02x/%08x/message", + if (!bsnprintf(buf, sizeof(buf), "%s%s/%02x/%08x/message", PATH_SPOOL, PATH_QUEUE, (msgid & 0xff000000) >> 24, @@ -1200,7 +1200,7 @@ show_offline_envelope(uint64_t evpid) struct envelope evp; - if (! bsnprintf(pathname, sizeof pathname, + if (!bsnprintf(pathname, sizeof pathname, "/queue/%02x/%08x/%016"PRIx64, (evpid_to_msgid(evpid) & 0xff000000) >> 24, evpid_to_msgid(evpid), evpid)) @@ -1224,7 +1224,7 @@ show_offline_envelope(uint64_t evpid) goto end; } - if (! envelope_load_buffer(&evp, p, plen)) + if (!envelope_load_buffer(&evp, p, plen)) goto end; evp.id = evpid; show_queue_envelope(&evp, 0); @@ -1270,7 +1270,7 @@ display(const char *s) if (i == 3) errx(1, "crypto-setup: invalid key"); - if (! crypto_decrypt_file(fp, ofp)) { + if (!crypto_decrypt_file(fp, ofp)) { printf("object is encrypted: %s\n", key); exit(1); } diff --git a/usr.sbin/smtpd/smtpd.c b/usr.sbin/smtpd/smtpd.c index 2e0d4e8d313..2fd69397bd4 100644 --- a/usr.sbin/smtpd/smtpd.c +++ b/usr.sbin/smtpd/smtpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: smtpd.c,v 1.268 2015/12/20 14:06:24 gilles Exp $ */ +/* $OpenBSD: smtpd.c,v 1.269 2015/12/28 22:08:30 jung Exp $ */ /* * Copyright (c) 2008 Gilles Chehade <gilles@poolp.org> @@ -644,7 +644,7 @@ main(int argc, char *argv[]) log_info("info: %s %s starting", SMTPD_NAME, SMTPD_VERSION); - if (! foreground) + if (!foreground) if (daemon(0, 0) == -1) err(1, "failed to daemonize"); @@ -726,11 +726,11 @@ load_pki_tree(void) if (pki->pki_key_file == NULL) fatalx("load_pki_tree: missing key file"); - if (! ssl_load_certificate(pki, pki->pki_cert_file)) + if (!ssl_load_certificate(pki, pki->pki_cert_file)) fatalx("load_pki_tree: failed to load certificate file"); if (pki->pki_dhparams_file) - if (! ssl_load_dhparams(pki, pki->pki_dhparams_file)) + if (!ssl_load_dhparams(pki, pki->pki_dhparams_file)) fatalx("load_pki_tree: failed to load dhparams file"); } @@ -738,7 +738,7 @@ load_pki_tree(void) iter_dict = NULL; while (dict_iter(env->sc_ca_dict, &iter_dict, &k, (void **)&sca)) { log_debug("info: loading CA information for %s", k); - if (! ssl_load_cafile(sca, sca->ca_cert_file)) + if (!ssl_load_cafile(sca, sca->ca_cert_file)) fatalx("load_pki_tree: failed to load CA file"); } } @@ -755,7 +755,7 @@ load_pki_keys(void) while (dict_iter(env->sc_pki_dict, &iter_dict, &k, (void **)&pki)) { log_debug("info: loading pki keys for %s", k); - if (! ssl_load_keyfile(pki, pki->pki_key_file, k)) + if (!ssl_load_keyfile(pki, pki->pki_key_file, k)) fatalx("load_pki_keys: failed to load key file"); } } @@ -933,7 +933,7 @@ forkmda(struct mproc *p, uint64_t id, struct deliver *deliver) return; } - if (deliver->userinfo.uid == 0 && ! db->allow_root) { + if (deliver->userinfo.uid == 0 && !db->allow_root) { (void)snprintf(ebuf, sizeof ebuf, "not allowed to deliver to: %s", deliver->user); m_create(p_pony, IMSG_MDA_DONE, 0, 0, -1); @@ -1129,7 +1129,7 @@ offline_enqueue(char *name) _exit(1); } - if (! S_ISREG(sb.st_mode)) { + if (!S_ISREG(sb.st_mode)) { log_warnx("warn: smtpd: file %s (uid %d) not regular", path, sb.st_uid); _exit(1); @@ -1237,7 +1237,7 @@ parent_forward_open(char *username, char *directory, uid_t uid, gid_t gid) int fd; struct stat sb; - if (! bsnprintf(pathname, sizeof (pathname), "%s/.forward", + if (!bsnprintf(pathname, sizeof (pathname), "%s/.forward", directory)) { log_warnx("warn: smtpd: %s: pathname too large", pathname); return -1; @@ -1272,7 +1272,7 @@ parent_forward_open(char *username, char *directory, uid_t uid, gid_t gid) return -1; } - if (! secure_file(fd, pathname, directory, uid, 1)) { + if (!secure_file(fd, pathname, directory, uid, 1)) { log_warnx("warn: smtpd: %s: unsecure file", pathname); close(fd); return -1; @@ -1318,7 +1318,7 @@ imsg_dispatch(struct mproc *p, struct imsg *imsg) if (smtpd_process == PROC_CONTROL) return; - if (! bsnprintf(key, sizeof key, + if (!bsnprintf(key, sizeof key, "profiling.imsg.%s.%s.%s", proc_name(smtpd_process), proc_name(p->proc), diff --git a/usr.sbin/smtpd/table.c b/usr.sbin/smtpd/table.c index b5f8c5e822e..143aceba001 100644 --- a/usr.sbin/smtpd/table.c +++ b/usr.sbin/smtpd/table.c @@ -1,4 +1,4 @@ -/* $OpenBSD: table.c,v 1.21 2015/11/30 14:13:03 gilles Exp $ */ +/* $OpenBSD: table.c,v 1.22 2015/12/28 22:08:30 jung Exp $ */ /* * Copyright (c) 2013 Eric Faurot <eric@openbsd.org> @@ -128,7 +128,7 @@ table_lookup(struct table *table, struct dict *params, const char *key, enum tab if (table->t_backend->lookup == NULL) return (-1); - if (! lowercase(lkey, key, sizeof lkey)) { + if (!lowercase(lkey, key, sizeof lkey)) { log_warnx("warn: lookup key too long: %s", key); return -1; } @@ -299,7 +299,7 @@ table_add(struct table *t, const char *key, const char *val) if (t->t_type & T_DYNAMIC) fatalx("table_add: cannot add to table"); - if (! lowercase(lkey, key, sizeof lkey)) { + if (!lowercase(lkey, key, sizeof lkey)) { log_warnx("warn: lookup key too long: %s", key); return; } @@ -375,9 +375,9 @@ table_mailaddr_match(const char *s1, const char *s2) struct mailaddr m1; struct mailaddr m2; - if (! text_to_mailaddr(&m1, s1)) + if (!text_to_mailaddr(&m1, s1)) return 0; - if (! text_to_mailaddr(&m2, s2)) + if (!text_to_mailaddr(&m2, s2)) return 0; return mailaddr_match(&m1, &m2); } @@ -394,9 +394,9 @@ table_netaddr_match(const char *s1, const char *s2) if (strcasecmp(s1, s2) == 0) return 1; - if (! text_to_netaddr(&n1, s1)) + if (!text_to_netaddr(&n1, s1)) return 0; - if (! text_to_netaddr(&n2, s2)) + if (!text_to_netaddr(&n2, s2)) return 0; if (n1.ss.ss_family != n2.ss.ss_family) return 0; @@ -511,7 +511,7 @@ table_open_all(void) iter = NULL; while (dict_iter(env->sc_tables_dict, &iter, NULL, (void **)&t)) - if (! table_open(t)) + if (!table_open(t)) fatalx("failed to open table %s", t->t_name); } @@ -613,7 +613,7 @@ table_parse_lookup(enum table_service service, const char *key, if (lk->maddrmap == NULL) return (-1); maddrmap_init(lk->maddrmap); - if (! mailaddr_line(lk->maddrmap, line)) { + if (!mailaddr_line(lk->maddrmap, line)) { maddrmap_free(lk->maddrmap); return (-1); } diff --git a/usr.sbin/smtpd/table_static.c b/usr.sbin/smtpd/table_static.c index 885034a9bb4..65892cbedc2 100644 --- a/usr.sbin/smtpd/table_static.c +++ b/usr.sbin/smtpd/table_static.c @@ -1,4 +1,4 @@ -/* $OpenBSD: table_static.c,v 1.13 2015/12/22 07:52:52 sunil Exp $ */ +/* $OpenBSD: table_static.c,v 1.14 2015/12/28 22:08:30 jung Exp $ */ /* * Copyright (c) 2013 Eric Faurot <eric@openbsd.org> @@ -238,9 +238,9 @@ table_static_fetch(void *hdl, struct dict *params, struct table *t = hdl; const char *k; - if (! dict_iter(&t->t_dict, &t->t_iter, &k, (void **)NULL)) { + if (!dict_iter(&t->t_dict, &t->t_iter, &k, (void **)NULL)) { t->t_iter = NULL; - if (! dict_iter(&t->t_dict, &t->t_iter, &k, (void **)NULL)) + if (!dict_iter(&t->t_dict, &t->t_iter, &k, (void **)NULL)) return 0; } diff --git a/usr.sbin/smtpd/to.c b/usr.sbin/smtpd/to.c index a83fc3d078b..de3d82e8083 100644 --- a/usr.sbin/smtpd/to.c +++ b/usr.sbin/smtpd/to.c @@ -1,4 +1,4 @@ -/* $OpenBSD: to.c,v 1.23 2015/12/14 10:22:12 jung Exp $ */ +/* $OpenBSD: to.c,v 1.24 2015/12/28 22:08:30 jung Exp $ */ /* * Copyright (c) 2009 Jacek Masiulaniec <jacekm@dobremiasto.net> @@ -200,7 +200,7 @@ time_to_text(time_t when) fatalx("time_to_text: localtime"); /* We do not use strftime because it is subject to locale substitution*/ - if (! bsnprintf(buf, sizeof(buf), + if (!bsnprintf(buf, sizeof(buf), "%s, %d %s %d %02d:%02d:%02d %c%02d%02d (%s)", day[lt->tm_wday], lt->tm_mday, month[lt->tm_mon], lt->tm_year + 1900, @@ -394,7 +394,7 @@ text_to_relayhost(struct relayhost *relay, const char *s) } else { for (end = beg; *end; ++end) - if (! isalnum((unsigned char)*end) && + if (!isalnum((unsigned char)*end) && *end != '_' && *end != '.' && *end != '-') break; len = end - beg; @@ -413,7 +413,7 @@ text_to_relayhost(struct relayhost *relay, const char *s) return 0; } - if (! valid_domainpart(relay->hostname)) + if (!valid_domainpart(relay->hostname)) return 0; if ((relay->flags & F_LMTP) && (relay->port == 0)) return 0; @@ -857,7 +857,7 @@ alias_is_include(struct expandnode *alias, const char *line, size_t len) else return 0; - if (! alias_is_filename(alias, line + skip, len - skip)) + if (!alias_is_filename(alias, line + skip, len - skip)) return 0; alias->type = EXPAND_INCLUDE; diff --git a/usr.sbin/smtpd/util.c b/usr.sbin/smtpd/util.c index 146d2176f35..b6b7cd5abdb 100644 --- a/usr.sbin/smtpd/util.c +++ b/usr.sbin/smtpd/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.123 2015/12/14 10:22:12 jung Exp $ */ +/* $OpenBSD: util.c,v 1.124 2015/12/28 22:08:30 jung Exp $ */ /* * Copyright (c) 2000,2001 Markus Friedl. All rights reserved. @@ -178,7 +178,7 @@ mkdirs_component(char *path, mode_t mode) if (mkdir(path, mode | S_IWUSR | S_IXUSR) == -1) return 0; } - else if (! S_ISDIR(sb.st_mode)) + else if (!S_ISDIR(sb.st_mode)) return 0; return 1; @@ -204,7 +204,7 @@ mkdirs(char *path, mode_t mode) for (p = path; *p; p++) { if (*p == '/') { if (buf[0] != '\0') - if (! mkdirs_component(buf, mode)) + if (!mkdirs_component(buf, mode)) return 0; while (*p == '/') p++; @@ -216,8 +216,8 @@ mkdirs(char *path, mode_t mode) } buf[i++] = *p; } - if (! done) - if (! mkdirs_component(buf, mode)) + if (!done) + if (!mkdirs_component(buf, mode)) return 0; if (chmod(path, mode) == -1) @@ -377,7 +377,7 @@ mktmpfile(void) char path[PATH_MAX]; int fd; - if (! bsnprintf(path, sizeof(path), "%s/smtpd.XXXXXXXXXX", + if (!bsnprintf(path, sizeof(path), "%s/smtpd.XXXXXXXXXX", PATH_TEMPORARY)) { log_warn("snprintf"); fatal("exiting"); @@ -449,7 +449,7 @@ mailaddr_match(const struct mailaddr *maddr1, const struct mailaddr *maddr2) if (m2.user[0] == '\0' && m2.domain[0] == '\0') return 1; - if (! hostname_match(m1.domain, m2.domain)) + if (!hostname_match(m1.domain, m2.domain)) return 0; if (m2.user[0]) { @@ -471,7 +471,7 @@ valid_localpart(const char *s) { #define IS_ATEXT(c) (isalnum((unsigned char)(c)) || strchr(MAILADDR_ALLOWED, (c))) nextatom: - if (! IS_ATEXT(*s) || *s == '\0') + if (!IS_ATEXT(*s) || *s == '\0') return 0; while (*(++s) != '\0') { if (*s == '.') @@ -642,7 +642,7 @@ xlowercase(char *buf, const char *s, size_t len) if (len == 0) fatalx("lowercase: len == 0"); - if (! lowercase(buf, s, len)) + if (!lowercase(buf, s, len)) fatalx("lowercase: truncation"); } |