From nobody Thu Mar 2 16:07:45 2023 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4PSGGT6bnxz3vyLC; Thu, 2 Mar 2023 16:07:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4PSGGT654hz4Rtj; Thu, 2 Mar 2023 16:07:45 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677773265; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rLSSbKuhog5uPfpVm55PYaSPIPSYsmJLxHoa9qljdDg=; b=qFNmBy8LKBSNzYIjfsf/1YP8LV5E/eOpN4K5//TCNYF5tQnEdsExFeOteovGcURRFnezPu /scSGw2y014conzkBDnx6fWVCXS52oVnd+78dCOwZ9CrtS+8IPG1MnmrpQ6D8XzFu8k73N q08jf33hFRepVL8jk58XeiidIUlJkWYGsnbp66+QFKEFvH/zwyqZKirdT4l34QbeplqGIl 1euTDzWhC+/WFnKq4gb/HwHVpjR/paPz+oLo6SGPZSKgNzXBk/sI+VwRe8qn+aWtLRKgfR UDiRiWx1JEOARzG8XmUfA2yrEk3LrMzRpo2H2ge+p40N10cQGX8TQRNhVrpT3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1677773265; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rLSSbKuhog5uPfpVm55PYaSPIPSYsmJLxHoa9qljdDg=; b=R7Od0ecZQq+MDUr/kabk/mOmNzmLwAZKKhP1NSpwgjwH8uLLPReX9/b/HZsby4cHYEfBXB pOCzdQADCjAhUa6j88DkKn6vHi2S4+FhIWlkY4eIg/r5e7gnu8xtNSSlnn7Dv3eHbx6g3+ msofjwToFQLR3CnV59v0e2nusPb3hoVmSw8vDN1OyKeCFWr1ne8/CUl+sfnuVic1ebLVcG TBN1b/asgU5Afrr27W6DaPbbuW2Cc2noxlupoFKEcLR8wryZqVjO+nea8rwJ6yTnJFC57h jpSdAFdRbkSdi00rL2lNGjmLil6pWQMcKAcDiMJ8qcQOXlkYZSWMuONckecADQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1677773265; a=rsa-sha256; cv=none; b=XbS0p5k5xlPW/QlCQvfcPFR1m2UNCMRg0h4lHR8XOmllx1HQFu6FzR0MnjtxvOLHjR0d7u rUWti72L3CzFSp57/BHKt4tvovlu3GWegXgpIZQf8IUEm4n2S0sGR4RAeS8WevzYgEVJL+ ovdjtcMx1UCjy6Mf9Z7IBkqDl9r4CbyFBRtQnS5/J0fger6yapaIitivnzevsa5FdOCqA4 CjS70ubb0yD6PhXM1N+XU7ydK+h5MhWpH4Y1kk+stEwAeALc37KXdzvMa7WOJRE9SPDjOr 2BsHautUePncvpV3Vg8jbY/YnJCUbIOWDfglFbUs+jgI3zaeE+vWmd18OK+rnQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4PSGGT582gzN47; Thu, 2 Mar 2023 16:07:45 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 322G7jco021259; Thu, 2 Mar 2023 16:07:45 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 322G7j6u021258; Thu, 2 Mar 2023 16:07:45 GMT (envelope-from git) Date: Thu, 2 Mar 2023 16:07:45 GMT Message-Id: <202303021607.322G7j6u021258@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Ed Maste Subject: git: 2b29bd3a6d59 - stable/13 - blacklistd: whitespace cleanup List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: emaste X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: 2b29bd3a6d59eec73db76575303dac145d82aa57 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=2b29bd3a6d59eec73db76575303dac145d82aa57 commit 2b29bd3a6d59eec73db76575303dac145d82aa57 Author: Ed Maste AuthorDate: 2022-10-12 17:40:38 +0000 Commit: Ed Maste CommitDate: 2023-03-02 14:25:27 +0000 blacklistd: whitespace cleanup Diff reduction against NetBSD external/bsd/blacklist (at commit 03c74c04f277). Sponsored by: The FreeBSD Foundation (cherry picked from commit 631bdcf3043c00b90fc29aedb8da91251be2cd8a) --- contrib/blacklist/bin/blacklistd.c | 17 ++++++++--------- contrib/blacklist/bin/conf.c | 30 +++++++++++++++--------------- contrib/blacklist/bin/run.c | 2 +- contrib/blacklist/bin/support.c | 2 +- contrib/blacklist/diff/proftpd.diff | 2 +- contrib/blacklist/lib/bl.c | 4 ++-- 6 files changed, 28 insertions(+), 29 deletions(-) diff --git a/contrib/blacklist/bin/blacklistd.c b/contrib/blacklist/bin/blacklistd.c index e880eb457df0..4aa845e46525 100644 --- a/contrib/blacklist/bin/blacklistd.c +++ b/contrib/blacklist/bin/blacklistd.c @@ -123,7 +123,7 @@ getremoteaddress(bl_info_t *bi, struct sockaddr_storage *rss, socklen_t *rsl) return 0; if (errno != ENOTCONN) { - (*lfun)(LOG_ERR, "getpeername failed (%m)"); + (*lfun)(LOG_ERR, "getpeername failed (%m)"); return -1; } @@ -141,13 +141,13 @@ getremoteaddress(bl_info_t *bi, struct sockaddr_storage *rss, socklen_t *rsl) break; default: (*lfun)(LOG_ERR, "bad client passed socket family %u", - (unsigned)bi->bi_ss.ss_family); + (unsigned)bi->bi_ss.ss_family); return -1; } if (*rsl != bi->bi_slen) { (*lfun)(LOG_ERR, "bad client passed socket length %u != %u", - (unsigned)*rsl, (unsigned)bi->bi_slen); + (unsigned)*rsl, (unsigned)bi->bi_slen); return -1; } @@ -157,7 +157,7 @@ getremoteaddress(bl_info_t *bi, struct sockaddr_storage *rss, socklen_t *rsl) if (*rsl != rss->ss_len) { (*lfun)(LOG_ERR, "bad client passed socket internal length %u != %u", - (unsigned)*rsl, (unsigned)rss->ss_len); + (unsigned)*rsl, (unsigned)rss->ss_len); return -1; } #endif @@ -176,12 +176,12 @@ process(bl_t bl) struct timespec ts; if (clock_gettime(CLOCK_REALTIME, &ts) == -1) { - (*lfun)(LOG_ERR, "clock_gettime failed (%m)"); + (*lfun)(LOG_ERR, "clock_gettime failed (%m)"); return; } if ((bi = bl_recv(bl)) == NULL) { - (*lfun)(LOG_ERR, "no message (%m)"); + (*lfun)(LOG_ERR, "no message (%m)"); return; } @@ -251,7 +251,6 @@ process(bl_t bl) (*lfun)(LOG_INFO, "blocked %s/%d:%d for %d seconds", rbuf, c.c_lmask, c.c_port, c.c_duration); - } break; case BL_DELETE: @@ -264,7 +263,7 @@ process(bl_t bl) /* ignore for now */ break; default: - (*lfun)(LOG_ERR, "unknown message %d", bi->bi_type); + (*lfun)(LOG_ERR, "unknown message %d", bi->bi_type); } state_put(state, &c, &dbi); @@ -306,7 +305,7 @@ update(void) void *ss = &c.c_ss; if (clock_gettime(CLOCK_REALTIME, &ts) == -1) { - (*lfun)(LOG_ERR, "clock_gettime failed (%m)"); + (*lfun)(LOG_ERR, "clock_gettime failed (%m)"); return; } diff --git a/contrib/blacklist/bin/conf.c b/contrib/blacklist/bin/conf.c index f21dd8b05158..5fc614d794b1 100644 --- a/contrib/blacklist/bin/conf.c +++ b/contrib/blacklist/bin/conf.c @@ -174,9 +174,9 @@ again: } break; } - } else + } else tot = im; - + if (e == 0) { c->c_duration = (int)tot; return 0; @@ -215,7 +215,7 @@ static int conf_getmask(const char *f, size_t l, bool local, const char **p, int *mask) { char *d; - const char *s = *p; + const char *s = *p; if ((d = strchr(s, ':')) != NULL) { *d++ = '\0'; @@ -266,7 +266,7 @@ conf_gethostport(const char *f, size_t l, bool local, struct conf *c, sin6->sin6_len = sizeof(*sin6); #endif port = &sin6->sin6_port; - } + } } else if (pstr != p || strchr(p, '.') || conf_is_interface(p)) { if (pstr == p) pstr = "*"; @@ -368,7 +368,7 @@ conf_getname(const char *f, size_t l, bool local, struct conf *c, { if (conf_getmask(f, l, local, &p, &c->c_rmask) == -1) return -1; - + if (strcmp(p, "*") == 0) { strlcpy(c->c_name, rulename, CONFNAMESZ); return 0; @@ -475,7 +475,7 @@ conf_amask_eq(const void *v1, const void *v2, size_t len, int mask) return 1; goto out; case FEQUAL: - + (*lfun)(LOG_CRIT, "%s: Internal error: bad mask %d", __func__, mask); abort(); @@ -689,7 +689,7 @@ conf_addr_eq(const struct sockaddr_storage *s1, static int conf_eq(const struct conf *c1, const struct conf *c2) { - + if (!conf_addr_eq(&c1->c_ss, &c2->c_ss, c2->c_lmask)) return 0; @@ -746,7 +746,7 @@ fmtport(char *b, size_t l, int port) if (port == FSTAR) return; - if (b[0] == '\0' || strcmp(b, "*") == 0) + if (b[0] == '\0' || strcmp(b, "*") == 0) snprintf(b, l, "%d", port); else { snprintf(buf, sizeof(buf), ":%d", port); @@ -822,7 +822,7 @@ conf_print(char *buf, size_t len, const char *pref, const char *delim, fmtmask(ha, sizeof(ha), c->c_family, c->c_lmask); fmtport(ha, sizeof(ha), c->c_port); - + sp = *delim == '\t' ? 20 : -1; hb[0] = '\0'; if (*delim) @@ -880,7 +880,7 @@ conf_merge(struct conf *c, const struct conf *sc) (*lfun)(LOG_DEBUG, "%s: %s", __func__, conf_print(buf, sizeof(buf), "to:\t", "", c)); } - + if (sc->c_name[0]) memcpy(c->c_name, sc->c_name, CONFNAMESZ); if (sc->c_uid != FEQUAL) @@ -1014,13 +1014,13 @@ conf_find(int fd, uid_t uid, const struct sockaddr_storage *rss, slen = sizeof(lss); memset(&lss, 0, slen); if (getsockname(fd, (void *)&lss, &slen) == -1) { - (*lfun)(LOG_ERR, "getsockname failed (%m)"); + (*lfun)(LOG_ERR, "getsockname failed (%m)"); return NULL; } slen = sizeof(proto); if (getsockopt(fd, SOL_SOCKET, SO_TYPE, &proto, &slen) == -1) { - (*lfun)(LOG_ERR, "getsockopt failed (%m)"); + (*lfun)(LOG_ERR, "getsockopt failed (%m)"); return NULL; } @@ -1037,7 +1037,7 @@ conf_find(int fd, uid_t uid, const struct sockaddr_storage *rss, cr->c_proto = IPPROTO_UDP; break; default: - (*lfun)(LOG_ERR, "unsupported protocol %d", proto); + (*lfun)(LOG_ERR, "unsupported protocol %d", proto); return NULL; } @@ -1049,7 +1049,7 @@ conf_find(int fd, uid_t uid, const struct sockaddr_storage *rss, cr->c_port = ntohs(((struct sockaddr_in6 *)&lss)->sin6_port); break; default: - (*lfun)(LOG_ERR, "unsupported family %d", lss.ss_family); + (*lfun)(LOG_ERR, "unsupported family %d", lss.ss_family); return NULL; } @@ -1134,7 +1134,7 @@ conf_parse(const char *f) fclose(fp); confset_sort(&lc); confset_sort(&rc); - + confset_replace(&rconf, &rc); confset_replace(&lconf, &lc); diff --git a/contrib/blacklist/bin/run.c b/contrib/blacklist/bin/run.c index 8499edd3d9c2..5588f0198c04 100644 --- a/contrib/blacklist/bin/run.c +++ b/contrib/blacklist/bin/run.c @@ -75,7 +75,7 @@ run(const char *cmd, const char *name, ...) (argv[i] = va_arg(ap, char *)) != NULL; i++) continue; va_end(ap); - + if (debug) { size_t z; int r; diff --git a/contrib/blacklist/bin/support.c b/contrib/blacklist/bin/support.c index 79a1c6ee93ac..d560d2303223 100644 --- a/contrib/blacklist/bin/support.c +++ b/contrib/blacklist/bin/support.c @@ -46,7 +46,7 @@ __RCSID("$NetBSD: support.c,v 1.9 2018/09/18 22:12:19 christos Exp $"); #include "support.h" static __attribute__((__format_arg__(3))) const char * -expandm(char *buf, size_t len, const char *fmt) +expandm(char *buf, size_t len, const char *fmt) { char *p; size_t r; diff --git a/contrib/blacklist/diff/proftpd.diff b/contrib/blacklist/diff/proftpd.diff index c811c9cf50bc..455b7cd60c64 100644 --- a/contrib/blacklist/diff/proftpd.diff +++ b/contrib/blacklist/diff/proftpd.diff @@ -1,7 +1,7 @@ --- Make.rules.in.orig 2015-05-27 20:25:54.000000000 -0400 +++ Make.rules.in 2016-01-25 21:48:47.000000000 -0500 @@ -110,3 +110,8 @@ - + FTPWHO_OBJS=ftpwho.o scoreboard.o misc.o BUILD_FTPWHO_OBJS=utils/ftpwho.o utils/scoreboard.o utils/misc.o + diff --git a/contrib/blacklist/lib/bl.c b/contrib/blacklist/lib/bl.c index ab2bd7c43ebe..a3aa4ef1f9f6 100644 --- a/contrib/blacklist/lib/bl.c +++ b/contrib/blacklist/lib/bl.c @@ -496,12 +496,12 @@ bl_recv(bl_t b) } if (got != (GOT_CRED|GOT_FD)) { - bl_log(b->b_fun, LOG_ERR, "message missing %s %s", + bl_log(b->b_fun, LOG_ERR, "message missing %s %s", #if GOT_CRED != 0 (got & GOT_CRED) == 0 ? "cred" : #endif "", (got & GOT_FD) == 0 ? "fd" : ""); - + return NULL; }