diff options
author | Werner Koch <wk@gnupg.org> | 2020-10-20 10:43:55 +0200 |
---|---|---|
committer | Werner Koch <wk@gnupg.org> | 2020-10-20 12:15:55 +0200 |
commit | c94ee1386e0d5cdac51086c4d5b92de59c09c9b5 (patch) | |
tree | 34089b99da850a449f95ab9dd7e88317194b5f11 /tools/gpg-wks-server.c | |
parent | gpg,ecc: Fix SOS handling when receiving from agent. (diff) | |
download | gnupg2-c94ee1386e0d5cdac51086c4d5b92de59c09c9b5.tar.xz gnupg2-c94ee1386e0d5cdac51086c4d5b92de59c09c9b5.zip |
Replace all calls to access by gnupg_access
* common/sysutils.c (gnupg_access): New. Replace all calls to access
by this wrapper.
* common/homedir.c (w32_shgetfolderpath): Change to return UTF-8
directory name.
(standard_homedir): Adjust for change.
(w32_commondir, gnupg_cachedir): Ditto.
--
Also use SHGetFolderPathW instead of SHGetFolderPathA on Windows.
This is required to correctly handle non-ascii filenames on Windows.
GnuPG-bug-id: 5098
Diffstat (limited to 'tools/gpg-wks-server.c')
-rw-r--r-- | tools/gpg-wks-server.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/tools/gpg-wks-server.c b/tools/gpg-wks-server.c index 967572581..32cd46530 100644 --- a/tools/gpg-wks-server.c +++ b/tools/gpg-wks-server.c @@ -1182,7 +1182,7 @@ process_new_key (server_ctx_t ctx, estream_t key) goto leave; } - if (access (dname, W_OK)) + if (gnupg_access (dname, W_OK)) { log_info ("skipping address '%s': Domain not configured\n", sl->mbox); continue; @@ -1459,7 +1459,7 @@ check_and_publish (server_ctx_t ctx, const char *address, const char *nonce) err = gpg_error_from_syserror (); goto leave; } - if (!access (fnewname, W_OK)) + if (!gnupg_access (fnewname, W_OK)) { /* Yes, we have a dane directory. */ s = strchr (address, '@'); @@ -1795,7 +1795,7 @@ command_list_domains (void) { "pending", "-rwx" }, { "hu", "-rwxr-xr-x" } }; - + gpg_err_code_t ec; gpg_error_t err; strlist_t domaindirs; strlist_t sl; @@ -1832,9 +1832,9 @@ command_list_domains (void) err = gpg_error_from_syserror (); goto leave; } - if (access (fname, W_OK)) + if ((ec = gnupg_access (fname, W_OK))) { - err = gpg_error_from_syserror (); + err = gpg_error (ec); if (gpg_err_code (err) == GPG_ERR_ENOENT) { if (gnupg_mkdir (fname, requireddirs[i].perm)) @@ -1862,9 +1862,9 @@ command_list_domains (void) err = gpg_error_from_syserror (); goto leave; } - if (access (fname, F_OK)) + if ((ec = gnupg_access (fname, F_OK))) { - err = gpg_error_from_syserror (); + err = gpg_error (ec); if (gpg_err_code (err) == GPG_ERR_ENOENT) log_error ("domain %s: submission address not configured\n", domain); @@ -1941,6 +1941,7 @@ command_cron (void) static gpg_error_t command_check_key (const char *userid) { + gpg_err_code_t ec; gpg_error_t err; char *addrspec = NULL; char *fname = NULL; @@ -1949,9 +1950,9 @@ command_check_key (const char *userid) if (err) goto leave; - if (access (fname, R_OK)) + if ((ec = gnupg_access (fname, R_OK))) { - err = gpg_error_from_syserror (); + err = gpg_error (ec); if (opt_with_file) es_printf ("%s n %s\n", addrspec, fname); if (gpg_err_code (err) == GPG_ERR_ENOENT) |