libgpg-error.git
2 days agobuild: use EXEEXT_FOR_BUILD everywhere. master
Michael Haubenwallner [Thu, 12 Jul 2018 15:36:13 +0000 (17:36 +0200)]
build: use EXEEXT_FOR_BUILD everywhere.

* src/Makefile.am: Use EXEEXT_FOR_BUILD with all build tools.

Signed-off-by: Michael Haubenwallner
<michael.haubenwallner@ssi-schaefer.com>

7 days agoPost release updates
Werner Koch [Thu, 12 Jul 2018 09:08:47 +0000 (11:08 +0200)]
Post release updates

--

7 days agoRelease 1.32 libgpg-error-1.32
Werner Koch [Thu, 12 Jul 2018 08:59:54 +0000 (10:59 +0200)]
Release 1.32

Signed-off-by: Werner Koch <wk@gnupg.org>
7 days agoestream: Always propagate flush event to cookie functions.
Werner Koch [Thu, 12 Jul 2018 07:17:52 +0000 (09:17 +0200)]
estream: Always propagate flush event to cookie functions.

* src/estream.c (flush_stream): Always call cookie's flush func.

Signed-off-by: Werner Koch <wk@gnupg.org>
8 days agobuild: Use AX_CC_FOR_BUILD and EXEEXT.
NIIBE Yutaka [Wed, 11 Jul 2018 01:56:30 +0000 (10:56 +0900)]
build: Use AX_CC_FOR_BUILD and EXEEXT.

* configure.ac (AX_CC_FOR_BUILD): New.
* doc/Makefile.am: Use EXEEXT and EXEEXT_FOR_BUILD.
* m4/ac_prog_cc_for_build.m4: Remove.
* m4/ax_cc_for_build.m4: New.

--

Suggested-by: Michael Haubenwallner
      <michael.haubenwallner@ssi-schaefer.com>
Fixes-commit: 6eb80abcde5ad776379069871e4156b28ef69712
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
8 days agodoc: Now, yat2m is a standard tool.
NIIBE Yutaka [Wed, 11 Jul 2018 01:54:09 +0000 (10:54 +0900)]
doc: Now, yat2m is a standard tool.

* configure.ac (YAT2M, HAVE_YAT2M): Remove.
* doc/Makefile.am: Always use yat2m which comes with this source.

--

Suggested-by: Michael Haubenwallner
      <michael.haubenwallner@ssi-schaefer.com>
Fixes-commit: 4dc6d4d2067c726cdb13593bf151637319ff65e6
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
9 days agobuild: Remove version_parts in autogen.sh.
NIIBE Yutaka [Tue, 10 Jul 2018 08:10:13 +0000 (17:10 +0900)]
build: Remove version_parts in autogen.sh.

* autogen.rc (version_parts): Remove.
* autogen.sh: Determine by $micro argument.

--

It can be determined by the invocation of

    ./autogen.sh --find-version

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
2 weeks agoRemove leftover debug output from gpg-error.
Werner Koch [Thu, 5 Jul 2018 06:58:39 +0000 (08:58 +0200)]
Remove leftover debug output from gpg-error.

* src/gpg-error.c (main): Remove a log_debug.
--

Also a few typo fixes.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 weeks agopo: Update Ukrainian translation.
Yuri Chornoivan [Sat, 14 Apr 2018 18:17:15 +0000 (21:17 +0300)]
po: Update Ukrainian translation.

2 weeks agocore: Initialize values in estream_format
Andre Heinecke [Wed, 4 Jul 2018 16:19:42 +0000 (18:19 +0200)]
core: Initialize values in estream_format

* src/estream-printf.c (_gpgrt_estream_format): Make sure
valuetable.value is inialized even on stack.

--
This makes the behavior more consistent with the calloc'ed
codepath for more then 8 variables.

It also fixes a potential crash if there were unmatched
format args provided.

GnuPG-Bug-Id: T4054

7 weeks agopo: Update Russian translation.
Ineiev [Sat, 21 Apr 2018 10:07:08 +0000 (10:07 +0000)]
po: Update Russian translation.

7 weeks agocore: Fix problem with C11 and stdnoreturn.h.
Werner Koch [Wed, 30 May 2018 15:08:54 +0000 (17:08 +0200)]
core: Fix problem with C11 and stdnoreturn.h.

* src/gpg-error.h.in (GPGRT_ATTR_NORETURN): Use gcc specific symbol name
__noreturn__.
--

GnuPG-bug-id: 4002
Signed-off-by: Werner Koch <wk@gnupg.org>
7 weeks agopo: More Spanish translations.
emma peel [Sat, 26 May 2018 09:02:06 +0000 (09:02 +0000)]
po: More Spanish translations.

--

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2 months agodoc: Fix yat2m name for native w32 build
Andre Heinecke [Thu, 3 May 2018 12:27:51 +0000 (14:27 +0200)]
doc: Fix yat2m name for native w32 build

* doc/Makefile.am: Handle not cross compiling but building for
windows.

Signed-off-by: Andre Heinecke <aheinecke@intevation.de>
2 months agoPost release updates
Werner Koch [Wed, 2 May 2018 18:36:45 +0000 (20:36 +0200)]
Post release updates

--

2 months agoRelease 1.31. libgpg-error-1.31
Werner Koch [Wed, 2 May 2018 18:28:38 +0000 (20:28 +0200)]
Release 1.31.

* configure.ac: Set LT version to C24/A24/R2.

2 months agopo: Enable Spanish translation
Werner Koch [Tue, 1 May 2018 17:45:42 +0000 (19:45 +0200)]
po: Enable Spanish translation

--

Signed-off-by: Werner Koch <wk@gnupg.org>
2 months agocore,w32: Avoid recursive use of npth_unprotect.
Werner Koch [Tue, 1 May 2018 17:35:28 +0000 (19:35 +0200)]
core,w32: Avoid recursive use of npth_unprotect.

* src/w32-estream.c (reader): Use standard free.
(writer): Ditto.
--

There are two errors: The minor one is that we allocated with calloc
but released with _gpgrt_free.  The major one is the recursive use of
npth_unprotect due to the syscall_clamp mechanism:

