aboutsummaryrefslogtreecommitdiffstats
path: root/g10/keyring.c
diff options
context:
space:
mode:
Diffstat (limited to 'g10/keyring.c')
-rw-r--r--g10/keyring.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/g10/keyring.c b/g10/keyring.c
index f424f94fc..6ed9e2b41 100644
--- a/g10/keyring.c
+++ b/g10/keyring.c
@@ -228,7 +228,7 @@ keyring_is_writable (void *token)
{
KR_RESOURCE r = token;
- return r? (r->read_only || !access (r->fname, W_OK)) : 0;
+ return r? (r->read_only || !gnupg_access (r->fname, W_OK)) : 0;
}
@@ -1606,6 +1606,7 @@ static int
do_copy (int mode, const char *fname, KBNODE root,
off_t start_offset, unsigned int n_packets )
{
+ gpg_err_code_t ec;
IOBUF fp, newfp;
int rc=0;
char *bakfname = NULL;
@@ -1613,8 +1614,8 @@ do_copy (int mode, const char *fname, KBNODE root,
/* Open the source file. Because we do a rename, we have to check the
permissions of the file */
- if (access (fname, W_OK))
- return gpg_error_from_syserror ();
+ if ((ec = gnupg_access (fname, W_OK)))
+ return gpg_error (ec);
fp = iobuf_open (fname);
if (mode == 1 && !fp && errno == ENOENT) {