summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Harris <jgh146exb@wizmail.org>2020-06-04 13:54:55 +0100
committerJeremy Harris <jgh146exb@wizmail.org>2020-06-04 14:31:36 +0100
commit0e0e1716286028c369f93a28412839c657e6b47c (patch)
tree11a61ce0b9a184ae6d0ce961aa6fddbf163b9dd2 /src
parent0fe0ef0afacee70e95242c9e63cab9701c40a2ba (diff)
Fix -bi. Bug 2590
Actual fix from pierre.labastie@neuf.fr ; additional coding and testcase bu jgh Broken-by: bdcc6f2bd5
Diffstat (limited to 'src')
-rw-r--r--src/src/exim.c10
-rw-r--r--src/src/smtp_in.c5
2 files changed, 9 insertions, 6 deletions
diff --git a/src/src/exim.c b/src/src/exim.c
index 2f4149f6f..0b7b87ed5 100644
--- a/src/src/exim.c
+++ b/src/src/exim.c
@@ -2149,7 +2149,7 @@ on the second character (the one after '-'), to save some effort. */
concept of *the* alias file, but since Sun's YP make script calls
sendmail this way, some support must be provided. */
case 'i':
- if (!*++argrest) bi_option = TRUE;
+ if (!*argrest) bi_option = TRUE;
else badarg = TRUE;
break;
@@ -4117,7 +4117,7 @@ script. */
if (bi_option)
{
(void)fclose(config_file);
- if (bi_command)
+ if (bi_command && *bi_command)
{
int i = 0;
uschar *argv[3];
@@ -4128,11 +4128,11 @@ if (bi_option)
setgroups(group_count, group_list);
exim_setugid(real_uid, real_gid, FALSE, US"running bi_command");
- DEBUG(D_exec) debug_printf("exec %.256s %.256s\n", argv[0],
- argv[1] ? argv[1] : US"");
+ DEBUG(D_exec) debug_printf("exec '%.256s' %s%.256s%s\n", argv[0],
+ argv[1] ? "'" : "", argv[1] ? argv[1] : US"", argv[1] ? "'" : "");
execv(CS argv[0], (char *const *)argv);
- exim_fail("exim: exec failed: %s\n", strerror(errno));
+ exim_fail("exim: exec '%s' failed: %s\n", argv[0], strerror(errno));
}
else
{
diff --git a/src/src/smtp_in.c b/src/src/smtp_in.c
index b9cf540a9..09586c335 100644
--- a/src/src/smtp_in.c
+++ b/src/src/smtp_in.c
@@ -1824,9 +1824,12 @@ s_connhad_log(gstring * g)
const uschar * sep = smtp_connection_had[SMTP_HBUFF_SIZE-1] != SCH_NONE
? US" C=..." : US" C=";
-for (int i = smtp_ch_index; i < SMTP_HBUFF_SIZE; i++, sep = US",")
+for (int i = smtp_ch_index; i < SMTP_HBUFF_SIZE; i++)
if (smtp_connection_had[i] != SCH_NONE)
+ {
g = string_append(g, 2, sep, smtp_names[smtp_connection_had[i]]);
+ sep = US",";
+ }
for (int i = 0; i < smtp_ch_index; i++, sep = US",")
g = string_append(g, 2, sep, smtp_names[smtp_connection_had[i]]);
return g;