1. Around the call to _gpgrt_w32_poll

2. By gpgrt_lock_lock on behalf of a the custom allocation handler in
   the worker threads at their _gpgrt_free.

This problem was exhibited by GnuPG's dirmngr component.

GnuPG-bug-id: 3937
Signed-off-by: Werner Koch <wk@gnupg.org>
2 months agopo: new Spanish translation
emma peel [Sun, 15 Apr 2018 08:54:29 +0000 (08:54 +0000)]
po: new Spanish translation

Signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
2 months agoPost release updates
Werner Koch [Mon, 30 Apr 2018 06:39:11 +0000 (08:39 +0200)]
Post release updates

--

2 months agoRelease 1.30. libgpg-error-1.30
Werner Koch [Mon, 30 Apr 2018 06:33:14 +0000 (08:33 +0200)]
Release 1.30.

* configure.ac: Bump LT version to C24/A/24/R1.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 months agobuild: More release creation automation.
Werner Koch [Mon, 30 Apr 2018 06:24:12 +0000 (08:24 +0200)]
build: More release creation automation.

* Makefile.am: Add release and sign-release targets.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 months agocore: Fix gpgrt_poll for Windows under nPth.
Werner Koch [Mon, 30 Apr 2018 05:49:11 +0000 (07:49 +0200)]
core: Fix gpgrt_poll for Windows under nPth.

* src/estream.c (_gpgrt_poll) [W32]: Use syscall clamp.

Signed-off-by: Werner Koch <wk@gnupg.org>
2 months agodoc: Add SPDX indentifier for the versioninfo template.
Werner Koch [Mon, 23 Apr 2018 10:49:12 +0000 (12:49 +0200)]
doc: Add SPDX indentifier for the versioninfo template.

--

3 months agodoc: Fix yat2m build for cross compilation.
NIIBE Yutaka [Fri, 13 Apr 2018 06:45:54 +0000 (15:45 +0900)]
doc: Fix yat2m build for cross compilation.

* doc/Makefile.am: Fix target of yat2m-for-build.

--

GnuPG-bug-id: 3901
Fixes-commit: efc4769339d42a4a399c040c146cf4a29c02ea4f
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
3 months agobuild: Check -lsocket -lnsl for Solaris.
NIIBE Yutaka [Thu, 12 Apr 2018 00:40:19 +0000 (09:40 +0900)]
build: Check -lsocket -lnsl for Solaris.

* configure.ac: Check inet_addr for -lnsl, and socket for -lsocket.

--

Once I used LIB_SOCKET_NSL for the variable name, but it is already
used by AX_LIB_SOCKET_NSL in autoconf-archive as an alias of the
macro.  So, I changed the variable name.

GnuPG-bug-id: 3869
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
3 months agobuild: Make sure version.texi is generated in time.
Damien Goutte-Gattat via Gnupg-devel [Wed, 11 Apr 2018 15:06:01 +0000 (16:06 +0100)]
build: Make sure version.texi is generated in time.

[[PGP Signed Part:Good signature from AA4373E6C82C78AD Damien Goutte-Gattat <dgouttegattat@incenp.org> (trust undefined) created at 2018-04-11T17:05:27+0200 using RSA]]
[1. text/plain]

* doc/Makefile.am (yat2m-stamp): Depend on version.texi.
--

When building from a cloned Git repository and with `make -j 3`
(or higher), the version.texi file may not have been generated
yet when yat2m is called to generate the man page, resulting in
a build failure.

Signed-off-by: Damien Goutte-Gattat <dgouttegattat@incenp.org>
3 months agoPost release updates
Werner Koch [Wed, 11 Apr 2018 07:40:17 +0000 (09:40 +0200)]
Post release updates

--

3 months agoRelease 1.29 gpgrt-1.29 libgpg-error-1.29
Werner Koch [Wed, 11 Apr 2018 07:24:03 +0000 (09:24 +0200)]
Release 1.29

* configure.ac: Bump LT version to C24/A24/R0.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 months agodoc: Beautify comments in gpg-error.h.
Werner Koch [Wed, 11 Apr 2018 07:12:39 +0000 (09:12 +0200)]
doc: Beautify comments in gpg-error.h.

--

Signed-off-by: Werner Koch <wk@gnupg.org>
3 months agocore: Finalize the API for argparse.
Werner Koch [Wed, 11 Apr 2018 07:10:14 +0000 (09:10 +0200)]
core: Finalize the API for argparse.

* src/gpg-error.h.in (ARGPARSE_end): Simplify.
* src/argparse.c (_gpgrt_argparse_internal_s): Add field opts.
(deinitialize): Release new field.
(initialize): Add arg opts and create a copy of the option list.  Add
the internal options.
(_gpgrt_argparse): Rename arg opts to opts_orig and set new local var
opts.  Adjust all references to opts.
(find_long_option): Adjust for chnaged type of OPTS.  Re-indent.
(arg_parse): Remove internal option assignment.  Rename arg opts to
opts_orig and set new local var opts.  Adjust all references to opts.
(show_help): Adjust all references to opts.
--

The old ARGPARSE_end maro was a bit cumbersome and does not allow to
chnage the number of internal options.  Thus this somewhat larger
chnage to keep the internal options out of the API.

Note that with this change the internal options now also work in a
option file and not just on the command line; that does not make much
sense but is probably less surprising.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 months agodoc: Fix previous commit.
NIIBE Yutaka [Tue, 27 Mar 2018 03:16:20 +0000 (12:16 +0900)]
doc: Fix previous commit.

--

Fixes-commit: efc4769339d42a4a399c040c146cf4a29c02ea4f
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
3 months agodoc: Support cross compilation for yat2m.
NIIBE Yutaka [Tue, 27 Mar 2018 00:53:42 +0000 (09:53 +0900)]
doc: Support cross compilation for yat2m.

* configure.ac (HAVE_YAT2M): New.
* doc/Makefile.am [CROSS_COMPILING]: Supported.

--

Makefile portability is also improved.

