summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2013-06-12 10:00:33 -0400
committerNick Mathewson <nickm@torproject.org>2013-06-12 10:00:33 -0400
commit3bdc4e5feee7059344f61d8d7362c77fafc5c8a8 (patch)
tree0ebe113d529b7799f07d2c6b626e7a05347cb80c
parent4f4fc63fea0589a4fa03f3859dc27860cdde75af (diff)
parent884a0e269c382f9e927d8c8b1ef4ef9d2d48379d (diff)
downloadtor-3bdc4e5feee7059344f61d8d7362c77fafc5c8a8.tar.gz
tor-3bdc4e5feee7059344f61d8d7362c77fafc5c8a8.zip
Merge remote-tracking branch 'public/bug2077_share_delete' into maint-0.2.4
-rw-r--r--changes/bug2077_share_delete7
-rw-r--r--src/common/compat.c2
2 files changed, 8 insertions, 1 deletions
diff --git a/changes/bug2077_share_delete b/changes/bug2077_share_delete
new file mode 100644
index 0000000000..71e9160538
--- /dev/null
+++ b/changes/bug2077_share_delete
@@ -0,0 +1,7 @@
+ o Major bugfixes (windows):
+ - Open files to be mapped with FILE_SHARE_DELETE so that we can
+ replace them before closing the mapping. This is a likely cause of
+ warnings and crashes when replacing the microdescriptor cache
+ file. Diagnosed based on comments by "doorss" and by Robert
+ Ransom. Possible fix for bug 2077; bugfix on 0.2.2.6-alpha.
+
diff --git a/src/common/compat.c b/src/common/compat.c
index c97a4545c9..cb1dd787a0 100644
--- a/src/common/compat.c
+++ b/src/common/compat.c
@@ -248,7 +248,7 @@ tor_mmap_file(const char *filename)
strlcpy(tfilename,filename,MAX_PATH);
#endif
file_handle = CreateFile(tfilename,
- GENERIC_READ, FILE_SHARE_READ,
+ GENERIC_READ, FILE_SHARE_READ|FILE_SHARE_DELETE,
NULL,
OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL,