summaryrefslogtreecommitdiffstats
path: root/g10/tofu.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2016-11-18 01:32:34 +0100
committerNIIBE Yutaka <gniibe@fsij.org>2016-11-18 01:32:34 +0100
commitb2e1b17efa952afcf7aeec8b15e9d0088dba587a (patch)
tree112c756c11b8388e5aa11bef2049e2970d0bf2be /g10/tofu.c
parentscd: Don't limit to ST-2xxx for PC/SC. (diff)
downloadgnupg2-b2e1b17efa952afcf7aeec8b15e9d0088dba587a.tar.xz
gnupg2-b2e1b17efa952afcf7aeec8b15e9d0088dba587a.zip
g10: Fix creating a lock for ToFU.
* g10/tofu.c (busy_handler): Add third argument which is mandatory for O_CREATE flag. -- Reported-by: Kristian Fiskerstrand Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to 'g10/tofu.c')
-rw-r--r--g10/tofu.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/g10/tofu.c b/g10/tofu.c
index 03d8ebee9..cf1d00aae 100644
--- a/g10/tofu.c
+++ b/g10/tofu.c
@@ -732,7 +732,8 @@ busy_handler (void *cookie, int call_count)
process will have to wait a bit longer, but otherwise nothing
horrible should happen. */
- int fd = open (dbs->want_lock_file, O_CREAT);
+ int fd = open (dbs->want_lock_file, O_CREAT,
+ S_IRUSR|S_IRGRP|S_IROTH|S_IWUSR);
if (fd == -1)
log_debug ("TOFU: Error opening '%s': %s\n",
dbs->want_lock_file, strerror (errno));