gnupg/common
Werner Koch 9a3e41c151
common: Improve lock strategy for dotlock.
* common/dotlock.c (next_wait_interval): New.
(dotlock_take_unix): Use new function.
(dotlock_take_w32): Ditto.
--

In particular when using a dotlock file for protecting the spawning
and several processes try to spawn the agent or another component, we
often run into long delays.  The solution is to is to exponential
backoff and also to reduce the initial delay from 50ms to 4ms.  We
further limit the maximum wait period to about 2 seconds and then
repeat at intervals of 512, 1024 and 2048ms.  In the wait-forever case
we add a small random value to have different intervals per process.

GnuPG-bug-id: 3380

For testing this code snippet in the spawning function might be
useful:

          const char *s;
          if ((s=getenv("hold_gpg_file")))
            while (!gnupg_access (s, F_OK))
              gnupg_sleep (1);
2023-10-02 14:45:19 +02:00
..
ChangeLog-2011 Fix typos 2015-10-28 10:20:17 +01:00
ChangeLog-2011.include Spelling fixes in docs and comments. 2017-04-28 10:06:33 +09:00
ChangeLog.jnlib common: Remove JNLIB from boiler plate (jnlib merge). 2015-04-24 16:42:28 +02:00
Makefile.am common: Add new function b64decode. 2023-10-02 13:03:03 +02:00
README common: Update README. 2016-03-02 14:27:30 +01:00
agent-opt.c agent: New OPTION pretend-request-origin 2018-03-23 08:37:14 +01:00
all-tests.scm tests: More fix for semihosted environment. 2022-12-01 17:09:45 +09:00
asshelp.c common: Remove Windows CE support in common. 2022-11-16 10:05:37 +09:00
asshelp.h Use only one copy of the warn_server_mismatch function. 2020-09-01 20:43:57 +02:00
asshelp2.c sm: Print diagnostic about CRL problems due to Tor mode. 2022-04-11 17:57:14 +02:00
audit.c dirmngr: Distinguish between "no crl" and "crl not trusted". 2023-03-09 18:28:39 +01:00
audit.h headers: fix spelling 2018-10-25 16:53:05 -04:00
b64dec.c common: Add new function b64decode. 2023-10-02 13:03:03 +02:00
b64enc.c common: Add new function b64decode. 2023-10-02 13:03:03 +02:00
call-gpg.c agent,gpg,tools: Fix use of log_get_fd. 2022-06-22 13:34:06 +09:00
call-gpg.h Change all http://www.gnu.org in license notices to https:// 2016-11-05 12:02:19 +01:00
ccparray.c Change all http://www.gnu.org in license notices to https:// 2016-11-05 12:02:19 +01:00
ccparray.h Change all http://www.gnu.org in license notices to https:// 2016-11-05 12:02:19 +01:00
common-defs.h common: Remove Windows CE support in common. 2022-11-16 10:05:37 +09:00
comopt.c common: Change allocation of the comopt symbol. 2023-04-04 16:51:58 +02:00
comopt.h common: Change allocation of the comopt symbol. 2023-04-04 16:51:58 +02:00
compliance.c gpg: Replace --override-compliance-check by a real fix. 2023-01-20 11:03:40 +01:00
compliance.h sm: Fix compliance checking for ECC signature verification. 2023-01-12 20:52:27 +01:00
convert.c dirmngr: New option --ignore-cert 2021-10-06 10:35:51 +02:00
dotlock.c common: Improve lock strategy for dotlock. 2023-10-02 14:45:19 +02:00
dotlock.h Clarify text of LGPLv2+/GPLv2+ licensed files. 2017-02-24 13:48:28 +01:00
dynload.h common,w32: Use LoadLibraryEx to fix a warning in mingw. 2022-06-03 11:11:28 +02:00
exaudit.awk Nuked almost all trailing white space. 2011-02-04 12:57:53 +01:00
exechelp-posix.c common: Remove Windows CE support in common. 2022-11-16 10:05:37 +09:00
exechelp-w32.c common: Remove Windows CE support in common. 2022-11-16 10:05:37 +09:00
exechelp.h agent,common,dirmngr,tests,tools: Remove spawn PREEXEC argument. 2022-10-20 14:19:19 +09:00
exectool.c agent,common,dirmngr,tests,tools: Remove spawn PREEXEC argument. 2022-10-20 14:19:19 +09:00
exectool.h Spelling cleanup. 2020-02-18 18:07:46 -05:00
exstatus.awk Nuked almost all trailing white space. 2011-02-04 12:57:53 +01:00
fwddecl.h Change all http://www.gnu.org in license notices to https:// 2016-11-05 12:02:19 +01:00
gc-opt-flags.h gpgconf: Further simplify the gpgconf option processing. 2020-03-14 19:12:41 +01:00
get-passphrase.c Change all http://www.gnu.org in license notices to https:// 2016-11-05 12:02:19 +01:00
get-passphrase.h Change all http://www.gnu.org in license notices to https:// 2016-11-05 12:02:19 +01:00
gettime.c common: Remove Windows CE support in common. 2022-11-16 10:05:37 +09:00
gettime.h sm: Fix use of value NONE in gnupg_isotime_t type. 2022-02-18 11:11:12 +09:00
gnupg.ico w32: Add icons and version information. 2013-05-07 21:35:48 +02:00
gpgrlhelp.c Support a history file in gpg-card and gpg-connect-agent. 2020-07-02 15:48:55 +02:00
helpfile.c Replace most of the remaining stdio calls by estream calls. 2020-10-20 12:15:56 +02:00
homedir.c Use keyboxd on a fresh install also on Windows. 2023-04-19 11:05:42 +02:00
host2net.h Change all http://www.gnu.org in license notices to https:// 2016-11-05 12:02:19 +01:00
i18n.c common: Respect gpgconf.ctl when looking up translations 2021-10-06 13:42:50 +02:00
i18n.h Fix typos found using codespell. 2015-11-17 12:50:22 +01:00
init.c w32: Make sure DEP is enabled. 2023-01-11 11:33:26 +01:00
init.h common: Fix for GPG_ERR_SOURCE_DEFAULT check. 2022-09-14 16:59:56 +09:00
iobuf.c common,w32: Add missing GetLastError->errno mapping. 2023-07-04 09:19:05 +02:00
iobuf.h gpg: Make progress work for large files on Windows. 2023-06-13 10:07:07 +02:00
isascii.c common: Change license of isascii.c to all-premissive, 2015-12-14 16:21:19 +01:00
ksba-io-support.c gpgsm: Print PROGRESS status lines. 2023-06-15 10:37:07 +02:00
ksba-io-support.h gpgsm: Print PROGRESS status lines. 2023-06-15 10:37:07 +02:00
localename.c common: Fix warning for portability. 2017-03-07 10:42:46 +09:00
logging.h Require libgpg-error 1.29 and remove internal logging functions. 2018-06-12 13:46:00 +02:00
mapstrings.c common: Fix translations in --help for gpgrt < 1.47 2022-12-16 17:29:12 +01:00
mbox-util.c common: Add gnupg_memstr to replace static versions. 2023-09-26 14:17:37 +02:00
mbox-util.h common: Prepare for parsing mail sub-addresses. 2018-11-12 07:44:33 +01:00
membuf.c common: Add set_membuf_err. 2021-12-20 19:34:34 +01:00
membuf.h common: Add set_membuf_err. 2021-12-20 19:34:34 +01:00
miscellaneous.c common: Detect PNG and JPEG file formats. 2023-01-19 11:27:25 +01:00
mischelp.c w32: Allow Unicode filenames for iobuf_cancel. 2022-06-03 10:54:35 +02:00
mischelp.h common/mischelp: use platform memory zeroing function for wipememory 2018-12-01 13:43:09 +02:00
mkdir_p.c Replace all calls to stat by gnupg_stat. 2020-10-20 16:38:06 +02:00
mkdir_p.h Change all http://www.gnu.org in license notices to https:// 2016-11-05 12:02:19 +01:00
mkerrors all: fix more spelling errors 2018-10-25 16:53:05 -04:00
mkerrtok all: fix more spelling errors 2018-10-25 16:53:05 -04:00
mkstrtable.awk common: Fix AWK portability. 2019-04-16 13:24:10 +09:00
name-value.c dirmngr: Extend the AD_QUERY command. 2023-06-07 10:03:48 +02:00
name-value.h common: New function nve_set 2023-05-26 11:56:36 +02:00
openpgp-fpr.c gpg: Partial fix for Unicode problem in output files. 2021-05-25 13:39:59 +02:00
openpgp-oid.c gpg: Curvenames may now compared case insensitive. 2023-04-12 17:10:08 +02:00
openpgp-s2k.c Fix a reference in comment. 2019-07-12 12:11:26 +09:00
openpgpdefs.h common: New module to compute openpgp fingerprints 2021-04-16 12:49:37 +02:00
percent.c Spelling cleanup. 2020-02-18 18:07:46 -05:00
pkscreening.c gpg,sm: New option --with-key-screening. 2017-10-17 21:10:19 +02:00
pkscreening.h gpg,sm: New option --with-key-screening. 2017-10-17 21:10:19 +02:00
recsel.c common: Add gnupg_memstr to replace static versions. 2023-09-26 14:17:37 +02:00
recsel.h Change all http://www.gnu.org in license notices to https:// 2016-11-05 12:02:19 +01:00
server-help.c common: New functions get_option_value and ascii_strupr. 2019-02-08 11:13:33 +01:00
server-help.h common: New functions get_option_value and ascii_strupr. 2019-02-08 11:13:33 +01:00
session-env.c common: Pass XDG_SESSION_TYPE and QT_QPA_PLATFORM envvars to pinentry 2021-08-02 17:19:45 +02:00
session-env.h Change all http://www.gnu.org in license notices to https:// 2016-11-05 12:02:19 +01:00
sexp-parse.h headers: fix spelling 2018-10-25 16:53:05 -04:00
sexputil.c common: Fix parsing ECC key. 2023-05-01 11:38:20 +09:00
shareddefs.h agent: New OPTION pretend-request-origin 2018-03-23 08:37:14 +01:00
signal.c gpg,common,scd,sm: Function prototype fixes for modern compiler. 2022-09-13 16:34:00 +09:00
simple-pwquery.c all: fix spelling and typos 2018-10-24 15:56:18 -04:00
simple-pwquery.h Spelling fixes in docs and comments. 2017-04-28 10:06:33 +09:00
ssh-utils.c common: Fix to determine ECC curve for SSH. 2022-09-06 13:43:03 +09:00
ssh-utils.h scd: Let READKEY support --format=ssh option. 2022-03-02 14:07:46 +09:00
status.c dirmngr: Distinguish between "no crl" and "crl not trusted". 2023-03-09 18:28:39 +01:00
status.h gpg: New option --assert-signer. 2023-04-05 21:32:23 +02:00
stringhelp.c common: Add gnupg_memstr to replace static versions. 2023-09-26 14:17:37 +02:00
stringhelp.h common: Add gnupg_memstr to replace static versions. 2023-09-26 14:17:37 +02:00
strlist.c Clarify text of LGPLv2+/GPLv2+ licensed files. 2017-02-24 13:48:28 +01:00
strlist.h Clarify text of LGPLv2+/GPLv2+ licensed files. 2017-02-24 13:48:28 +01:00
sysutils.c common: Never remove /dev/null. 2023-09-07 17:21:05 +02:00
sysutils.h common,w32: Add missing GetLastError->errno mapping. 2023-07-04 09:19:05 +02:00
t-b64.c common: Add new function b64decode. 2023-10-02 13:03:03 +02:00
t-ccparray.c Change all http://www.gnu.org in license notices to https:// 2016-11-05 12:02:19 +01:00
t-convert.c common: New function hex2fixedbuf. 2019-10-01 10:32:31 +02:00
t-dotlock.c Remove remaining support for WindowsCE 2022-06-03 10:08:21 +02:00
t-exechelp.c all: fix spelling and typos 2018-10-24 15:56:18 -04:00
t-exectool.c Replace all calls to access by gnupg_access 2020-10-20 12:15:55 +02:00
t-gettime.c tests: Fix t-gettime for a time_t of 64 and a long of 32 bit. 2017-01-12 10:39:19 +01:00
t-helpfile.c Change all http://www.gnu.org in license notices to https:// 2016-11-05 12:02:19 +01:00
t-iobuf.c Replace use of variable-length-arrays. 2017-01-02 13:29:18 +01:00
t-mapstrings.c common: New function map_static_strings 2022-03-18 14:14:39 +01:00
t-mbox-util.c tests: Add two user-id parsing test cases. 2019-09-17 16:19:28 +02:00
t-name-value.c Spelling cleanup. 2020-02-18 18:07:46 -05:00
t-openpgp-oid.c Spelling cleanup. 2020-02-18 18:07:46 -05:00
t-percent.c Spelling cleanup. 2020-02-18 18:07:46 -05:00
t-recsel.c common: Fix t-recsel. 2022-09-14 15:42:03 +09:00
t-session-env.c w32: Exclude tests with HOME. 2022-04-06 13:28:15 +09:00
t-sexputil.c tests: Cope with broken Libgcrypt versions 2021-06-22 12:30:46 +02:00
t-ssh-utils.c tests: Fix warning in common/t-ssh-utils.c 2022-04-14 10:14:51 +02:00
t-stringhelp.c Remove remaining support for WindowsCE 2022-06-03 10:08:21 +02:00
t-strlist.c Clarify text of LGPLv2+/GPLv2+ licensed files. 2017-02-24 13:48:28 +01:00
t-support.c Clarify text of LGPLv2+/GPLv2+ licensed files. 2017-02-24 13:48:28 +01:00
t-support.h Clarify text of LGPLv2+/GPLv2+ licensed files. 2017-02-24 13:48:28 +01:00
t-sysutils.c Remove remaining support for WindowsCE 2022-06-03 10:08:21 +02:00
t-timestuff.c Clarify text of LGPLv2+/GPLv2+ licensed files. 2017-02-24 13:48:28 +01:00
t-w32-cmdline.c common,w32: Implement globing of command line args. 2021-03-04 16:59:21 +01:00
t-w32-reg.c gpgconf: Improve registry dumping. 2022-08-02 14:35:38 +02:00
t-zb32.c Change all http://www.gnu.org in license notices to https:// 2016-11-05 12:02:19 +01:00
tlv-builder.c agent: Avoid memory leaks in error code paths. 2021-05-20 13:38:07 +02:00
tlv.c sm: Remove duplicated code. 2023-06-28 17:34:19 +02:00
tlv.h common: Add an easy to use DER builder. 2020-04-24 15:37:48 +02:00
ttyio.c w32: Add fallback in case the Windows console can't cope with Unicode. 2021-06-22 11:12:28 +02:00
ttyio.h Support a history file in gpg-card and gpg-connect-agent. 2020-07-02 15:48:55 +02:00
types.h build: Use modern Autoconf check for types. 2020-11-18 13:36:30 +09:00
userids.c kbx: Fix keyboxd searching with multiple patterns. 2021-07-08 13:57:13 +02:00
userids.h Change all http://www.gnu.org in license notices to https:// 2016-11-05 12:02:19 +01:00
utf8conv.c gpg,common,scd,sm: Function prototype fixes for modern compiler. 2022-09-13 16:34:00 +09:00
utf8conv.h Clarify text of LGPLv2+/GPLv2+ licensed files. 2017-02-24 13:48:28 +01:00
util.h common: Add new function b64decode. 2023-10-02 13:03:03 +02:00
utilproto.h Change all http://www.gnu.org in license notices to https:// 2016-11-05 12:02:19 +01:00
w32-cmdline.c common: Rename w32-misc.c to w32-cmdline.c 2021-03-04 17:14:02 +01:00
w32-reg.c gpgconf: Improve registry dumping. 2022-08-02 14:35:38 +02:00
w32help.h gpgconf: Improve registry dumping. 2022-08-02 14:35:38 +02:00
w32info-rc.h.in doc: Update copyright notices. 2023-01-20 09:07:20 +01:00
xasprintf.c Change all http://www.gnu.org in license notices to https:// 2016-11-05 12:02:19 +01:00
xreadline.c Change all http://www.gnu.org in license notices to https:// 2016-11-05 12:02:19 +01:00
yesno.c Clean up word replication. 2017-02-21 13:11:46 -05:00
zb32.c Change all http://www.gnu.org in license notices to https:// 2016-11-05 12:02:19 +01:00
zb32.h Change all http://www.gnu.org in license notices to https:// 2016-11-05 12:02:19 +01:00

README

Common functionality used by all modules of GnuPG.