| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
| |
* 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]>
|
|
|
|
|
|
|
|
| |
--
It is the GNU GPL, so print that and not jus the SPDX identifier.
Signed-off-by: Werner Koch <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
| |
* 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]>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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]>
|
|
|
|
|
|
|
|
|
|
| |
* 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]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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]>
|
|
|
|
|
|
|
|
|
|
|
| |
* 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]>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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]>
|
|
|
|
| |
--
|
| |
|
|
|
|
| |
--
|
|
|
|
| |
--
|
|
|
|
|
|
|
|
|
|
|
| |
* 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]>
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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]>
|
|
|
|
| |
Signed-off-by: NIIBE Yutaka <[email protected]>
|
|
|
|
|
|
| |
* src/Makefile.am (mkheader): Remove -O0 option.
Signed-off-by: NIIBE Yutaka <[email protected]>
|
|
|
|
|
|
|
| |
* 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]>
|
|
|
|
|
|
| |
--
Signed-off-by: NIIBE Yutaka <[email protected]>
|
|
|
|
|
|
|
|
|
| |
* src/gpg-error.c (main): Fix conditional compilation.
--
Reported-by: Rey Abeleda <[email protected]>
Signed-off-by: NIIBE Yutaka <[email protected]>
|
|
|
|
|
|
|
| |
* tests/t-b64.c (test_b64dec_string): De-allocate.
GnuPG-bug-id: 4698
Signed-off-by: NIIBE Yutaka <[email protected]>
|
|
|
|
|
|
|
| |
* src/sysutils.c (_gpgrt_setenv): Avoid call with value=NULL.
GnuPG-bug-id: 4698
Signed-off-by: NIIBE Yutaka <[email protected]>
|
|
|
|
|
|
|
| |
* src/logging.c (fun_writer): Fix for socket_dir_cb.
GnuPG-bug-id: 4698
Signed-off-by: NIIBE Yutaka <[email protected]>
|
|
|
|
|
|
|
|
| |
* 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]>
|
|
|
|
|
|
|
|
| |
src/err-codes.h.in (GPG_ERR_KEYBOXD): Add missing tabs.
--
Fixes-commit: c6d9598a8572e7757504ddf53c01dcf611228143
Signed-off-by: Werner Koch <[email protected]>
|
|
|
|
|
|
|
|
| |
* src/estream-printf.c (pr_string): Here.
--
GnuPG-bug-id: 4698
Signed-off-by: Werner Koch <[email protected]>
|
|
|
|
|
|
| |
* src/gpgrt-config.in: Support Libs.private and Requires.private.
Signed-off-by: NIIBE Yutaka <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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]>
|
|
|
|
|
|
| |
* src/estream.c (_gpgrt_poll): Go to leave, when something is ready.
Signed-off-by: NIIBE Yutaka <[email protected]>
|
|
|
|
|
|
| |
* src/estream.c (_gpgrt_poll): Fix for want_oob.
Signed-off-by: NIIBE Yutaka <[email protected]>
|
|
|
|
| |
--
|
|
|
|
|
|
| |
* src/estream.c (tmpfd): Use intptr_t.
Signed-off-by: NIIBE Yutaka <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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]>
|
|
|
|
|
|
|
|
|
|
| |
* 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]>
|
|
|
|
|
|
|
|
|
|
|
| |
* 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]>
|
|
|
|
|
|
| |
* src/gpgrt-int.h (struct _gpgrt_b64state): Use unsigned for bit flags.
Signed-off-by: NIIBE Yutaka <[email protected]>
|
|
|
|
|
|
| |
* src/estream.c (_gpgrt_poll): Check for malloc error.
Signed-off-by: Werner Koch <[email protected]>
|
|
|
|
|
|
|
|
|
| |
* src/estream.c [HAVE_POLL_H] (_gpgrt_poll): No VLA.
--
Fixes-commit: a21a7de8c2cf986235382e7e04805744f6df116e
Signed-off-by: NIIBE Yutaka <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
| |
* 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]>
|
|
|
|
|
|
|
|
|
|
|
| |
* 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]>
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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]>
|
|
|
|
|
|
|
|
|
|
| |
* 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]>
|
|
|
|
|
|
|
|
| |
* src/Makefile.am (gpg-error-config): Exit 1 on failure.
--
Signed-off-by: NIIBE Yutaka <[email protected]>
|
|
|
|
|
|
| |
--
Signed-off-by: NIIBE Yutaka <[email protected]>
|
|
|
|
|
|
|
|
|
|
| |
* 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]>
|
|
|
|
| |
--
|
|
|
|
|
|
|
|
|
| |
* tests/t-logging.c (check_log_info): Free LOGBUF.
--
GnuPG-bug-id: 4498
Signed-off-by: NIIBE Yutaka <[email protected]>
|
|
|
|
|
|
|
|
|
|
|
| |
* 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]>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* 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]>
|
|
|
|
|
|
| |
--
Also a few comment typo fixes.
|