aboutsummaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* estream: Skip the read-only stream when IN_ATEXIT is true.HEADmasterNIIBE Yutaka3 days1-1/+4
| | | | | | | | | * src/estream.c (_gpgrt_fflush): Skip the read-only stream. -- GnuPG-bug-id: 8518 Signed-off-by: NIIBE Yutaka <[email protected]>
* Fix gpgrt_ftrylockfile.NIIBE Yutaka3 days1-1/+1
| | | | | | | | | * src/estream.c (trylock_stream): Return 0 on success, -1 on error. -- GnuPG-bug-id: 8519 Signed-off-by: NIIBE Yutaka <[email protected]>
* GPGRT_HAVE_PRAGMA_GCC_PUSH now also covers diagnostic push.Werner Koch2026-09-141-2/+3
| | | | | | | | | * src/gpg-error.h.in: Redefine GPGRT_HAVE_PRAGMA_GCC_PUSH -- The old definition only covered push_option which is available since gcc 4.4 (released 2009). The new definition also covers the diagnostic push pragma which was introduced with 4.6 (released 2011).
* doc: some comment updatesWerner Koch2026-07-101-0/+4
| | | | --
* w32: New function gpgrt_w32_set_errno.Werner Koch2026-06-247-3/+33
| | | | | | | | | | | | | | * src/visibility.c (gpgrt_w32_set_errno): New. * src/w32-add.h: Add function. * src/gpg-error.def.in: Ditto. * src/estream.c (_gpgrt_w32_set_errno): Return the windows error code. * src/gpg-error.c (main): Add CMD_MAPW32ERR with name "mapw32err" and implement it. -- We use various mappings from Windows Error codes to ERRNO and thus to gpg-error. it is better to eventuially have one central place for such mappings.
* build: No use of awk with gen-lock-obj.sh.NIIBE Yutaka2026-06-231-15/+10
| | | | | | | | | | | | * configure.ac: For invocation of gen-lock-obj.sh, use NM instead of OBJDUMP, use no AWK. * src/gen-lock-obj.sh: Use NM with option -P and -t d for portable output in decimal. No use of AWK, simply use cut. -- Signed-off-by: Alexis LothorĂ© <[email protected]> Signed-off-by: NIIBE Yutaka <[email protected]>
* Revert "Fix possible lockup in an atexit handler"Werner Koch2026-05-031-12/+15
| | | | | | | | | | | * src/estream.c (_gpgrt_fflush): Do not use the in_atexit flag. -- We need to research how we can better handle atexit handlers and stream locking; in particilar for stdout and stderr. For now we keep the code but disable it. Fixes-commit: 50f0c56bdd36f7f709a62503942ac55399dafb9c
* Fix possible lockup in an atexit handlerWerner Koch2026-04-305-9/+24
| | | | | | | | | | | * src/estream.c (_gpgrt_fflush): Add arg in_atexit and skip the flush in this mode if the lock can not be taken. Change all callers. -- The problem should up with gpgsm encryption on the standard mode and a no public key error. In this case the process got stuck in the atexit handler after a FAILURE gpgsm-exit status line to stderr. It is better not to have a hanging process than having flushed everything.
* Fix possible stack overflow in es_printf for %.100f format.Werner Koch2026-04-292-3/+27
| | | | | | | | | | | | | | | | * configure.ac: Add test for snprintf. * src/gpgrt-int.h: Do not re-map snprintf if KEEP_SYSTEM_SNPRINTF is defined. * src/estream-printf.c (KEEP_SYSTEM_SNPRINTF): Define. (pr_float): Increase static buffer size. Use snprintf for long double. * tests/t-printf.c: Include float.h. (check_large_float): New. -- GnuPG-bug-id: 8240 Reported-by: Dirk Mueller <[email protected]> (AI)
* Fix out-of-bounds read in vfnameconcat.Werner Koch2026-04-281-3/+4
| | | | | | | | * src/stringutils.c (_gpgrt_vfnameconcat): Use the correct value for the trailing slash check. -- Reported-by: Dirk Mueller <[email protected]> (AI)
* build:cross: Remove section name to dump.NIIBE Yutaka2026-04-141-1/+1
| | | | | | | | | | * src/gen-lock-obj.sh: Don't specify section name. -- It may be .bss.mtx depending to a toolchain. Signed-off-by: NIIBE Yutaka <[email protected]>
* spawn:w32: Fix use-after-scope of handle array.Mikhail Filippov2026-03-171-1/+1
| | | | | | * src/spawn-w32.c (_gpgrt_process_spawn): Move the hd[32] array declaration from inside the inner block to the function scope, so that the array remains live when CreateProcessW is called.
* build: Revert pkg-config requirement.Sachin T2026-03-041-1/+1
| | | | | | | | | * configure.ac: Don't use PKG_CHECK_MODULES. * src/Makefile.am (mkheader): Remove EXTRA_LIBS_FOR_BUILD. -- Signed-off-by: Sachin T <[email protected]>
* New error codes for algorithm complianceWerner Koch2026-03-021-2/+4
| | | | | | | -- This will help to implement GnuPG-bug-id: 6644
* w32:estream: Use INVALID_SOCKET to check invalid socket.NIIBE Yutaka2026-02-261-4/+5
| | | | | | | | | | | | | * src/estream.c (IS_INVALID_SOCKET): New. (func_sock_read, func_sock_write, func_sock_ioctl, func_sock_destroy): Use IS_INVALID_SOCKET. -- It is possible for some architectures that the value of extended -1 and ~0 is different in C. Better to avoid the issue in advance. Signed-off-by: NIIBE Yutaka <[email protected]>
* Release 1.59libgpg-error-1.59gpgrt-1.59Werner Koch2026-02-183-3/+3
|
* spawn:w32: Fix with GPGRT_PROCESS_*_KEEP flags.NIIBE Yutaka2026-02-041-9/+18
| | | | | | | | | | * src/spawn-w32.c (_gpgrt_process_spawn): Don't close the handle when GPGRT_PROCESS_*_KEEP is specified. -- GnuPG-bug-id: 8052 Signed-off-by: NIIBE Yutaka <[email protected]>
* spawn:w32: Fix preparing the environment block.NIIBE Yutaka2026-02-041-3/+7
| | | | | | | | | | | | * src/spawn-w32.c (prepare_env_block): Copy environment variables correctly by memmove. -- With "export GNUPGHOME=something", t-spawn.exe failed before the fix. GnuPG-bug-id: 8052 Signed-off-by: NIIBE Yutaka <[email protected]>
* spawn:posix: Take care of POSIX semaphore "shared" semantics.NIIBE Yutaka2026-02-031-2/+4
| | | | | | | | | | | | | | * src/spawn-posix.c (spawn_detached): Don't call _gpgrt_post_syscall on the child process. (_gpgrt_process_spawn): Likewise. -- On NetBSD, a POSIX semaphore is somehow shared among processes, even if sem_init is called with PSHARED=0. GnuPG-bug-id: 8065 Signed-off-by: NIIBE Yutaka <[email protected]>
* w32:spawn: Handle the case where ->hProcess has invalid handle.NIIBE Yutaka2026-01-071-1/+5
| | | | | | | | | * src/spawn-w32.c (_gpgrt_process_terminat): Care about the case it's INVALID_HANDLE_VALUE. -- Signed-off-by: NIIBE Yutaka <[email protected]>
* w32: Fix a syntax error in a non-DLL buildWerner Koch2025-12-121-1/+1
| | | | * src/w32-utils.c (_gpgrt_w32__init_utils): Fix syntax error.
* argparse: gpgrt_fconcat to get the SYSCONFDIR.Werner Koch2025-12-093-2/+21
| | | | | | | | | | | * src/stringutils.c (_gpgrt_fconcat): New internal function. * src/argparse.c (_gpgrt_argparser): Use it. -- This fixes the conf files default also for Windows. Updates-commmit: a9fc729253eec88f56d810bd2a8edd327267c5b4 GnuPG-bug-id: 7894
* New function gpgrt_fconcat.Werner Koch2025-12-0912-28/+335
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * src/w32-utils.c: New. * src/init.c (_gpg_err_init, DllMain): Call new init function. * src/visibility.c (gpgrt_fconcat): New. * src/gpg-error.h.in (gpgrt_fconcat): New prototype. (GPGRT_FCONCAT_ABS): New. (GPGRT_FCONCAT_TILDE): New. (GPGRT_FCONCAT_SYSCONF): New. * src/gpg-error.def.in (gpgrt_fconcat): New. * src/gpg-error.vers: (gpgrt_fconcat): New. * src/stringutils.c (_gpgrt_vfnameconcat): Repalce want-abs but a new flags arg. Change to support GPGRT_FCONCAT_SYSCONF. Fix tilde expansion under Windows to use CISDL_PROFILE instead of $HOME. Adjust all callers. * src/gpg-error.c (main): New command "fconcat". -- This function allows to get the sysconfig directory in a portable way. On Windows this is CISDL_COMMON_APPDATA\GNU\etc. On Unix this is the directory specified at the configure run. This patch also changes the behaviour of tilde expansion in Windows which was not well defined. It does now use CISDL_PROFILE instead of the HOME envvar which is uncommon under Windows. Note that under Windows "~user/foo" is still not defined. Tilde expansion is not done when GPGRT_FCONCAT_SYSCONF is used. GnuPG-bug-id: 7894
* Dynload GetThreadUILanguage to keep support for Windows XPWerner Koch2025-11-261-2/+13
| | | | | | * src/w32-gettext.c (get_thread_ui_language): New func ptr. (module_init): Initialize it. (my_nl_locale_name): Use it instead of a direct call.
* Use UI language instead of locale for translationsIngo Klöcker2025-11-261-2/+2
| | | | | | | | | | | | | | | * src/w32-gettext.c (my_nl_locale_name): Use GetThreadUILanguage instead of GetThreadLocale. -- This ensures that the user configured display language is used even if the regional format (which is meant for dates and times) is set to another locale. GetThreadUILanguage is available since Windows Vista and Windows Server 2008. GnuPG-bug-id: 7874
* spawn:posix: Rename the field to ENVP to avoid a build issue.NIIBE Yutaka2025-11-191-4/+4
| | | | | | | | | | | * src/spawn-posix.c (struct gpgrt_spawn_actions): Rename the field to ENVP. (my_exec, _gpgrt_spawn_actions_set_environ): Follow the change. -- Signed-off-by: Sachin T <[email protected]> Co-authored-by: NIIBE Yutaka <[email protected]>
* argparse: Use SYSCONFDIR for /etc.NIIBE Yutaka2025-11-192-2/+3
| | | | | | | | | | * src/Makefile.am (libgpg_error_la_CPPFLAGS): Add SYSCONFDIR. * src/argparse.c (_gpgrt_argparser): Use it. -- GnuPG-bug-id: 7894 Signed-off-by: NIIBE Yutaka <[email protected]>
* estream: Implictly enable sysopen when the the share flag is given.Werner Koch2025-10-071-9/+7
| | | | | | | | * src/estream.c (parse_mode): Fix parsing of "share". Set sysopen flag. -- Updates-commit: 0b170a499a87abc4a18b6f7d76beb44901fa0cdd
* estream: Extend the new share keyword to allow all modes.Werner Koch2025-10-072-15/+42
| | | | | | | | | | | | | * src/estream.c (X_SHARE_RW): Replace by ... (X_SHARE_CUSTOM,X_SHARE_READ,X_SHARE_WRITE,X_SHARE_DEL): new. (func_file_create_w32): Set share_mode accordingly. (parse_mode): Extend the "share" keyword. * src/gpg-error.c (main): Add option --openmode to allow testing of the share modes. -- Updates-commit: 2344947717d29170c918a195541db568648c7aa3
* Update copyright and version string in gpg-error.m4.NIIBE Yutaka2025-10-031-3/+3
| | | | | | | | * src/gpg-error.m4: Update. -- Signed-off-by: NIIBE Yutaka <[email protected]>
* estream: New mode keyword "share=rw".Werner Koch2025-10-021-14/+34
| | | | | | | | | * src/estream.c (X_SAMETHREAD): Move to the top. Also for the other X_constants. (_gpgrt_fopen): Move setting of FILE_FLAG_SEQUENTIAL_SCAN to ... (func_file_create_w32): here. Replace arg flags_and_attrs by xflags and use cflags to set certain properties. (parse_mode): Add mode keyword "share=rw".
* Also fix for test(1) operator -o.NIIBE Yutaka2025-09-241-5/+5
| | | | | | | | | | * autogen.sh: Don't use -o operator, but shell ||. * src/gpgrt-config.in: Likewise. -- GnuPG-bug-id: 7807 Signed-off-by: NIIBE Yutaka <[email protected]>
* Fixes for obsoleted/removed test(1) operator -aWerner Koch2025-09-234-8/+8
| | | | | | | | | | | | | * autogen.sh: Here. * configure.ac: And here. * src/gen-lock-obj.sh: And here. * src/gpg-error.m4 (AM_PATH_GPG_ERROR): And here. * src/gpgrt-config.in (eval_compare_version): And here. * src/gpgrt.m4 (AM_PATH_GPGRT): And here. -- See GnuPG-bug-id: 7807
* Silence warnings when enabling the trace functions.Werner Koch2025-09-231-8/+8
| | | | | * src/w32-estream.c (reader): Use correct printf format specifiers for the trace functions.
* w32: Don't convert slash->backslash when it's under Wine.NIIBE Yutaka2025-09-231-4/+9
| | | | | | | | | * src/sysutils.c (_gpgrt_fname_to_wchar): No change under Wine. -- GnuPG-bug-id: 7138 Signed-off-by: NIIBE Yutaka <[email protected]>
* w32:spawn: Fix thread-unfriendly internal check.NIIBE Yutaka2025-09-233-24/+56
| | | | | | | | | | | | | * src/gpgrt-int.h (_gpgrt_windows_feature): New. * src/init.c (windows_specific_init): New. (real_init) [HAVE_W32_SYSTEM]: Call windows_specific_init. (_gpgrt_windows_feature): New. * src/spawn-w32.c (check_windows_version): Remove. (_gpgrt_process_spawn): Use _gpgrt_windows_feature. -- Signed-off-by: NIIBE Yutaka <[email protected]>
* estream: Support the %b conversion specifier from C23Werner Koch2025-08-141-7/+31
| | | | | | | | | | | | | | * src/estream-printf.c (CONSSPEC_BIN): New. (compute_type): Handle it. (parse_format): Support 'b'. (do_format): Divert 'b' to pr_integer. (pr_integer): Print binary format. * tests/t-printf.c (check_fprintf_sf): Add two simple testcases. -- Might be handy in some cases and is easy to implement. Minor drawback is that this increases a stack based buffer from 100 to 150 bytes.
* Set build specific variable for zOSWerner Koch2025-08-141-1/+2
| | | | | * configure.ac (EXTRA_LIBS_FOR_BUILD): New ac_subst. * src/Makefile.am (mkheader): Append that var to the rule.
* syscfg: Add x86_64 Android arch.Ben Kibbey2025-07-202-0/+26
| | | | | | | | | * src/syscfg/lock-obj-pub.x86_64-unknown-linux-androideabi.h: New. * src/Makefile.am (lock_obj_pub): Add it. -- Signed-off-by: Ben Kibbey <[email protected]>
* syscfg: Add i686 Android arch.Ben Kibbey2025-07-202-0/+22
| | | | | | | | | * src/syscfg/lock-obj-pub.i686-unknown-linux-androideabi.h: New. * src/Makefile.am (lock_obj_pub): Add it. -- Signed-off-by: Ben Kibbey <[email protected]>
* syscfg: Add armv7a alias to arm for Android.Ben Kibbey2025-07-201-0/+1
| | | | | | | | * src/mkheader.c (canon_host_triplet): Add alias. -- Signed-off-by: Ben Kibbey <[email protected]>
* syscfg: Add 64-bit Android arch.Ben Kibbey2025-07-202-0/+26
| | | | | | | | | * src/syscfg/lock-obj-pub.aarch64-unknown-linux-androideabi.h: New. * src/Makefile.am (lock_obj_pub): Add it. -- Signed-off-by: Ben Kibbey <[email protected]>
* w32:spawn: Support pipe I/O for GPGRT_PROCESS_DETACHED.NIIBE Yutaka2025-07-161-208/+69
| | | | | | | | | | | | | | | | | * src/spawn-w32.c (struct gpgrt_spawn_actions): Add detached field. (spawn_detached): Merge into ... (_gpgrt_process_spawn): ... here, supporting pipe I/O. (_gpgrt_process_release): Handle detached process. (_gpgrt_process_wait_list): Likewise. -- For old Windows, pipe I/O and NUL stdio are not supported for a process with GPGRT_PROCESS_DETACHED. Creation of a process can be done, but the process has INVALID HANDLE for stdio. GnuPG-bug-id: 7716 Signed-off-by: NIIBE Yutaka <[email protected]>
* w32:spawn: New flag GPGRT_PROCESS_STDIO_NUL.NIIBE Yutaka2025-07-152-11/+27
| | | | | | | | | | | * src/gpg-error.h.in (GPGRT_PROCESS_STDIO_NUL): New. * src/spawn-w32.c (w32_open_null): Add ENABLE_NULL_DEVICE argument. (_gpgrt_process_spawn): Follow the change. -- GnuPG-bug-id: 7723 Signed-off-by: NIIBE Yutaka <[email protected]>
* w32:spawn: Fix resource leaks for HANDLEs by w32_open_null.NIIBE Yutaka2025-07-151-124/+125
| | | | | | | | | | * src/spawn-w32.c (_gpgrt_process_spawn): Don't modify hd fields in ACT. Clean up use of hd_in, hd_out, and hd_err. -- GnuPG-bug-id: 7716 Signed-off-by: NIIBE Yutaka <[email protected]>
* w32:spawn: Fix inheriting HANDLEs.NIIBE Yutaka2025-07-141-2/+2
| | | | | | | | | | | * src/spawn-w32.c (spawn_detached): Use EXTENDED_STARTUPINFO_PRESENT to enable lpAttributeList in STARTUPINFOEXW. (_gpgrt_process_spawn): Likewise. -- GnuPG-bug-id: 7716 Signed-off-by: NIIBE Yutaka <[email protected]>
* gpgrt-config: It's gcc which supports -print-search-dirs option.NIIBE Yutaka2025-07-021-1/+1
| | | | | | | | | | | * src/gpgrt-config.in (determine_gpgrt_libdir): Default to gcc. -- This minor chang helps non-GNU system with vendor C compiler as cc. Signed-off-by: NIIBE Yutaka <[email protected]>
* spawn: Define _GPGRT_NEED_AFLOCAL for OS without AF_LOCAL.NIIBE Yutaka2025-07-011-0/+1
| | | | | | | | * src/spawn-posix.c (_GPGRT_NEED_AFLOCAL): Add. -- Signed-off-by: NIIBE Yutaka <[email protected]>
* spawn:posix: Use 1024 for arbitrary limit, following GPGME.NIIBE Yutaka2025-06-261-2/+2
| | | | | | | | | * src/spawn-posix.c (get_max_fds): Use 1024 (was: 256). -- GnuPG-bug-id: 7696 Signed-off-by: NIIBE Yutaka <[email protected]>
* spawn:posix: Add an improvement when closefrom is not available.NIIBE Yutaka2025-06-262-25/+35
| | | | | | | | | | | | | | | * src/gpgrt-int.h (_gpgrt_close_all_fds): Fix function declaration. * src/spawn-posix.c (USE_GET_MAX_FDS): Define when closefrom is not available. (get_max_fds): Add an argument of FALLBACK_MAX_FDS. (_gpgrt_close_all_fds, my_exec, spawn_detached): Likewise. (_gpgrt_process_spawn): [USE_GET_MAX_FDS && _SC_OPEN_MAX]: It's a parent process which calls sysconf. -- GnuPG-bug-id: 7696 Signed-off-by: NIIBE Yutaka <[email protected]>