mirror of
git://git.gnupg.org/gnupg.git
synced 2025-07-02 22:46:30 +02:00
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
This commit is contained in:
parent
228836f79f
commit
c94ee1386e
28 changed files with 151 additions and 128 deletions
|
@ -685,7 +685,7 @@ load_certs_from_system (void)
|
|||
gpg_error_t err = 0;
|
||||
|
||||
for (idx=0; idx < DIM (table); idx++)
|
||||
if (!access (table[idx].name, F_OK))
|
||||
if (!gnupg_access (table[idx].name, F_OK))
|
||||
{
|
||||
/* Take the first available bundle. */
|
||||
err = load_certs_from_file (table[idx].name, CERTTRUST_CLASS_SYSTEM, 0);
|
||||
|
|
|
@ -1099,7 +1099,7 @@ main (int argc, char **argv)
|
|||
log_info (_("Note: '%s' is not considered an option\n"), argv[i]);
|
||||
}
|
||||
|
||||
if (!access ("/etc/"DIRMNGR_NAME, F_OK)
|
||||
if (!gnupg_access ("/etc/"DIRMNGR_NAME, F_OK)
|
||||
&& !strncmp (gnupg_homedir (), "/etc/", 5))
|
||||
log_info
|
||||
("NOTE: DirMngr is now a proper part of %s. The configuration and"
|
||||
|
|
|
@ -577,6 +577,7 @@ http_register_tls_callback (gpg_error_t (*cb)(http_t, http_session_t, int))
|
|||
void
|
||||
http_register_tls_ca (const char *fname)
|
||||
{
|
||||
gpg_err_code_t ec;
|
||||
strlist_t sl;
|
||||
|
||||
if (!fname)
|
||||
|
@ -588,9 +589,8 @@ http_register_tls_ca (const char *fname)
|
|||
{
|
||||
/* Warn if we can't access right now, but register it anyway in
|
||||
case it becomes accessible later */
|
||||
if (access (fname, F_OK))
|
||||
log_info (_("can't access '%s': %s\n"), fname,
|
||||
gpg_strerror (gpg_error_from_syserror()));
|
||||
if ((ec = gnupg_access (fname, F_OK)))
|
||||
log_info (_("can't access '%s': %s\n"), fname, gpg_strerror (ec));
|
||||
sl = add_to_strlist (&tls_ca_certlist, fname);
|
||||
if (*sl->d && !strcmp (sl->d + strlen (sl->d) - 4, ".pem"))
|
||||
sl->flags = 1;
|
||||
|
@ -606,6 +606,7 @@ http_register_tls_ca (const char *fname)
|
|||
void
|
||||
http_register_cfg_ca (const char *fname)
|
||||
{
|
||||
gpg_err_code_t ec;
|
||||
strlist_t sl;
|
||||
|
||||
if (!fname)
|
||||
|
@ -617,9 +618,8 @@ http_register_cfg_ca (const char *fname)
|
|||
{
|
||||
/* Warn if we can't access right now, but register it anyway in
|
||||
case it becomes accessible later */
|
||||
if (access (fname, F_OK))
|
||||
log_info (_("can't access '%s': %s\n"), fname,
|
||||
gpg_strerror (gpg_error_from_syserror()));
|
||||
if ((ec = gnupg_access (fname, F_OK)))
|
||||
log_info (_("can't access '%s': %s\n"), fname, gpg_strerror (ec));
|
||||
sl = add_to_strlist (&cfg_ca_certlist, fname);
|
||||
if (*sl->d && !strcmp (sl->d + strlen (sl->d) - 4, ".pem"))
|
||||
sl->flags = 1;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue