aboutsummaryrefslogtreecommitdiffstats
path: root/src (unfollow)
Commit message (Collapse)AuthorFilesLines
2021-11-03Release 1.43libgpg-error-1.43gpgrt-1.43Werner Koch2-2/+2
2021-11-03argparse: Add more system variables.Werner Koch1-4/+31
* src/argparse.c (get_var): Fix "_windows", add "_gpgrtversion" and "strusageN". (handle_meta_if): Avoid evaluating inactive branches. * tests/t-argparse.conf: Add a few other outputs.
2021-10-31argparse: Add support to read values from the Windows Registry.Werner Koch1-56/+623
* src/argparse.c (struct variable_s): New. (struct _gpgrt_argparse_internal_s): New fields expand, if_cond, if_active and vartbl. (deinitialize): Free vartbl. (initialize): Clear new vars. (get_var): New. (substitute_vars): New. (set_variable): New. (handle_meta_if): New. (handle_meta_let): New. (handle_meta_getenv): New. (handle_meta_echo): Re-implement in terms of variabale substitution. (handle_meta_expand): New. (handle_metacmd): Add new meta commands. (_gpgrt_argparse): Expand values if enabled. (_gpgrt_argparse): Take care of conditions. (_gpgrt_argparser): Reset some state at the end of a file. * tests/etc/t-argparse.conf: Adjust for changed system variables. * tests/t-argparse.c (my_strusage): Add a value for a version test. (main): Add new option "street". * tests/t-argparse.conf: A couple if additions for the new conditions. -- The whole thing is actually only for here for doing this [let tkey HKLM\Foo\Bar\GnuPG:trusted-key-1] [if $tkey] trusted-key $tkey [fi] But we are hackers and tend to make things more complicated^Wflexible. Documentation will be done eventually. Signed-off-by: Werner Koch <[email protected]>
2021-10-22core: new internal function _gpgrt_w32_reg_get_string.Werner Koch2-6/+56
* src/w32-reg.c (_gpgrt_w32_reg_query_string): Allow abbreviated root names. (_gpgrt_w32_reg_get_string): New. -- This should eventually be made public. Noet that we have a copy in gnupg.
2021-09-10gpgrt-config: Fix behavior when PKG_CONFIG_LIBDIR="".NIIBE Yutaka1-1/+1
* src/gpgrt-config.in: Correctly detect the case. -- GnuPG-bug-id: 5595 Signed-off-by: NIIBE Yutaka <[email protected]>
2021-08-06posix-lock: Support GNU C library 2.34 or later.NIIBE Yutaka1-2/+5
* configure.ac: Add check for sys/single_threaded.h. * src/posix-lock.c [USE_POSIX_THREADS_FROM_LIBC]: Use __libc_single_threaded to detect if it's single threaded. -- GnuPG-bug-id: 5547 Signed-off-by: NIIBE Yutaka <[email protected]>
2021-08-05core: Minor clean up.NIIBE Yutaka1-3/+0
* src/stringutils.c: Remove inclusion of pwd.h. Signed-off-by: NIIBE Yutaka <[email protected]>
2021-06-21build: Fix --disable-threads.NIIBE Yutaka1-1/+1
* src/gen-lock-obj.sh: Fix generating '}}}'. -- GnuPG-bug-id: 5495 Reported-by: Fabrice Fontaine <[email protected]> Fixes-commit: 1fb90a7da186ee2ee098a666f6f3a35bb1720e59 Signed-off-by: NIIBE Yutaka <[email protected]>
2021-06-08core: Avoid truncation of error message in the middle of a character.NIIBE Yutaka1-0/+25
* configure.ac (AM_LANGINFO_CODESET): Add. * src/strerror.c (_gpg_strerror_r): Check the boundary of character. -- GnuPG-bug-id: 5048 Signed-off-by: NIIBE Yutaka <[email protected]>
2021-05-20core: Make gpgrt_free robust against legacy free implementations.Werner Koch1-0/+12
* src/init.c (_gpgrt_free): Shortcut NULL and save ERRNO. Signed-off-by: Werner Koch <[email protected]>
2021-04-12build,tests: Fix leaks of memory or file pointer.Jakub Jelen1-0/+1
* src/mkheader.c (parse_config_h): Close FP. * tests/t-b64.c (test_b64enc_string): Free STATE. (test_b64dec_string): Free BUFFER. * tests/t-syserror.c (main): Close FP. -- GnuPG-bug-id: 5381 Signed-off-by: Jakub Jelen <[email protected]>
2021-04-08core: Fix gpgrt_wait_processes, by skipping invalid PID.NIIBE Yutaka1-1/+6
* src/spawn-posix.c (_gpgrt_wait_processes): Skip invalid PID. -- The API itself is not good to handle multiple processes. Given the API, skipping invalid PID is better for usefulness. GnuPG-bug-id: 5381 Reported-by: Jakub Jelen <[email protected]> Signed-off-by: NIIBE Yutaka <[email protected]>
2021-04-07build: Fix gpgrt-config for handling 'Requires' field.NIIBE Yutaka1-1/+2
* src/gpgrt-config.in (get_attr_l): Fix thinko for word split. -- GnuPG-bug-id: 5381 Reported-by: Jakub Jelen <[email protected]> Signed-off-by: NIIBE Yutaka <[email protected]>
2021-03-31m4: Fix previous commit.NIIBE Yutaka1-1/+1
Signed-off-by: NIIBE Yutaka <[email protected]>
2021-03-31m4: Support cross-compiling better.NIIBE Yutaka1-3/+4
* src/gpg-error.m4 (GPGRT_CONFIG): Prefer the one under $prefix. (sed expression): Better compatibility to POSIX sed. -- GnuPG-bug-id: 5365 Reported-by: Jay Freeman (saurik) Signed-off-by: NIIBE Yutaka <[email protected]>
2021-03-26build: Fix generation of lock-obj-pub.native.h for cross build.David Michael1-1/+1
* src/gen-lock-obj.sh: Capture echo output with quotes. -- Fixes-commit: 99ae862a96a569724f49a604ebb7d3f6d2c2d374 Signed-off-by: David Michael <[email protected]>
2021-03-22core: Add GPG_ERR_SOURCE_TPM2D.Werner Koch1-2/+2
* src/err-sources.h.in (GPG_ERR_SOURCE_TPM2D): New.
2021-03-05w32: Allow Unicode paths for the gettext domain.Werner Koch1-45/+12
* src/w32-gettext.c: Remove remaining WindowsCE support (load_domain): Use CreateFileW.
2021-03-04w32: Minor cleanup of w32-gettextWerner Koch2-3/+6
* src/w32-gettext.c: Include gpgrt.h instead gpg-error.h. (utf8_to_wchar): Use underscored function. (_gpg_w32_textdomain): Ditto. --
2021-02-18build: Support --disable-threads by gen-lock-obj.sh.NIIBE Yutaka1-1/+17
* configure.ac: Supply --disable-threads to gen-lock-obj.sh. Tighten the condition of using gen-lock-obj.sh for GNU/Linux. * src/gen-lock-obj.sh: Support --disable-threads. -- GnuPG-bug-id: 5296 Signed-off-by: NIIBE Yutaka <[email protected]>
2021-02-16build: Fix gpgrt-config.NIIBE Yutaka1-6/+1
* src/gpgrt-config.in: Remove delimiter variable. -- Fixes-commit: 7b81ec272b0c54ac893c09be4715b76e84c27b23 Signed-off-by: NIIBE Yutaka <[email protected]>
2021-02-16build: More fix for determining libdir for gpgrt-config.NIIBE Yutaka1-11/+33
* src/gpg-error.m4: Use CC -print-search-dirs for better support of GNU style cross prefix. -- GnuPG-bug-id: 5293 Signed-off-by: NIIBE Yutaka <[email protected]>
2021-02-15build: Fix the previous change.NIIBE Yutaka1-6/+6
* src/gpg-error.m4: Fix test condition for GPGRT_CONFIG. Fix behaviour when there is no GPG_ERROR_CONFIG. -- Signed-off-by: NIIBE Yutaka <[email protected]>
2021-02-12build: Improve how to determine $libdir for gpgrt-configNIIBE Yutaka1-46/+42
* src/gpg-error.m4: Fix $gpgrt_libdir handling. -- GnuPG-bug-id: 5293 Signed-off-by: NIIBE Yutaka <[email protected]>
2021-02-09Support cross-compiling on more platforms.NIIBE Yutaka1-4/+12
* src/gen-lock-obj.sh (ECHO_C, ECHO_N): Portability fix. -- GnuPG-bug-id: 5289 Signed-off-by: NIIBE Yutaka <[email protected]>
2020-12-21core: Yet another fix to the ignore meta command.Werner Koch1-1/+18
* src/argparse.c (_gpgrt_argparse): Entirely skip ignored sysconf commands. Fix state transitions in the ignore case.
2020-12-21Release 1.40libgpg-error-1.40gpgrt-1.40Werner Koch1-1/+2
* configure.ac: Bump LT version to C31/A31/R0.
2020-12-21w32: Allow Unicode for internal getusername function.Werner Koch1-9/+19
* src/sysutils.c (_gpgrt_getusername) [W32]: Use GetUserNameW. -- This is used by argparse for user specific parts. Tested using the echo meta-command. Signed-off-by: Werner Koch <[email protected]>
2020-12-18core: Fix the "ignore" meta command of the argparser.Werner Koch1-35/+54
* src/argparse.c (_gpgrt_argparse): Factor some code out to ... (prepare_arg_return): new. (_gpgrt_argparse): No missing arg error in ignore sections. -- Options in an [ignore] section do not anymore lead to an error if an argument is missing. However, if the option is also in a force section the error is thrown. Signed-off-by: Werner Koch <[email protected]>
2020-11-17m4: Update with newer autoconf constructs.NIIBE Yutaka1-3/+3
* src/gpg-error.m4: Replace AC_HELP_STRING to AS_HELP_STRING. Signed-off-by: NIIBE Yutaka <[email protected]>
2020-10-19New public function gpgrt_access.Werner Koch9-3/+69
* 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
2020-10-09w32: Support utf8 also for getcwd.Werner Koch4-22/+74
* src/sysutils.c (_gpgrt_getcwd) [W32]: Implement utf-8 support. * src/w32-gettext.c (wchar_to_native): Factor some code out to .. (wchar_to_cp): new. (_gpgrt_wchar_to_utf8): New. * tests/t-stringutils.c: Include windows.h. (utf8_to_wchar): New. (wchar_to_utf8): New. (mygetcwd): Use wchar version for Windows. (main): New option --pwd.
2020-10-08doc: Fix typos in commentsWerner Koch1-1/+1
--
2020-08-24Release 1.39libgpg-error-1.39gpgrt-1.39Werner Koch1-1/+1
2020-08-21core,w32: Add UTF-8 support to gpgrt_fopen, gpgrt_mkdir and gpgrt_chdir.Werner Koch6-20/+227
* src/protos.h: New. * src/Makefile.am (libgpg_error_la_SOURCES): Add file. * src/gpgrt-int.h: Include protos.h. * src/sysutils.c (_gpgrt_mkdir) [W32]: Make UTF-8 aware. (_gpgrt_chdir) [W32]: Ditto. * src/w32-gettext.c: Include protos.h. (utf8_to_wchar): Allow for strings. (_gpgrt_utf8_to_wchar): New. (_gpgrt_free_wchar): New. * src/estream.c (map_w32_to_errno): Add more error codes. (_gpgrt_w32_set_errno): New. (any8bitchar) [W32]: New helper. (func_file_create) [W32]: Convert file name and use _wopen. -- GnuPG-bug-id: 4083 Signed-off-by: Werner Koch <[email protected]>
2020-08-21argparse: Handle a corner case of wrong ARGC.NIIBE Yutaka1-2/+1
* src/argparse.c (arg_parse): Avoid null dereference when ARGC is wrong. Signed-off-by: NIIBE Yutaka <[email protected]>
2020-08-17Fix a current gcc's -fsanitize warning.Werner Koch1-2/+2
* src/argparse.c (ARGPARSE_FLAG__INITIALIZED): Make sure it is an unsigned int. -- GnuPG-bug-id: 5026
2020-08-11core,w32: Use timeout in es_poll even if there are no FDs.Werner Koch1-3/+17
* src/w32-estream.c (_gpgrt_w32_poll): Sleep if there are no handles to wait for. -- This better matches the semantics of poll and select and avoid busy waitins. We had this problem for example in the LDAP helper process reaper of GnuPG's Dirmngr. Signed-off-by: Werner Koch <[email protected]>
2020-08-05Make --lib-version work again.Werner Koch1-3/+36
* src/gpg-error.c (main): Add printing code. -- This was lost while changing to the included option parser back in 2018. The new code also does some prettying of the output. Fixes-commit: 11ce9bc3d6fe75859e18112824ae7ec3ca0fc8df Signed-off-by: Werner Koch <[email protected]>
2020-08-03gpgrt-config: Fix handling 'Requires' field.NIIBE Yutaka1-6/+11
* src/gpgrt-config.in (get_attr_l): New. (all_required_config_files): Use get_attr_l. -- GnuPG-bug-id: 5010 Signed-off-by: NIIBE Yutaka <[email protected]>
2020-07-15w32: Add gpgrt_fcancel to the definition.NIIBE Yutaka1-0/+2
* src/gpg-error.def.in (gpgrt_fcancel): Add. Fixes-commit: 3413489d25577e3fe7f529b8e610a45d2bd1857c Signed-off-by: NIIBE Yutaka <[email protected]>
2020-06-26estream: Add gpgrt_fcancelWerner Koch7-9/+44
* src/estream.c (do_close): Add arg 'cancel_mode' and chnage all callers. (_gpgrt_fcancel): New. * src/gpg-error.def.in, src/gpg-error.vers: Add function. * src/visibility.c (gpgrt_fcancel): New. * src/gpg-error.h.in (gpgrt_fcancel): New. -- Signed-off-by: Werner Koch <[email protected]>
2020-06-15build: Fix the gpg-error-config test for cross build.NIIBE Yutaka1-0/+2
* src/gpg-error-config-test.sh.in: Clear PKG_CONFIG_SYSROOT_DIR. GnuPG-bug-id: 4973 Signed-off-by: NIIBE Yutaka <[email protected]>
2020-06-03build: Fix cross-compiling into a separate build dir.David Michael1-1/+1
* configure.ac: Create the src directory before writing into it. * src/Makefile.am (EXTRA_DIST): Add gen-lock-obj.sh. -- Signed-off-by: David Michael <[email protected]>
2020-05-19syscfg: add 64-bit big-endian MIPS architecturedkg/fix-4952Daniel Kahn Gillmor2-0/+26
* src/syscfg/lock-obj-pub.mips64-unknown-linux-gnuabi64.h: new. * src/Makefile.am (lock_obj_pub): Add it. -- This information was dervied and reported by YunQiang Su <[email protected]>. GnuPG-bug-id: 4952 Debian-bug-id: 960161 Signed-off-by: Daniel Kahn Gillmor <[email protected]>
2020-04-09build: Use gen-lock-obj.sh script when possible.NIIBE Yutaka1-0/+7
* configure.ac (HAVE_GENERATED_LOCK_OBJ_H): New. * src/Makefile.am: Support HAVE_GENERATED_LOCK_OBJ_H. -- For cross build, when possible (currently for GNU/Linux), generate lock-obj-pub.native.h by the script. GnuPG-bug-id: 4774 Signed-off-by: NIIBE Yutaka <[email protected]>
2020-04-09build: Add a shell script to generate lock-obj-pub.h.NIIBE Yutaka1-0/+112
* src/gen-lock-obj.sh: New. Signed-off-by: NIIBE Yutaka <[email protected]>
2020-04-03core: Improve the echo and info meta commands of the arg parserWerner Koch1-9/+74
* src/argparse.c (handle_meta_echo): Substitue some vars. (handle_meta_user): Factor some code out to ... (assure_username): new. -- Yeah, that is not really needed but might sometimes be helpful. Signed-off-by: Werner Koch <[email protected]>
2020-04-03core: Implement meta command [user] also for WindowsWerner Koch2-2/+21
* src/argparse.c (initialize): Clear username. * src/sysutils.c (_gpgrt_getusername): Implement for Windows. -- This also fixes a missing intialization Signed-off-by: Werner Koch <[email protected]>
2020-04-03core: Implement meta command [user] for the arg parser.Werner Koch3-25/+106
* src/sysutils.c (_gpgrt_getusername): New. * src/argparse.c (struct _gpgrt_argparse_internal_s): New flags user_* and store the current user. (initialize): Free new malloced field. Clear new flags. (handle_meta_user): Implement. (handle_metacmd): Implement user sections. Remove "group" meta command. (_gpgrt_argparse): Implement user sections. (finish_read_sys): Reset new vars. -- Implementing group would be somewhat complicated and it is doubtful whether this really makes sense and is manageable for the admin. Note that we have not yet implemented this for Windows. Signed-off-by: Werner Koch <[email protected]>