g10: Fix creating a lock for ToFU.
authorNIIBE Yutaka <gniibe@fsij.org>
Fri, 18 Nov 2016 00:32:34 +0000 (09:32 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Fri, 18 Nov 2016 00:32:34 +0000 (09:32 +0900)
* 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>
g10/tofu.c

index 03d8ebe..cf1d00a 100644 (file)
@@ -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));