summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2022-03-09 14:11:05 +0000
committerJeremy Harris <jgh146exb@wizmail.org>2022-03-09 14:11:05 +0000
commit6e48a63849cd3f1dfb3555fe57094954b3f7f092 (patch)
tree6f5dcfe58d482a03f2e5be25adee17b01fa4c374
parent7980dd8917020521479f2bb28a2363e76fb551e2 (diff)
downloadexim4-6e48a63849cd3f1dfb3555fe57094954b3f7f092.tar.gz
tidying
-rw-r--r--doc/doc-docbook/spec.xfpt2
-rw-r--r--src/src/child.c2
-rw-r--r--src/src/tls-openssl.c4
-rw-r--r--src/src/transport.c33
-rw-r--r--src/src/transports/pipe.c56
5 files changed, 39 insertions, 58 deletions
diff --git a/doc/doc-docbook/spec.xfpt b/doc/doc-docbook/spec.xfpt
index 1a88489f9..1f0f473d8 100644
--- a/doc/doc-docbook/spec.xfpt
+++ b/doc/doc-docbook/spec.xfpt
@@ -6998,7 +6998,7 @@ IPv4, in dotted-quad form. (Exim converts IPv4-mapped IPv6 addresses to this
notation before executing the lookup.)
One option is supported, "ret=full", to request the return of the entire line
-rather than omitting the key porttion.
+rather than omitting the key portion.
Note however that the key portion will have been de-quoted.
.next
diff --git a/src/src/child.c b/src/src/child.c
index 38b9d32fa..267306ee3 100644
--- a/src/src/child.c
+++ b/src/src/child.c
@@ -167,7 +167,7 @@ exim_nullstd(); /* Make sure std{in,out,err} exist */
execv(CS argv[0], (char *const *)argv);
log_write(0,
- LOG_MAIN | ((exec_type == CEE_EXEC_EXIT)? LOG_PANIC : LOG_PANIC_DIE),
+ LOG_MAIN | (exec_type == CEE_EXEC_EXIT ? LOG_PANIC : LOG_PANIC_DIE),
"re-exec of exim (%s) with %s failed: %s", exim_path, argv[first_special],
strerror(errno));
diff --git a/src/src/tls-openssl.c b/src/src/tls-openssl.c
index 14ba2fc0c..d5c5778fc 100644
--- a/src/src/tls-openssl.c
+++ b/src/src/tls-openssl.c
@@ -4585,8 +4585,8 @@ Returns: NULL on success, or error message
uschar *
tls_validate_require_cipher(void)
{
-SSL_CTX *ctx;
-uschar *s, *expciphers, *err;
+SSL_CTX * ctx;
+uschar * expciphers, * err;
tls_openssl_init();
diff --git a/src/src/transport.c b/src/src/transport.c
index 96a936503..8b320ecc2 100644
--- a/src/src/transport.c
+++ b/src/src/transport.c
@@ -2101,15 +2101,15 @@ arguments are verbatim. Copy each argument into a new string. */
s = cmd;
while (isspace(*s)) s++;
-for (; *s != 0 && argcount < max_args; argcount++)
+for (; *s && argcount < max_args; argcount++)
{
if (*s == '\'')
{
ss = s + 1;
- while (*ss != 0 && *ss != '\'') ss++;
+ while (*ss && *ss != '\'') ss++;
argv[argcount] = ss = store_get(ss - s++, cmd);
- while (*s != 0 && *s != '\'') *ss++ = *s++;
- if (*s != 0) s++;
+ while (*s && *s != '\'') *ss++ = *s++;
+ if (*s) s++;
*ss++ = 0;
}
else
@@ -2117,11 +2117,11 @@ for (; *s != 0 && argcount < max_args; argcount++)
while (isspace(*s)) s++;
}
-argv[argcount] = US 0;
+argv[argcount] = NULL;
/* If *s != 0 we have run out of argument slots. */
-if (*s != 0)
+if (*s)
{
uschar *msg = string_sprintf("Too many arguments in command \"%s\" in "
"%s", cmd, etext);
@@ -2159,16 +2159,15 @@ DEBUG(D_transport)
if (expand_arguments)
{
- BOOL allow_dollar_recipients = addr != NULL &&
- addr->parent != NULL &&
- Ustrcmp(addr->parent->address, "system-filter") == 0;
+ BOOL allow_dollar_recipients = addr && addr->parent
+ && Ustrcmp(addr->parent->address, "system-filter") == 0;
- for (int i = 0; argv[i] != US 0; i++)
+ for (int i = 0; argv[i]; i++)
{
/* Handle special fudge for passing an address list */
- if (addr != NULL &&
+ if (addr &&
(Ustrcmp(argv[i], "$pipe_addresses") == 0 ||
Ustrcmp(argv[i], "${pipe_addresses}") == 0))
{
@@ -2200,7 +2199,7 @@ if (expand_arguments)
/* Handle special case of $address_pipe when af_force_command is set */
- else if (addr != NULL && testflag(addr,af_force_command) &&
+ else if (addr && testflag(addr,af_force_command) &&
(Ustrcmp(argv[i], "$address_pipe") == 0 ||
Ustrcmp(argv[i], "${address_pipe}") == 0))
{
@@ -2220,7 +2219,7 @@ if (expand_arguments)
/* +1 because addr->local_part[0] == '|' since af_force_command is set */
s = expand_string(addr->local_part + 1);
- if (!s || *s == '\0')
+ if (!s || !*s)
{
addr->transport_return = FAIL;
addr->message = string_sprintf("Expansion of \"%s\" "
@@ -2248,14 +2247,14 @@ if (expand_arguments)
while (isspace(*s)) s++; /* strip space after arg */
}
- address_pipe_argv[address_pipe_argcount] = US 0;
+ address_pipe_argv[address_pipe_argcount] = NULL;
/* If *s != 0 we have run out of argument slots. */
- if (*s != 0)
+ if (*s)
{
uschar *msg = string_sprintf("Too many arguments in $address_pipe "
"\"%s\" in %s", addr->local_part + 1, etext);
- if (addr != NULL)
+ if (addr)
{
addr->transport_return = FAIL;
addr->message = msg;
@@ -2334,7 +2333,7 @@ if (expand_arguments)
DEBUG(D_transport)
{
debug_printf("direct command after expansion:\n");
- for (int i = 0; argv[i] != US 0; i++)
+ for (int i = 0; argv[i]; i++)
debug_printf(" argv[%d] = %s\n", i, string_printing(argv[i]));
}
}
diff --git a/src/src/transports/pipe.c b/src/src/transports/pipe.c
index df3693aba..39875b3de 100644
--- a/src/src/transports/pipe.c
+++ b/src/src/transports/pipe.c
@@ -88,31 +88,13 @@ BOOL pipe_transport_entry(transport_instance *tblock, address_item *addr) {retur
/* Default private options block for the pipe transport. */
pipe_transport_options_block pipe_transport_option_defaults = {
- NULL, /* cmd */
- NULL, /* allow_commands */
- NULL, /* environment */
- US"/bin:/usr/bin", /* path */
- NULL, /* message_prefix (reset in init if not bsmtp) */
- NULL, /* message_suffix (ditto) */
- US mac_expanded_string(EX_TEMPFAIL) ":" /* temp_errors */
- mac_expanded_string(EX_CANTCREAT),
- NULL, /* check_string */
- NULL, /* escape_string */
- 022, /* umask */
- 20480, /* max_output */
- 60*60, /* timeout */
- 0, /* options */
- FALSE, /* force_command */
- FALSE, /* freeze_exec_fail */
- FALSE, /* freeze_signal */
- FALSE, /* ignore_status */
- FALSE, /* permit_coredump */
- FALSE, /* restrict_to_path */
- FALSE, /* timeout_defer */
- FALSE, /* use_shell */
- FALSE, /* use_bsmtp */
- FALSE, /* use_classresources */
- FALSE /* use_crlf */
+ .path = US"/bin:/usr/bin",
+ .temp_errors = US mac_expanded_string(EX_TEMPFAIL) ":"
+ mac_expanded_string(EX_CANTCREAT),
+ .umask = 022,
+ .max_output = 20480,
+ .timeout = 60*60,
+ /* all others null/zero/false */
};
@@ -278,12 +260,12 @@ if (ob->allow_commands && ob->use_shell)
driver options. Only one of body_only and headers_only can be set. */
ob->options |=
- (tblock->body_only? topt_no_headers : 0) |
- (tblock->headers_only? topt_no_body : 0) |
- (tblock->return_path_add? topt_add_return_path : 0) |
- (tblock->delivery_date_add? topt_add_delivery_date : 0) |
- (tblock->envelope_to_add? topt_add_envelope_to : 0) |
- (ob->use_crlf? topt_use_crlf : 0);
+ (tblock->body_only ? topt_no_headers : 0)
+ | (tblock->headers_only ? topt_no_body : 0)
+ | (tblock->return_path_add ? topt_add_return_path : 0)
+ | (tblock->delivery_date_add ? topt_add_delivery_date : 0)
+ | (tblock->envelope_to_add ? topt_add_envelope_to : 0)
+ | (ob->use_crlf ? topt_use_crlf : 0);
}
@@ -581,9 +563,8 @@ else
}
/* If no command has been supplied, we are in trouble.
- * We also check for an empty string since it may be
- * coming from addr->local_part[0] == '|'
- */
+We also check for an empty string since it may be
+coming from addr->local_part[0] == '|' */
if (!cmd || !*cmd)
{
@@ -652,11 +633,12 @@ envp[envcount++] = string_sprintf("QUALIFY_DOMAIN=%s", qualify_domain_sender);
envp[envcount++] = string_sprintf("SENDER=%s", sender_address);
envp[envcount++] = US"SHELL=/bin/sh";
-if (addr->host_list != NULL)
+if (addr->host_list)
envp[envcount++] = string_sprintf("HOST=%s", addr->host_list->name);
-if (f.timestamps_utc) envp[envcount++] = US"TZ=UTC";
-else if (timezone_string != NULL && timezone_string[0] != 0)
+if (f.timestamps_utc)
+ envp[envcount++] = US"TZ=UTC";
+else if (timezone_string && timezone_string[0])
envp[envcount++] = string_sprintf("TZ=%s", timezone_string);
/* Add any requested items */