Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2002-06-11 06:22:02 +0400
committerChristopher Faylor <me@cgf.cx>2002-06-11 06:22:02 +0400
commitd5377829a83b0e7a6989bbc19fc17dbf42d74bb2 (patch)
treedd282ed9ef8c6b81af012171df1c4c2def2ad64f /winsup/cygwin/spawn.cc
parent380aaf2d2ced0e305e91c85d8bda2de6092b424f (diff)
* spawn.cc (spawn_guts): Define sec_attribs and call sec_user_nih() only once.
Diffstat (limited to 'winsup/cygwin/spawn.cc')
-rw-r--r--winsup/cygwin/spawn.cc20
1 files changed, 9 insertions, 11 deletions
diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc
index a63adc664..c1934b17a 100644
--- a/winsup/cygwin/spawn.cc
+++ b/winsup/cygwin/spawn.cc
@@ -623,7 +623,7 @@ spawn_guts (const char * prog_arg, const char *const *argv,
cygbench ("spawn-guts");
if (!cygheap->user.impersonated || cygheap->user.token == INVALID_HANDLE_VALUE)
{
-
+ PSECURITY_ATTRIBUTES sec_attribs = sec_user_nih (sa_buf);
ciresrv.moreinfo->uid = getuid32 ();
/* FIXME: This leaks a handle in the CreateProcessAsUser case since the
child process doesn't know about cygwin_mount_h. */
@@ -631,14 +631,12 @@ spawn_guts (const char * prog_arg, const char *const *argv,
newheap = cygheap_setup_for_child (&ciresrv, cygheap->fdtab.need_fixup_before ());
rc = CreateProcess (runpath, /* image name - with full path */
one_line.buf, /* what was passed to exec */
- /* process security attrs */
- sec_user_nih (sa_buf),
- /* thread security attrs */
- sec_user_nih (sa_buf),
- TRUE, /* inherit handles from parent */
+ sec_attribs, /* process security attrs */
+ sec_attribs, /* thread security attrs */
+ TRUE, /* inherit handles from parent */
flags,
- envblock,/* environment */
- 0, /* use current drive/directory */
+ envblock, /* environment */
+ 0, /* use current drive/directory */
&si,
&pi);
}
@@ -688,10 +686,10 @@ spawn_guts (const char * prog_arg, const char *const *argv,
one_line.buf, /* what was passed to exec */
sec_attribs, /* process security attrs */
sec_attribs, /* thread security attrs */
- TRUE, /* inherit handles from parent */
+ TRUE, /* inherit handles from parent */
flags,
- envblock,/* environment */
- 0, /* use current drive/directory */
+ envblock, /* environment */
+ 0, /* use current drive/directory */
&si,
&pi);
/* Restore impersonation. In case of _P_OVERLAY this isn't