<feed xmlns='http://www.w3.org/2005/Atom'>
<title>libgpg-error/src/gpg-error.vers, branch gniibe/t5912</title>
<subtitle>Error codes used by GnuPG et al.</subtitle>
<id>http://git.bktus.com/gpgfrontend/libgpg-error/atom?h=gniibe%2Ft5912</id>
<link rel='self' href='http://git.bktus.com/gpgfrontend/libgpg-error/atom?h=gniibe%2Ft5912'/>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/libgpg-error/'/>
<updated>2020-10-19T13:21:59Z</updated>
<entry>
<title>New public function gpgrt_access.</title>
<updated>2020-10-19T13:21:59Z</updated>
<author>
<name>Werner Koch</name>
<email>wk@gnupg.org</email>
</author>
<published>2020-10-19T13:21:59Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/libgpg-error/commit/?id=4764c5a3a4d704b3b42bafc5eba3996579030703'/>
<id>urn:sha1:4764c5a3a4d704b3b42bafc5eba3996579030703</id>
<content type='text'>
* 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
</content>
</entry>
<entry>
<title>estream: Add gpgrt_fcancel</title>
<updated>2020-06-26T13:25:27Z</updated>
<author>
<name>Werner Koch</name>
<email>wk@gnupg.org</email>
</author>
<published>2020-06-26T13:24:43Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/libgpg-error/commit/?id=3413489d25577e3fe7f529b8e610a45d2bd1857c'/>
<id>urn:sha1:3413489d25577e3fe7f529b8e610a45d2bd1857c</id>
<content type='text'>
* 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 &lt;wk@gnupg.org&gt;
</content>
</entry>
<entry>
<title>core: New function gpgrt_reallocarray.</title>
<updated>2020-03-03T14:41:39Z</updated>
<author>
<name>Werner Koch</name>
<email>wk@gnupg.org</email>
</author>
<published>2020-03-03T14:41:39Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/libgpg-error/commit/?id=969abd302211262562df93ae5412ee319aae69e6'/>
<id>urn:sha1:969abd302211262562df93ae5412ee319aae69e6</id>
<content type='text'>
* src/init.c (_gpgrt_reallocarray): New.
* src/visibility.c (gpgrt_reallocarray): New.
* src/gpg-error.vers, src/gpg-error.def.in: Add new function.
* src/gpg-error.h.in: Add new interface.
* tests/t-malloc.c: New.
* tests/Makefile.am (TESTS): Add new test.
--

Note that this function is different from the glibc function because
it has an extra parameter which allows to clear the new elements.  A
realloc after a calloc with forgotten memset after it is a common
source of error, thus we introduce this slightly different function.

Signed-off-by: Werner Koch &lt;wk@gnupg.org&gt;
</content>
</entry>
<entry>
<title>core: Add a high level option/argument parser.</title>
<updated>2020-02-18T15:50:46Z</updated>
<author>
<name>Werner Koch</name>
<email>wk@gnupg.org</email>
</author>
<published>2020-02-18T15:47:05Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/libgpg-error/commit/?id=933eb9346a84c87f83f77d990be2f66e2f7b62e7'/>
<id>urn:sha1:933eb9346a84c87f83f77d990be2f66e2f7b62e7</id>
<content type='text'>
* 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 &lt;wk@gnupg.org&gt;
</content>
</entry>
<entry>
<title>core: Add gpgrt_fnameconcat and gpgrt_absfnameconcat.</title>
<updated>2020-02-18T07:56:33Z</updated>
<author>
<name>Werner Koch</name>
<email>wk@gnupg.org</email>
</author>
<published>2020-02-18T07:53:30Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/libgpg-error/commit/?id=5742b8eaf3fa9cda3dfb6b3ad0fea7485fff1a12'/>
<id>urn:sha1:5742b8eaf3fa9cda3dfb6b3ad0fea7485fff1a12</id>
<content type='text'>
* 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 &lt;wk@gnupg.org&gt;
</content>
</entry>
<entry>
<title>core: New functions gpgrt_abort and gpgrt_add_emergency_cleanup.</title>
<updated>2019-01-04T12:13:53Z</updated>
<author>
<name>Werner Koch</name>
<email>wk@gnupg.org</email>
</author>
<published>2019-01-04T12:13:53Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/libgpg-error/commit/?id=933bfd7b652a907c0d8dd5337c6b5b9cb82ce7b7'/>
<id>urn:sha1:933bfd7b652a907c0d8dd5337c6b5b9cb82ce7b7</id>
<content type='text'>
* src/init.c (emergency_cleanup_list): New gloabl var.
(_gpgrt_add_emergency_cleanup): New.
(_gpgrt_abort): New. Repalce all calls to abort by this.  Also replace
all assert by either log_assert or a stderr output followed by a
_gpgrt_abort.
(run_emergency_cleanup): New.
* src/visibility.c (gpgrt_add_emergency_cleanup): New public API.
(gpgrt_abort): New public API.
--

Libgcrypt uses its own assert function which makes sure to terminate
the secure memory.  This is safe as log as an assert is triggered
internally in Libgcrypt.  GnuPG runs emergency cleanup handlers right
before log_fatal etc to tell Libgcrypt to terminate the secure memory.
With the move of the logging function to gpgrt in gnupg 2.3 this did
not anymore.  Thus we now provide a mechanism in gpgrt to do right
that.  Eventually Libgcrypt can also make use of this.

What this does not handle are calls to abort or failed asserts in
external libraries or in libc.  We can't do anything about it in a
library because a library may not setup signal handlers.