Fixes-commit: 4dc6d4d2067c726cdb13593bf151637319ff65e6
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
3 months agobuild: Okay travis, take this
Werner Koch [Thu, 22 Mar 2018 20:26:24 +0000 (21:26 +0100)]
build: Okay travis, take this

--

3 months agobuild: Another try on travis.yml
Werner Koch [Thu, 22 Mar 2018 20:10:21 +0000 (21:10 +0100)]
build: Another try on travis.yml

--

Why don't they return useful error messages????

3 months agobuild: And even more travis.yml tweaking
Werner Koch [Thu, 22 Mar 2018 20:08:45 +0000 (21:08 +0100)]
build: And even more travis.yml tweaking

--

3 months agobuild: And more travis.yml tweaking
Werner Koch [Thu, 22 Mar 2018 20:00:51 +0000 (21:00 +0100)]
build: And more travis.yml tweaking

--

3 months agobuild: More travis.yml tweaking
Werner Koch [Thu, 22 Mar 2018 19:28:38 +0000 (20:28 +0100)]
build: More travis.yml tweaking

--

3 months agobuild: Update travis configuration.
Werner Koch [Thu, 22 Mar 2018 18:55:51 +0000 (19:55 +0100)]
build: Update travis configuration.

--

3 months agobuild: Add option --git-build to autogen.sh
Werner Koch [Thu, 22 Mar 2018 18:55:31 +0000 (19:55 +0100)]
build: Add option --git-build to autogen.sh

3 months agobuild: Testing travis.
Werner Koch [Thu, 22 Mar 2018 18:32:59 +0000 (19:32 +0100)]
build: Testing travis.

--

3 months agodoc: Update NEWS
Werner Koch [Thu, 22 Mar 2018 17:37:13 +0000 (18:37 +0100)]
doc: Update NEWS

--

3 months agoyat2m: Avoid compiler warnings
Werner Koch [Thu, 22 Mar 2018 16:42:20 +0000 (17:42 +0100)]
yat2m: Avoid compiler warnings

* doc/yat2m.c (evaluate_conditions): Mark args unused
(proc_texi_cmd): Avoid shadowing warning.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 months agocore: Remove outdated comments.
Werner Koch [Thu, 22 Mar 2018 16:21:32 +0000 (17:21 +0100)]
core: Remove outdated comments.

--

3 months agocore: Add Base-64 encoder.
Werner Koch [Thu, 22 Mar 2018 16:20:52 +0000 (17:20 +0100)]
core: Add Base-64 encoder.

* 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 <wk@gnupg.org>
3 months agocore: Add file b64enc.c from gnupg
Werner Koch [Thu, 22 Mar 2018 07:26:51 +0000 (08:26 +0100)]
core: Add file b64enc.c from gnupg

--

This is from GnuPG commit fa0ed1c7e2eee7c559026696e6b21acc882a97aa
with two tabs replaced by spaces.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 months agodoc: Fix build and installation of yat2m.
NIIBE Yutaka [Thu, 22 Mar 2018 02:15:15 +0000 (11:15 +0900)]
doc: Fix build and installation of yat2m.

* configure.ac (YAT2M): Require it when cross compiling.
* doc/Makefile.am (bin_PROGRAMS): Add yat2m.

--

Before 1.28, yat2m used to be an internal tool.  Now, it's a standard
tool.  For native build, it is built and used for initial
installation.  For cross build, it is required on the build system.

Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
3 months agopo: Update one fuzzy in all translations.
Werner Koch [Wed, 21 Mar 2018 18:06:40 +0000 (19:06 +0100)]
po: Update one fuzzy in all translations.

--

This was due to the removal of the "%s: " used for the prefix in a
printf.  It is now printed with log_error which prints the prefix on
its own.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 months agopo: Merge GnuPG's strings from argparse.c
Werner Koch [Wed, 21 Mar 2018 17:53:34 +0000 (18:53 +0100)]
po: Merge GnuPG's strings from argparse.c

Signed-off-by: Werner Koch <wk@gnupg.org>
3 months agotools: Use gpgrt_argparse for the gpg-error tool.
Werner Koch [Wed, 21 Mar 2018 17:36:23 +0000 (18:36 +0100)]
tools: Use gpgrt_argparse for the gpg-error tool.

* src/gpg-error.c (show_usage): Remove.
(my_strusage): New.
(main): Change to use argparse.  Also use log_error.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 months agocore: Add public function gpgrt_usage.
Werner Koch [Wed, 21 Mar 2018 17:34:15 +0000 (18:34 +0100)]
core: Add public function gpgrt_usage.

* src/visibility.c (gpgrt_usage): New.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 months agocore: Add the group of argparse functions.
Werner Koch [Wed, 21 Mar 2018 15:23:29 +0000 (16:23 +0100)]
core: Add the group of argparse functions.

* src/visibility.c (gpgrt_argparse): New.
(gpgrt_strusage): New.
(gpgrt_set_strusage): New.
(gpgrt_set_usage_outfnc): New.
(gpgrt_set_fixed_string_mapper): New.
* src/gpg-error.def.in, src/gpg-error.vers: Add new functions.
* src/gpg-error.h.in: Add ARGPARSE macros from the former argparse.h.
(gpgrt_argparse_t): New.
(gpgrt_opt_t): New.
* configure.ac (AH_BOTTOM): Request argparse macros.
* src/Makefile.am (libgpg_error_la_SOURCES): Add argparse.c.
* src/argparse.h: Remove.
* src/argparse.c: Revamp to fit into libgpg-error.
(_gpgrt_argparse): New.
(_gpgrt_usage): Rename from usage.
(_gpgrt_strusage): Rename from strusage.  Define two new levels and
templates for three common licenses.
(_gpgrt_set_strusage): Rename from set_strusage.
(_gpgrt_set_usage_outfnc): New.
(_gpgrt_set_fixed_string_mapper): New.

* tests/t-argparse.c: New.
--

These functions are in use by GnuPG and other software for 20 years
and it makes sense to have them always available instead of copying
and maintaing the source in several projects.  Note that there are
minor changes in the API compared to GnuPG.

