]> git.ipfire.org Git - thirdparty/postfix.git/commitdiff
postfix-3.12-20260516 master
authorWietse Z Venema <wietse@porcupine.org>
Sat, 16 May 2026 05:00:00 +0000 (00:00 -0500)
committerViktor Dukhovni <ietf-dane@dukhovni.org>
Sun, 17 May 2026 14:15:29 +0000 (00:15 +1000)
58 files changed:
postfix/.indent.pro
postfix/HISTORY
postfix/proto/stop.double-history
postfix/proto/stop.spell-history
postfix/src/bounce/bounce_notify_util_tester.c
postfix/src/global/allowed_prefix.c
postfix/src/global/allowed_prefix.h
postfix/src/global/anvil_clnt.c
postfix/src/global/dict_sqlite_test.c
postfix/src/global/haproxy_srvr.h
postfix/src/global/hfrom_format_test.c
postfix/src/global/mail_version.h
postfix/src/global/map_search_test.c
postfix/src/global/nbdb_redirect.c
postfix/src/global/nbdb_redirect_test.c
postfix/src/global/rfc2047_code.c
postfix/src/nbdb_reindexd/nbdb_process.c
postfix/src/nbdb_reindexd/nbdb_safe.c
postfix/src/postscreen/postscreen_dnsbl_test.c
postfix/src/postscreen/postscreen_smtpd.c
postfix/src/postscreen/postscreen_tls_conf.c
postfix/src/posttls-finger/posttls-finger.c
postfix/src/ptest/msg_jmp.c
postfix/src/ptest/ptest_log_test.c
postfix/src/smtp/smtp_connect.c
postfix/src/smtp/smtp_proto.c
postfix/src/smtp/smtp_reqtls_policy_test.c
postfix/src/smtpd/smtpd.c
postfix/src/testing/make_attr.c
postfix/src/testing/match_basic.c
postfix/src/testing/match_basic_test.c
postfix/src/testing/mock_dns_lookup.c
postfix/src/testing/mock_myaddrinfo_test.c
postfix/src/testing/mock_servent.h
postfix/src/testing/mock_server.c
postfix/src/testing/mock_server.h
postfix/src/testing/mock_server_test.c
postfix/src/testing/mock_stat.c
postfix/src/tls/tls.h
postfix/src/tls/tls_misc.c
postfix/src/tls/tls_proxy_client_init_proto_test.c
postfix/src/tls/tls_proxy_client_param_proto_test.c
postfix/src/tls/tls_proxy_server_init_proto.c
postfix/src/tls/tls_proxy_server_init_proto_test.c
postfix/src/tls/tls_proxy_server_param_proto_test.c
postfix/src/tls/tls_verify.c
postfix/src/tlsproxy/tlsproxy_diff.c
postfix/src/util/argv.c
postfix/src/util/argv.h
postfix/src/util/dict.h
postfix/src/util/dict_open.c
postfix/src/util/dynamicmaps.c
postfix/src/util/inet_connect.c
postfix/src/util/myaddrinfo.c
postfix/src/util/mystrtok_test.c
postfix/src/util/sunos5_stream_test.c
postfix/src/util/wrap_netdb.h
postfix/src/util/wrap_stat.c

index 9ece20998e1acaab808392289b3109a96d6e8364..81780bfb571d4016bd79d5b2cc92a5b9b0c34555 100644 (file)
@@ -2,7 +2,7 @@
 -TADDR_MATCH_LIST
 -TADDR_PATTERN
 -TALIAS_TOKEN
--TALLOWED_PARENT
+-TALLOWED_PREFIX
 -TANVIL_CLNT
 -TANVIL_LOCAL
 -TANVIL_MAX
 -TMOCK_APPL_STATUS
 -TMOCK_EXPECT
 -TMOCK_OPEN_AS_REQ
+-TMOCK_SERVER
 -TMOCK_SPAWN_CMD_REQ
 -TMOCK_STAT_REQ
 -TMOCK_UNIX_SERVER
 -Tssize_t
 -Tssl_cipher_stack_t
 -Tssl_comp_stack_t
--Tstat
 -Ttime_t
 -Ttlsa_filter
 -Tuint16_t
index c934825e9aa93c6e95ab95f0339f0c30f3feb6d3..4a30c1525e3291805b3098851f9ee9e4f148d96e 100644 (file)
@@ -31161,6 +31161,17 @@ Apologies for any names omitted.
        anvil/anvil.c, global/anvil_clnt.[hc], proto/postconf.proto,
        mantools/postlink.
 
+20260516
+
+       Cleanup: moved a "mask &= ~TLS_LOG_TRACE" statement whose effect
+       was never used. File:tls/tls_misc.c.
+
+       Safety: future-proofing (posttls-finger.c) and fail-closed
+       (tls_misc.c).
+
+       Re-indented the source code after deleting 'stat' and adding
+       missing types to .indent.pro.
+
 TODO
 
        Reorganize PTEST_LIB, PMOCK_LIB, TESTLIB, TESTLIBS, etc.
index c463b4d8f7978a3923fffea90ff395b51b625d05..2a32e3bee1af562bd1dae4705486c5b18c9161f3 100644 (file)
@@ -259,3 +259,5 @@ proto  proto stop proto stop double cc
  smtpd smtpd c tls tls h tls tls_client c tls tls_misc c 
  smtp smtp c smtp smtp_params c smtp smtp_proto c 
  tlsproxy tlsproxy c tlsproxy tlsproxy_client c 
+ postscreen postscreen c postscreen postscreen_tls_conf c 
+ anvil anvil c global anvil_clnt hc proto postconf proto 
index e30c9f947f549e556f3ad06aa16da145af9c894f..f1f938112cf9fe8bf7bb818e0dd7d9b982fbad0a 100644 (file)
@@ -139,3 +139,4 @@ gmock
 sunos
 WebPKI
 rf
+musl
index 2d6c12303e47edad96369870ce7667183760d958..6f3289db5e672ed8253cb4beefcb99a2276d0ed0 100644 (file)
@@ -157,11 +157,11 @@ int     main(int argc, char **argv)
     };
 
     test_server_main(argc, argv, test_driver,
-             CA_TEST_MAIN_INT_TABLE(int_table),
-             CA_TEST_MAIN_STR_TABLE(str_table),
-             CA_TEST_MAIN_TIME_TABLE(time_table),
-             CA_TEST_MAIN_NBOOL_TABLE(nbool_table),
-             0);
+                    CA_TEST_MAIN_INT_TABLE(int_table),
+                    CA_TEST_MAIN_STR_TABLE(str_table),
+                    CA_TEST_MAIN_TIME_TABLE(time_table),
+                    CA_TEST_MAIN_NBOOL_TABLE(nbool_table),
+                    0);
 
     exit(0);
 }
