diff options
Diffstat (limited to 'g10')
-rw-r--r-- | g10/gpg.c | 4 | ||||
-rw-r--r-- | g10/keyring.c | 2 | ||||
-rw-r--r-- | g10/misc.c | 6 | ||||
-rw-r--r-- | g10/openfile.c | 2 | ||||
-rw-r--r-- | g10/tdbio.c | 4 | ||||
-rw-r--r-- | g10/tofu.c | 4 |
6 files changed, 11 insertions, 11 deletions
@@ -1501,7 +1501,7 @@ check_permissions (const char *path, int item) } /* It's okay if the file or directory doesn't exist */ - if(stat(tmppath,&statbuf)!=0) + if (gnupg_stat (tmppath,&statbuf)) { ret=0; goto end; @@ -1512,7 +1512,7 @@ check_permissions (const char *path, int item) I'm stopping at one level down. */ dir=make_dirname(tmppath); - if(stat(dir,&dirbuf)!=0 || !S_ISDIR(dirbuf.st_mode)) + if (gnupg_stat (dir,&dirbuf) || !S_ISDIR (dirbuf.st_mode)) { /* Weird error */ ret=1; diff --git a/g10/keyring.c b/g10/keyring.c index 6ed9e2b41..8c31ccc87 100644 --- a/g10/keyring.c +++ b/g10/keyring.c @@ -1371,7 +1371,7 @@ rename_tmp_file (const char *bakfname, const char *tmpfname, const char *fname) statbuf.st_mode=S_IRUSR | S_IWUSR; - if (!stat (bakfname, &statbuf) && !chmod (fname, statbuf.st_mode)) + if (!gnupg_stat (bakfname, &statbuf) && !chmod (fname, statbuf.st_mode)) ; else log_error ("WARNING: unable to restore permissions to '%s': %s", diff --git a/g10/misc.c b/g10/misc.c index 22ed47e7c..c344ff244 100644 --- a/g10/misc.c +++ b/g10/misc.c @@ -102,7 +102,7 @@ register_secured_file (const char *fname) struct secured_file_item *sf; /* Note that we stop immediately if something goes wrong here. */ - if (stat (fname, &buf)) + if (gnupg_stat (fname, &buf)) log_fatal (_("fstat of '%s' failed in %s: %s\n"), fname, "register_secured_file", strerror (errno)); /* log_debug ("registering '%s' i=%lu.%lu\n", fname, */ @@ -131,7 +131,7 @@ unregister_secured_file (const char *fname) struct stat buf; struct secured_file_item *sf, *sfprev; - if (stat (fname, &buf)) + if (gnupg_stat (fname, &buf)) { log_error (_("fstat of '%s' failed in %s: %s\n"), fname, "unregister_secured_file", strerror (errno)); @@ -205,7 +205,7 @@ is_secured_filename (const char *fname) /* Note that we print out a error here and claim that a file is secure if something went wrong. */ - if (stat (fname, &buf)) + if (gnupg_stat (fname, &buf)) { if (errno == ENOENT || errno == EPERM || errno == EACCES) return 0; diff --git a/g10/openfile.c b/g10/openfile.c index fd9edb66b..86ed1dc79 100644 --- a/g10/openfile.c +++ b/g10/openfile.c @@ -409,7 +409,7 @@ get_openpgp_revocdir (const char *home) struct stat statbuf; fname = make_filename (home, GNUPG_OPENPGP_REVOC_DIR, NULL); - if (stat (fname, &statbuf) && errno == ENOENT) + if (gnupg_stat (fname, &statbuf) && errno == ENOENT) { if (gnupg_mkdir (fname, "-rwx")) log_error (_("can't create directory '%s': %s\n"), diff --git a/g10/tdbio.c b/g10/tdbio.c index b91a843ff..9bae2ed32 100644 --- a/g10/tdbio.c +++ b/g10/tdbio.c @@ -681,7 +681,7 @@ tdbio_set_dbname (ctrl_t ctrl, const char *new_dbname, * trustdb.gpg. This check is not required in theory, but it helps * in practice avoiding costly operations of preparing and taking * the lock. */ - if (!stat (fname, &statbuf) && statbuf.st_size > 0) + if (!gnupg_stat (fname, &statbuf) && statbuf.st_size > 0) { /* OK, we have the valid trustdb.gpg already. */ return 0; @@ -722,7 +722,7 @@ tdbio_set_dbname (ctrl_t ctrl, const char *new_dbname, take_write_lock (); if (gnupg_access (fname, R_OK) - || stat (fname, &statbuf) + || gnupg_stat (fname, &statbuf) || statbuf.st_size == 0) { estream_t fp; diff --git a/g10/tofu.c b/g10/tofu.c index 63f941e51..9cdcfaa61 100644 --- a/g10/tofu.c +++ b/g10/tofu.c @@ -197,7 +197,7 @@ begin_transaction (ctrl_t ctrl, int only_batch) /* Check if another process wants to run. (We just ignore any * stat failure. A waiter might have to wait a bit longer, but * otherwise there should be no impact.) */ - if (stat (dbs->want_lock_file, &statbuf) == 0 + if (gnupg_stat (dbs->want_lock_file, &statbuf) == 0 && statbuf.st_ctime != dbs->want_lock_file_ctime) { end_transaction (ctrl, 2); @@ -237,7 +237,7 @@ begin_transaction (ctrl_t ctrl, int only_batch) dbs->in_batch_transaction = 1; dbs->batch_update_started = gnupg_get_time (); - if (stat (dbs->want_lock_file, &statbuf) == 0) + if (gnupg_stat (dbs->want_lock_file, &statbuf) == 0) dbs->want_lock_file_ctime = statbuf.st_ctime; } |