From 9fd630fb23b741bc41c4d3d9e09198da1b4c6470 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 2 Oct 2025 16:53:27 +0200 Subject: common,w32: Always use share mode readwrite for the keybox. * common/iobuf.c (direct_open) [W32]: Always use a share mode read or write. * kbx/keybox-init.c (_keybox_ll_open): Ditto. This requires the latest gpgrt to work. -- Cherry pick 2.2 commit: 3971b2528f465dcac0ea75c77840cb22b6a969d3 This change might help with GnuPG-bug-id: 7829 --- common/mischelp.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'common/mischelp.c') diff --git a/common/mischelp.c b/common/mischelp.c index ef70c9d83..db0bd0521 100644 --- a/common/mischelp.c +++ b/common/mischelp.c @@ -85,6 +85,9 @@ same_file_p (const char *name1, const char *name2) wname = gpgrt_fname_to_wchar (name1); if (wname) { + /* Note that if the desiredAccess (2nd arg) is zero, we are + * allowed to query certain metadata even if GENERIC_READ + * would have not been granted. */ file1 = CreateFileW (wname, 0, 0, NULL, OPEN_EXISTING, 0, NULL); xfree (wname); } -- cgit