diff options
| author | Werner Koch <[email protected]> | 2025-10-02 14:53:27 +0000 |
|---|---|---|
| committer | NIIBE Yutaka <[email protected]> | 2025-10-21 04:18:26 +0000 |
| commit | 9fd630fb23b741bc41c4d3d9e09198da1b4c6470 (patch) | |
| tree | 8bd34aa4d3b1e38f77a1fdb2b8f6392d2374e600 /common/iobuf.c | |
| parent | w32:common: Take care of possible race on startup under Windows. (diff) | |
| download | gnupg-9fd630fb23b741bc41c4d3d9e09198da1b4c6470.tar.gz gnupg-9fd630fb23b741bc41c4d3d9e09198da1b4c6470.zip | |
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
Diffstat (limited to 'common/iobuf.c')
| -rw-r--r-- | common/iobuf.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/common/iobuf.c b/common/iobuf.c index 833b90295..770b67c29 100644 --- a/common/iobuf.c +++ b/common/iobuf.c @@ -286,7 +286,6 @@ direct_open (const char *fname, const char *mode, int mode700) return GNUPG_INVALID_FD; da = GENERIC_READ | GENERIC_WRITE; cd = OPEN_EXISTING; - sm = FILE_SHARE_READ | FILE_SHARE_WRITE; } else if (strchr (mode, 'w')) { @@ -294,14 +293,13 @@ direct_open (const char *fname, const char *mode, int mode700) return GNUPG_INVALID_FD; da = GENERIC_WRITE; cd = CREATE_ALWAYS; - sm = FILE_SHARE_WRITE; } else { da = GENERIC_READ; cd = OPEN_EXISTING; - sm = FILE_SHARE_READ; } + sm = FILE_SHARE_READ | FILE_SHARE_WRITE; /* We always use the Unicode version because it supports file names * longer than MAX_PATH. (requires gpgrt 1.45) */ |
