pg_regress: Disable autoruns for cmd.exe on Windows
authorMichael Paquier <michael@paquier.xyz>
Thu, 11 Jan 2024 01:39:58 +0000 (10:39 +0900)
committerMichael Paquier <michael@paquier.xyz>
Thu, 11 Jan 2024 01:39:58 +0000 (10:39 +0900)
This is similar to 9886744a361b, to prevent the execution of other
programs due to autorun configurations which could influence the
postmaster startup.

Like the other change, no backpatch is done.

Discussion: https://postgr.es/m/20230922.161551.320043332510268554.horikyota.ntt@gmail.com

src/test/regress/pg_regress.c

index c20027d14f9d10ecf2569288f511274c55ce1289..c894005dac06bc233896520c83c18e51af8ace9c 100644 (file)
@@ -1242,7 +1242,7 @@ spawn_process(const char *cmdline)
                comspec = "CMD";
 
        memset(&pi, 0, sizeof(pi));
-       cmdline2 = psprintf("\"%s\" /c \"%s\"", comspec, cmdline);
+       cmdline2 = psprintf("\"%s\" /d /c \"%s\"", comspec, cmdline);
 
        if (!CreateRestrictedProcess(cmdline2, &pi))
                exit(2);