From 94431adbd61d7706fe6df3a19bcae043fec950bf Mon Sep 17 00:00:00 2001 From: "Heiko Schlittermann (HS12-RIPE)" Date: Sat, 31 Oct 2015 22:47:29 +0100 Subject: [PATCH 1/1] Source: Remove trailing whitespaces from src/*.{h,c} --- src/src/dcc.c | 8 ++--- src/src/deliver.c | 60 ++++++++++++++++----------------- src/src/dns.c | 2 +- src/src/expand.c | 14 ++++---- src/src/functions.h | 2 +- src/src/host.c | 2 +- src/src/imap_utf7.c | 16 ++++----- src/src/lookups/ibase.c | 2 +- src/src/lookups/ldap.c | 2 +- src/src/macros.h | 2 +- src/src/malware.c | 10 +++--- src/src/memcheck.h | 20 +++++------ src/src/parse.c | 2 +- src/src/pdkim/pdkim.c | 6 ++-- src/src/pdkim/rsa.c | 8 ++--- src/src/readconf.c | 2 +- src/src/smtp_in.c | 24 ++++++------- src/src/spool_in.c | 4 +-- src/src/spool_out.c | 2 +- src/src/tls-gnu.c | 2 +- src/src/tls-openssl.c | 4 +-- src/src/tls.c | 4 +-- src/src/tlscert-gnu.c | 6 ++-- src/src/tlscert-openssl.c | 18 +++++----- src/src/transport.c | 4 +-- src/src/transports/appendfile.c | 4 +-- src/src/valgrind.h | 50 +++++++++++++-------------- 27 files changed, 140 insertions(+), 140 deletions(-) diff --git a/src/src/dcc.c b/src/src/dcc.c index d630c58a9..b03690ca6 100644 --- a/src/src/dcc.c +++ b/src/src/dcc.c @@ -144,18 +144,18 @@ dcc_process(uschar **listptr) bzero(opts,sizeof(opts)); Ustrncpy(opts, dccifd_options, sizeof(opts)-1); /* if $acl_m_dcc_override_client_ip is set use it */ - if (((override_client_ip = expand_string(US"$acl_m_dcc_override_client_ip")) != NULL) && + if (((override_client_ip = expand_string(US"$acl_m_dcc_override_client_ip")) != NULL) && (override_client_ip[0] != '\0')) { Ustrncpy(client_ip, override_client_ip, sizeof(client_ip)-1); DEBUG(D_acl) debug_printf("DCC: Client IP (overridden): %s\n", client_ip); - } + } else if(sender_host_address) { /* else if $sender_host_address is available use that? */ Ustrncpy(client_ip, sender_host_address, sizeof(client_ip)-1); DEBUG(D_acl) debug_printf("DCC: Client IP (sender_host_address): %s\n", client_ip); - } + } else { /* sender_host_address is NULL which means it comes from localhost */ Ustrncpy(client_ip, dcc_default_ip_option, sizeof(client_ip)-1); @@ -451,7 +451,7 @@ dcc_process(uschar **listptr) /* The third and following lines are the X-DCC header, * so we store it in dcc_header_str. */ /* check if we don't get more than we can handle */ - if(k < sizeof(dcc_header_str)) { + if(k < sizeof(dcc_header_str)) { dcc_header_str[k] = recvbuf[i]; k++; } diff --git a/src/src/deliver.c b/src/src/deliver.c index 3dfa84261..5c4b22712 100644 --- a/src/src/deliver.c +++ b/src/src/deliver.c @@ -3060,7 +3060,7 @@ while (!done) /* copy and read header */ memcpy(header, ptr, PIPE_HEADER_SIZE); - header[PIPE_HEADER_SIZE] = '\0'; + header[PIPE_HEADER_SIZE] = '\0'; id = header[0]; subid = header[1]; required = Ustrtol(header + 2, &endc, 10) + PIPE_HEADER_SIZE; /* header + data */ @@ -3073,7 +3073,7 @@ while (!done) } DEBUG(D_deliver) - debug_printf("header read id:%c,subid:%c,size:%s,required:%d,remaining:%d,unfinished:%d\n", + debug_printf("header read id:%c,subid:%c,size:%s,required:%d,remaining:%d,unfinished:%d\n", id, subid, header+2, required, remaining, unfinished); /* is there room for the dataset we want to read ? */ @@ -3086,16 +3086,16 @@ while (!done) break; } - /* we wrote all datasets with atomic write() calls + /* we wrote all datasets with atomic write() calls remaining < required only happens if big_buffer was too small - to get all available data from pipe. unfinished has to be true + to get all available data from pipe. unfinished has to be true as well. */ if (remaining < required) { if (unfinished) continue; msg = string_sprintf("failed to read pipe from transport process " - "%d for transport %s: required size=%d > remaining size=%d and unfinished=false", + "%d for transport %s: required size=%d > remaining size=%d and unfinished=false", pid, addr->transport->driver_name, required, remaining); done = TRUE; break; @@ -3103,7 +3103,7 @@ while (!done) /* step behind the header */ ptr += PIPE_HEADER_SIZE; - + /* Handle each possible type of item, assuming the complete item is available in store. */ @@ -3822,7 +3822,7 @@ int header_length; if (size > 99999) { - log_write(0, LOG_MAIN|LOG_PANIC_DIE, + log_write(0, LOG_MAIN|LOG_PANIC_DIE, "Failed writing transport result to pipe: can't handle buffers > 99999 bytes. truncating!\n"); size = 99999; } @@ -3838,7 +3838,7 @@ if (header_length != PIPE_HEADER_SIZE) writebuffer[0] = '\0'; } -DEBUG(D_deliver) debug_printf("header write id:%c,subid:%c,size:%d,final:%s\n", +DEBUG(D_deliver) debug_printf("header write id:%c,subid:%c,size:%d,final:%s\n", id, subid, size, writebuffer); if (buf && size > 0) @@ -5751,7 +5751,7 @@ if (process_recipients != RECIP_IGNORE) if (r->pno >= 0) new->onetime_parent = recipients_list[r->pno].address; - /* If DSN support is enabled, set the dsn flags and the original receipt + /* If DSN support is enabled, set the dsn flags and the original receipt to be passed on to other DSN enabled MTAs */ new->dsn_flags = r->dsn_flags & rf_dsnflags; new->dsn_orcpt = r->orcpt; @@ -6850,7 +6850,7 @@ while(addr_dsntmp) addr_senddsn->next = addr_next; } else - DEBUG(D_deliver) debug_printf("DSN: not sending DSN success message\n"); + DEBUG(D_deliver) debug_printf("DSN: not sending DSN success message\n"); addr_dsntmp = addr_dsntmp->next; } @@ -6860,11 +6860,11 @@ if (addr_senddsn) pid_t pid; int fd; - /* create exim process to send message */ + /* create exim process to send message */ pid = child_open_exim(&fd); DEBUG(D_deliver) debug_printf("DSN: child_open_exim returns: %d\n", pid); - + if (pid < 0) /* Creation of child failed */ { log_write(0, LOG_MAIN|LOG_PANIC_DIE, "Process %d (parent %d) failed to " @@ -6872,24 +6872,24 @@ if (addr_senddsn) getppid(), strerror(errno)); DEBUG(D_deliver) debug_printf("DSN: child_open_exim failed\n"); - } + } else /* Creation of child succeeded */ { FILE *f = fdopen(fd, "wb"); /* header only as required by RFC. only failure DSN needs to honor RET=FULL */ int topt = topt_add_return_path | topt_no_body; uschar * bound; - + DEBUG(D_deliver) debug_printf("sending error message to: %s\n", sender_address); - + /* build unique id for MIME boundary */ bound = string_sprintf(TIME_T_FMT "-eximdsn-%d", time(NULL), rand()); DEBUG(D_deliver) debug_printf("DSN: MIME boundary: %s\n", bound); - + if (errors_reply_to) fprintf(f, "Reply-To: %s\n", errors_reply_to); - + fprintf(f, "Auto-Submitted: auto-generated\n" "From: Mail Delivery System \n" "To: %s\n" @@ -6899,7 +6899,7 @@ if (addr_senddsn) "--%s\n" "Content-type: text/plain; charset=us-ascii\n\n" - + "This message was created automatically by mail delivery software.\n" " ----- The following addresses had successful delivery notifications -----\n", qualify_domain_sender, sender_address, bound, bound); @@ -6951,11 +6951,11 @@ if (addr_senddsn) } fprintf(f, "--%s\nContent-type: text/rfc822-headers\n\n", bound); - + fflush(f); transport_filter_argv = NULL; /* Just in case */ return_path = sender_address; /* In case not previously set */ - + /* Write the original email out */ transport_write_message(NULL, fileno(f), topt, 0, NULL, NULL, NULL, NULL, NULL, 0); fflush(f); @@ -7315,7 +7315,7 @@ wording. */ fprintf(f, "X-Original-Envelope-ID: error decoding xtext formated ENVID\n"); } fputc('\n', f); - + for (addr = handled_addr; addr; addr = addr->next) { host_item * hu; @@ -7355,16 +7355,16 @@ wording. */ emf_text = next_emf(emf, US"copy"); /* add message body - we ignore the intro text from template and add + we ignore the intro text from template and add the text for bounce_return_size_limit at the end. - + bounce_return_message is ignored in case RET= is defined we honor these values otherwise bounce_return_body is honored. - + bounce_return_size_limit is always honored. */ - + fprintf(f, "--%s\n", bound); dsnlimitmsg = US"X-Exim-DSN-Information: Due to administrative limits only headers are returned"; @@ -7393,7 +7393,7 @@ wording. */ dsnnotifyhdr = dsnlimitmsg; } } - + #ifdef EXPERIMENTAL_INTERNATIONAL if (message_smtputf8) fputs(topt & topt_no_body ? "Content-type: message/global-headers\n\n" @@ -7411,11 +7411,11 @@ wording. */ transport_write_message(NULL, fileno(f), topt, 0, dsnnotifyhdr, NULL, NULL, NULL, NULL, 0); fflush(f); - + /* we never add the final text. close the file */ if (emf) (void)fclose(emf); - + fprintf(f, "\n--%s--\n", bound); /* Close the file, which should send an EOF to the child process @@ -7831,7 +7831,7 @@ else if (addr_defer != (address_item *)(+1)) "Reporting-MTA: dns; %s\n", bound, smtp_active_hostname); - + if (dsn_envid) { @@ -7855,7 +7855,7 @@ else if (addr_defer != (address_item *)(+1)) addr_dsndefer->address); if (addr_dsndefer->host_used && addr_dsndefer->host_used->name) { - fprintf(f, "Remote-MTA: dns; %s\n", + fprintf(f, "Remote-MTA: dns; %s\n", addr_dsndefer->host_used->name); print_dsn_diagnostic_code(addr_dsndefer, f); } diff --git a/src/src/dns.c b/src/src/dns.c index f99b470b2..27ab2d2a2 100644 --- a/src/src/dns.c +++ b/src/src/dns.c @@ -468,7 +468,7 @@ if ( !h->aa || !*trusted || !(auth_name = dns_extract_auth_name(dnsa)) || OK != match_isinlist(auth_name, &trusted, 0, NULL, NULL, - MCL_DOMAIN, TRUE, NULL) + MCL_DOMAIN, TRUE, NULL) ) return FALSE; diff --git a/src/src/expand.c b/src/src/expand.c index f9849e67c..2c3c8a4a5 100644 --- a/src/src/expand.c +++ b/src/src/expand.c @@ -1267,7 +1267,7 @@ certfield * cp; if (!(vp = find_var_ent(certvar))) { - expand_string_message = + expand_string_message = string_sprintf("no variable named \"%s\"", certvar); return NULL; /* Unknown variable name */ } @@ -1275,7 +1275,7 @@ if (!(vp = find_var_ent(certvar))) want to do that in future */ if (vp->type != vtype_cert) { - expand_string_message = + expand_string_message = string_sprintf("\"%s\" is not a certificate", certvar); return NULL; /* Unknown variable name */ } @@ -1295,7 +1295,7 @@ for(cp = certfields; return (*cp->getfn)( *(void **)vp->value, modifier ); } -expand_string_message = +expand_string_message = string_sprintf("bad field selector \"%s\" for certextract", field); return NULL; } @@ -4108,9 +4108,9 @@ while (*s != 0) } else if (Ustrlen(sub_arg[1]) != 1) { - expand_string_message = + expand_string_message = string_sprintf( - "IMAP folder separator must be one character, found \"%s\"", + "IMAP folder separator must be one character, found \"%s\"", sub_arg[1]); goto EXPAND_FAILED; } @@ -6636,7 +6636,7 @@ while (*s != 0) } /* replace illegal UTF-8 sequences by replacement character */ - + #define UTF8_REPLACEMENT_CHAR US"?" case EOP_UTF8CLEAN: @@ -6645,7 +6645,7 @@ while (*s != 0) int bytes_left = 0; long codepoint = -1; uschar seq_buff[4]; /* accumulate utf-8 here */ - + while (*sub != 0) { int complete = 0; diff --git a/src/src/functions.h b/src/src/functions.h index 9baa32d59..2fe681394 100644 --- a/src/src/functions.h +++ b/src/src/functions.h @@ -215,7 +215,7 @@ extern int host_nmtoa(int, int *, int, uschar *, int); extern uschar *host_ntoa(int, const void *, uschar *, int *); extern int host_scan_for_local_hosts(host_item *, host_item **, BOOL *); -extern uschar *imap_utf7_encode(uschar *, const uschar *, +extern uschar *imap_utf7_encode(uschar *, const uschar *, uschar, uschar *, uschar **); extern void invert_address(uschar *, uschar *); diff --git a/src/src/host.c b/src/src/host.c index 5c69c7fc2..429b6352c 100644 --- a/src/src/host.c +++ b/src/src/host.c @@ -2620,7 +2620,7 @@ if (rc != DNS_SUCCEED && (whichrrs & HOST_FIND_BY_MX) != 0) if (dnssec_request) { if (dns_is_secure(&dnsa)) - { + { DEBUG(D_host_lookup) debug_printf("%s MX DNSSEC\n", host->name); dnssec = DS_YES; lookup_dnssec_authenticated = US"yes"; } diff --git a/src/src/imap_utf7.c b/src/src/imap_utf7.c index 7fa03aa50..739e47f41 100644 --- a/src/src/imap_utf7.c +++ b/src/src/imap_utf7.c @@ -57,7 +57,7 @@ if ((icd = iconv_open("UTF-16BE", CCS charset)) == (iconv_t)-1) errno == EINVAL ? " (maybe unsupported conversion)" : ""); return NULL; } -#endif +#endif while (slen > 0) { @@ -76,7 +76,7 @@ while (slen > 0) return NULL; } #else - for (utf16ptr = utf16buf; + for (utf16ptr = utf16buf; slen > 0 && (utf16ptr - utf16buf) < sizeof(utf16buf); utf16ptr += 2, slen--, sptr++) { @@ -97,14 +97,14 @@ while (slen > 0) { lastsep = FALSE; /* Encode as modified BASE64 */ - if (!base64mode) + if (!base64mode) { *outptr++ = '&'; base64mode = TRUE; i = 0; } - for (j = 0; j < 2; j++, s++) switch (i++) + for (j = 0; j < 2; j++, s++) switch (i++) { case 0: /* Top 6 bits of the first octet */ @@ -130,7 +130,7 @@ while (slen > 0) /* Encode as self (almost) */ if (base64mode) { - switch (i) + switch (i) { case 1: /* Remaining bottom 2 bits of the last octet */ @@ -176,11 +176,11 @@ while (slen > 0) } } - } /* End of input string */ + } /* End of input string */ -if (base64mode) +if (base64mode) { - switch (i) + switch (i) { case 1: /* Remaining bottom 2 bits of the last octet */ diff --git a/src/src/lookups/ibase.c b/src/src/lookups/ibase.c index 7fd53d011..3c679c6cf 100644 --- a/src/src/lookups/ibase.c +++ b/src/src/lookups/ibase.c @@ -577,7 +577,7 @@ static lookup_info _lookup_info = { #ifdef DYNLOOKUP #define ibase_lookup_module_info _lookup_module_info #endif - + static lookup_info *_lookup_list[] = { &_lookup_info }; lookup_module_info ibase_lookup_module_info = { LOOKUP_MODULE_INFO_MAGIC, _lookup_list, 1 }; diff --git a/src/src/lookups/ldap.c b/src/src/lookups/ldap.c index b870df147..276bf32b0 100644 --- a/src/src/lookups/ldap.c +++ b/src/src/lookups/ldap.c @@ -800,7 +800,7 @@ while ((rc = ldap_result(lcp->ld, msgid, 0, timeoutptr, &result)) == /* In case we requested one attribute only but got * several times into that attr loop, we need to append - * the additional values. (This may happen if you derive + * the additional values. (This may happen if you derive * attributeTypes B and C from A and then query for A.) * In all other cases we detect the different attribute * and append only every non first value. */ diff --git a/src/src/macros.h b/src/src/macros.h index 5a35a9b56..4df7e5150 100644 --- a/src/src/macros.h +++ b/src/src/macros.h @@ -166,7 +166,7 @@ as long as the maximum path length. */ # define BIG_BUFFER_SIZE 16384 #endif -/* header size of pipe content +/* header size of pipe content currently: char id, char subid, char[5] length */ #define PIPE_HEADER_SIZE 7 diff --git a/src/src/malware.c b/src/src/malware.c index 96af1e8c6..37e380c29 100644 --- a/src/src/malware.c +++ b/src/src/malware.c @@ -1802,7 +1802,7 @@ if (!malware_ok) ) { int slen = Ustrlen(buf); - if (slen >= 1) + if (slen >= 1) { DEBUG(D_acl) debug_printf("got from avast: %s\n", buf); switch (avast_stage) @@ -1858,15 +1858,15 @@ if (!malware_ok) if ((malware_name = m_pcre_exec(ava_re_virus, buf))) { /* remove backslash in front of [whitespace|backslash] */ uschar * p, * p0; - for (p = malware_name; *p; ++p) + for (p = malware_name; *p; ++p) if (*p == '\\' && (isspace(p[1]) || p[1] == '\\')) for (p0 = p; *p0; ++p0) *p0 = p0[1]; - + avast_stage = AVA_DONE; goto endloop; } - if (Ustrncmp(buf, "200 SCAN OK", 11) == 0) + if (Ustrncmp(buf, "200 SCAN OK", 11) == 0) { /* we're done finally */ if (send(sock, "QUIT\n", 5, 0) < 0) /* courtesy */ return m_errlog_defer_3(scanent, string_sprintf( @@ -1890,7 +1890,7 @@ if (!malware_ok) switch(avast_stage) { - case AVA_HELO: + case AVA_HELO: case AVA_OPT: case AVA_RSP: return m_errlog_defer_3(scanent, nread >= 0 diff --git a/src/src/memcheck.h b/src/src/memcheck.h index bf95491b9..6f97b09af 100644 --- a/src/src/memcheck.h +++ b/src/src/memcheck.h @@ -22,16 +22,16 @@ 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - 2. The origin of this software must not be misrepresented; you must - not claim that you wrote the original software. If you use this - software in a product, an acknowledgment in the product + 2. The origin of this software must not be misrepresented; you must + not claim that you wrote the original software. If you use this + software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 3. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. - 4. The name of the author may not be used to endorse or promote - products derived from this software without specific prior written + 4. The name of the author may not be used to endorse or promote + products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS @@ -53,7 +53,7 @@ the terms of the GNU General Public License, version 2. See the COPYING file in the source distribution for details. - ---------------------------------------------------------------- + ---------------------------------------------------------------- */ @@ -71,12 +71,12 @@ #include "valgrind.h" -/* !! ABIWARNING !! ABIWARNING !! ABIWARNING !! ABIWARNING !! +/* !! ABIWARNING !! ABIWARNING !! ABIWARNING !! ABIWARNING !! This enum comprises an ABI exported by Valgrind to programs which use client requests. DO NOT CHANGE THE ORDER OF THESE ENTRIES, NOR DELETE ANY -- add new ones at the end. */ typedef - enum { + enum { VG_USERREQ__MAKE_MEM_NOACCESS = VG_USERREQ_TOOL_BASE('M','C'), VG_USERREQ__MAKE_MEM_UNDEFINED, VG_USERREQ__MAKE_MEM_DEFINED, @@ -97,7 +97,7 @@ typedef VG_USERREQ__COUNT_LEAK_BLOCKS, /* This is just for memcheck's internal use - don't use it */ - _VG_USERREQ__MEMCHECK_RECORD_OVERLAP_ERROR + _VG_USERREQ__MEMCHECK_RECORD_OVERLAP_ERROR = VG_USERREQ_TOOL_BASE('M','C') + 256 } Vg_MemCheckClientRequest; @@ -110,7 +110,7 @@ typedef VALGRIND_DO_CLIENT_REQUEST_EXPR(0 /* default return */, \ VG_USERREQ__MAKE_MEM_NOACCESS, \ (_qzz_addr), (_qzz_len), 0, 0, 0) - + /* Similarly, mark memory at _qzz_addr as addressable but undefined for _qzz_len bytes. */ #define VALGRIND_MAKE_MEM_UNDEFINED(_qzz_addr,_qzz_len) \ diff --git a/src/src/parse.c b/src/src/parse.c index 0ceb800d1..d3f382b96 100644 --- a/src/src/parse.c +++ b/src/src/parse.c @@ -906,7 +906,7 @@ for (; len > 0; len--) { *t++ = '_'; first_byte = FALSE; - } + } else { sprintf(CS t, "=%02X", ch); diff --git a/src/src/pdkim/pdkim.c b/src/src/pdkim/pdkim.c index c37773e26..cd7952174 100644 --- a/src/src/pdkim/pdkim.c +++ b/src/src/pdkim/pdkim.c @@ -1083,7 +1083,7 @@ int pdkim_header_complete(pdkim_ctx *ctx) { ctx->cur_header->str); if (list == NULL) return PDKIM_ERR_OOM; sig->headers = list; - + NEXT_SIG: sig = sig->next; } @@ -1204,14 +1204,14 @@ DLLEXPORT int pdkim_feed (pdkim_ctx *ctx, * * col: this int holds and receives column number (octets since last '\n') * str: partial string to append to - * pad: padding, split line or space after before or after eg: ";" + * pad: padding, split line or space after before or after eg: ";" * intro: - must join to payload eg "h=", usually the tag name * payload: eg base64 data - long data can be split arbitrarily. * * this code doesn't fold the header in some of the places that RFC4871 * allows: As per RFC5322(2.2.3) it only folds before or after tag-value * pairs and inside long values. it also always spaces or breaks after the - * "pad" + * "pad" * * no guarantees are made for output given out-of range input. like tag * names loinger than 78, or bogus col. Input is assumed to be free of line breaks. diff --git a/src/src/pdkim/rsa.c b/src/src/pdkim/rsa.c index 68b201d89..f0536a6f6 100644 --- a/src/src/pdkim/rsa.c +++ b/src/src/pdkim/rsa.c @@ -178,7 +178,7 @@ int rsa_gen_key( rsa_context *ctx, do { - MPI_CHK( mpi_gen_prime( &ctx->P, ( nbits + 1 ) >> 1, 0, + MPI_CHK( mpi_gen_prime( &ctx->P, ( nbits + 1 ) >> 1, 0, f_rng, p_rng ) ); MPI_CHK( mpi_gen_prime( &ctx->Q, ( nbits + 1 ) >> 1, 0, @@ -224,7 +224,7 @@ cleanup: return( POLARSSL_ERR_RSA_KEY_GEN_FAILED | ret ); } - return( 0 ); + return( 0 ); } #endif @@ -276,7 +276,7 @@ int rsa_check_privkey( const rsa_context *ctx ) MPI_CHK( mpi_gcd( &G, &ctx->E, &H ) ); MPI_CHK( mpi_gcd( &G2, &P1, &Q1 ) ); - MPI_CHK( mpi_div_mpi( &L1, &L2, &H, &G2 ) ); + MPI_CHK( mpi_div_mpi( &L1, &L2, &H, &G2 ) ); MPI_CHK( mpi_mod_mpi( &I, &DE, &L1 ) ); /* @@ -291,7 +291,7 @@ int rsa_check_privkey( const rsa_context *ctx ) return( 0 ); } - + cleanup: mpi_free( &G, &I, &H, &Q1, &P1, &DE, &PQ, &G2, &L1, &L2, NULL ); diff --git a/src/src/readconf.c b/src/src/readconf.c index 8a62d0245..61d71773f 100644 --- a/src/src/readconf.c +++ b/src/src/readconf.c @@ -3040,7 +3040,7 @@ if (config_file != NULL) config_filename = config_main_filename = string_copy(filename); p = Ustrrchr(filename, '/'); - config_main_directory = p ? string_copyn(filename, p - filename) + config_main_directory = p ? string_copyn(filename, p - filename) : string_copy(US"."); } else diff --git a/src/src/smtp_in.c b/src/src/smtp_in.c index 9aacef1fc..d940c69f0 100644 --- a/src/src/smtp_in.c +++ b/src/src/smtp_in.c @@ -37,10 +37,10 @@ uschar *tcp_wrappers_name; /* Size of buffer for reading SMTP commands. We used to use 512, as defined by RFC 821. However, RFC 1869 specifies that this must be increased for SMTP commands that accept arguments, and this in particular applies to AUTH, where -the data can be quite long. More recently this value was 2048 in Exim; +the data can be quite long. More recently this value was 2048 in Exim; however, RFC 4954 (circa 2007) recommends 12288 bytes to handle AUTH. Clients -such as Thunderbird will send an AUTH with an initial-response for GSSAPI. -The maximum size of a Kerberos ticket under Windows 2003 is 12000 bytes, and +such as Thunderbird will send an AUTH with an initial-response for GSSAPI. +The maximum size of a Kerberos ticket under Windows 2003 is 12000 bytes, and we need room to handle large base64-encoded AUTHs for GSSAPI. */ @@ -3664,7 +3664,7 @@ while (done <= 0) } /* Advertise DSN support if configured to do so. */ - if (verify_check_host(&dsn_advertise_hosts) != FAIL) + if (verify_check_host(&dsn_advertise_hosts) != FAIL) { s = string_cat(s, &size, &ptr, smtp_code, 3); s = string_cat(s, &size, &ptr, US"-DSN\r\n", 6); @@ -4011,7 +4011,7 @@ while (done <= 0) rc = acl_check(ACL_WHERE_MAILAUTH, NULL, acl_smtp_mailauth, &user_msg, &log_msg); } - + switch (rc) { case OK: @@ -4020,23 +4020,23 @@ while (done <= 0) expand_check_condition(authenticated_by->mail_auth_condition, authenticated_by->name, US"authenticator")) break; /* Accept the AUTH */ - + ignore_msg = US"server_mail_auth_condition failed"; if (authenticated_id != NULL) ignore_msg = string_sprintf("%s: authenticated ID=\"%s\"", ignore_msg, authenticated_id); - + /* Fall through */ - + case FAIL: authenticated_sender = NULL; log_write(0, LOG_MAIN, "ignoring AUTH=%s from %s (%s)", value, host_and_ident(TRUE), ignore_msg); break; - + /* Should only get DEFER or ERROR here. Put back terminator overrides for error message */ - + default: value[-1] = '='; name[-1] = ' '; @@ -4206,7 +4206,7 @@ while (done <= 0) US"", #endif US"\r\n"); - else + else { #ifndef DISABLE_PRDR if (prdr_requested) @@ -4464,7 +4464,7 @@ while (done <= 0) if (user_msg == NULL) smtp_printf("250 Accepted\r\n"); else smtp_user_msg(US"250", user_msg); receive_add_recipient(recipient, -1); - + /* Set the dsn flags in the recipients_list */ recipients_list[recipients_count-1].orcpt = orcpt; recipients_list[recipients_count-1].dsn_flags = flags; diff --git a/src/src/spool_in.c b/src/src/spool_in.c index fdc83e5a7..a7095bbaa 100644 --- a/src/src/spool_in.c +++ b/src/src/spool_in.c @@ -761,7 +761,7 @@ for (recipients_count = 0; recipients_count < rcount; recipients_count++) { p -= len; errors_to = string_copy(p); - } + } } *(--p) = 0; /* Terminate address */ @@ -775,7 +775,7 @@ for (recipients_count = 0; recipients_count < rcount; recipients_count++) { p -= len; orcpt = string_copy(p); - } + } } *(--p) = 0; /* Terminate address */ diff --git a/src/src/spool_out.c b/src/src/spool_out.c index 39d0fea25..e7a6a6535 100644 --- a/src/src/spool_out.c +++ b/src/src/spool_out.c @@ -284,7 +284,7 @@ DEBUG(D_deliver) debug_printf("DSN: Flags :%d\n", r->dsn_flags); fprintf(f, "%s %s %d,%d %s %d,%d#3\n", r->address, orcpt, Ustrlen(orcpt), r->dsn_flags, errors_to, Ustrlen(errors_to), r->pno); } - + DEBUG(D_deliver) debug_printf("DSN: **** SPOOL_OUT - address: |%s| errorsto: |%s| orcpt: |%s| dsn_flags: %d\n", r->address, r->errors_to, r->orcpt, r->dsn_flags); } diff --git a/src/src/tls-gnu.c b/src/src/tls-gnu.c index 846a0f6b1..c316d0a24 100644 --- a/src/src/tls-gnu.c +++ b/src/src/tls-gnu.c @@ -1907,7 +1907,7 @@ if ((rc = tls_init(host, ob->tls_certificate, ob->tls_privatekey, gnutls_dh_set_prime_bits(state->session, dh_min_bits); } -/* Stick to the old behaviour for compatibility if tls_verify_certificates is +/* Stick to the old behaviour for compatibility if tls_verify_certificates is set but both tls_verify_hosts and tls_try_verify_hosts are unset. Check only the specified host patterns if one of them is defined */ diff --git a/src/src/tls-openssl.c b/src/src/tls-openssl.c index 73ac80734..c68b25d83 100644 --- a/src/src/tls-openssl.c +++ b/src/src/tls-openssl.c @@ -388,7 +388,7 @@ else if (depth != 0) { /* client, wanting stapling */ /* Add the server cert's signing chain as the one for the verification of the OCSP stapled information. */ - + if (!X509_STORE_add_cert(client_static_cbinfo->u_ocsp.client.verify_store, cert)) ERR_clear_error(); @@ -1838,7 +1838,7 @@ tls_client_basic_ctx_init(SSL_CTX * ctx, ) { int rc; -/* stick to the old behaviour for compatibility if tls_verify_certificates is +/* stick to the old behaviour for compatibility if tls_verify_certificates is set but both tls_verify_hosts and tls_try_verify_hosts is not set. Check only the specified host patterns if one of them is defined */ diff --git a/src/src/tls.c b/src/src/tls.c index 6b1a189a9..60f0cfe98 100644 --- a/src/src/tls.c +++ b/src/src/tls.c @@ -89,7 +89,7 @@ to_tz(uschar * tz) { uschar * old = US getenv("TZ"); setenv("TZ", CS tz, 1); - tzset(); + tzset(); return old; } static void @@ -99,7 +99,7 @@ restore_tz(uschar * tz) setenv("TZ", CS tz, 1); else unsetenv("TZ"); - tzset(); + tzset(); } /************************************************* diff --git a/src/src/tlscert-gnu.c b/src/src/tlscert-gnu.c index 69ce27fc8..d00258b9e 100644 --- a/src/src/tlscert-gnu.c +++ b/src/src/tlscert-gnu.c @@ -328,11 +328,11 @@ for(index = 0;; index++) switch (ret) { case GNUTLS_SAN_DNSNAME: tag = US"DNS"; break; - case GNUTLS_SAN_URI: tag = US"URI"; break; + case GNUTLS_SAN_URI: tag = US"URI"; break; case GNUTLS_SAN_RFC822NAME: tag = US"MAIL"; break; default: continue; /* ignore unrecognised types */ } - list = string_append_listele(list, sep, + list = string_append_listele(list, sep, match == -1 ? string_sprintf("%s=%s", tag, ele) : ele); } /*NOTREACHED*/ @@ -368,7 +368,7 @@ for(index = 0;; index++) #else -expand_string_message = +expand_string_message = string_sprintf("%s: OCSP support with GnuTLS requires version 3.0.0\n", __FUNCTION__); return NULL; diff --git a/src/src/tlscert-openssl.c b/src/src/tlscert-openssl.c index 19db0408f..94534d808 100644 --- a/src/src/tlscert-openssl.c +++ b/src/src/tlscert-openssl.c @@ -241,9 +241,9 @@ BIO * bp = BIO_new(BIO_s_mem()); if (!bp) return badalloc(); if (X509_print_ex(bp, (X509 *)cert, 0, - X509_FLAG_NO_HEADER | X509_FLAG_NO_VERSION | X509_FLAG_NO_SERIAL | - X509_FLAG_NO_SIGNAME | X509_FLAG_NO_ISSUER | X509_FLAG_NO_VALIDITY | - X509_FLAG_NO_SUBJECT | X509_FLAG_NO_PUBKEY | X509_FLAG_NO_EXTENSIONS | + X509_FLAG_NO_HEADER | X509_FLAG_NO_VERSION | X509_FLAG_NO_SERIAL | + X509_FLAG_NO_SIGNAME | X509_FLAG_NO_ISSUER | X509_FLAG_NO_VALIDITY | + X509_FLAG_NO_SUBJECT | X509_FLAG_NO_PUBKEY | X509_FLAG_NO_EXTENSIONS | /* X509_FLAG_NO_SIGDUMP is the missing one */ X509_FLAG_NO_AUX) == 1) { @@ -267,10 +267,10 @@ BIO * bp = BIO_new(BIO_s_mem()); if (!bp) return badalloc(); if (X509_print_ex(bp, (X509 *)cert, 0, - X509_FLAG_NO_HEADER | X509_FLAG_NO_VERSION | X509_FLAG_NO_SERIAL | + X509_FLAG_NO_HEADER | X509_FLAG_NO_VERSION | X509_FLAG_NO_SERIAL | /* X509_FLAG_NO_SIGNAME is the missing one */ - X509_FLAG_NO_ISSUER | X509_FLAG_NO_VALIDITY | - X509_FLAG_NO_SUBJECT | X509_FLAG_NO_PUBKEY | X509_FLAG_NO_EXTENSIONS | + X509_FLAG_NO_ISSUER | X509_FLAG_NO_VALIDITY | + X509_FLAG_NO_SUBJECT | X509_FLAG_NO_PUBKEY | X509_FLAG_NO_EXTENSIONS | X509_FLAG_NO_SIGDUMP | X509_FLAG_NO_AUX) == 1) { long len = BIO_get_mem_data(bp, &cp); @@ -482,19 +482,19 @@ for (j = 0; j < (int)n; j++) sprintf(CS cp+2*j, "%02X", md[j]); return(cp); } -uschar * +uschar * tls_cert_fprt_md5(void * cert) { return fingerprint((X509 *)cert, EVP_md5()); } -uschar * +uschar * tls_cert_fprt_sha1(void * cert) { return fingerprint((X509 *)cert, EVP_sha1()); } -uschar * +uschar * tls_cert_fprt_sha256(void * cert) { return fingerprint((X509 *)cert, EVP_sha256()); diff --git a/src/src/transport.c b/src/src/transport.c index c258bfd9d..62cbdc632 100644 --- a/src/src/transport.c +++ b/src/src/transport.c @@ -1068,7 +1068,7 @@ if (dkim_private_key && dkim_domain && dkim_selector) uschar *dkim_strict_result = expand_string(dkim_strict); if (dkim_strict_result) if ( (strcmpic(dkim_strict,US"1") == 0) || - (strcmpic(dkim_strict,US"true") == 0) ) + (strcmpic(dkim_strict,US"true") == 0) ) { /* Set errno to something halfway meaningful */ save_errno = EACCES; @@ -1855,7 +1855,7 @@ test but the code should work */ if (!bContinuation) { - Ustrcpy (new_message_id, message_id); + Ustrcpy (new_message_id, message_id); dbfn_close(dbm_file); return FALSE; } diff --git a/src/src/transports/appendfile.c b/src/src/transports/appendfile.c index 9de6c9fd0..c8abe9bc5 100644 --- a/src/src/transports/appendfile.c +++ b/src/src/transports/appendfile.c @@ -186,7 +186,7 @@ appendfile_transport_options_block appendfile_transport_option_defaults = { NULL, /* quota_warn_threshold */ NULL, /* mailbox_size_string */ NULL, /* mailbox_filecount_string */ - NULL, /* expand_maildir_use_size_file */ + NULL, /* expand_maildir_use_size_file */ US"^(?:cur|new|\\..*)$", /* maildir_dir_regex */ NULL, /* maildir_tag */ NULL, /* maildirfolder_create_regex */ @@ -276,7 +276,7 @@ uid = uid; gid = gid; if (ob->expand_maildir_use_size_file) - ob->maildir_use_size_file = expand_check_condition(ob->expand_maildir_use_size_file, + ob->maildir_use_size_file = expand_check_condition(ob->expand_maildir_use_size_file, US"`maildir_use_size_file` in transport", tblock->name); /* Loop for quota, quota_filecount, quota_warn_threshold, mailbox_size, diff --git a/src/src/valgrind.h b/src/src/valgrind.h index 4d41690ab..f16e70177 100644 --- a/src/src/valgrind.h +++ b/src/src/valgrind.h @@ -21,16 +21,16 @@ 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - 2. The origin of this software must not be misrepresented; you must - not claim that you wrote the original software. If you use this - software in a product, an acknowledgment in the product + 2. The origin of this software must not be misrepresented; you must + not claim that you wrote the original software. If you use this + software in a product, an acknowledgment in the product documentation would be appreciated but is not required. 3. Altered source versions must be plainly marked as such, and must not be misrepresented as being the original software. - 4. The name of the author may not be used to endorse or promote - products derived from this software without specific prior written + 4. The name of the author may not be used to endorse or promote + products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS @@ -52,13 +52,13 @@ the terms of the GNU General Public License, version 2. See the COPYING file in the source distribution for details. - ---------------------------------------------------------------- + ---------------------------------------------------------------- */ /* This file is for inclusion into client (your!) code. - You can use these macros to manipulate and query Valgrind's + You can use these macros to manipulate and query Valgrind's execution inside your own programs. The resulting executables will still run without Valgrind, just a @@ -180,8 +180,8 @@ this is executed not under Valgrind. Args are passed in a memory block, and so there's no intrinsic limit to the number that could be passed, but it's currently five. - - The macro args are: + + The macro args are: _zzq_rlval result lvalue _zzq_default default value (result returned when running on real CPU) _zzq_request request code @@ -208,7 +208,7 @@ || (defined(PLAT_x86_win32) && defined(__GNUC__)) typedef - struct { + struct { unsigned int nraddr; /* where's the code? */ } OrigFn; @@ -262,7 +262,7 @@ typedef #if defined(PLAT_x86_win32) && !defined(__GNUC__) typedef - struct { + struct { unsigned int nraddr; /* where's the code? */ } OrigFn; @@ -317,7 +317,7 @@ typedef #if defined(PLAT_amd64_linux) || defined(PLAT_amd64_darwin) typedef - struct { + struct { unsigned long long int nraddr; /* where's the code? */ } OrigFn; @@ -371,7 +371,7 @@ typedef #if defined(PLAT_ppc32_linux) typedef - struct { + struct { unsigned int nraddr; /* where's the code? */ } OrigFn; @@ -431,7 +431,7 @@ typedef #if defined(PLAT_ppc64_linux) typedef - struct { + struct { unsigned long long int nraddr; /* where's the code? */ unsigned long long int r2; /* what tocptr do we need? */ } @@ -497,7 +497,7 @@ typedef #if defined(PLAT_arm_linux) typedef - struct { + struct { unsigned int nraddr; /* where's the code? */ } OrigFn; @@ -556,7 +556,7 @@ typedef #if defined(PLAT_ppc32_aix5) typedef - struct { + struct { unsigned int nraddr; /* where's the code? */ unsigned int r2; /* what tocptr do we need? */ } @@ -628,7 +628,7 @@ typedef #if defined(PLAT_ppc64_aix5) typedef - struct { + struct { unsigned long long int nraddr; /* where's the code? */ unsigned long long int r2; /* what tocptr do we need? */ } @@ -1753,7 +1753,7 @@ typedef "r0", "r2", "r3", "r4", "r5", "r6", "r7", "r8", "r9", "r10", \ "r11", "r12", "r13" -/* These CALL_FN_ macros assume that on ppc32-linux, +/* These CALL_FN_ macros assume that on ppc32-linux, sizeof(unsigned long) == 4. */ #define CALL_FN_W_v(lval, orig) \ @@ -4269,7 +4269,7 @@ typedef #define VG_IS_TOOL_USERREQ(a, b, v) \ (VG_USERREQ_TOOL_BASE(a,b) == ((v) & 0xffff0000)) -/* !! ABIWARNING !! ABIWARNING !! ABIWARNING !! ABIWARNING !! +/* !! ABIWARNING !! ABIWARNING !! ABIWARNING !! ABIWARNING !! This enum comprises an ABI exported by Valgrind to programs which use client requests. DO NOT CHANGE THE ORDER OF THESE ENTRIES, NOR DELETE ANY -- add new ones at the end. */ @@ -4452,7 +4452,7 @@ VALGRIND_PRINTF(const char *format, ...) VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, VG_USERREQ__PRINTF_VALIST_BY_REF, (unsigned long)format, - (unsigned long)&vargs, + (unsigned long)&vargs, 0, 0, 0); #endif va_end(vargs); @@ -4482,7 +4482,7 @@ VALGRIND_PRINTF_BACKTRACE(const char *format, ...) VALGRIND_DO_CLIENT_REQUEST(_qzz_res, 0, VG_USERREQ__PRINTF_BACKTRACE_VALIST_BY_REF, (unsigned long)format, - (unsigned long)&vargs, + (unsigned long)&vargs, 0, 0, 0); #endif va_end(vargs); @@ -4494,7 +4494,7 @@ VALGRIND_PRINTF_BACKTRACE(const char *format, ...) /* These requests allow control to move from the simulated CPU to the real CPU, calling an arbitary function. - + Note that the current ThreadId is inserted as the first argument. So this call: @@ -4599,7 +4599,7 @@ VALGRIND_PRINTF_BACKTRACE(const char *format, ...) - It marks the block as being addressable and undefined (if 'is_zeroed' is not set), or addressable and defined (if 'is_zeroed' is set). This controls how accesses to the block by the program are handled. - + 'addr' is the start of the usable block (ie. after any redzone), 'sizeB' is its size. 'rzB' is the redzone size if the allocator can apply redzones -- these are blocks of padding at the start and end of @@ -4607,7 +4607,7 @@ VALGRIND_PRINTF_BACKTRACE(const char *format, ...) Valgrind will spot block overruns. `is_zeroed' indicates if the memory is zeroed (or filled with another predictable value), as is the case for calloc(). - + VALGRIND_MALLOCLIKE_BLOCK should be put immediately after the point where a heap block -- that will be used by the client program -- is allocated. It's best to put it at the outermost level of the allocator if possible; @@ -4653,7 +4653,7 @@ VALGRIND_PRINTF_BACKTRACE(const char *format, ...) Note: there is currently no VALGRIND_REALLOCLIKE_BLOCK client request; it has to be emulated with MALLOCLIKE/FREELIKE and memory copying. - + Ignored if addr == 0. */ #define VALGRIND_MALLOCLIKE_BLOCK(addr, sizeB, rzB, is_zeroed) \ -- 2.30.2