Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 74b8e6a

Browse filesBrowse files
committed
Re-enable autoruns for cmd.exe on Windows
This acts as a revert of b83747a and 9886744. 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(es) 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
1 parent 066e8ac commit 74b8e6a
Copy full SHA for 74b8e6a

File tree

Expand file treeCollapse file tree

2 files changed

+3
-3
lines changed
Filter options
Expand file treeCollapse file tree

2 files changed

+3
-3
lines changed

‎src/bin/pg_ctl/pg_ctl.c

Copy file name to clipboardExpand all lines: src/bin/pg_ctl/pg_ctl.c
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -552,11 +552,11 @@ start_postmaster(void)
552552
else
553553
close(fd);
554554

555-
cmd = psprintf("\"%s\" /D /C \"\"%s\" %s%s < \"%s\" >> \"%s\" 2>&1\"",
555+
cmd = psprintf("\"%s\" /C \"\"%s\" %s%s < \"%s\" >> \"%s\" 2>&1\"",
556556
comspec, exec_path, pgdata_opt, post_opts, DEVNULL, log_file);
557557
}
558558
else
559-
cmd = psprintf("\"%s\" /D /C \"\"%s\" %s%s < \"%s\" 2>&1\"",
559+
cmd = psprintf("\"%s\" /C \"\"%s\" %s%s < \"%s\" 2>&1\"",
560560
comspec, exec_path, pgdata_opt, post_opts, DEVNULL);
561561

562562
if (!CreateRestrictedProcess(cmd, &pi, false))

‎src/test/regress/pg_regress.c

Copy file name to clipboardExpand all lines: src/test/regress/pg_regress.c
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1244,7 +1244,7 @@ spawn_process(const char *cmdline)
12441244
comspec = "CMD";
12451245

12461246
memset(&pi, 0, sizeof(pi));
1247-
cmdline2 = psprintf("\"%s\" /d /c \"%s\"", comspec, cmdline);
1247+
cmdline2 = psprintf("\"%s\" /c \"%s\"", comspec, cmdline);
12481248

12491249
if (!CreateRestrictedProcess(cmdline2, &pi))
12501250
exit(2);

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.