aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Paquier <michael@paquier.xyz>2024-07-08 09:35:10 +0900
committerMichael Paquier <michael@paquier.xyz>2024-07-08 09:43:35 +0900
commitfa1a63dffcd7113d990b3a50d7e697c7852dc9c5 (patch)
tree306fc741390734c914e0c5f14394353837a8a7b3
parent84a9d38006280f092b2b3f14841e4156c7a6e80d (diff)
downloadpostgresql-fa1a63dffcd7113d990b3a50d7e697c7852dc9c5.tar.gz
postgresql-fa1a63dffcd7113d990b3a50d7e697c7852dc9c5.zip
Re-enable autoruns for for cmd.exe on Windows
This acts as a revert of b83747a8a65b and 9886744a361b. As pointed out by Noah, HEAD and REL_17_STABLE are in a weird state where the code paths adding /D would limit the spawn of child processes, but we still have code paths where the spawn of more than one child process would be possible. Let's remove these /D switches for now, to bring back the code into a state consistent with how autorun is configured on a Windows host. Reported-by: Noah Misch Discussion: https://postgr.es/m/20240630021211.f3.nmisch@google.com Backpatch-through: 17
-rw-r--r--src/bin/pg_ctl/pg_ctl.c4
-rw-r--r--src/test/regress/pg_regress.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/src/bin/pg_ctl/pg_ctl.c b/src/bin/pg_ctl/pg_ctl.c
index 405e223c190..57ed8c8e294 100644
--- a/src/bin/pg_ctl/pg_ctl.c
+++ b/src/bin/pg_ctl/pg_ctl.c
@@ -552,11 +552,11 @@ start_postmaster(void)
else
close(fd);
- cmd = psprintf("\"%s\" /D /C \"\"%s\" %s%s < \"%s\" >> \"%s\" 2>&1\"",
+ cmd = psprintf("\"%s\" /C \"\"%s\" %s%s < \"%s\" >> \"%s\" 2>&1\"",
comspec, exec_path, pgdata_opt, post_opts, DEVNULL, log_file);
}
else
- cmd = psprintf("\"%s\" /D /C \"\"%s\" %s%s < \"%s\" 2>&1\"",
+ cmd = psprintf("\"%s\" /C \"\"%s\" %s%s < \"%s\" 2>&1\"",
comspec, exec_path, pgdata_opt, post_opts, DEVNULL);
if (!CreateRestrictedProcess(cmd, &pi, false))
diff --git a/src/test/regress/pg_regress.c b/src/test/regress/pg_regress.c
index 06f6775fc65..7e7ad256000 100644
--- a/src/test/regress/pg_regress.c
+++ b/src/test/regress/pg_regress.c
@@ -1244,7 +1244,7 @@ spawn_process(const char *cmdline)
comspec = "CMD";
memset(&pi, 0, sizeof(pi));
- cmdline2 = psprintf("\"%s\" /d /c \"%s\"", comspec, cmdline);
+ cmdline2 = psprintf("\"%s\" /c \"%s\"", comspec, cmdline);
if (!CreateRestrictedProcess(cmdline2, &pi))
exit(2);