aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* core: Extend the way a config file can be specified,Werner Koch2020-02-221-8/+88
| | | | | | | | * src/argparse.c (PATHSEP_C, DIRSEP_C): New. (is_absfname, is_twopartfname): New. (_gpgrt_argparser): Allow for a two-part config name. Signed-off-by: Werner Koch <[email protected]>
* core: Change printed license names.Werner Koch2020-02-201-3/+3
| | | | | | | | -- It is the GNU GPL, so print that and not jus the SPDX identifier. Signed-off-by: Werner Koch <[email protected]>
* core: Skip cmdline parsing for no or an empty argv.Werner Koch2020-02-201-4/+13
| | | | | | | | | | | * src/argparse.c (_gpgrt_argparser): Allow for empty argv. Also fix memory leak. -- This comes handy when rereading option files on SIGHUP, for example in gpg-agent. There is no need to provide a dummy array. Signed-off-by: Werner Koch <[email protected]>
* core: More fixes for the new option/argument parser.Werner Koch2020-02-191-7/+18
| | | | | | | | | | | | | * src/argparse.c (arg_parse): Always set opt_flags. New flag no_init. (_gpgrt_argparse): Clear opt_flags at start. (_gpgrt_argparser): Call arg_parse directly. Call arg_parse with no_init set. -- The no_init flag is a minor performance feature to by pass the initialize function which has already been called by _gpgrt_argparser. Signed-off-by: Werner Koch <[email protected]>
* core: Some fixes for the new option/argument parserWerner Koch2020-02-191-8/+29
| | | | | | | | | | * src/argparse.c (ARGPARSE_FLAG__INITIALIZED): New. (initialize): Use a flag bit to track the initialization state. (_gpgrt_argparser): Clear some state on switching files. -- Fixes-commit: 933eb9346a84c87f83f77d990be2f66e2f7b62e7 Signed-off-by: Werner Koch <[email protected]>
* core: Add a high level option/argument parser.Werner Koch2020-02-1816-21/+520
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * gpg-error.h.in (GPGRT_CONFDIR_USER, GPGRT_CONFDIR_SYS): New consts. (ARGPARSE_FLAG_SYS, ARGPARSE_FLAG_USER, ARGPARSE_FLAG_VERBOSE) (ARGPARSE_NO_CONFFILE, ARGPARSE_CONFFILE, ARGPARSE_OPT_CONFFILE): New consts. (ARGPARSE_conffile, ARGPARSE_noconffile): New macros. (gpgrt_set_confdir): New func. (gpgrt_argparser): New func. * src/argparse.c (confdir): New var. (enum argparser_states): New. (struct _gpgrt_argparse_internal_s): Add a couple of new fields. (initialize): Init them. (any_opt_conffile): New. (_gpgrt_argparser): New. (_gpgrt_set_confdir): New. * src/visibility.c (gpgrt_argparser): New. (gpgrt_set_confdir): New. * src/gpg-error.def.in, src/gpg-error.vers: Add those functions. * tests/t-argparse.c (main): Reworked. * tests/etc/t-argparse.conf: New file. * tests/t-argparse.conf: New file. -- gpgrt_argparser is a high level version of gpgrt_argparse. It handles reading of configuration files internally and allows allows for a global configuration file. The design is so that it minimizes the work to replace the existing option parsing in gpg and friends by this one and to allow global configuration files for them. This is the just the basic code which should allow replacement of the parsers. A forthcoming patch will implement flags for options given in the global config file. GnuPG-bug-id: 4788 Signed-off-by: Werner Koch <[email protected]>
* core: Add gpgrt_fnameconcat and gpgrt_absfnameconcat.Werner Koch2020-02-1814-3/+639
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/gpg-error.h.in (gpgrt_fnameconcat): New. (gpgrt_absfnameconcat): New. * src/visibility.c (gpgrt_fnameconcat, gpgrt_absfnameconcat): New. * src/stringutils.c: New file. (_gpgrt_vfnameconcat): New. (_gpgrt_fnameconcat, _gpgrt_absfnameconcat): New. * src/gpg-error.def.in: Add new functions. * src/gpg-error.vers: Ditto. * src/sysutils.c: Include pwd.h. (_gpgrt_getpwdir): New. * configure.ac: Test for pwd.h, getpwnam, getpwuid, and their _r variants. * src/Makefile.am (libgpg_error_la_SOURCES): Add new file. * tests/t-stringutils.c: New. * tests/t-common.h (xmalloc, xstrdup, xfree): New. (die): Kludge to avoid compiler warnings. -- The new functions are based on the code of make_filename from GnuPG. They have been written by me ages ago with only minor modifications by David Shaw. I re-license them from LGPL-3.0+ OR GPL-2.0+ to LGPL-2.1-or-later. Signed-off-by: Werner Koch <[email protected]>
* w32: Support static link with -lws2_32.NIIBE Yutaka2020-02-183-2/+6
| | | | | | | | | | | * configure.ac (GPG_ERROR_CONFIG_LIBS_PRIVATE): New. * src/Makefile.am (socklibs): Use GPG_ERROR_CONFIG_LIBS_PRIVATE. * src/gpg-error.pc.in: Require @GPG_ERROR_CONFIG_LIBS_PRIVATE@. -- GnuPG-bug-id: 4623 Signed-off-by: NIIBE Yutaka <[email protected]>
* logging: Also protect gpgrt_inc_errorcount against counter overflow.Werner Koch2020-02-101-7/+5
| | | | | | | | | | | | | * src/logging.c (_gpgrt_inc_errorcount): Protect against counter overflow. (_gpgrt_logv_internal): Use that function here so that we have only one check for counter overflow. -- We already had an overflow checking for log_error but not for the silent increment function. Signed-off-by: Werner Koch <[email protected]>
* Post release updatesWerner Koch2020-02-072-1/+5
| | | | --
* Release 1.37libgpg-error-1.37gpgrt-1.37Werner Koch2020-02-072-4/+60
|
* po: Auto updateWerner Koch2020-02-0718-0/+2112
| | | | --
* po: Update German translationWerner Koch2020-02-071-1/+106
| | | | --
* tools: Allow error symbol lookup w/o the GPG_ERR_ prefix.Werner Koch2020-02-061-0/+71
| | | | | | | | | | | * src/gpg-error.c (get_err_from_codesymbol): New. (main): Use it here. -- Saves lot of typing for example when looking up an error description using --desc. Signed-off-by: Werner Koch <[email protected]>
* build: Always pass -no-undefined to libtool.Werner Koch2020-02-061-3/+1
| | | | | | | | | | | | * src/Makefile.am: Remove no_undefined macro. -- This helps to build on Cygwin and does the right thing anyway because we do not have any dependencies in gpgrt. Thanks to Michael Haubenwaller to explain this and propose a patch. GnuPG-bug-id: 4474 Signed-off-by: Werner Koch <[email protected]>
* po: Update Japanese Translation.NIIBE Yutaka2020-01-231-3/+96
| | | | Signed-off-by: NIIBE Yutaka <[email protected]>
* build: Don't use -O0 which is not portable.NIIBE Yutaka2020-01-071-1/+1
| | | | | | * src/Makefile.am (mkheader): Remove -O0 option. Signed-off-by: NIIBE Yutaka <[email protected]>
* New error codes for SQLiteWerner Koch2019-12-134-2/+120
| | | | | | | * src/err-codes.h.in: Add GPG_ERR_SQL_ codes. * src/gpg-error.h.in (gpg_err_code_from_sqlite): New. Signed-off-by: Werner Koch <[email protected]>
* po: Update Japanese Translations.NIIBE Yutaka2019-12-091-1/+13
| | | | | | -- Signed-off-by: NIIBE Yutaka <[email protected]>
* Fix gpg-error.c for preprocessor use.NIIBE Yutaka2019-09-241-4/+4
| | | | | | | | | * src/gpg-error.c (main): Fix conditional compilation. -- Reported-by: Rey Abeleda <[email protected]> Signed-off-by: NIIBE Yutaka <[email protected]>
* tests: Fix deallocation of buffer in t-b64.c.NIIBE Yutaka2019-09-181-0/+1
| | | | | | | * tests/t-b64.c (test_b64dec_string): De-allocate. GnuPG-bug-id: 4698 Signed-off-by: NIIBE Yutaka <[email protected]>
* gpgrt_setenv: Define behavior when value=NULL.NIIBE Yutaka2019-09-181-1/+1
| | | | | | | * src/sysutils.c (_gpgrt_setenv): Avoid call with value=NULL. GnuPG-bug-id: 4698 Signed-off-by: NIIBE Yutaka <[email protected]>
* logging: Fix the case of using socket_dir_cb which may return NULL.NIIBE Yutaka2019-09-181-3/+4
| | | | | | | * src/logging.c (fun_writer): Fix for socket_dir_cb. GnuPG-bug-id: 4698 Signed-off-by: NIIBE Yutaka <[email protected]>
* estream: Care about erroneous case for stream close.NIIBE Yutaka2019-09-181-10/+5
| | | | | | | | * src/estream.c (do_list_remove): Only access ITEM->NEXT when it's not null. GnuPG-bug-id: 4698 Signed-off-by: NIIBE Yutaka <[email protected]>
* core: Fix broken strings (first letter missing)Werner Koch2019-09-101-1/+1
| | | | | | | | src/err-codes.h.in (GPG_ERR_KEYBOXD): Add missing tabs. -- Fixes-commit: c6d9598a8572e7757504ddf53c01dcf611228143 Signed-off-by: Werner Koch <[email protected]>
* estream: Fix dead assigniment.Werner Koch2019-09-081-1/+0
| | | | | | | | * src/estream-printf.c (pr_string): Here. -- GnuPG-bug-id: 4698 Signed-off-by: Werner Koch <[email protected]>
* gpgrt-config: Support Libs.private and Requires.private.NIIBE Yutaka2019-09-041-0/+20
| | | | | | * src/gpgrt-config.in: Support Libs.private and Requires.private. Signed-off-by: NIIBE Yutaka <[email protected]>
* estream: Fix gpgrt_poll at EOF.NIIBE Yutaka2019-08-231-1/+1
| | | | | | | | | | | | | | * src/estream.c [HAVE_POLL_H] (_gpgrt_poll): Catch POLLHUP event for want_read. -- At EOF, here is a difference of semantics between poll(2) and select(2). For poll(2), detection of EOF is an event of POLLHUP, not POLLIN. Fixes-commit: a21a7de8c2cf986235382e7e04805744f6df116e Signed-off-by: NIIBE Yutaka <[email protected]>
* estream: Fix gpgrt_poll to prevent waiting indefinitely for others.NIIBE Yutaka2019-08-231-0/+3
| | | | | | * src/estream.c (_gpgrt_poll): Go to leave, when something is ready. Signed-off-by: NIIBE Yutaka <[email protected]>
* estream: Fix poll condition.NIIBE Yutaka2019-08-221-3/+4
| | | | | | * src/estream.c (_gpgrt_poll): Fix for want_oob. Signed-off-by: NIIBE Yutaka <[email protected]>
* New error codes NO_KEYBOXD, KEYBOXD, NO_SERVICE, and SERVICE.Werner Koch2019-08-052-1/+23
| | | | --
* w32: Fix cast to internal fd.NIIBE Yutaka2019-07-251-1/+1
| | | | | | * src/estream.c (tmpfd): Use intptr_t. Signed-off-by: NIIBE Yutaka <[email protected]>
* estream: Fix IS_INVALID_FD.NIIBE Yutaka2019-07-251-5/+1
| | | | | | | | | | | | * src/estream.c (IS_INVALID_FD): Simply compare to -1. -- Perhaps, when it was written at first, use of HANDLE was in mind. Now, we have different set of methods for Windows, and this macro is only for integer fd access, no need of ifdef/endif. Signed-off-by: NIIBE Yutaka <[email protected]>
* w32: Fix HANDLE to internal fd conversion.NIIBE Yutaka2019-07-241-6/+21
| | | | | | | | | | * src/spawn-w32.c (handle_to_fd): Use intptr_t type. -- See the section of _open_osfhandle in C Run-Time Library Reference. Signed-off-by: NIIBE Yutaka <[email protected]>
* build: Use {CFLAGS,CPPFLAGS, LDFLAGS}_FOR_BUILD for helper programsdkg-fix-T4643Daniel Kahn Gillmor2019-07-182-4/+8
| | | | | | | | | | | * doc/Makefile.am: add CPPFLAGS_FOR_BUILD for yat2m-for-build (other flags were already present). * src/Makefile.am: add {CFLAGS,CPPFLAGS,LDFLAGS}_FOR_BUILD for mkhelper, mkw32errmap, and mkerrcodes. Debian-bug-id: 932213 GnuPG-bug-id: 4643 Signed-off-by: Daniel Kahn Gillmor <[email protected]>
* Fix signedness for a single-bit field.NIIBE Yutaka2019-07-111-3/+3
| | | | | | * src/gpgrt-int.h (struct _gpgrt_b64state): Use unsigned for bit flags. Signed-off-by: NIIBE Yutaka <[email protected]>
* estream: Add missing malloc check.Werner Koch2019-06-271-1/+6
| | | | | | * src/estream.c (_gpgrt_poll): Check for malloc error. Signed-off-by: Werner Koch <[email protected]>
* estream: Don't use variable length array.NIIBE Yutaka2019-06-261-1/+7
| | | | | | | | | * src/estream.c [HAVE_POLL_H] (_gpgrt_poll): No VLA. -- Fixes-commit: a21a7de8c2cf986235382e7e04805744f6df116e Signed-off-by: NIIBE Yutaka <[email protected]>
* estream: Use poll(2) when available.NIIBE Yutaka2019-06-262-1/+83
| | | | | | | | | | | * configure.ac: Detect poll.h. * src/estream.c [HAVE_POLL_H] (_gpgrt_poll): Use poll. -- Here, we use C99 feature of array declaration with variable. Signed-off-by: NIIBE Yutaka <[email protected]>
* tests: Skip the test when pkg-config is too old.NIIBE Yutaka2019-06-181-0/+6
| | | | | | | | | | | * src/gpg-error-config-test.sh.in: Check pkg-config version. -- Use of sort and sed 1q for version check is taken from .m4 code in gettext. Signed-off-by: NIIBE Yutaka <[email protected]>
* build: Take care of POSIX shell path.NIIBE Yutaka2019-06-185-4/+10
| | | | | | | | | | | | * configure.ac (INSTALLSHELLPATH): New. * src/Makefile.am: Change invocation of gpg-error-config-test.sh. * src/gpgrt-config.in (INSTALLSHELLPATH): To be substituted. * src/gpg-error-config-test.sh.in: Likewise. -- GnuPG-bug-id: 4574 Signed-off-by: NIIBE Yutaka <[email protected]>
* Portability fix for PID.NIIBE Yutaka2019-06-181-1/+1
| | | | | | | | | | * src/spawn-posix.c (gpgrt_wait_processes): Cast to int. -- On some systems (like Solaris), pid_t is long int. Signed-off-by: NIIBE Yutaka <[email protected]>
* build: Add failure exit for gpg-error-config build.NIIBE Yutaka2019-06-181-0/+1
| | | | | | | | * src/Makefile.am (gpg-error-config): Exit 1 on failure. -- Signed-off-by: NIIBE Yutaka <[email protected]>
* po: Update Japanese translation.NIIBE Yutaka2019-05-291-10/+6
| | | | | | -- Signed-off-by: NIIBE Yutaka <[email protected]>
* Detect to use strerror_s.NIIBE Yutaka2019-05-292-1/+12
| | | | | | | | | | * configure.ac [mingw32*] (strerror_s): Detect. * src/strerror.c [HAVE_STRERROR_S] (system_strerror_r): Use strerror_s. -- GnuPG-bug-id: 4539 Signed-off-by: NIIBE Yutaka <[email protected]>
* po: Update Polish translationWerner Koch2019-05-271-9/+5
| | | | --
* tests: Fix a memory leak.NIIBE Yutaka2019-05-141-0/+1
| | | | | | | | | * tests/t-logging.c (check_log_info): Free LOGBUF. -- GnuPG-bug-id: 4498 Signed-off-by: NIIBE Yutaka <[email protected]>
* build: Update m4/iconv.m4.NIIBE Yutaka2019-05-131-48/+68
| | | | | | | | | | | * m4/iconv.m4: Update from gettext 0.20.1. -- This includes fixes of file descriptor leaks. GnuPG-bug-id: 4504 Signed-off-by: NIIBE Yutaka <[email protected]>
* awk: Prepare for Gawk 5.0.NIIBE Yutaka2019-04-157-11/+11
| | | | | | | | | | | | | | | | * src/Makefile.am: Use pkg_namespace (instead of namespace). * src/mkerrnos.awk: Likewise. * lang/cl/mkerrcodes.awk: Don't escape # in regexp. * src/mkerrcodes.awk, src/mkerrcodes1.awk, src/mkerrcodes2.awk: Ditto. -- In Gawk 5.0, regexp routines are replaced by Gnulib implementation, which only allows escaping specific characters. GnuPG-bug-id: 4459 Reported-by: Marius Schamschula Signed-off-by: NIIBE Yutaka <[email protected]>
* yat2m: Change style for @samp and add @kbd.Werner Koch2019-04-041-3/+4
| | | | | | -- Also a few comment typo fixes.