* cygheap.cc (cygheap_init): Eliminate debugging #if.
* fork.cc (fork_parent): Don't issue errors if "somebody" has set the PID_EXITED flag on a child. Don't close process handle if it has potentially already been closed. * pinfo.cc (winpids::add): Eliminate PID_ALLPIDS handling which was obsoleted by previous changes. * spawn.cc (av::fixup): Do win16 detection for .com files. Make sure that buffer has been unmapped in all cases.
This commit is contained in:
parent
bf58ec35b4
commit
a743e3b940
@ -1,3 +1,16 @@
|
|||||||
|
2005-09-05 Christopher Faylor <cgf@timesys.com>
|
||||||
|
|
||||||
|
* cygheap.cc (cygheap_init): Eliminate debugging #if.
|
||||||
|
|
||||||
|
* fork.cc (fork_parent): Don't issue errors if "somebody" has set the
|
||||||
|
PID_EXITED flag on a child. Don't close process handle if it has
|
||||||
|
potentially already been closed.
|
||||||
|
* pinfo.cc (winpids::add): Eliminate PID_ALLPIDS handling which was
|
||||||
|
obsoleted by previous changes.
|
||||||
|
|
||||||
|
* spawn.cc (av::fixup): Do win16 detection for .com files. Make sure
|
||||||
|
that buffer has been unmapped in all cases.
|
||||||
|
|
||||||
2005-09-05 Corinna Vinschen <corinna@vinschen.de>
|
2005-09-05 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* thread.h (pthread_mutex::get_pthread_self): Remove.
|
* thread.h (pthread_mutex::get_pthread_self): Remove.
|
||||||
|
@ -158,12 +158,7 @@ cygheap_init ()
|
|||||||
cygheap_protect.init ("cygheap_protect");
|
cygheap_protect.init ("cygheap_protect");
|
||||||
if (!cygheap)
|
if (!cygheap)
|
||||||
{
|
{
|
||||||
#if 1
|
|
||||||
cygheap = (init_cygheap *) memset (_cygheap_start, 0, _cygheap_mid - _cygheap_start);
|
cygheap = (init_cygheap *) memset (_cygheap_start, 0, _cygheap_mid - _cygheap_start);
|
||||||
#else
|
|
||||||
cygheap = (init_cygheap *) _cygheap_start;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
cygheap_max = cygheap;
|
cygheap_max = cygheap;
|
||||||
_csbrk (sizeof (*cygheap));
|
_csbrk (sizeof (*cygheap));
|
||||||
}
|
}
|
||||||
|
@ -283,8 +283,7 @@ fork_parent (HANDLE&, dll *&first_dll, bool& load_dlls, void *stack_here, child_
|
|||||||
|
|
||||||
pthread::atforkprepare ();
|
pthread::atforkprepare ();
|
||||||
|
|
||||||
int c_flags = GetPriorityClass (hMainProc) /*|
|
int c_flags = GetPriorityClass (hMainProc);
|
||||||
CREATE_NEW_PROCESS_GROUP*/;
|
|
||||||
STARTUPINFO si = {0, NULL, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL};
|
STARTUPINFO si = {0, NULL, NULL, NULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL};
|
||||||
|
|
||||||
/* If we don't have a console, then don't create a console for the
|
/* If we don't have a console, then don't create a console for the
|
||||||
@ -336,7 +335,7 @@ fork_parent (HANDLE&, dll *&first_dll, bool& load_dlls, void *stack_here, child_
|
|||||||
/* Remove impersonation */
|
/* Remove impersonation */
|
||||||
cygheap->user.deimpersonate ();
|
cygheap->user.deimpersonate ();
|
||||||
|
|
||||||
syscall_printf ("CreateProcess (%s, %s, 0, 0, 1, %x, 0, 0, %p, %p)",
|
syscall_printf ("CreateProcess (%s, %s, 0, 0, 1, %p, 0, 0, %p, %p)",
|
||||||
myself->progname, myself->progname, c_flags, &si, &pi);
|
myself->progname, myself->progname, c_flags, &si, &pi);
|
||||||
bool locked = __malloc_lock ();
|
bool locked = __malloc_lock ();
|
||||||
rc = CreateProcess (myself->progname, /* image to run */
|
rc = CreateProcess (myself->progname, /* image to run */
|
||||||
@ -418,7 +417,8 @@ fork_parent (HANDLE&, dll *&first_dll, bool& load_dlls, void *stack_here, child_
|
|||||||
/* Wait for subproc to initialize itself. */
|
/* Wait for subproc to initialize itself. */
|
||||||
if (!ch.sync (child->pid, pi.hProcess, FORK_WAIT_TIMEOUT))
|
if (!ch.sync (child->pid, pi.hProcess, FORK_WAIT_TIMEOUT))
|
||||||
{
|
{
|
||||||
system_printf ("child %d died waiting for longjmp before initialization", child_pid);
|
if (NOTSTATE (child, PID_EXITED))
|
||||||
|
system_printf ("child %d died waiting for longjmp before initialization", child_pid);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -469,7 +469,8 @@ fork_parent (HANDLE&, dll *&first_dll, bool& load_dlls, void *stack_here, child_
|
|||||||
goto cleanup;
|
goto cleanup;
|
||||||
else if (!ch.sync (child->pid, pi.hProcess, FORK_WAIT_TIMEOUT))
|
else if (!ch.sync (child->pid, pi.hProcess, FORK_WAIT_TIMEOUT))
|
||||||
{
|
{
|
||||||
system_printf ("child %d died waiting for dll loading", child_pid);
|
if (NOTSTATE (child, PID_EXITED))
|
||||||
|
system_printf ("child %d died waiting for dll loading", child_pid);
|
||||||
goto cleanup;
|
goto cleanup;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -506,7 +507,7 @@ fork_parent (HANDLE&, dll *&first_dll, bool& load_dlls, void *stack_here, child_
|
|||||||
__malloc_unlock ();
|
__malloc_unlock ();
|
||||||
|
|
||||||
/* Remember to de-allocate the fd table. */
|
/* Remember to de-allocate the fd table. */
|
||||||
if (pi.hProcess)
|
if (pi.hProcess && !child.hProcess)
|
||||||
ForceCloseHandle1 (pi.hProcess, childhProc);
|
ForceCloseHandle1 (pi.hProcess, childhProc);
|
||||||
if (pi.hThread)
|
if (pi.hThread)
|
||||||
ForceCloseHandle (pi.hThread);
|
ForceCloseHandle (pi.hThread);
|
||||||
|
@ -1196,8 +1196,7 @@ winpids::add (DWORD& nelem, bool winpid, DWORD pid)
|
|||||||
pinfolist = (pinfo *) realloc (pinfolist, size_pinfolist (npidlist + 1));
|
pinfolist = (pinfo *) realloc (pinfolist, size_pinfolist (npidlist + 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
pinfolist[nelem].init (cygpid, PID_NOREDIR | (winpid ? PID_ALLPIDS : 0)
|
pinfolist[nelem].init (cygpid, PID_NOREDIR | pinfo_access, NULL);
|
||||||
| pinfo_access, NULL);
|
|
||||||
if (winpid)
|
if (winpid)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
@ -1205,7 +1204,7 @@ winpids::add (DWORD& nelem, bool winpid, DWORD pid)
|
|||||||
{
|
{
|
||||||
if (!pinfo_access)
|
if (!pinfo_access)
|
||||||
return;
|
return;
|
||||||
pinfolist[nelem].init (cygpid, PID_NOREDIR | (winpid ? PID_ALLPIDS : 0), NULL);
|
pinfolist[nelem].init (cygpid, PID_NOREDIR, NULL);
|
||||||
if (!pinfolist[nelem])
|
if (!pinfolist[nelem])
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1020,7 +1020,9 @@ av::fixup (child_info_types chtype, const char *prog_arg, path_conv& real_path,
|
|||||||
{
|
{
|
||||||
/* If the file name ends in either .exe, .com, .bat, or .cmd we assume
|
/* If the file name ends in either .exe, .com, .bat, or .cmd we assume
|
||||||
that it is NOT a script file */
|
that it is NOT a script file */
|
||||||
while (*ext == '\0' || chtype == PROC_SPAWN || (wincap.detect_win16_exe () && strcasematch (ext, ".exe")))
|
while (*ext == '\0' || chtype == PROC_SPAWN
|
||||||
|
|| (wincap.detect_win16_exe () && (strcasematch (ext, ".exe")
|
||||||
|
|| strcasematch (ext, ".com"))))
|
||||||
{
|
{
|
||||||
HANDLE h = CreateFile (real_path, GENERIC_READ,
|
HANDLE h = CreateFile (real_path, GENERIC_READ,
|
||||||
FILE_SHARE_READ | FILE_SHARE_WRITE,
|
FILE_SHARE_READ | FILE_SHARE_WRITE,
|
||||||
@ -1053,6 +1055,7 @@ av::fixup (child_info_types chtype, const char *prog_arg, path_conv& real_path,
|
|||||||
if (real_path.has_acls () && allow_ntsec
|
if (real_path.has_acls () && allow_ntsec
|
||||||
&& check_file_access (real_path, X_OK))
|
&& check_file_access (real_path, X_OK))
|
||||||
{
|
{
|
||||||
|
UnmapViewOfFile (buf);
|
||||||
debug_printf ("... but not executable");
|
debug_printf ("... but not executable");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user