Use windows DACL fix for pg_regress as well.
authorMagnus Hagander <magnus@hagander.net>
Tue, 4 Mar 2008 15:38:31 +0000 (15:38 +0000)
committerMagnus Hagander <magnus@hagander.net>
Tue, 4 Mar 2008 15:38:31 +0000 (15:38 +0000)
Dave Page

src/test/regress/pg_regress.c

index 4eca8482d8b2d24252d272f6f75a09d6b3edd48e..71ef94d2d5a641f637ccf6ba731521142bccf691 100644 (file)
@@ -11,7 +11,7 @@
  * Portions Copyright (c) 1996-2008, PostgreSQL Global Development Group
  * Portions Copyright (c) 1994, Regents of the University of California
  *
- * $PostgreSQL: pgsql/src/test/regress/pg_regress.c,v 1.42 2008/02/20 22:44:16 tgl Exp $
+ * $PostgreSQL: pgsql/src/test/regress/pg_regress.c,v 1.43 2008/03/04 15:38:31 mha Exp $
  *
  *-------------------------------------------------------------------------
  */
@@ -1009,14 +1009,30 @@ spawn_process(const char *cmdline)
        cmdline2 = malloc(strlen(cmdline) + 8);
        sprintf(cmdline2, "cmd /c %s", cmdline);
 
-       if (!CreateProcessAsUser(restrictedToken, NULL, cmdline2, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi))
+       if (!CreateProcessAsUser(restrictedToken,
+                                               NULL,
+                                               cmdline2,
+                                               NULL,
+                                               NULL,
+                                               TRUE,
+                                               CREATE_SUSPENDED,
+                                               NULL,
+                                               NULL,
+                                               &si,
+                                               &pi))
        {
                fprintf(stderr, _("could not start process for \"%s\": %lu\n"),
                                cmdline2, GetLastError());
                exit_nicely(2);
        }
+
+#ifndef __CYGWIN__
+       AddUserToDacl(pi.hProcess);
+#endif
+
        free(cmdline2);
 
+    ResumeThread(pi.hThread);
        CloseHandle(pi.hThread);
        return pi.hProcess;
 #endif