Signed-off-by: Werner Koch <wk@gnupg.org>
3 months agocore: Import argparse code from gnupg master
Werner Koch [Wed, 21 Mar 2018 08:22:09 +0000 (09:22 +0100)]
core: Import argparse code from gnupg master

--

4 months agocore: Fix regression on arm64 due to invalid use of va_list.
Werner Koch [Sun, 18 Mar 2018 16:39:43 +0000 (17:39 +0100)]
core: Fix regression on arm64 due to invalid use of va_list.

* src/logging.c (_gpgrt_log_printhex): Provide a dummy arg instead of
NULL.
--

Fix
Suggested-by: Jakub Wilk <jwilk@jwilk.net>
Signed-off-by: Werner Koch <wk@gnupg.org>
4 months agocore: Fix building on W64
Werner Koch [Wed, 14 Mar 2018 09:07:42 +0000 (10:07 +0100)]
core: Fix building on W64

* src/w32-add.h: Remove hack to define pid_t.
* src/gpg-error.h.in: Eval macro to define pid_t.
* src/mkheader.c (have_sys_types_h, sys_types_h_included): New.
(parse_config_h): Test for sys/types.h.
(write_special): Protect inclusion of sys/types.h.  Define new macro
'define:pid_t'.
--

Regression-due-to: 1865c0ba1769b407a3c504f1ab0a4278704a9fc1
Signed-off-by: Werner Koch <wk@gnupg.org>
4 months agoPost release updates
Werner Koch [Tue, 13 Mar 2018 12:42:17 +0000 (13:42 +0100)]
Post release updates

--

4 months agoRelease 1.28 gpgrt-1.28 libgpg-error-1.28
Werner Koch [Tue, 13 Mar 2018 12:02:58 +0000 (13:02 +0100)]
Release 1.28

Signed-off-by: Werner Koch <wk@gnupg.org>
4 months agobuild: Update copyright notices and remove gpgscm from the release.
Werner Koch [Tue, 13 Mar 2018 10:36:17 +0000 (11:36 +0100)]
build: Update copyright notices and remove gpgscm from the release.

--

Signed-off-by: Werner Koch <wk@gnupg.org>
4 months agocore: Fix regression due to not exporting the process API.
Werner Koch [Tue, 13 Mar 2018 08:57:46 +0000 (09:57 +0100)]
core: Fix regression due to not exporting the process API.

--
Fixes-commit: 0e503cae75cb1a6aa257228a65941b7630ff35d6

Signed-off-by: Werner Koch <wk@gnupg.org>
4 months agocore: Remove accidently committed time function API.
Werner Koch [Mon, 12 Mar 2018 10:50:51 +0000 (11:50 +0100)]
core: Remove accidently committed time function API.

--

Fixes-commit: f9a33a7f7e44a644ff4e31f7e9f1c2c1ec1f8eee

4 months agocore: Do not export the process API
Werner Koch [Mon, 12 Mar 2018 10:01:27 +0000 (11:01 +0100)]
core: Do not export the process API

--

We may need to change the API and thus we better wait before
publishing this new interface.

Signed-off-by: Werner Koch <wk@gnupg.org>
4 months agosyscfg: Add a riscv64 architecture.
NIIBE Yutaka [Wed, 28 Feb 2018 01:47:51 +0000 (10:47 +0900)]
syscfg: Add a riscv64 architecture.

* src/syscfg/lock-obj-pub.riscv64-unknown-linux-gnu.h: New.
* src/Makefile.am (lock_obj_pub): Add it.
--

Debian-bug-id: 891663
Co-authored-by: Karsten Merker <merker@debian.org>
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
4 months agobuild: Document how to use git send-email.
Werner Koch [Wed, 21 Feb 2018 17:23:52 +0000 (18:23 +0100)]
build: Document how to use git send-email.

* autogen.rc: Add patches_to.
* autogen.sh: Run git config sendemail.to.
* doc/HACKING: Describe use of git send-email.
--

Co-authored-by: Todd Zullinger
Signed-off-by: Werner Koch <wk@gnupg.org>
4 months agodoc: clarify patch submission workflow
Thorsten Behrens [Thu, 1 Feb 2018 13:24:07 +0000 (14:24 +0100)]
doc: clarify patch submission workflow

Signed-off-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
4 months agodoc: Typo fixes.
Werner Koch [Wed, 21 Feb 2018 16:54:30 +0000 (17:54 +0100)]
doc: Typo fixes.

--

4 months agobuild: let autogen.sh set a git PATCH prefix
Werner Koch [Wed, 21 Feb 2018 16:53:36 +0000 (17:53 +0100)]
build: let autogen.sh set a git PATCH prefix

--

Also commit the missing commit-msg hook.

Signed-off-by: Werner Koch <wk@gnupg.org>
7 months agocore: Avoid using estream_t in the public API.
Werner Koch [Mon, 11 Dec 2017 15:33:37 +0000 (16:33 +0100)]
core: Avoid using estream_t in the public API.

* src/gpg-error.h.in: Always use gpgrt_stream-t.
--

estream_t can only be used if GPGRT_ENABLE_ES_MACROS is defined.

Fixes-commit: 1865c0ba1769b407a3c504f1ab0a4278704a9fc1
Signed-off-by: Werner Koch <wk@gnupg.org>
7 months agocore: Rename the gpgrt_log_levels enum values.
Werner Koch [Fri, 8 Dec 2017 12:31:07 +0000 (13:31 +0100)]
core: Rename the gpgrt_log_levels enum values.

* src/gpg-error.h.in (gprt_log_levels): Rename to GPGRT_LOGLVL.
--

Explicitly naming them and not distinguishing them from the other log
constants is a Good Thing anyway.  It also helps against the symbol name
clash with the GPGRT enum values from gnupg's logging module.

Signed-off-by: Werner Koch <wk@gnupg.org>
7 months agocore: Wrap blocking system calls of the spawn functions.
Werner Koch [Wed, 29 Nov 2017 20:13:11 +0000 (21:13 +0100)]
core: Wrap blocking system calls of the spawn functions.

Signed-off-by: Werner Koch <wk@gnupg.org>
7 months agocore: Unify syscall_clamp functions.
Werner Koch [Wed, 29 Nov 2017 19:22:06 +0000 (20:22 +0100)]
core: Unify syscall_clamp functions.

