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:
authorMichael Haubenwallner <michael.haubenwallner@ssi-schaefer.com>2019-04-30 17:15:30 +0300
committerCorinna Vinschen <corinna@vinschen.de>2019-04-30 19:10:08 +0300
commite33db96a14b85d2a2a414de784013637bc4e1fcc (patch)
treeb528d0937a8126d29a4911583733f7919b1977e4 /winsup/cygwin/dll_init.cc
parent0f5776c47ca08c31c939f4b9faf6c105b61fa688 (diff)
Cygwin: dll_list: query dll file id at load time
NtQueryVirtualMemory for MemorySectionName does not reliable return the changed dll file name when another process does move the file around, and we may end up creating forkable hardlinks to wrong dll files. So query the file id when loading the dll rather than before fork.
Diffstat (limited to 'winsup/cygwin/dll_init.cc')
-rw-r--r--winsup/cygwin/dll_init.cc2
1 files changed, 2 insertions, 0 deletions
diff --git a/winsup/cygwin/dll_init.cc b/winsup/cygwin/dll_init.cc
index 28f4e53a8..4ba1bd22d 100644
--- a/winsup/cygwin/dll_init.cc
+++ b/winsup/cygwin/dll_init.cc
@@ -380,6 +380,8 @@ dll_list::alloc (HINSTANCE h, per_process *p, dll_type type)
d->forkable_ntname = d->ntname + ntnamelen + 1;
*d->forkable_ntname = L'\0';
}
+ if (forkables_supported ())
+ d->stat_real_file_once (); /* uses nt_max_path_buf () */
append (d);
if (type == DLL_LOAD)
loaded_dlls++;