aboutsummaryrefslogtreecommitdiffstats
path: root/common/sysutils.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Remove use of gnulib (part 2)Werner Koch2014-11-111-9/+143
| | | | | | | | | | | | | | | | * configure.ac (strpbrk): Add to AC_CHECK_FUNCS. (gl_EARLY): Remove. * common/stringhelp.c (strpbrk) [!HAVE_STRPBRK]: New. * common/sysutils.c (gnupg_mkdtemp): New. Based on code from glibc-2.6. (gnupg_setenv): Rewrite. (gnupg_unsetenv): Rewrite. * g10/exec.c: Include sysutils.h and replace mkdtemp by gnupg_mkdtemp. * g13/be-encfs.c: Ditto. * g13/mount.c: Ditto. * tools/symcryptrun.c (confucius_mktmpdir): Ditto. Signed-off-by: Werner Koch <[email protected]>
* Remove use of gnulib (part 1)Werner Koch2014-11-111-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * gl/: Remove entire tree. * configure.ac: Remove gnulib tests and the gl/ Makefile. (setenv): Add to AC_CHECK_FUNCS. * autogen.rc (extra_aclocal_flags): Set to empty. * Makefile.am (ACLOCAL_AMFLAGS): Remove -I gl/m4 (SUBDIRS): Remove gl/. * agent/Makefile.am (common_libs): Remove ../gl/gnulib.a * common/Makefile.am (t_common_ldadd): Ditto. * dirmngr/Makefile.am (dirmngr_LDADD): Ditto. (dirmngr_ldap_LDADD, dirmngr_client_LDADD): Ditto. * g10/Makefile.am (needed_libs): Ditto. * g13/Makefile.am (g13_LDADD): Ditto. * kbx/Makefile.am (kbxutil_LDADD): Ditto. ($(PROGRAMS)): Ditto. * scd/Makefile.am (scdaemon_LDADD): Ditto. * sm/Makefile.am (common_libs): Ditto. * tools/Makefile.am (common_libs, commonpth_libs): Ditto. * agent/gpg-agent.c: Remove "mkdtemp.h" * g10/exec.c: Ditto. * scd/scdaemon.c: Ditto. * tools/symcryptrun.c: Ditto. * common/sysutils.c: Remove "setenv.h" * common/t-timestuff.c: Use putenv if setenv is not available. -- gnulib has always been a cause of trouble in GnuPG because we used only a very few functions and the complex include machinery of gnulib is quite complex and the cause for many build problems for example on OS X. This is not gnulib's fault but due to our limited use of gnulib and that we only rarely update the gnulib code to avoid regressions. In part two we will address the functions mkdtemp setenv unsetenv strpbrk which may bot be implemented on all platforms. They are not required on a libc based system. Signed-off-by: Werner Koch <[email protected]>
* common: Cleanup the use of USE_NPTH and HAVE_NPTH macros.Werner Koch2014-05-021-12/+2
| | | | | | | | | | | | | | | | | * configure.ac (HAVE_NPTH): New ac_define. * common/estream.c: Use USE_NPTH instead of HAVE_NPTH. * common/http.c: Ditto. Replace remaining calls to pth by npth calls. (connect_server): Remove useless _(). * common/exechelp-posix.c, common/exechelp-w32.c * common/exechelp-w32ce.c: Use HAVE_PTH to include npth.h. * common/init.c (_init_common_subsystems): Remove call to pth_init. * common/sysutils.c (gnupg_sleep): Use npth_sleep. * scd/ccid-driver.c (my_sleep): Ditto. -- USE_NPTH is used in case were we may build with and without nPth. The missing definition HAVE_NPTH didn't allowed us to build outher sources with nPTh support.
* common: Add function gnupg_getcwd.Werner Koch2014-04-221-0/+30
| | | | | | * tools/gpg-connect-agent.c (gnu_getcwd): Move to ... * common/sysutils.c (gnupg_getcwd): .. here. * tools/gpg-connect-agent.c (get_var_ext): Use gnupg_getcwd.
* w32: Include winsock2.h to silence warnings.Werner Koch2014-03-071-0/+3
|
* w32: Define WINVER only if needed.Werner Koch2014-03-071-1/+3
| | | | * common/sysutils.c (WINVER): Define only if less that 5.0.
* ssh: Add support for Putty.Werner Koch2014-03-071-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * agent/gpg-agent.c [W32]: Include Several Windows header. (opts): Change help text for enable-ssh-support. (opts, main): Add option --enable-putty-support (putty_support, PUTTY_IPC_MAGIC, PUTTY_IPC_MAXLEN): New for W32. (agent_init_default_ctrl): Add and asssert call. (putty_message_proc, putty_message_thread): New. (handle_connections) [W32]: Start putty message thread. * common/sysutils.c (w32_get_user_sid): New for W32 only * tools/gpgconf-comp.c (gc_options_gpg_agent): Add --enable-ssh-support and --enable-putty-support. Make the configuration group visible at basic level. * agent/command-ssh.c (serve_mmapped_ssh_request): New for W32 only. -- This patch enables support for Putty. It has been tested with Putty 0.62 using an Unix created ssh key copied to the private-keys-v1.d directory on Windows and with a manually crafted sshcontrol file. It also works with a smartcard key. May thanks to gniibe who implemented a proxy in Python to test the putty/gpg-agent communication. Signed-off-by: Werner Koch <[email protected]> (cherry picked from commit 9f32499f99a0817f63f7a73b09bdcebe60d4775d) Resolved conflicts: NEWS agent/agent.h agent/gpg-agent.c: Convert from pth to npth. common/sysutils.c common/sysutils.h
* Change license for some files in common to LGPLv3+/GPLv2+.Werner Koch2012-04-201-5/+15
| | | | | | | | | | | | | | | | | | | | | | | Having the LGPL on the common GnuPG code helps to share code between GnuPG and related projects (like GPGME and Libassuan). This is good for interoperability and to reduces bugs. * common/asshelp.c, common/asshelp.h, common/asshelp2.c, common/b64dec.c * common/b64enc.c, common/convert.c, common/dns-cert.c * common/dns-cert.h common/exechelp-posix.c, common/exechelp-w32.c * common/exechelp-w32ce.c, common/exechelp.h, common/get-passphrase.c * common/get-passphrase.h, common/gettime.c, common/gpgrlhelp.c * common/helpfile.c, common/homedir.c, common/http.c, common/http.h * common/i18n.c, common/init.c, common/init.h, common/iobuf.c * common/iobuf.h, common/localename.c, common/membuf.c, common/membuf.h * common/miscellaneous.c, common/openpgp-oid.c, common/openpgpdefs.h * common/percent.c, common/pka.c, common/pka.h, common/session-env.c * common/session-env.h, common/sexp-parse.h, common/sexputil.c * common/signal.c, common/srv.c, common/srv.h, common/ssh-utils.c * common/ssh-utils.h, common/sysutils.c, common/sysutils.h * common/tlv.c, common/tlv.h, common/ttyio.c, common/ttyio.h * common/userids.c, common/userids.h, common/xasprintf.c: Change license to LGPLv3+/GPLv2+/
* Port to npth.Marcus Brinkmann2012-01-251-6/+6
| | | | | | | | | | | | | | | | | | | | | * configure.ac: Don't check for PTH but for NPTH. (AH_BOTTOM): Remove PTH_SYSCALL_SOFT. (have_pth): Rename to ... (have_npth): ... this. (USE_GNU_NPTH): Rename to ... (USE_GNU_PTH): ... this. * m4/npth.m4: New file. * agent/Makefile.am, agent/cache.c, agent/call-pinentry.c, agent/call-scd.c, agent/findkey.c, agent/gpg-agent.c, agent/trustlist.c, common/Makefile.am, common/estream.c, common/exechelp-posix.c, common/exechelp-w32.c, common/exechelp-w32ce.c, common/http.c, common/init.c, common/sysutils.c, dirmngr/Makefile.am, dirmngr/crlfetch.c, dirmngr/dirmngr.c, dirmngr/dirmngr_ldap.c, dirmngr/ldap-wrapper-ce.c, dirmngr/ldap-wrapper.c, dirmngr/ldap.c, g13/Makefile.am, g13/call-gpg.c, g13/g13.c, g13/runner.c, scd/Makefile.am, scd/apdu.c, scd/app.c, scd/ccid-driver.c, scd/command.c, scd/scdaemon.c, tools/Makefile.am: Port to npth.
* Add code for explicit selection of pooled A records.Werner Koch2011-04-121-0/+11
| | | | | | | | | | | To better cope with round robin pooled A records like keys.gnupg.net we need to keep some information on unresponsive hosts etc. What we do now is to resolve the hostnames, remember them and select a random one. If a host is dead it will be marked and a different one selected. This is intended to solve the problem of long timeouts due to unresponsive hosts. The code is not yet finished but selection works.
* Nuked almost all trailing white space.post-nuke-of-trailing-wsWerner Koch2011-02-041-15/+14
| | | | | | | | We better do this once and for all instead of cluttering all future commits with diffs of trailing white spaces. In the majority of cases blank or single lines are affected and thus this change won't disturb a git blame too much. For future commits the pre-commit scripts checks that this won't happen again.
* Fix dirmngr problems on CE.Werner Koch2010-08-121-2/+2
| | | | | | Add new dirmngr commands. Minor other fixes.
* common/Marcus Brinkmann2010-06-101-2/+4
| | | | | | | | | | | | | 2010-06-11 Marcus Brinkmann <[email protected]> * sysutils.c (translate_sys2libc_fd): Revert last change. (translate_sys2libc_fd_int): Revert last change. sm/ 2010-06-11 Marcus Brinkmann <[email protected]> * server.c (cmd_message) [HAVE_W32CE_SYSTEM]: Finish pipe.
* 2010-06-10 Marcus Brinkmann <[email protected]>Marcus Brinkmann2010-06-101-4/+2
| | | | | | | | * sysutils.c (translate_sys2libc_fd) [HAVE_W32CE_SYSTEM]: Implement. (translate_sys2libc_fd_int) [HAVE_W32CE_SYSTEM]: Don't call translate_sys2libc_fd.
* 2010-06-08 Marcus Brinkmann <[email protected]>Marcus Brinkmann2010-06-081-1/+3
| | | | | | | | | | * Makefile.am (AM_CFLAGS): Add $(LIBASSUAN_CFLAGS). (t_common_ldadd): Add $(LIBASSUAN_LIBS). * sysutils.c: Include <assuan.h>. (translate_sys2libc_fd_int): Cast to silence gcc warning. * iobuf.c: Include <assuan.h> (translate_file_handle): Fix syntax error.
* Change OpenPGP test framework to run under the control of the agent.Werner Koch2010-06-071-2/+7
|
* common/Marcus Brinkmann2010-04-201-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 2010-04-20 Marcus Brinkmann <[email protected]> * logging.c (do_log_ignore_arg): New helper function. (log_string): Use it to remove ugly volatile hack that causes gcc warning. (log_flush): Likewise. * sysutils.c (gnupg_unsetenv) [!HAVE_W32CE_SYSTEM]: Return something. (gnupg_setenv) [!HAVE_W32CE_SYSTEM]: Likewise. * pka.c (get_pka_info): Solve strict aliasing rule violation. * t-exechelp.c (test_close_all_fds): Use dummy variables to silence gcc warning. kbx/ 2010-04-20 Marcus Brinkmann <[email protected]> * keybox-update.c [!HAVE_DOSISH_SYSTEM]: Include ../common/sysutils.h even then to silence gcc warning about missing declaration of gnupg_remove. tools/ 2010-04-20 Marcus Brinkmann <[email protected]> * gpgconf-comp.c (option_check_validity): Use dummy variables to silence gcc warning.
* Fixed dependencies and a syntax errorWerner Koch2010-04-141-2/+2
|
* ./autogen.sh --build-w32ce does now succeed.Werner Koch2010-04-141-0/+11
|
* Whole lot of changes to support CE.Werner Koch2010-04-141-2/+109
|
* More changes for CE. gpgsm does now build and run a keylisting.Werner Koch2010-03-241-0/+24
|
* More chnages to use estream. Add a way to replace the standardWerner Koch2010-03-221-1/+1
| | | | | descriptors.
* First steps towards the W32CE portWerner Koch2010-03-021-28/+57
|
* Import/export of pkcs#12 now uses the gpg-agent directly.Werner Koch2009-04-011-3/+5
| | | | | Removed duplicated code (percent unescaping).
* Marked all unused args on non-W32 platforms.Werner Koch2008-10-201-0/+2
|
* g10/Marcus Brinkmann2008-06-251-128/+0
| | | | | | | | | | | | | | | | | | | | | | 2008-06-25 Marcus Brinkmann <[email protected]> * gpg.c (enum cmd_and_opt_values): Remove option oEnableW32HandleTranslation. (opts): Remove option --enable-w32-handle-translation. (main): Remove variable w32_handle_translation. common/ 2008-06-25 Marcus Brinkmann <[email protected]> Revert last three changes related to handle translation. * sysutils.c: (FD_TRANSLATE_MAX, fd_translate, fd_translate_len) (translate_table_init, translate_table_lookup): Removed. * iobuf.c (check_special_filename): Do not use translate_table_lookup. * sysutils.h (translate_table_init, translate_table_lookup): Remove prototypes.
* Robustness fix.Werner Koch2008-06-191-9/+16
| | | | | Add group to the --gpgconf-list.
* 2008-06-18 Marcus Brinkmann <[email protected]>Marcus Brinkmann2008-06-181-1/+4
| | | | | * sysutils.c (TRANS_MAX): Bump up to 350 to be on the safe side.
* 2008-06-18 Marcus Brinkmann <[email protected]>Marcus Brinkmann2008-06-181-0/+118
| | | | | | | | | | | | | * sysutils.h (translate_table_init, translate_table_lookup): New prototypes. * sysutils.c: Include <ctype.h>. (FD_TRANSLATE_MAX): New macro. (fd_translate, fd_translate_len): New static variables. (translate_table_init, translate_table_lookup): New functions. (translate_sys2libc_fd_int): Translate file descriptor. * iobuf.c (check_special_filename): Translate handle values from special filenames.
* Poems for AllowSetForegroundWindow (W32)Werner Koch2008-02-141-1/+16
|
* Try to make sure that the standard descriptors are connected when callingWerner Koch2007-12-031-1/+75
| | | | | gpgsm.
* Updated estream.Werner Koch2007-08-221-2/+88
| | | | | More changes for Windows.
* Translate all file descriptors received from assuan.Werner Koch2007-07-121-13/+25
|
* Changed to GPLv3.Werner Koch2007-07-041-4/+2
| | | | | Removed intl/.
* Fixed a problem in estream-printf.c.Werner Koch2007-06-251-0/+29
| | | | | Changes for Windows (gpgsm -k does now work). Minor cleanups.
* [w32] gpg-agent is now started automagically by gpgsm.Werner Koch2007-06-201-6/+49
|
* First steps towards supporting W32.Werner Koch2007-06-061-1/+1
| | | | | | | This is mainly source code reorganization. Update gnulib. g10/ does currently not build.
* Updated FSF's address.Werner Koch2006-06-201-1/+2
|
* New debugging optionhs, updates to the manual.Werner Koch2005-06-071-1/+1
|
* * sysutils.c (disable_core_dumps): Only set the current limit.Werner Koch2004-05-111-7/+30
| | | | | | | | | | | | | | | (enable_core_dumps): New. * gpgsm.texi (Esoteric Options): Add --debug-allow-core-dump. * gpgsm.c: New option --debug-allow-core-dump. * gpgsm.h (opt): Add member CONFIG_FILENAME. * gpgsm.c (main): Use it here instead of the local var. * server.c (gpgsm_server): Print some additional information with the hello in verbose mode.
* minor cleanupsWerner Koch2004-02-121-1/+2
|
* * sysutils.c: New. This is the misc.c file from gnupg 1.0.6 withWerner Koch2002-01-191-0/+206
the OpenPGP stuff removed. * sysutils.h: New.