* src/estream.c (_gpgrt_set_syscall_clamp)
(_gpgrt_get_syscall_clamp): Move to ...
* src/syscall-clamp.c: new file.
(_gpgrt_pre_syscall, _gpgrt_post_syscall): New.
* src/Makefile.am (libgpg_error_la_SOURCES): Add that file.
* src/estream.c: Replace the syscall wrapper with the new functions.
* src/posix-lock.c: Ditto.
* src/w32-lock.c: Ditto.
* src/posix-thread.c: Ditto.
* src/w32-thread.c: Ditto.

Signed-off-by: Werner Koch <wk@gnupg.org>
7 months agocore: Implement the spawn functions.
Werner Koch [Wed, 29 Nov 2017 18:29:18 +0000 (19:29 +0100)]
core: Implement the spawn functions.

* src/gpg-error.h.in  (GPGRT_SPAWN_NONBLOCK): New const.
(GPGRT_SPAWN_RUN_ASFW): New const.
(GPGRT_SPAWN_DETACHED): New const.
(gpgrt_make_pipe): New function.
(gpgrt_create_pipe): New macro.
(gpgrt_create_inbound_pipe): New macro.
(gpgrt_create_outbound_pipe): New macro.
(gpgrt_spawn_process): New function.
(gpgrt_spawn_process_fd): New function.
(gpgrt_spawn_process_detached): New function.
(gpgrt_wait_process): New function.
(gpgrt_wait_processes): New function.
(gpgrt_kill_process): New function.
(gpgrt_release_process): New function.
* src/gpg-error.def.in, src/gpg-error.vers: Add new functions.
* src/visibility.c, src/visibility.h: Add wrappers for new functions.
* src/spawn-posix.c: Rework to better fit the use in gpgrt.  Rename
all public function with a _gpgrt prefix.
* src/spawn-w32.c: Ditto.
* src/gpgrt-int.h: Likewise.
* src/Makefile.am (arch_sources): Add spawn-posix.c and spawn-w32.c.
* src/w32-add.h: Add pid_t typedef as a temporary hack.
* configure.ac: Check for signal.h and getrlimit.
(AC_FUNC_FORK): New.
--

This does build but porting the tests and further changes are
required.  Don't assume that the API for the new fucntions is stable.

Signed-off-by: Werner Koch <wk@gnupg.org>
7 months agoImport and relicense exechelp* functions from GnuPG.
Werner Koch [Wed, 29 Nov 2017 10:48:52 +0000 (11:48 +0100)]
Import and relicense exechelp* functions from GnuPG.

* src/spawn-posix.c: New.  Taken from GnuPG's exechelp-posix.c.
* src/spawn-w32.c: New.  Taken from GnuPG's exechelp-w32.c.
* src/gpgrt-int.h: Include prototypes from GnuPG's exechelp.h.
--

The original files were under (LGPL-3.0+ OR GPL-2.0+) and have
entirely been written by g10 Code employees.  Being the responsible
person at g10 Code, I endorse the license change to LGPL-2.1.

Signed-off-by: Werner Koch <wk@gnupg.org>
7 months agocore: Change new functions to return gpg_err_code_t.
Werner Koch [Tue, 28 Nov 2017 15:36:12 +0000 (16:36 +0100)]
core: Change new functions to return gpg_err_code_t.

* src/gpg-error.h.in (gpgrt_sentenv, gpgrt_mkdir, gpgrt_chdir): Change
return type to gpg_err_code_t.
* src/sysutils.c (_gpgrt_setenv): Implement that.
(_gpgrt_mkdir): Ditto.
(_gpgrt_chdir): Ditto.
* gpgscm/ffi.c (do_setenv, do_mkdir): Adjust for this change.
--

The functions are already a bit different and thus it is useful to let
them return a gpg-error style error code and don't let the user
implement that for each call.

Signed-off-by: Werner Koch <wk@gnupg.org>
7 months agogpgscm: Some adjustments for use in gpgrt.
Werner Koch [Tue, 28 Nov 2017 15:17:23 +0000 (16:17 +0100)]
gpgscm: Some adjustments for use in gpgrt.

* gpgscm/Makefile.am: Remove cruft leftover from GnuPG.  Link to the
just build libgpg-error.
* gpgscm/private.h: Include gpgrt.h and provide i18n macros.
(xfree, xtrymalloc, xtrycalloc, xtryrealloc): New macros.
(xmalloc, xstrdup): New inline functions.
* gpgscm/main.c: Remove inclusion of gcrypt.h and gpg-error.h.  Remove
all other gnupg specific headers.
(opts, parse_arguments): Temporary comment out.
(main): Adjust for use with gpgrt.  Temporary comment out some stuff.
* gpgscm/ffi-private.h: Include local gpgrt.h instead of gpg-error.h.
* gpgscm/ffi.h: Ditto.
* gpgscm/ffi.c: Remove gpg-error.h and headers from GnuPG.
(do_getenv): Use gpgrt_getenv.
(do_setenv): Use gpgrt_setenv.
(do_mkdtemp): Temporary return an error.
(unlink_recursively): Use gpgrt_bsprintf.
(do_getcwd): Use gpgrt_getcwd.
(do_mkdir): Use gpgrt_mkdir.
(do_get_isotime): Temporary return an error.
(do_get_time): Directly use time().
--

Note that this does not yet compile because the spawn functions from
GnuPG are missing.  There are two other problems as well:

 - We don't have GnuPG's isotime fucntions.  We need to see whether we
   want to support them in gpgrt.  That might be useful in libksba.

 - gpgrt_mkdtemp does not work.  We do not want to link to Libgcrypt,
   which is the way mkdtemp was written for GnuPG.  We should get a
   more straight implementation.

Signed-off-by: Werner Koch <wk@gnupg.org>
7 months agocore: New API functions gpgrt_mkdir, gpgrt_chdir, gpgrt_getcwd.
Werner Koch [Tue, 28 Nov 2017 14:39:56 +0000 (15:39 +0100)]
core: New API functions gpgrt_mkdir, gpgrt_chdir, gpgrt_getcwd.