index 178f250a685a2c905969263f966d64d7cf63226c..a226f178f2f896006fde3a0a7a4fa0efff14a87b 100644 (file)
@@ -81,7 +81,7 @@ ALLOWED_PREFIX *allowed_prefix_create(const char *prefixes)
     tp = argv_alloc(5);
     while ((prefix = mystrtok(&bp, CHARS_COMMA_SP)) != 0) {
        if (*prefix != '/') {
-           (void) decline_request_with("relative pathname",prefix);
+           (void) decline_request_with("relative pathname", prefix);
            continue;
        }
        /* Trim trailing '/'. */
index 0ca75c37834759f953a3717025fe7e40bafaeddb..bdb83fcdb011ad56207681fb914d5ccdd63359ad 100644 (file)
@@ -1,5 +1,5 @@
-#ifndef _ALLOWED_PARENT_H_INCLUDED_
-#define _ALLOWED_PARENT_H_INCLUDED_
+#ifndef _ALLOWED_PREFIX_H_INCLUDED_
+#define _ALLOWED_PREFIX_H_INCLUDED_
 
 /*++
 /* NAME
index e536c52d0417508f612adee022642664f2857a2a..800a625305b3277fbffef8b913f532b75ad11571 100644 (file)
@@ -223,8 +223,8 @@ void    anvil_clnt_free(ANVIL_CLNT *anvil_clnt)
 
 int     anvil_clnt_lookup(ANVIL_CLNT *anvil_clnt, const char *service,
                                  const char *addr, int *count, int *rate,
-                                 int *msgs, int *rcpts, int *newtls,
-                                 int *auths, int *tlstrs)
+                                 int *msgs, int *rcpts, int *newtls,
+                                 int *auths, int *tlstrs)
 {
     char   *ident = ANVIL_IDENT(service, addr);
     int     status;
index 0eae17cd92c854c2f702e236d0b12175873e523d..f0c1a1972d7f1933dfce8926452be933932bf495 100644 (file)
@@ -159,7 +159,7 @@ static void test_flag_non_recommended_query(PTEST_CTX *t, const PTEST_CASE *tp)
     if (unlink(cfpath) < 0)
        ptest_error(t, "unlink %s: %m", cfpath);
 #else
-    ptest_skip(t);
+            ptest_skip(t);
 #endif
 }
 
index 9467b058eac223691f621594b4cb631d72ceefef..e007ef59d4c983910462dfeec79533218d4ddc84 100644 (file)
@@ -204,7 +204,7 @@ struct proxy_hdr_v2 {
  /*
   * End protocol v2 definitions from haproxy/include/types/connection.h.
   */
-#endif /* HAPROXY_SRVR_INTERNAL */
+#endif                                 /* HAPROXY_SRVR_INTERNAL */
 
 /* LICENSE
 /* .ad
index f5d1a390354763d83bccef7ece86b9155bde9005..eb2dd62e7ad6ed28508af382d4f542f44106932c 100644 (file)
@@ -73,8 +73,8 @@ static void test_hfrom_format_parse(PTEST_CTX *t, const PTEST_CASE *tp)
            if (*np->want_log == 0) {
                if (got_code != np->want_code) {
                    ptest_error(t, "got code \"%d\", want \"%d\"(%s)",
-                              got_code, np->want_code,
-                              str_hfrom_format_code(np->want_code));
+                               got_code, np->want_code,
+                               str_hfrom_format_code(np->want_code));
                }
            }
        });
@@ -121,7 +121,7 @@ static void test_str_hfrom_format_code(PTEST_CTX *t, const PTEST_CASE *tp)
            if (*cp->want_log == 0) {
                if (strcmp(got_name, cp->want_name) != 0) {
                    ptest_error(t, "got name: \"%s\", want: \"%s\"",
-                              got_name, cp->want_name);
+                               got_name, cp->want_name);
                }
            }
        });
index a531444487e62c65523b050a60c5597ca67cd54e..047d98af7ca5842e891f352925f377e075f46b28 100644 (file)
@@ -20,7 +20,7 @@
   * Patches change both the patchlevel and the release date. Snapshots have no
   * patchlevel; they change the release date only.
   */
-#define MAIL_RELEASE_DATE      "20260514"
+#define MAIL_RELEASE_DATE      "20260516"
 #define MAIL_VERSION_NUMBER    "3.12"
 
 #ifdef SNAPSHOT
index 8eb6b91b7e319b2820732ab4a92c0b5532daf6b4..0e037eac94c0a70b915e52e6477024320d26146a 100644 (file)
@@ -223,7 +223,7 @@ static void test_map_search(PTEST_CTX *t, const struct PTEST_CASE *unused)
                            escape_order(got_escaped,
                      string_or_null(map_search_from_create->search_order)),
                            escape_order(want_escaped,
-                                    string_or_null(tp->want_search_order)));
+                                   string_or_null(tp->want_search_order)));
            }
        });
     }
index 5de5e4a50655181303a36e6680e20354737cb20c..9ae67430cfe3f2ebe856bb52fc8a4b418ab12c7a 100644 (file)
@@ -185,7 +185,7 @@ static DICT *nbdb_dict_open(const char *leg_type, const char *name,
                                   "known pathname suffix", non_leg_type));
        }
        non_leg_index_path = concatenate(name, non_leg_suffix, (char *) 0);
-       stat_res = stat (non_leg_index_path, &st);
+       stat_res = stat(non_leg_index_path, &st);
 
        saved_errno = errno;
        myfree(non_leg_index_path);
index 728b5d707d282b322fa9d5f1cbda36df9415f0b3..ec698678b82f71ddc926cb3d43a46f5720c7e601 100644 (file)
@@ -169,7 +169,7 @@ static int redirects_dict_open_btree_to_def_cache_db_type(const TEST_CASE *tp)
        setup_common_mock_open_info();
        var_cache_db_type = "lmdb";
        capture = msg_capt_create(100);
-        var_nbdb_log_redirect = want_logging != 0;
+       var_nbdb_log_redirect = want_logging != 0;
 
        /*
         * Verify that 'btree' redirects to $default_cache_db_type ('lmdb').
index 3c8b7b201292ae281bb442555a5c5356036c5338..40b7866838bb0361b213e1f5db520aae91a329ef 100644 (file)
 
  /*
   * What ASCII characters are allowed in the 'charset' or 'encoding' tokens
-  * of an encoded-word. 202604 Claude: in the macro expansion replace
-  * several instances of 'ch' with 'c'.
+  * of an encoded-word. 202604 Claude: in the macro expansion replace several
+  * instances of 'ch' with 'c'.
   */
 #define RFC2047_ESPECIALS_STR  "()<>@,;:\\\"/[]?.="
 #define RFC2047_ALLOWED_TOKEN_CHAR(c) \
