Skip to content

Commit 9b8a93b

Browse files
committed
Use windows DACL fix for pg_regress as well.
Dave Page
1 parent 2c63d84 commit 9b8a93b

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

src/test/regress/pg_regress.c

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
1212
* Portions Copyright (c) 1994, Regents of the University of California
1313
*
14-
* $PostgreSQL: pgsql/src/test/regress/pg_regress.c,v 1.42 2008/02/20 22:44:16 tgl Exp $
14+
* $PostgreSQL: pgsql/src/test/regress/pg_regress.c,v 1.43 2008/03/04 15:38:31 mha Exp $
1515
*
1616
*-------------------------------------------------------------------------
1717
*/
@@ -1009,14 +1009,30 @@ spawn_process(const char *cmdline)
10091009
cmdline2 = malloc(strlen(cmdline) + 8);
10101010
sprintf(cmdline2, "cmd /c %s", cmdline);
10111011

1012-
if (!CreateProcessAsUser(restrictedToken, NULL, cmdline2, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
1012+
if (!CreateProcessAsUser(restrictedToken,
1013+
NULL,
1014+
cmdline2,
1015+
NULL,
1016+
NULL,
1017+
TRUE,
1018+
CREATE_SUSPENDED,
1019+
NULL,
1020+
NULL,
1021+
&si,
1022+
&pi))
10131023
{
10141024
fprintf(stderr, _("could not start process for \"%s\": %lu\n"),
10151025
cmdline2, GetLastError());
10161026
exit_nicely(2);
10171027
}
1028+
1029+
#ifndef __CYGWIN__
1030+
AddUserToDacl(pi.hProcess);
1031+
#endif
1032+
10181033
free(cmdline2);
10191034

1035+
ResumeThread(pi.hThread);
10201036
CloseHandle(pi.hThread);
10211037
return pi.hProcess;
10221038
#endif

0 commit comments

Comments
 (0)