* src/gpg-error.h.in (gpgrt_mkdir, gpgrt_chdir, gpgrt_getcwd): New.
* src/visibility.c, src/visibility.h: Add wrappers.
* src/gpg-error.vers, src/gpg-error.def.in: Add them.
* src/sysutils.c (modestr_to_mode): New.
(_gpgrt_mkdir, _gpgrt_chdir, _gpgrt_getcwd): New.
* m4/gnupg-misc.m4: New.
* m4/Makefile.am (EXTRA_DIST): Add new M4 file.
* configure.ac: Call new GNUPG_FUNC_MKDIR_TAKES_ONE_ARG.
(AC_CHECK_FUNCS): Add stat.
--

The code has been taken from GnuPG.  _gpgrt_mkdir was originally
written by me as gnupg_mkdir and here relicensed to LGPLv2.1+.
_gpgrt_getcwd was originally written by in 2007 and also here
relicensed to LGPLv2.1.  The new M4 macro was also written by me for
use in in GnuPG; it has been taken from GnUPG's acinclude.m4, moved to
its own file here, and relicensed to FSFULLR.

Signed-off-by: Werner Koch <wk@gnupg.org>
7 months agocore: Prepare to build with gpgscm.
Werner Koch [Tue, 28 Nov 2017 11:54:13 +0000 (12:54 +0100)]
core: Prepare to build with gpgscm.

* configure.ac: New option --enable-gpgscm.  Create gpgscm/Makefile.
(GPGRT_ENABLE_LOG_MACROS): Define.
* Makefile.am (SUBDIRS): Add gpgscm
* src/logging.c (_gpgrt_logv_clock): Do not use the log_debug macro.
--

Note that gpscm does not yet build.

Signed-off-by: Werner Koch <wk@gnupg.org>
7 months agocore: New API functions gpgrt_getenv and gpgrt_setenv.
Werner Koch [Tue, 28 Nov 2017 11:34:12 +0000 (12:34 +0100)]
core: New API functions gpgrt_getenv and gpgrt_setenv.

* src/gpg-error.h.in (gpgrt_getenv, gpgrt_setenv): New.
(gpgrt_unsetenv): New macro.
* src/gpg-error.vers, src/gpg-error.def.in: Add them.
* src/visibility.c (gpgrt_getenv, gpgrt_setenv): New.
* src/visibility.h: Add them.
* src/sysutils.c: Include string.h and on Windows windows.h.
(_gpgrt_getenv): New.
(_gpgrt_setenv): New.
--

These functions are wrappers to cope with Windows problems.  The code
is similar to what we have in GnuPG but not identical.

Requires better testing.

Signed-off-by: Werner Koch <wk@gnupg.org>
7 months agocore: Install new files gpgrt.m4 and gpgrt-config.
Werner Koch [Mon, 27 Nov 2017 14:40:01 +0000 (15:40 +0100)]
core: Install new files gpgrt.m4 and gpgrt-config.

* src/gpgrt.m4: New.  Bascially a copy of libgpg-error.m4
* src/gpg-error-config.in: Decide which name to print.
* src/Makefile.am (nodist_bin_SCRIPTS): Add gpgrt-config.
(m4data_DATA): Add gpgrt.m4
(EXTRA_DIST): Add gpgrt.m4.
(BUILT_SOURCES): Add gpgrt-config.
(CLEANFILES): Add gpgrt-config.
(gpgrt-config): Create from gpg-error-config.
--

These files can be used instead of gpg-error-config or gpg-error.m4.
The hope is that providing them early will ease an eventual migration
from libgpg-error to libgpgrt easier.

Signed-off-by: Werner Koch <wk@gnupg.org>
7 months agodoc: Add a comment to the Windows registry functions.
Werner Koch [Mon, 27 Nov 2017 13:48:15 +0000 (14:48 +0100)]
doc: Add a comment to the Windows registry functions.

--

7 months agocore: Avoid endless recursion if log_set_sink has not been used.
Werner Koch [Mon, 27 Nov 2017 13:47:11 +0000 (14:47 +0100)]
core: Avoid endless recursion if log_set_sink has not been used.

* src/logging.c (_gpgrt_log_set_sink): Do not call gf_is_valid if the
default sink has been requested.

Signed-off-by: Werner Koch <wk@gnupg.org>
7 months agocore: Add new macro log_assert to the API.
Werner Koch [Mon, 27 Nov 2017 12:40:23 +0000 (13:40 +0100)]
core: Add new macro log_assert to the API.

* src/gpg-error.h.in (log_assert): New macro.

Signed-off-by: Werner Koch <wk@gnupg.org>
7 months agocore: Do not use the estream_t alias in gpg-error.h.
Werner Koch [Wed, 22 Nov 2017 10:26:06 +0000 (11:26 +0100)]
core: Do not use the estream_t alias in gpg-error.h.

* src/gpg-error.h.in: Use gpgrt_stream_t in prototypes.
--

estream_t is not necessary enabled so to keep the namespace clean.

Signed-off-by: Werner Koch <wk@gnupg.org>
8 months agow32: Avoid unused code warning.
Werner Koch [Fri, 17 Nov 2017 16:34:04 +0000 (17:34 +0100)]
w32: Avoid unused code warning.

* src/w32-estream.c (_gpgrt_w32_poll) [!ENABLE_TRACING]: Do not use
waitinfo.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
8 months agow32: Add new API fucntion gpgrt_w32_reg_query_string.
Werner Koch [Fri, 17 Nov 2017 16:25:58 +0000 (17:25 +0100)]
w32: Add new API fucntion gpgrt_w32_reg_query_string.

* src/w32-reg.c: New.
* src/w32-add.h: Add gpgrt_w32_reg_query_string.
* src/visibility.c (gpgrt_w32_reg_query_string): New wrapper.
* src/gpg-error.def.in: Add gpgrt_w32_reg_query_string.
* configure.ac (ac_check_funcs): Add stpcpy.
* src/Makefile.am (arch_sources): Add w32-reg.c
(socklibs): New.
(libgpg_error_la_LIBADD): Add socklibs.
* src/gpgrt-int.h (xfree, xtrymalloc, xtrycalloc)
(xtryrealloc): New internal macros.
(_gpgrt_stpcpy, stpcpy): New replacement fucntion and macro.
* src/logging.c (_gpgrt_logv_internal): Use new registry query
function and add standard registry key.
--

