1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-06-11 23:59:50 +02:00

g10: Write first keybox record in binary mode

* g10/keydb.c (maybe_create_keyring_or_box): Open in binary mode.

--
This fixes keybox corruption on windows.

Signed-off-by: Andre Heinecke <aheinecke@intevation.de>
This commit is contained in:
Andre Heinecke 2016-10-21 14:59:26 +02:00
parent d2653b1a6d
commit f7e50634be

View File

@ -415,7 +415,7 @@ maybe_create_keyring_or_box (char *filename, int is_box, int force_create)
that the detection magic will work the next time it is used. */ that the detection magic will work the next time it is used. */
if (is_box) if (is_box)
{ {
FILE *fp = fopen (filename, "w"); FILE *fp = fopen (filename, "wb");
if (!fp) if (!fp)
rc = gpg_error_from_syserror (); rc = gpg_error_from_syserror ();
else else