diff options
author | Werner Koch <[email protected]> | 2020-10-19 13:21:59 +0000 |
---|---|---|
committer | Werner Koch <[email protected]> | 2020-10-19 13:21:59 +0000 |
commit | 4764c5a3a4d704b3b42bafc5eba3996579030703 (patch) | |
tree | 44983a7d7b811145c19de90bd01e52c979815a52 /src/spawn-w32.c | |
parent | w32: Support utf8 also for getcwd. (diff) | |
download | libgpg-error-4764c5a3a4d704b3b42bafc5eba3996579030703.tar.gz libgpg-error-4764c5a3a4d704b3b42bafc5eba3996579030703.zip |
New public function gpgrt_access.
* src/gpg-error.h.in (gpgrt_access): New.
* src/gpg-error.vers. src/gpg-error.def.in: Add new function.
* src/sysutils.c (any8bitchar): New.
(_gpgrt_access): New.
* src/visibility.c (gpgrt_access): New.
* src/spawn-w32.c (_gpgrt_spawn_process_detached): Use it.
* src/argparse.c (try_versioned_conffile): Use it.
* tests/t-stringutils.c (check_access): New simple test.
--
This is basically a wrapper to allow handling of utf8 encoded file
names on Windows. This also fixes the case for versioned config files
in directories with non-ascii characters.
The new test needs to be run manually on Windows using a directory
with Unicode characters.
GnuPG-bug-id: 5098
Diffstat (limited to 'src/spawn-w32.c')
-rw-r--r-- | src/spawn-w32.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/spawn-w32.c b/src/spawn-w32.c index 12ebe40..3ede1f2 100644 --- a/src/spawn-w32.c +++ b/src/spawn-w32.c @@ -826,12 +826,14 @@ _gpgrt_spawn_process_detached (const char *pgmname, const char *argv[], int cr_flags; char *cmdline; int ret; + gpg_err_code_t ec; /* We don't use ENVP. */ (void)envp; - if (access (pgmname, X_OK)) - return _gpg_err_code_from_syserror (); + ec = _gpgrt_access (pgmname, X_OK); + if (ec) + return ec; /* Prepare security attributes. */ memset (&sec_attr, 0, sizeof sec_attr ); |