This also fixes the build failure on Widnwos for logging.c.

The code for gpgrt_w32_reg_query_string has been taken from the
function read_w32_registry_string in w32-utils.c in the GPGME package.

Signed-off-by: Werner Koch <wk@gnupg.org>
8 months agocore: New API functions gpgrt_strdup and gpgrt_strconcat.
Werner Koch [Fri, 17 Nov 2017 10:26:03 +0000 (11:26 +0100)]
core: New API functions gpgrt_strdup and gpgrt_strconcat.

* src/visibility.c (gpgrt_strdup): New API fucntion.
(gpgrt_strconcat): New API fucntion.
* src/visibility.h: Add corresponding macros.
* src/gpg-error.def.in: Add them.
* src/gpg-error.vers: Add them.
* src/gpgrt-int.h (DIM): New macro.
* src/init.c (_gpgrt_strdup): New.
(_gpgrt_strconcat_core): New.
(_gpgrt_strconcat): New.
--

Signed-off-by: Werner Koch <wk@gnupg.org>
8 months agocore: New API functions gpgrt_malloc, gpgrt_calloc, and gpgrt_realloc.
Werner Koch [Fri, 17 Nov 2017 10:00:39 +0000 (11:00 +0100)]
core: New API functions gpgrt_malloc, gpgrt_calloc, and gpgrt_realloc.

* src/visibility.c (gpgrt_realloc): New API function.
(gpgrt_malloc): New API function.
(gpgrt_calloc): New API function.
* src/visibility.h: Add corresponding macros.
* src/gpg-error.def.in: Add them.
* src/gpg-error.vers: Add them.
* src/init.c (_gpgrt_calloc): New.
* src/gpg-error.h.in: Add prototypes.

Signed-off-by: Werner Koch <wk@gnupg.org>
8 months agocore: Add logging API.
Werner Koch [Fri, 17 Nov 2017 08:37:54 +0000 (09:37 +0100)]
core: Add logging API.

* src/visibility.c (gpgrt_get_errorcount): New API.
(gpgrt_inc_errorcount): New API.
(gpgrt_log_set_sink): New API.
(gpgrt_log_set_socket_dir_cb): New API.
(gpgrt_log_set_pid_suffix_cb): New API.
(gpgrt_log_set_prefix): New API.
(gpgrt_log_get_prefix): New API.
(gpgrt_log_test_fd): New API.
(gpgrt_log_get_fd): New API.
(gpgrt_log_get_stream): New API.
(gpgrt_log): New API.
(gpgrt_logv): New API.
(gpgrt_logv_prefix): New API.
(gpgrt_log_string): New API.
(gpgrt_log_info): New API.
(gpgrt_log_error): New API.
(gpgrt_log_fatal): New API.
(gpgrt_log_bug): New API.
(gpgrt_log_debug): New API.
(gpgrt_log_debug_string): New API.
(gpgrt_log_printf): New API.
(gpgrt_log_flush): New API.
(gpgrt_log_printhex): New API.
(gpgrt_log_clock): New API.
(_gpgrt_log_assert): New function for the ABI.
* src/visibility.h: Add corresponding macros.
* src/gpg-error.def.in: Add new functions.
* src/gpg-error.vers: Add new functions.
* src/gpg-error.h.in (GPGRT_LOG_WITH_PREFIX): New constant.
(GPGRT_LOG_WITH_TIME): New constant.
(GPGRT_LOG_WITH_PID): New constant.
(GPGRT_LOG_RUN_DETACHED): New constant.
(GPGRT_LOG_NO_REGISTRY): New constant.
(GPGRT_LOG_BEGIN): New enum value.
(GPGRT_LOG_CONT): New enum value.
(GPGRT_LOG_INFO): New enum value.
(GPGRT_LOG_WARN): New enum value.
(GPGRT_LOG_ERROR): New enum value.
(GPGRT_LOG_FATAL): New enum value.
(GPGRT_LOG_BUG): New enum value.
(GPGRT_LOG_DEBUG): New enum value.
(log_get_errorcount, log_inc_errorcount, log_set_file, log_set_fd)
(log_set_stream, log_set_socket_dir_cb, log_set_pid_suffix_cb)
(log_set_prefix, log_get_prefix, log_test_fd, log_get_fd)
(log_get_stream, log_log, log_logv, log_logv_prefix, log_string)
(log_bug, log_fatal, log_error, log_info, log_debug, log_debug_string)
(log_printf, log_printhex, log_clock)
(log_flush) [GPGRT_ENABLE_LOG_MACROS]: New wrapper macros.
(gpgrt_assert): New macro.
* src/gpgrt-int.h: Add prototypes for logging.c.
(gpgrt_assert): Redefine for internal use.
* src/logging.h: Remove.
* src/logging.c: Include gpgrt-int.h instead of the stuff from GnuPG.
Use _gpgrt malloc funcsions and the internal versions of the estream
functions.  Rename all public fucntions with a _gpgrt_ prefix.
(print_prefix): Return the printed length.
(_gpgrt_logv_internal): Ditto.
(_gpgrt_log_printhex): Change order of args and turn into a printf
like function.
(_gpgrt_logv_printhex): New. Take the core of the former
log_printhex.
(_gpgrt_log_clock): Turn into a printf like functions.
(_gpgrt_logv_clock): New.  Take the core of the former log_clock.
--

This logging API is a slightly modified version of what we are using
in GnuPG.

Signed-off-by: Werner Koch <wk@gnupg.org>
8 months agoNew configure options and macros for internal use.
Werner Koch [Fri, 17 Nov 2017 08:18:13 +0000 (09:18 +0100)]
New configure options and macros for internal use.