Signed-off-by: Werner Koch &lt;wk@gnupg.org&gt;
</content>
</entry>
<entry>
<title>core: New functions gpgrt_fprintf_sf anf gpgrt_fprintf_sf_unlocked.</title>
<updated>2018-11-26T19:22:24Z</updated>
<author>
<name>Werner Koch</name>
<email>wk@gnupg.org</email>
</author>
<published>2018-11-26T19:22:24Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/libgpg-error/commit/?id=bd8668c120ac0f725edb092b2c4ca49ffdb78ed2'/>
<id>urn:sha1:bd8668c120ac0f725edb092b2c4ca49ffdb78ed2</id>
<content type='text'>
* src/gpg-error.h.in (gpgrt_string_filter_t): New type.
(gpgrt_fprintf_sf, gpgrt_fprintf_sf_unlocked): New.
* src/gpg-error.vers, src/gpg-error.def.in: Add them.
* src/visibility.c (gpgrt_fprintf_sf): New.
(gpgrt_fprintf_sf_unlocked): New.
* src/estream-printf.c (pr_string): Add and use args sf, sfvalue and
string_no.
(do_format): Add args sf and sfvalue.  Keep a string format counter.
(_gpgrt_estream_format): Add args sf and sfvalue.  Change all callers
to provide NULL for them.
* src/estream.c (_gpgrt_vfprintf_unlocked, _gpgrt_vfprintf): Add sf
and sfvalue and adjust all callers.
(do_print_stream): Ditto.

* tests/t-printf.c (stream_to_string): New.
(struct sfstate_s): New.
(string_filter): New.
(check_fprintf_sf): New.
(main): Call new test.
--

The actual reason to implement these functions is to enhance the
internal logging function with a filter to sanitized strings so that
control values or other things can be quoted.

Signed-off-by: Werner Koch &lt;wk@gnupg.org&gt;
</content>
</entry>
<entry>
<title>core: Add a limited version of gpgrt_ftruncate.</title>
<updated>2018-11-26T19:09:53Z</updated>
<author>
<name>Werner Koch</name>
<email>wk@gnupg.org</email>
</author>
<published>2018-11-26T19:06:36Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/libgpg-error/commit/?id=ffb49b72f132d954a3d9fa11e45803c36a62fd25'/>
<id>urn:sha1:ffb49b72f132d954a3d9fa11e45803c36a62fd25</id>
<content type='text'>
* src/gpg-error.h.in (gpgrt_ftruncate, es_ftruncate): New.
* src/gpg-error.def.in, src/gpg-error.vers: Add gpgrt_ftruncate.
* src/visibility.c (gpgrt_ftruncate): new.
* src/gpgrt-int.h (COOKIE_IOCTL_TRUNCATE): New.
* src/estream.c (func_mem_ioctl): Support new internal IOCTL.
(_gpgrt_ftruncate): New.
--

Right now the ftruncate works only on memory streams.  Can easily be
added to other stream times.

Signed-off-by: Werner Koch &lt;wk@gnupg.org&gt;
</content>
</entry>
<entry>
<title>core: New API gpgrt_cmp_version</title>
<updated>2018-11-15T18:28:20Z</updated>
<author>
<name>Werner Koch</name>
<email>wk@gnupg.org</email>
</author>
<published>2018-11-15T18:18:53Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/libgpg-error/commit/?id=a5d4a4b32b11814d673241d62624ecec1d577571'/>
<id>urn:sha1:a5d4a4b32b11814d673241d62624ecec1d577571</id>
<content type='text'>
* src/gpg-error.h.in: New API gpgrt_cmp_version.
* src/visibility.c (gpgrt_cmp_version): New wrapper.
* src/version.c (parse_version_string): Revamped.
(do_cmp_version): New.
(_gpgrt_cmp_version): New.
(_gpg_error_check_version): Re-implemented using the new func.
* tests/t-version.c: Include t-common.h.
(t_gpgrt_cmp_version): New test.
(main): Run new test.  Change test for new version number to require a
2 level number.
--

We have implementations of very similar functions in all out libs.
Thus it makes sense to provide a generic version.  This version is
actually derived from the ftp-indexer.c we use for the gnupg
website (see the gnupg-doc repo).

Signed-off-by: Werner Koch &lt;wk@gnupg.org&gt;
</content>
</entry>
<entry>
<title>core: Add Base-64 encoder.</title>
<updated>2018-03-22T16:38:24Z</updated>
<author>
<name>Werner Koch</name>
<email>wk@gnupg.org</email>
</author>
<published>2018-03-22T16:20:52Z</published>
<link rel='alternate' type='text/html' href='http://git.bktus.com/gpgfrontend/libgpg-error/commit/?id=ffc8f805165a13d16ed227051c59d732117ec9d4'/>
<id>urn:sha1:ffc8f805165a13d16ed227051c59d732117ec9d4</id>
<content type='text'>
* src/b64enc.c: Change to fit into libgpg-error.
* src/Makefile.am: Add b64enc.c
* src/b64dec.c: Use xtrymalloc etc.  Always use gpg_err_code_t.
(_gpgrt_b64dec_start): Set decoder flag
(_gpgrt_b64dec_finish): Check for conflict.
(_gpgrt_b64state): Move to ...
* src/gpgrt-int.h: here.  Add new fields.
* src/visibility.c (gpgrt_b64enc_start): New.
(gpgrt_b64enc_write): New.
(gpgrt_b64enc_finish): New.
* src/gpg-error.vers, src/gpg-error.def.in: Add new functions.
* src/gpg-error.h.in: Ditto.
* src/visibility.h: Ditto.

* tests/t-b64dec.c: Remove.
* tests/t-b64.c: New.
* tests/Makefile.am (TESTS): Replace t-b64dec by t-b64.
--

Signed-off-by: Werner Koch &lt;wk@gnupg.org&gt;
</content>
</entry>
</feed>