@@ -659,7 +659,7 @@ static const TEST_CASE test_cases[] = {
        "encoder called with empty charset name\n"
     },
     {"validates_charset_length", test_rfc2047_encode,
-       RFC2047_HEADER_CONTEXT_COMMENT, /* charset= */ 
+       RFC2047_HEADER_CONTEXT_COMMENT, /* charset= */
        "1234567890123456789012345678901234567890",
        "testme", 0, " ", NO_OUTPUT, "rfc2047_code: warning: rfc2047_encode: "
        "unreasonable charset name: "
index 0ad6ef109e65c9ffdbd42ad19fd708014898243a..2ddcd4bf94739c043694050febcdc18283142967 100644 (file)
@@ -129,7 +129,7 @@ int     nbdb_process(const char *leg_type, const char *source_path,
      * the client may have connected to this service before the file was
      * indexed.
      */
-    if (stat (STR(new_idx_path), &new_idx_st) == 0 && new_idx_st.st_size > 0) {
+    if (stat(STR(new_idx_path), &new_idx_st) == 0 && new_idx_st.st_size > 0) {
        msg_info("target file '%s' already exists, skipping this request",
                 STR(new_idx_path));
        return (NBDB_STAT_OK);
@@ -140,7 +140,7 @@ int     nbdb_process(const char *leg_type, const char *source_path,
      * the owner's (uid, gid) to run the postmap or postalias command with.
      */
     vstring_sprintf(leg_idx_path, "%s%s", source_path, NBDB_LEGACY_SUFFIX);
-    if (stat (STR(leg_idx_path), &leg_idx_st) < 0) {
+    if (stat(STR(leg_idx_path), &leg_idx_st) < 0) {
        vstring_sprintf(why, "look up status for legacy indexed file '%s': %m",
                        STR(leg_idx_path));
        return (NBDB_STAT_ERROR);
@@ -151,7 +151,7 @@ int     nbdb_process(const char *leg_type, const char *source_path,
      * and will reject the request if the source has unsafe permissions for
      * the uid that we would run postmap or postalias with.
      */
-    if (stat (source_path, &source_st) < 0) {
+    if (stat(source_path, &source_st) < 0) {
        vstring_sprintf(why, "look up status for source file '%s': %m",
                        source_path);
        return (NBDB_STAT_ERROR);
@@ -164,7 +164,7 @@ int     nbdb_process(const char *leg_type, const char *source_path,
      */
     vstring_strcpy(parent_dir_buf, source_path);
     parent_dir = dirname(STR(parent_dir_buf));
-    if (stat (parent_dir, &parent_dir_st) < 0) {
+    if (stat(parent_dir, &parent_dir_st) < 0) {
        vstring_sprintf(why, "look up status for parent directory '%s': %m",
                        parent_dir);
        return (NBDB_STAT_ERROR);
index 621f5e692238b74103f36ec50f076d178bfb1b95..cf73e17429edec9070fbcdb366afbcf9c5b527f5 100644 (file)
@@ -76,7 +76,7 @@
 
 /* nbdb_safe_for_uid - owned by the user or root, not group or other writable */
 
-bool    nbdb_safe_for_uid(uid_t uid, const struct stat *st)
+bool    nbdb_safe_for_uid(uid_t uid, const struct stat * st)
 {
 
     /*
@@ -93,9 +93,9 @@ bool    nbdb_safe_for_uid(uid_t uid, const struct stat *st)
 /* nbdb_safe_to_index_as_legacy_index_owner - OK to run postmap/postalias */
 
 bool    nbdb_safe_to_index_as_legacy_index_owner(
-                     const char *source_path, const struct stat *source_st,
-                   const char *leg_idx_path, const struct stat *leg_idx_st,
-                  const char *parent_dir, const struct stat *parent_dir_st,
+                    const char *source_path, const struct stat * source_st,
+                  const char *leg_idx_path, const struct stat * leg_idx_st,
+                 const char *parent_dir, const struct stat * parent_dir_st,
                                                         VSTRING *why)
 {
     uid_t   runas_uid;
index 8e3a0fcf69a63b1ab8e783ff597085e18a3ba5a9..ef7ccada37517895ab3b856dda619940fac33a77 100644 (file)
@@ -343,7 +343,7 @@ struct multi_dnsbl_data {
     const char *dnsbl_sites;           /* postscreen_dnsbl_sites */
     const char *req_addr;              /* in dnsblog request */
     struct dnsbl_data dnsbl_data[MAX_DNSBL_SITES];
-    int            want_ttl;                   /* effective TTL */
+    int     want_ttl;                  /* effective TTL */
     int     want_score;                        /* sum of weights */
 };
 
@@ -500,7 +500,7 @@ static void test_multi_dnsbl(PTEST_CTX *t, const PTEST_CASE *tp)
                                            dp[n].res_ttl),
                              ATTR_TYPE_END);
                mock_server_interact(mp[n], serialized_req,
-                                         serialized_resp);
+                                    serialized_resp);
                vstring_free(serialized_req);
                vstring_free(serialized_resp);
            }
index 89fcdac31b0d34d8c605c062b61762d083b39578..6449a9abf245d0c1acfe0d6451324af8d5ed28cd 100644 (file)
@@ -1243,14 +1243,15 @@ void    psc_smtpd_init(void)
     psc_smtpd_helo_reply = mystrdup(STR(psc_temp));
 
     /*
-     * STARTTLS support. This affects the EHLO greeting. */
+     * STARTTLS support. This affects the EHLO greeting.
+     */
     psc_tls_pre_jail();
 
     /*
      * Initialize the EHLO reply. Once for plaintext sessions, and once for
      * TLS sessions.
      */
-    psc_smtpd_format_ehlo_reply(psc_temp, psc_ehlo_discard_mask 
+    psc_smtpd_format_ehlo_reply(psc_temp, psc_ehlo_discard_mask
                                | (psc_tls_ready ? 0 : EHLO_MASK_STARTTLS));
     psc_smtpd_ehlo_reply_plain = mystrdup(STR(psc_temp));
 
index 3ba6d0908302efe693ceb9290e2d6bccb15ea9ec..44c54d0d4ee2c068865ea7e450fdd82270120f69 100644 (file)
@@ -91,6 +91,7 @@ bool    psc_tls_ready;
 #ifdef USE_TLS
 TLS_SERVER_PARAMS psc_tls_params;
 TLS_SERVER_INIT_PROPS psc_init_props;
+
 #endif
 
  /*
@@ -311,7 +312,7 @@ bool    psc_tls_pre_start(const PSC_STATE *state,
                                 cipher_grade = cipher_grade,
                                 cipher_exclusions = STR(cipher_exclusions),
                                 mdalg = var_psc_tls_fpt_dgst,
-                                trace_size_limit = var_psc_tls_trace_size_limit,
+                           trace_size_limit = var_psc_tls_trace_size_limit,
                                 trace_peer = state->smtp_client_addr);
     return (true);
 }
index 690aedb401d9670595cd7bc3f19debed8972f853..5c943632dd260ebd7a6082ca5f1f0e20970e3fed 100644 (file)
@@ -533,6 +533,7 @@ static DNS_RR *host_addr(STATE *, const char *);
 
 #if defined(USE_TLS) && defined(HAVE_SSL_TRACE)
 static BIO *posttls_trace_open(void *, const char *);
+
 #endif
 
 #define HNAME(addr) (addr->qname)
@@ -1933,6 +1934,8 @@ static BIO *posttls_trace_open(void *arg, const char *trace_peer)
     if (state->trace_file == 0) {
        VSTRING *path = vstring_alloc(64);
 
+       /* Cheap defense against future change to reuse the path buffer. */
+       VSTRING_RESET(path);
        bio = tls_trace_create_file(path, trace_peer);
        state->trace_file = vstring_export(path);
        if (bio == 0) {
@@ -2047,7 +2050,7 @@ static void parse_options(STATE *state, int argc, char *argv[])
     state->level = TLS_LEV_DANE;
     state->mxinsec_level = TLS_LEV_DANE;
     state->tlsproxy_mode = 0;
-    state->trace_file = 0;             /* lazily constructed at trace_open */
+    state->trace_file = 0;                     /* lazily constructed */
 #else
 #define TLSOPTS ""
     state->level = TLS_LEV_NONE;
index 0535ea561dfe4ebae94bd328bd1c4b2d587179da..87a91c4c2bb451b0ef4a333507677640e51bb678 100644 (file)
@@ -60,8 +60,8 @@
 #include <msg_jmp.h>
 
  /*
-  * Private state. But it has to be caller-visible
-because msg_setjmp() cannot be a function.
+  * Private state. But it has to be caller-visible because msg_setjmp()
+  * cannot be a function.
   */
 MSG_JMP_BUF *msg_jmp_bufp;
 
index fb72b92d64e7855f4b271e94903be733a8b7f3dd..796a5cae7526d51bcec9aefbdabe465105fe81b1 100644 (file)
@@ -43,7 +43,7 @@ static void ptest_log_flags_missing_message(PTEST_CTX *t, const PTEST_CASE *unus
     expect_ptest_log_event(t, "this is a forced 'Missing log event' error");
 }
 
-static void ptest_nested_logging(PTEST_CTX * t, const PTEST_CASE * unused)
+static void ptest_nested_logging(PTEST_CTX *t, const PTEST_CASE *unused)
 {
     expect_ptest_log_event(t, "top-level");
     msg_warn("this is a top-level event");
index 62ff23ca2a3e5d4d4be5d8bd01dcd280bc5fe800..5b2eb1d52447ae726dd9bd8bfa229f0ab640f62c 100644 (file)
@@ -552,7 +552,7 @@ static int smtp_get_effective_tls_level(DSN_BUF *why, SMTP_STATE *state)
                       STR(iter->host));
            return (0);
        }
-       break;
+       break;
     case SMTP_REQTLS_POLICY_ACT_OPP_TLS:
        if (tls->level == TLS_LEV_NONE) {
            if (state->tls_stats)
index 1e7a7521eb3d457a18d981b86c5899f56d38669d..6de6ad56e00a02861101853ff756e8bb05db0af9 100644 (file)
@@ -1098,7 +1098,7 @@ static int smtp_start_tls(SMTP_STATE *state)
 #endif
                                     ffail_type = 0,
                                     dane = state->tls->dane,
-                                    trace_size_limit = var_smtp_tls_trace_size_limit,
+                          trace_size_limit = var_smtp_tls_trace_size_limit,
                                     trace_peer = STR(iter->addr));
 
        /*
@@ -1231,7 +1231,7 @@ static int smtp_start_tls(SMTP_STATE *state)
 #endif
                             ffail_type = state->tls->ext_policy_failure,
                             dane = state->tls->dane,
-                            trace_size_limit = var_smtp_tls_trace_size_limit,
+                          trace_size_limit = var_smtp_tls_trace_size_limit,
                             trace_open = 0,
                             trace_arg = 0,
                             trace_peer = STR(iter->addr));
index eb445eb9decc18d3f920c24479727be102ab8ae2..f13e593a01a3fa884d26ebda94e102384e42ed4a 100644 (file)
@@ -260,12 +260,12 @@ static int converts_good_u_label_query(const TEST_CASE *tp)
 {
     const char *ext_policy = "inline:{{foo.xn--1xa.example = opportunistic}} enforce";
     const struct QUERY_REPLY qr[] = {
-        {"foo.xn--1xa.example", SMTP_REQTLS_POLICY_ACT_OPPORTUNISTIC},
-        {"foo.\xcf\x80.example", SMTP_REQTLS_POLICY_ACT_OPPORTUNISTIC},
-        {"x.foo.xn--1xa.example", SMTP_REQTLS_POLICY_ACT_ENFORCE},
-        {"x.foo.\xcf\x80.example", SMTP_REQTLS_POLICY_ACT_ENFORCE},
-        {"example", SMTP_REQTLS_POLICY_ACT_ENFORCE},
-        {0},
+       {"foo.xn--1xa.example", SMTP_REQTLS_POLICY_ACT_OPPORTUNISTIC},
+       {"foo.\xcf\x80.example", SMTP_REQTLS_POLICY_ACT_OPPORTUNISTIC},
+       {"x.foo.xn--1xa.example", SMTP_REQTLS_POLICY_ACT_ENFORCE},
+       {"x.foo.\xcf\x80.example", SMTP_REQTLS_POLICY_ACT_ENFORCE},
+       {"example", SMTP_REQTLS_POLICY_ACT_ENFORCE},
+       {0},
     };
     SMTP_REQTLS_POLICY *int_policy;
     const struct QUERY_REPLY *qp;
@@ -275,11 +275,11 @@ static int converts_good_u_label_query(const TEST_CASE *tp)
 
     int_policy = smtp_reqtls_policy_parse(test_origin, ext_policy);
     for (qp = qr; qp->query; qp++) {
-        got = smtp_reqtls_policy_eval(int_policy, qp->query);
-        if (got != qp->reply) {
-            msg_warn("got result '%d', want: '%d'", got, qp->reply);
-            errors++;
-        }
+       got = smtp_reqtls_policy_eval(int_policy, qp->query);
+       if (got != qp->reply) {
+           msg_warn("got result '%d', want: '%d'", got, qp->reply);
+           errors++;
+       }
     }
     smtp_reqtls_policy_free(int_policy);
     return (errors == 0);
@@ -289,10 +289,10 @@ static int fails_bad_u_label_query(const TEST_CASE *tp)
 {
     const char *ext_policy = "inline:{{foo.xn--1xa.example = opportunistic}} disable";
     const struct QUERY_REPLY qr[] = {
-        {"foo.\xcf\x80.example", SMTP_REQTLS_POLICY_ACT_OPPORTUNISTIC},
-        {"foo.-\xcf\x80.example", SMTP_REQTLS_POLICY_ACT_ENFORCE},
-        {"example", SMTP_REQTLS_POLICY_ACT_DISABLE},
-        {0},
+       {"foo.\xcf\x80.example", SMTP_REQTLS_POLICY_ACT_OPPORTUNISTIC},
+       {"foo.-\xcf\x80.example", SMTP_REQTLS_POLICY_ACT_ENFORCE},
+       {"example", SMTP_REQTLS_POLICY_ACT_DISABLE},
+       {0},
     };
     SMTP_REQTLS_POLICY *int_policy;
     const struct QUERY_REPLY *qp;
@@ -302,11 +302,11 @@ static int fails_bad_u_label_query(const TEST_CASE *tp)
 
     int_policy = smtp_reqtls_policy_parse(test_origin, ext_policy);
     for (qp = qr; qp->query; qp++) {
-        got = smtp_reqtls_policy_eval(int_policy, qp->query);
-        if (got != qp->reply) {
-            msg_warn("got result '%d', want: '%d'", got, qp->reply);
-            errors++;
-        }
+       got = smtp_reqtls_policy_eval(int_policy, qp->query);
+       if (got != qp->reply) {
+           msg_warn("got result '%d', want: '%d'", got, qp->reply);
+           errors++;
+       }
     }
     smtp_reqtls_policy_free(int_policy);
     return (errors == 0);
index 091f0f549b7b76d07f02ef97429bb9fb19a9a2c1..8e0bc714f8f2063acc3c250cf774e208e4aedbe1 100644 (file)
@@ -5352,7 +5352,7 @@ static void smtpd_start_tls(SMTPD_STATE *state)
                                 cipher_grade = cipher_grade,
                                 cipher_exclusions = STR(cipher_exclusions),
                                 mdalg = var_smtpd_tls_fpt_dgst,
-                                trace_size_limit = var_smtpd_tls_trace_size_limit,
+                         trace_size_limit = var_smtpd_tls_trace_size_limit,
                                 trace_peer = state->addr);
 
     /*
index dd332092f98cdcd383364754352657c174ff5776..5c628a529881a2398d31cdd15b6bb8d9a320c25b 100644 (file)
@@ -44,7 +44,7 @@
 
 /* make_attr - serialize attribute list */
 
-VSTRING *make_attr(ATTR_VPRINT_COMMON_FN vprint_fn, int flags, ...)
+VSTRING *make_attr(ATTR_VPRINT_COMMON_FN vprint_fn, int flags,...)
 {
     static const char myname[] = "make_attr";
     VSTRING *res = vstring_alloc(100);
index ee401dff3d07a931ae59ba0943a110866401d247..892f10385fa31dd04c1172e8627d7f6f69d9f3dd 100644 (file)
@@ -187,13 +187,13 @@ int     _eq_str(const char *file, int line, PTEST_CTX *t,
                        const char *what, const char *got, const char *want)
 {
     if (got == 0 && want == 0) {
-        return (1);
+       return (1);
     } else if (got == 0 || want == 0) {
-        if (t)
-            ptest_error(t, "%s:%d: %s: got '%s', want '%s'",
-                        file, line, what, STR_OR_NULL(got),
-                        STR_OR_NULL(want));
-        return (0);
+       if (t)
+           ptest_error(t, "%s:%d: %s: got '%s', want '%s'",
+                       file, line, what, STR_OR_NULL(got),
+                       STR_OR_NULL(want));
+       return (0);
     }
     if (strcmp(got, want) != 0) {
        if (t)
index 042b8806cdc9fd6d67b571827252c0e62a455a2b..0c88529c556d0462c08b4ac6e37ffb5168f37062 100644 (file)
@@ -23,7 +23,7 @@
 #include <ptest.h>
 
 typedef struct PTEST_CASE {
-    const char *testname;               /* Human-readable description */
+    const char *testname;              /* Human-readable description */
     void    (*action) (PTEST_CTX *t, const struct PTEST_CASE *);
 } PTEST_CASE;
 
@@ -68,8 +68,8 @@ static const char *flags_to_string(VSTRING *buf, int flags)
 
 static void test_eq_flags(PTEST_CTX *t, const PTEST_CASE *unused)
 {
-int got = FLAG_ONE;
-int want = FLAG_ONE | FLAG_TWO;
+    int     got = FLAG_ONE;
+    int     want = FLAG_ONE | FLAG_TWO;
 
     expect_ptest_error(t, "got 'one', want 'one|two'");
     if (eq_flags(t, "flags", got, want, flags_to_string)
index 286d3cab7ccf4197020b429c56e0c5bd83caedbb..d70e7489812d30d887be7be78da29d1b0c27fa8b 100644 (file)
@@ -189,7 +189,7 @@ static DNS_RR *full_copy_dns_rrlist(DNS_RR *list)
 DNS_RR *make_dns_rr(const char *qname, const char *rname, unsigned type,
                            unsigned class, unsigned ttl,
                            unsigned dnssec_valid, unsigned pref,
-                           unsigned weight, unsigned port,
+                           unsigned weight, unsigned port,
                            void *data, size_t data_len)
 {
     DNS_RR *rr;
index 216fa0be3f5071494dce658b879ad7938a12fc37..9d0173286765847c31c5d98b7e0169e8e8b48768 100644 (file)
@@ -75,7 +75,7 @@ static void test_hostname_to_sockaddr_failure(PTEST_CTX *t,
      * The missing expectation is intentional. Do not count this as an error.
      */
     expect_ptest_error(t, "unexpected call: "
-           "hostname_to_sockaddr_pf(\"notexist\", 0, \"smtp\", ");
+                    "hostname_to_sockaddr_pf(\"notexist\", 0, \"smtp\", ");
 
     /*
      * Invoke the mock and verify results.
index 4860c6d2882ae2748596f61394ca32563f61c8b5..f9b0767bf3d378a4b28c8089f8225156dbf769c8 100644 (file)
@@ -48,7 +48,7 @@ extern void _expect_endservent(const char *, int, int);
   */
 #define eq_servent(...) _eq_servent(__FILE__, __LINE__, __VA_ARGS__)
 
-extern int _eq_servent(const char *, int,PTEST_CTX *, 
+extern int _eq_servent(const char *, int, PTEST_CTX *,
                               const char *, struct servent *,
                               struct servent *);
 
index 458674498ab4e6ce0e50245a68a6b00d9c13f11d..04475cfef2ebab7226cb093e6631c05bdfa087e3 100644 (file)
@@ -251,8 +251,8 @@ static void mock_server_read_event(int event, void *context)
 /* mock_server_interact - set up request and/or response */
 
 void    mock_server_interact(MOCK_SERVER *mp,
-                                         const VSTRING *req,
-                                         const VSTRING *resp)
+                                    const VSTRING *req,
+                                    const VSTRING *resp)
 {
     const char myname[] = "mock_server_interact";
 
index c97d6344933d38dfd18e4d53801a09f9cfcd0f18..8f04638913c909f675d32a1bc3670d22d5851cbb 100644 (file)
@@ -27,15 +27,15 @@ typedef struct MOCK_SERVER {
     VSTRING *want_req;                 /* serialized request, may be null */
     VSTRING *resp;                     /* serialized response, may be null */
     VSTRING *iobuf;                    /* I/O buffer */
-    struct MOCK_SERVER *next;  /* chain of unconnected servers */
-    struct MOCK_SERVER *prev;  /* chain of unconnected servers */
+    struct MOCK_SERVER *next;          /* chain of unconnected servers */
+    struct MOCK_SERVER *prev;          /* chain of unconnected servers */
 } MOCK_SERVER;
 
 #define MOCK_SERVER_FLAG_CONNECTED     (1<<0)
 
 extern MOCK_SERVER *mock_unix_server_create(const char *);
 extern void mock_server_interact(MOCK_SERVER *, const VSTRING *,
-                                             const VSTRING *);
+                                        const VSTRING *);
 extern void mock_server_free(MOCK_SERVER *);
 extern void mock_server_free_void_ptr(void *);
 
index 2f22ec43bedbe7a9a3a710e57dee4230fb13a1d2..82d5c01989910299833f0e765c91b767ad8c9abc 100644 (file)
@@ -226,17 +226,17 @@ static void test_request_mismatch(PTEST_CTX *t, const PTEST_CASE *tp)
     REQUEST_READ_EVENT(session_state.fd, read_event, &session_state, 1);
     event_loop(1);
     if (session_state.error != 0) {
-        /* already reported */
+       /* already reported */
     } else if (VSTRING_LEN(session_state.resp_buf) != strlen(REQUEST_VAL)) {
-        ptest_error(t, "got resp_buf length %ld, want %ld",
-                    (long) VSTRING_LEN(session_state.resp_buf),
-                    (long) strlen(REQUEST_VAL));
+       ptest_error(t, "got resp_buf length %ld, want %ld",
+                   (long) VSTRING_LEN(session_state.resp_buf),
+                   (long) strlen(REQUEST_VAL));
     } else if (session_state.resp_len != strlen(REQUEST_VAL)) {
-        ptest_error(t, "got resp_len %d, want %ld",
-                    session_state.resp_len, (long) strlen(REQUEST_VAL));
+       ptest_error(t, "got resp_len %d, want %ld",
+                   session_state.resp_len, (long) strlen(REQUEST_VAL));
     } else if (strcmp(vstring_str(session_state.resp_buf), REQUEST_VAL) != 0) {
-        ptest_error(t, "got resp_buf '%s', want '%s'",
-                    vstring_str(session_state.resp_buf), REQUEST_VAL);
+       ptest_error(t, "got resp_buf '%s', want '%s'",
+                   vstring_str(session_state.resp_buf), REQUEST_VAL);
     }
 
     /*
@@ -318,17 +318,17 @@ static void test_server_speaks_only(PTEST_CTX *t, const PTEST_CASE *tp)
     REQUEST_READ_EVENT(session_state.fd, read_event, &session_state, 1);
     event_loop(1);
     if (session_state.error != 0) {
-        /* already reported */
+       /* already reported */
     } else if (VSTRING_LEN(session_state.resp_buf) != strlen(REQUEST_VAL)) {
-        ptest_error(t, "got resp_buf length %ld, want %ld",
-                    (long) VSTRING_LEN(session_state.resp_buf),
-                    (long) strlen(REQUEST_VAL));
+       ptest_error(t, "got resp_buf length %ld, want %ld",
+                   (long) VSTRING_LEN(session_state.resp_buf),
+                   (long) strlen(REQUEST_VAL));
     } else if (session_state.resp_len != strlen(REQUEST_VAL)) {
-        ptest_error(t, "got resp_len %d, want %ld",
-                    session_state.resp_len, (long) strlen(REQUEST_VAL));
+       ptest_error(t, "got resp_len %d, want %ld",
+                   session_state.resp_len, (long) strlen(REQUEST_VAL));
     } else if (strcmp(vstring_str(session_state.resp_buf), REQUEST_VAL) != 0) {
-        ptest_error(t, "got resp_buf '%s', wamt '%s'",
-                    vstring_str(session_state.resp_buf), REQUEST_VAL);
+       ptest_error(t, "got resp_buf '%s', wamt '%s'",
+                   vstring_str(session_state.resp_buf), REQUEST_VAL);
     }
 
     /*
index 8690d219532127a7c112240e723ef8c21f577efe..4296d9cf2272b7a0068acdf31eff5c1b8dd517cf 100644 (file)
@@ -97,7 +97,8 @@ void    teardown_mock_stat(void)
 
 /* stat - mock stat() implementation */
 
-int stat(const char *path, struct stat *st) {
+int     stat(const char *path, struct stat * st)
+{
     MOCK_STAT_REQ *mock_info;
 
     if ((mock_info = (MOCK_STAT_REQ *) htable_find(mock_stat_table, path)) == 0)
index 80f4bc57e6a1bd276f447f07b3182e5685410020..60c9cc53f2fd4b91cbc1c9065b1d1b6dc781e05b 100644 (file)
@@ -609,7 +609,7 @@ typedef struct {
     const char *cipher_exclusions;
     const char *mdalg;                 /* default message digest algorithm */
     int     trace_size_limit;          /* TLS protocol trace size limit */
-    BIO    *(*trace_open) (void *, const char *); /* override dest */
+    BIO    *(*trace_open) (void *, const char *);      /* override dest */
     void   *trace_arg;                 /* opaque trace_open argument */
     char   *trace_peer;                        /* Printable peer IP address */
 } TLS_SERVER_START_PROPS;
index 1c5a5a6aa877b0c8510b16ac4110c784c6b3458f..7ee92bedd6f188775438c4687d6f6f6ec93d9486 100644 (file)
@@ -616,8 +616,8 @@ int     tls_log_mask(const char *log_param, const char *log_level)
            msg_warn("%s: ignoring \"trace\" log level: "
                     "SSL_trace() is not available in this build",
                     log_param);
-           mask &= ~TLS_LOG_TRACE;
        }
+       mask &= ~TLS_LOG_TRACE;                 /* Never used */
     }
 #endif
     return (mask);
@@ -635,8 +635,8 @@ void    tls_msg_callback(int write_p, int version, int content_type,
     BIO    *bio = TLScontext->trace_bio;
 
     /*
-     * trace_size_limit <= 0 means either tracing is off (never started)
-     * or we already crossed the budget and emitted the truncation marker.
+     * trace_size_limit <= 0 means either tracing is off (never started) or
+     * we already crossed the budget and emitted the truncation marker.
      * Either way, do not write further.
      */
     if (bio == 0 || TLScontext->trace_size_limit <= 0)
@@ -666,14 +666,14 @@ bool    tls_trace_rate_ok(int tls_trace_rate_limit)
        if (anvil_clnt_tlstr(client, "any", "any", &rate) == ANVIL_STAT_OK) {
            ret = rate <= tls_trace_rate_limit;
        } else {
-           ret = true;
+           ret = false;
        }
        anvil_clnt_free(client);
     } else {
        ret = true;
     }
     return (ret);
-} 
+}
 
 /* tls_trace_create_qfile - default trace destination for daemons */
 
@@ -700,7 +700,7 @@ BIO    *tls_trace_create_qfile(const char *trace_peer)
 
 /* tls_trace_create_file - trace destination for CLI or daemon */
 
-BIO *tls_trace_create_file(VSTRING *path, const char *trace_peer)
+BIO    *tls_trace_create_file(VSTRING *path, const char *trace_peer)
 {
     struct timeval tv;
     struct tm *lt;
@@ -1557,22 +1557,21 @@ void    tls_free_context(TLS_SESS_STATE *TLScontext)
 
     /*
      * Release the protocol trace, if one was opened.  Order matters:
-     * SSL_free() above can still drive the message callback during
-     * teardown (close-notify processing in particular), so trace_bio
-     * must stay valid until after SSL_free() returns.  Closing it
-     * first would let tls_msg_callback() write through a freed BIO.
-     *
+     * SSL_free() above can still drive the message callback during teardown
+     * (close-notify processing in particular), so trace_bio must stay valid
+     * until after SSL_free() returns.  Closing it first would let
+     * tls_msg_callback() write through a freed BIO.
+     * 
      * Always BIO_flush() before close, so any stdio buffering inside
      * BIO_new_fp() lands on disk before the FILE * is fclose()d.  An
-     * application override may release the BIO; otherwise BIO_free_all
-     * walks the chain and (with BIO_CLOSE) closes the underlying file.
+     * application override may release the BIO; otherwise BIO_free_all walks
+     * the chain and (with BIO_CLOSE) closes the underlying file.
      */
     if (TLScontext->trace_bio != 0) {
        (void) BIO_flush(TLScontext->trace_bio);
        BIO_free_all(TLScontext->trace_bio);
        TLScontext->trace_bio = 0;
     }
-
     if (TLScontext->namaddr)
        myfree(TLScontext->namaddr);
     if (TLScontext->serverid)
index 1fbd6438d9408b60275d1d1898da11147db6312d..dcab45603189f091817305a63e6a3991666b6d94 100644 (file)
@@ -175,7 +175,7 @@ static void test_tls_proxy_client_init_serialize(PTEST_CTX *t,
     (void) eq_attr(t, "tls_proxy_client_init_serialize",
                   got_serialized_init_props, ref_serialized_init_props);
 #else
-    ptest_skip(t);
+            ptest_skip(t);
 #endif
 }
 
@@ -212,7 +212,7 @@ static void test_tls_proxy_client_init_from_string(PTEST_CTX *t,
     vstring_free(ref_serialized_init_props);
     vstring_free(got_serialized_init_props);
 #else
-    ptest_skip(t);
+            ptest_skip(t);
 #endif
 }
 
index 190800b1aadd51b03c24f8885283b2c7e92270c1..5ec6caa02acf9faa0d221bcd884bc309700d2c0c 100644 (file)
@@ -158,13 +158,13 @@ static VSTRING *setup_reference_serialized_params(TLS_CLIENT_PARAMS *params)
                      SEND_ATTR_INT(VAR_TLS_DAEMON_RAND_BYTES,
                                    params->tls_daemon_rand_bytes),
                      SEND_ATTR_INT(VAR_TLS_APPEND_DEF_CA,
-                                    params->tls_append_def_CA),
+                                   params->tls_append_def_CA),
                      SEND_ATTR_INT(VAR_TLS_PREEMPT_CLIST,
-                                    params->tls_preempt_clist),
+                                   params->tls_preempt_clist),
                      SEND_ATTR_INT(VAR_TLS_MULTI_WILDCARD,
-                                    params->tls_multi_wildcard),
+                                   params->tls_multi_wildcard),
                      SEND_ATTR_INT(VAR_TLS_FAST_SHUTDOWN,
-                                    params->tls_fast_shutdown),
+                                   params->tls_fast_shutdown),
                      ATTR_TYPE_END));
 }
 
@@ -194,7 +194,7 @@ static void test_tls_proxy_client_param_serialize(PTEST_CTX *t,
     (void) eq_attr(t, "tls_proxy_client_param_serialize",
                   got_serialized_params, ref_serialized_params);
 #else
-    ptest_skip(t);
+            ptest_skip(t);
 #endif
 }
 
@@ -233,7 +233,7 @@ static void test_tls_proxy_client_param_from_config(PTEST_CTX *t,
     vstring_free(want_client_params_serialized);
     vstring_free(got_client_params_serialized);
 #else
-    ptest_skip(t);
+            ptest_skip(t);
 #endif
 }
 
@@ -270,7 +270,7 @@ static void test_tls_proxy_client_param_from_string(PTEST_CTX *t,
     vstring_free(ref_serialized_params);
     vstring_free(got_serialized_params);
 #else
-    ptest_skip(t);
+            ptest_skip(t);
 #endif
 }
 
index f4cb7caa2c95937c81a5483037542b0e86b1fa15..219ea3912b423f6aaf0118bf4aa6d81c205f3aaa 100644 (file)
@@ -125,20 +125,20 @@ char   *tls_proxy_server_init_serialize(ATTR_PRINT_COMMON_FN print_fn,
 /* tls_proxy_server_init_from_string - deserialize TLS_SERVER_INIT_PROPS */
 
 TLS_SERVER_INIT_PROPS *tls_proxy_server_init_from_string(
-                                                ATTR_SCAN_COMMON_FN scan_fn,
-                                                             VSTRING *buf)
+                                               ATTR_SCAN_COMMON_FN scan_fn,
+                                                              VSTRING *buf)
 {
     const char myname[] = "tls_proxy_server_init_from_string";
     TLS_SERVER_INIT_PROPS *props = 0;
     VSTREAM *mp;
 
     if ((mp = vstream_memopen(buf, O_RDONLY)) == 0
-        || scan_fn(mp, ATTR_FLAG_NONE,
-                   RECV_ATTR_FUNC(tls_proxy_server_init_scan,
-                                  (void *) &props),
-                   ATTR_TYPE_END) != 1
-        || vstream_fclose(mp) != 0)
-        msg_fatal("%s: can't deserialize properties: %m", myname);
+       || scan_fn(mp, ATTR_FLAG_NONE,
+                  RECV_ATTR_FUNC(tls_proxy_server_init_scan,
+                                 (void *) &props),
+                  ATTR_TYPE_END) != 1
+       || vstream_fclose(mp) != 0)
+       msg_fatal("%s: can't deserialize properties: %m", myname);
     return (props);
 }
 
index 84363ca62777b6515c0b3634c05e0852de655afc..519619d1ecba4fcc0f3135e42631e6cbb17b4fbc 100644 (file)
@@ -61,7 +61,7 @@ typedef struct PTEST_CASE {
 char   *var_smtpd_tls_loglevel;
 int     var_smtpd_tls_ccert_vd;
 static char *cache_type;
-bool     var_smtpd_tls_set_sessid;
+bool    var_smtpd_tls_set_sessid;
 char   *var_smtpd_tls_chain_files;
 char   *var_smtpd_tls_cert_file;
 char   *var_smtpd_tls_key_file;
@@ -98,7 +98,7 @@ static void init_global_params(void)
     var_smtpd_tls_eecdh = DEF_SMTPD_TLS_EECDH;
     var_smtpd_tls_proto = DEF_SMTPD_TLS_PROTO;
     ask_ccert = 1,
-    var_smtpd_tls_fpt_dgst = DEF_SMTPD_TLS_FPT_DGST;
+       var_smtpd_tls_fpt_dgst = DEF_SMTPD_TLS_FPT_DGST;
 }
 
 static void setup_reference_unserialized_init_props(TLS_SERVER_INIT_PROPS *props)
@@ -205,7 +205,7 @@ static void test_tls_proxy_server_init_serialize(PTEST_CTX *t,
     (void) eq_attr(t, "tls_proxy_server_init_serialize",
                   got_serialized_init_props, ref_serialized_init_props);
 #else
-    ptest_skip(t);
+            ptest_skip(t);
 #endif
 }
 
@@ -242,7 +242,7 @@ static void test_tls_proxy_server_init_from_string(PTEST_CTX *t,
     vstring_free(ref_serialized_init_props);
     vstring_free(got_serialized_init_props);
 #else
-    ptest_skip(t);
+            ptest_skip(t);
 #endif
 }
 
index c68be0ef4acc1e3585b8de08727ad6788fb28120..1423442f8763851ffa14be7d26daa2f19c90e94c 100644 (file)
@@ -198,7 +198,7 @@ static void test_tls_proxy_server_param_serialize(PTEST_CTX *t,
     (void) eq_attr(t, "tls_proxy_server_param_serialize",
                   got_serialized_params, ref_serialized_params);
 #else
-    ptest_skip(t);
+            ptest_skip(t);
 #endif
 }
 
@@ -237,7 +237,7 @@ static void test_tls_proxy_server_param_from_config(PTEST_CTX *t,
     vstring_free(want_server_params_serialized);
     vstring_free(got_server_params_serialized);
 #else
-    ptest_skip(t);
+            ptest_skip(t);
 #endif
 }
 
@@ -274,7 +274,7 @@ static void test_tls_proxy_server_param_from_string(PTEST_CTX *t,
     vstring_free(ref_serialized_params);
     vstring_free(got_serialized_params);
 #else
-    ptest_skip(t);
+            ptest_skip(t);
 #endif
 }
 
index e6ff29ff1096822ac5f6221661e36717292cd6d6..089acb9931f4ef2ed5db33dff69a5d7bfba0239b 100644 (file)
 /* update_error_state - safely stash away error state */
 
 static void update_error_state(X509_STORE_CTX *ctx, TLS_SESS_STATE *TLScontext,
-                                 int depth, const X509 *errorcert, int errorcode)
+                           int depth, const X509 *errorcert, int errorcode)
 {
 
     /*
@@ -150,7 +150,7 @@ static void update_error_state(X509_STORE_CTX *ctx, TLS_SESS_STATE *TLScontext,
     if (TLScontext->errorcert != 0)
        X509_free((X509 *) TLScontext->errorcert);
     if (errorcert != 0)
-        X509_up_ref((X509 *) errorcert);
+       X509_up_ref((X509 *) errorcert);
     TLScontext->errorcert = errorcert;
     TLScontext->errorcode = errorcode;
     TLScontext->errordepth = depth;
index a9d057713938d2da3eeb45270271b4abf4d7bc6f..6f1db0d6fd5c7102ea29c45328cf908cb7cb36dc 100644 (file)
 /*     IBM T.J. Watson Research
 /*     P.O. Box 704
 /*     Yorktown Heights, NY 10598, USA
-/* 
+/*
 /*     Wietse Venema
 /*     Google, Inc.
 /*     111 8th Avenue
 /*     New York, NY 10011, USA
-/*     
+/*
 /*     Wietse Venema
 /*     porcupine.org
 /*--*/
index 8bc412f1847feaedec31b3bc73112eb678459387..406e0d495b10dc0b97139ec493bed75c2ceef5c7 100644 (file)
@@ -417,7 +417,7 @@ void    argv_delete(ARGV *argvp, ssize_t first, ssize_t how_many)
     /*
      * Sanity check. 202604 Claude: avoid expression 'first + how_many'.
      */
-    if (first < 0 || how_many < 0 || first > argvp->argc 
+    if (first < 0 || how_many < 0 || first > argvp->argc
        || how_many > argvp->argc - first)
        msg_panic("argv_delete bad range: (start=%ld count=%ld)",
                  (long) first, (long) how_many);
index 0de769daf8016382ace2c544a68f52f361a3c123..0b7fe46f29ab44cc2d72b472473dfaec439ed43e 100644 (file)
@@ -27,8 +27,10 @@ extern ARGV *argv_sort(ARGV *);              /* backwards compatibility */
 extern ARGV *argv_qsort(ARGV *, ARGV_COMPAR_FN);
 extern ARGV *argv_uniq(ARGV *, ARGV_COMPAR_FN);
 extern void argv_add(ARGV *,...);
+
 #if 0
 extern void argv_addn(ARGV *,...);
+
 #endif
 extern ARGV *argv_addv(ARGV *, const char *const *);
 extern void argv_terminate(ARGV *);
index 1ca8b7f6294102f906c1070e9809b1ebae3e33ad..4a39170c572bd693eeafa1e503ff2755a4a824bf 100644 (file)
@@ -314,7 +314,7 @@ extern const char *dict_file_lookup(DICT *dict, const char *);
   * dict_stream(3)
   */
 extern VSTREAM *dict_stream_open(const char *dict_type, const char *mapname,
-            int open_flags, int dict_flags, struct stat *st, VSTRING **why);
+           int open_flags, int dict_flags, struct stat * st, VSTRING **why);
 
 /* LICENSE
 /* .ad
index 80b621780d614109827b5dc2770f27f7d69a7a2e..8771a17a7c298ce757276ec8646ca9b8fd1b6029 100644 (file)
@@ -485,7 +485,7 @@ DICT   *dict_open(const char *dict_spec, int open_flags, int dict_flags)
     char   *dict_name;
     DICT   *dict;
 
-    if ((dict_name = split_at(saved_dict_spec, ':')) == 0 
+    if ((dict_name = split_at(saved_dict_spec, ':')) == 0
        || *saved_dict_spec == 0 || *dict_name == 0) {
        dict = dict_surrogate(dict_spec, "", open_flags, dict_flags,
          "open dictionary: expecting \"type:name\" form instead of \"%s\"",
@@ -695,8 +695,8 @@ static void init_dynamic_maps(void)
     if (dict_load_file_xt(TEST_DICT, TEST_CONF_PATH) == 0)
        msg_fatal("open %s: %m", TEST_CONF_PATH);
     if ((meta_dir = dict_lookup(TEST_DICT, META_DIR_KEY)) == 0
-        || (shlib_dir = dict_lookup(TEST_DICT, SHLIB_DIR_KEY)) == 0)
-        msg_fatal("unusable file: %s", TEST_CONF_PATH);
+       || (shlib_dir = dict_lookup(TEST_DICT, SHLIB_DIR_KEY)) == 0)
+       msg_fatal("unusable file: %s", TEST_CONF_PATH);
     path = concatenate(meta_dir, "/", "dynamicmaps.cf",
 #ifdef SHLIB_VERSION
                       ".", SHLIB_VERSION,
index 9aa7779d659fbd60a313c624892d2339356d993f..f1b794ac51dba5d2a163f8bab460815b53b88b75 100644 (file)
@@ -149,7 +149,7 @@ static const DICT_OPEN_INFO *dymap_dict_lookup(const char *dict_type)
                 dict_type, dict_type);
        return (0);
     }
-    if (stat (dp->soname, &st) < 0) {
+    if (stat(dp->soname, &st) < 0) {
        msg_warn("unsupported dictionary type: %s (%s: %m)",
                 dict_type, dp->soname);
        return (0);
index 0f5542e947c23687a8dd82a3f722b1caf0b4fc45..02a3962ad38b6f06bc86dfa9eb3c549b127d28da 100644 (file)
@@ -143,7 +143,7 @@ int     inet_connect(const char *addr, int block_mode, int timeout)
 
 /* inet_connect_one - try to connect to one address */
 
-static int inet_connect_one(struct addrinfo * res, int block_mode, int timeout)
+static int inet_connect_one(struct addrinfo *res, int block_mode, int timeout)
 {
     int     sock;
 
index 3ba09c3e36435b116aea7aa18069e9fed14bd93b..a6f382428d85009517dbd76c521272771fd9ba3d 100644 (file)
@@ -301,7 +301,7 @@ static int find_service(const char *service, int socktype)
 
 int     hostname_to_sockaddr_pf(const char *hostname, int pf,
                                        const char *service, int socktype,
-                                       struct addrinfo ** res)
+                                       struct addrinfo **res)
 {
 #ifdef EMULATE_IPV4_ADDRINFO
 
@@ -475,7 +475,7 @@ int     hostname_to_sockaddr_pf(const char *hostname, int pf,
 /* hostaddr_to_sockaddr - printable address to binary address form */
 
 int     hostaddr_to_sockaddr(const char *hostaddr, const char *service,
-                                    int socktype, struct addrinfo **  res)
+                                    int socktype, struct addrinfo **res)
 {
 #ifdef EMULATE_IPV4_ADDRINFO
 
@@ -757,7 +757,7 @@ void    myaddrinfo_control(int name,...)
 
 /* freeaddrinfo - release storage */
 
-void    freeaddrinfo(struct addrinfo * ai)
+void    freeaddrinfo(struct addrinfo *ai)
 {
     struct addrinfo *ap;
     struct addrinfo *next;
index 0aaf7fa0a2592fc37d032c3e1086a3fdd97423d1..93a5a53de38b5addf5e0f2ca40b7e78d9d7a89b5 100644 (file)
@@ -62,7 +62,7 @@ static void test_mystrtok(PTEST_CTX *t, const PTEST_CASE *unused)
            char   *cp = saved_input;
            int     n;
 
-           for (n = 0; /* See below */; n++) {
+           for (n = 0; /* See below */ ; n++) {
                got = mystrtok(&cp, CHARS_SPACE);
                if (!match_one(t, got, tp->want[n]) || got == 0)
                    break;
@@ -94,7 +94,7 @@ static void test_mystrtokq(PTEST_CTX *t, const PTEST_CASE *unused)
            char   *cp = saved_input;
            int     n;
 
-           for (n = 0; /* See below */; n++) {
+           for (n = 0; /* See below */ ; n++) {
                got = mystrtokq(&cp, CHARS_SPACE, CHARS_BRACE);
                if (!match_one(t, got, tp->want[n]) || got == 0)
                    break;
@@ -126,7 +126,7 @@ static void test_mystrtokdq(PTEST_CTX *t, const PTEST_CASE *unused)
            char   *cp = saved_input;
            int     n;
 
-           for (n = 0; /* See below */; n++) {
+           for (n = 0; /* See below */ ; n++) {
                got = mystrtokdq(&cp, CHARS_SPACE);
                if (!match_one(t, got, tp->want[n]) || got == 0)
                    break;
@@ -157,7 +157,7 @@ static void test_mystrtok_cw(PTEST_CTX *t, const PTEST_CASE *unused)
            expect_ptest_log_event(t,
                                "#comment after other text is not allowed");
 
-           for (n = 0; /* See below */; n++) {
+           for (n = 0; /* See below */ ; n++) {
                got = mystrtok_cw(&cp, CHARS_SPACE, "test");
                if (!match_one(t, got, tp->want[n]) || got == 0)
                    break;
@@ -188,7 +188,7 @@ static void test_mystrtokq_cw(PTEST_CTX *t, const PTEST_CASE *unused)
            expect_ptest_log_event(t,
                                "#comment after other text is not allowed");
 
-           for (n = 0; /* See below */; n++) {
+           for (n = 0; /* See below */ ; n++) {
                got = mystrtokq_cw(&cp, CHARS_SPACE, CHARS_BRACE, "test");
                if (!match_one(t, got, tp->want[n]) || got == 0)
                    break;
@@ -219,7 +219,7 @@ static void test_mystrtokdq_cw(PTEST_CTX *t, const PTEST_CASE *unused)
            expect_ptest_log_event(t,
                                "#comment after other text is not allowed");
 
-           for (n = 0; /* See below */; n++) {
+           for (n = 0; /* See below */ ; n++) {
                got = mystrtokdq_cw(&cp, CHARS_SPACE, "test");
                if (!match_one(t, got, tp->want[n]) || got == 0)
                    break;
index 5c8f82fa4bf60fe9faf9acd150de1599665d7de0..3a6540742ea8e6401b8fc348af8ea1c9320ea21f 100644 (file)
@@ -103,9 +103,11 @@ int     main(int argc, char **argv)
        msg_fatal("close server fd");
     return (0);
 }
+
 #else
 int     main(int argc, char **argv)
 {
     return (0);
 }
+
 #endif
index 3e49e7a0d698a73e8ea008947bc8fb6aa3ed5ed8..250345ec9f1248f4f1cc1659520ca12c36ce51b9 100644 (file)
   */
 #ifndef NO_MOCK_WRAPPERS
 extern int wrap_getaddrinfo(const char *, const char *,
-                                            const struct addrinfo *,
-                                            struct addrinfo **);
+                                   const struct addrinfo *,
+                                   struct addrinfo **);
 extern void wrap_freeaddrinfo(struct addrinfo *);
 extern int wrap_getnameinfo(const struct sockaddr *, socklen_t, char *,
-                                            size_t, char *, size_t, int);
+                                   size_t, char *, size_t, int);
 
 #define        getaddrinfo     wrap_getaddrinfo
 #define        freeaddrinfo    wrap_freeaddrinfo
index 321913a05dcd3fae79232fd7622207c224ee39d6..340178f1f816ecd3866d1f0a89a9d7c3a9549bdd 100644 (file)
 
 /* wrap_stat - mockable wrapper */
 
-int     wrap_stat(const char *path, struct stat *st)
+int     wrap_stat(const char *path, struct stat * st)
 {
 #undef stat
-    return (stat (path, st));
+    return (stat(path, st));
 }
 
 /* wrap_lstat - mockable wrapper */
 
-int     wrap_lstat(const char *path, struct stat *st)
+int     wrap_lstat(const char *path, struct stat * st)
 {
 #undef lstat
     return (lstat(path, st));