* configure.ac: Add option --enable-log-clock.
* configure.ac: Add option --enable-werror.
* src/sysutils.c: New.
* src/Makefile.am (libgpg_error_la_SOURCES): Add sysutils.c
* src/gpgrt-int.h: Add internal i18n macros and hacks to make working
with sockets easier.
(es_stdin, es_stdout, es_stderr): New internal macros.
(snprintf): New macro.

Signed-off-by: Werner Koch <wk@gnupg.org>
9 months agocore: Change license of logging.[ch] to LGPLv2.1
Werner Koch [Thu, 5 Oct 2017 18:56:06 +0000 (20:56 +0200)]
core: Change license of logging.[ch] to LGPLv2.1

--

This file has a long history.  I was first written by me in 1998 for
GnuPG under the name logger.c.  In 2010 it was renamed to
logging.c. Almost everything was written by me.  A few minor fixes are
from g10 Code employees and some other people.

Signed-off-by: Werner Koch <wk@gnupg.org>
9 months agocore: Import of logging.[ch] from GnuPG
Werner Koch [Thu, 5 Oct 2017 18:34:03 +0000 (20:34 +0200)]
core: Import of logging.[ch] from GnuPG

--

Taken from GnuPG master
commit 98c260e057e7829580da99f0c8e0037a3896bfae

Signed-off-by: Werner Koch <wk@gnupg.org>
9 months agogpgscm: Add required configure checks.
Werner Koch [Thu, 5 Oct 2017 16:38:21 +0000 (18:38 +0200)]
gpgscm: Add required configure checks.

* configure.ac: Add new checks.
* m4/readline.m4: New.  Taken from gnupg.
* m4/Makefile.am (EXTRA_DIST): Add it.

Signed-off-by: Werner Koch <wk@gnupg.org>
9 months agogpgscm: Change license from GPLv3+ to LGPLv2.1+
Werner Koch [Thu, 5 Oct 2017 16:10:39 +0000 (18:10 +0200)]
gpgscm: Change license from GPLv3+ to LGPLv2.1+

--

All changes to TinySCHEME were done by employees of g10 Code GmbH and
some minor things by a contractor.

Signed-off-by: Werner Koch <wk@gnupg.org>
9 months agogpgscm: Import gpgscm subdir from the gnupg repo
Werner Koch [Thu, 5 Oct 2017 15:29:28 +0000 (17:29 +0200)]
gpgscm: Import gpgscm subdir from the gnupg repo

--

The gpgscm directory has been filtered out from GnuPG master at
commit 98c260e057e7829580da99f0c8e0037a3896bfae

9 months agogpgscm: Move files to a gpgscm subdirectory.
Werner Koch [Thu, 5 Oct 2017 15:27:09 +0000 (17:27 +0200)]
gpgscm: Move files to a gpgscm subdirectory.

--

Note that we used

  git filter-branch --subdirectory-filter tests/gpgscm

in gnupg master to filter out the gpgscm part.  This commit merely
moves these files to a subdirectory which will be used in libgpg-error
for gpgscm.

Signed-off-by: Werner Koch <wk@gnupg.org>
10 months agogpgscm: Fix -Wimplicit-fallthrough warnings.
Justus Winter [Mon, 21 Aug 2017 12:49:29 +0000 (14:49 +0200)]
gpgscm: Fix -Wimplicit-fallthrough warnings.

* tests/gpgscm/scheme.c (CASE): Rearrange so that the case statement
is at the front.
(Eval_Cycle): Improve fallthrough annotations.

Signed-off-by: Justus Winter <justus@g10code.com>
11 months agobuild: New configure option --enable-all-tests.
Werner Koch [Tue, 8 Aug 2017 15:28:25 +0000 (17:28 +0200)]
build: New configure option --enable-all-tests.

* configure.ac: New option --enable-all-tests.
* tests/gpgscm/ffi.c (ffi_init): New gloabl var *run-all-tests*.
* tests/openpgp/all-tests.scm (all-tests): Use that var instead
of *maintainer-mode*.
* Makefile.am (AM_DISTCHECK_CONFIGURE_FLAGS): Add --enable-all-tests.
--

It is better to have a separate option to run all tests than to put
this on top of --enable-maintainer-mode.  This way we can also make
sure to run all tests during "make distcheck".

Signed-off-by: Werner Koch <wk@gnupg.org>
11 months agogpgscm: Make the test summary stand out
Werner Koch [Tue, 8 Aug 2017 11:47:00 +0000 (13:47 +0200)]
gpgscm: Make the test summary stand out

* tests/gpgscm/tests.scm (test-pool): Add delimiter lines.
--

This is to make those summaries a bit more simlar to those from
automake.

Signed-off-by: Werner Koch <wk@gnupg.org>
11 months agotests: Do not run all tests unless in maintainer mode.
Justus Winter [Mon, 7 Aug 2017 09:15:56 +0000 (11:15 +0200)]
tests: Do not run all tests unless in maintainer mode.

* configure.ac: Leak the maintainer mode flag into 'config.h'.
* tests/gpgscm/ffi.c: Pass it into the scheme environment.
* tests/openpgp/all-tests.scm: Only run tests against non-default
configurations (keyring, extended-key-format) in maintainer mode.
--

Werner is concerned that the tests do take up too much time and asked
me to reduce the runtime of the tests for normal users.

Signed-off-by: Justus Winter <justus@g10code.com>
12 months agogpgscm,w32: Fix testing for absolute paths.
Justus Winter [Tue, 18 Jul 2017 14:15:45 +0000 (16:15 +0200)]
gpgscm,w32: Fix testing for absolute paths.

* tests/gpgscm/main.c (path_absolute_p): New function.
(load): Use new function.

Signed-off-by: Justus Winter <justus@g10code.com>
12 months agogpgscm: Library improvements.
Justus Winter [Fri, 14 Jul 2017 10:57:41 +0000 (12:57 +0200)]
gpgscm: Library improvements.

* tests/gpgscm/repl.scm (prompt-yes-no?): New function.
* tests/gpgscm/tests.scm (pathsep-split): Likewise.
(pathsep-join): Likewise.
(with-path): Use the new function.

Signed-off-by: Justus Winter <justus@g10code.com>