Actual fix from pierre.labastie@neuf.fr ; additional coding and testcase bu jgh
Broken-by: bdcc6f2bd5
"log_reject_target", "malware" and "spam"; the arguments are expanded
so could be handling tainted values.
"log_reject_target", "malware" and "spam"; the arguments are expanded
so could be handling tainted values.
+JH/04 Bug 2590: Fix -bi (newaliases). A previous code rearrangement had
+ broken the (no-op) support for this sendmail command. Restore it
+ to doing nothing, silently, and returning good status.
+
Exim version 4.94
-----------------
Exim version 4.94
-----------------
concept of *the* alias file, but since Sun's YP make script calls
sendmail this way, some support must be provided. */
case 'i':
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;
else badarg = TRUE;
break;
if (bi_option)
{
(void)fclose(config_file);
if (bi_option)
{
(void)fclose(config_file);
+ if (bi_command && *bi_command)
{
int i = 0;
uschar *argv[3];
{
int i = 0;
uschar *argv[3];
setgroups(group_count, group_list);
exim_setugid(real_uid, real_gid, FALSE, US"running bi_command");
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);
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));
const uschar * sep = smtp_connection_had[SMTP_HBUFF_SIZE-1] != SCH_NONE
? US" C=..." : US" C=";
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)
if (smtp_connection_had[i] != SCH_NONE)
g = string_append(g, 2, sep, smtp_names[smtp_connection_had[i]]);
g = string_append(g, 2, sep, smtp_names[smtp_connection_had[i]]);
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;
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;
--- /dev/null
+# Exim test configuration 0590
+
+OPT =
+
+.include DIR/aux-var/std_conf_prefix
+
+
+# ----- Main settings -----
+
+OPT
+
+# End
--- /dev/null
+# -bi / newaliases
+#
+exim -bi
+****
+exim -DOPT=bi_command=/bin/echo -bi -oA 'hello from -bi'
+****