[git] GnuPG - branch, master, updated. gnupg-2.1.15-394-g1c0b140

by NIIBE Yutaka cvs at cvs.gnupg.org
Fri Nov 18 12:38:09 CET 2016


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "The GNU Privacy Guard".

The branch, master has been updated
       via  1c0b140cccfb884c6d07785c3284b9df06dccd3c (commit)
      from  833eef974ad4721b9b3e247bae9c890476a936ce (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 1c0b140cccfb884c6d07785c3284b9df06dccd3c
Author: NIIBE Yutaka <gniibe at fsij.org>
Date:   Fri Nov 18 20:32:22 2016 +0900

    g10: Fix flags to open for lock of ToFU.
    
    * g10/tofu.c (busy_handler): Fix the flags and utime is not needed.
    
    --
    
    The argument flags must include one of O_RDONLY, O_WRONLY, or O_RDWR.
    Adding O_TRUNC, the file is updated.  So, utime is not needed.
    
    Fixes-commit: b2e1b17efa952afcf7aeec8b15e9d0088dba587a
    Signed-off-by: NIIBE Yutaka <gniibe at fsij.org>

diff --git a/g10/tofu.c b/g10/tofu.c
index cf1d00a..2c9d17c 100644
--- a/g10/tofu.c
+++ b/g10/tofu.c
@@ -732,16 +732,13 @@ 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|O_WRONLY|O_TRUNC,
                      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));
       else
-        {
-          utime (dbs->want_lock_file, NULL);
-          close (fd);
-        }
+        close (fd);
     }
 
   /* Call again.  */

-----------------------------------------------------------------------

Summary of changes:
 g10/tofu.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)


hooks/post-receive
-- 
The GNU Privacy Guard
http://git.gnupg.org




More information about the Gnupg-commits mailing list