The branch main has been updated by emaste:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=631bdcf3043c00b90fc29aedb8da91251be2cd8a

commit 631bdcf3043c00b90fc29aedb8da91251be2cd8a
Author:     Ed Maste <ema...@freebsd.org>
AuthorDate: 2022-10-12 17:40:38 +0000
Commit:     Ed Maste <ema...@freebsd.org>
CommitDate: 2022-10-12 17:41:44 +0000

    blacklistd: whitespace cleanup
    
    Diff reduction against NetBSD external/bsd/blacklist (at commit
    03c74c04f277).
    
    Sponsored by:   The FreeBSD Foundation
---
 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 11c73451b84e..5e5a6dce1adc 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 e2a45f80d787..94baa75c09b0 100644
--- a/contrib/blacklist/bin/conf.c
+++ b/contrib/blacklist/bin/conf.c
@@ -173,9 +173,9 @@ again:
                        }
                        break;
                }
-       } else  
+       } else
                tot = im;
-                       
+
        if (e == 0) {
                c->c_duration = (int)tot;
                return 0;
@@ -214,7 +214,7 @@ static int
 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';
@@ -264,7 +264,7 @@ gethostport(const char *f, size_t l, bool local, struct 
conf *c, const char *p)
                        sin6->sin6_len = sizeof(*sin6);
 #endif
                        port = &sin6->sin6_port;
-               } 
+               }
        } else if (pstr != p || strchr(p, '.') || conf_is_interface(p)) {
                if (pstr == p)
                        pstr = "*";
@@ -366,7 +366,7 @@ getname(const char *f, size_t l, bool local, struct conf *c,
 {
        if (getmask(f, l, local, &p, &c->c_rmask) == -1)
                return -1;
-               
+
        if (strcmp(p, "*") == 0) {
                strlcpy(c->c_name, rulename, CONFNAMESZ);
                return 0;
@@ -473,7 +473,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();
@@ -687,7 +687,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;
 
@@ -744,7 +744,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);
@@ -820,7 +820,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)
@@ -878,7 +878,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)
@@ -1012,13 +1012,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;
        }
 
@@ -1035,7 +1035,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;
        }
 
@@ -1047,7 +1047,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;
        }
 
@@ -1132,7 +1132,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;
        }
 

Reply via email to