aboutsummaryrefslogtreecommitdiffstats
path: root/src/assuan-logging.c (unfollow)
Commit message (Collapse)AuthorFilesLines
2020-11-12Fix crash when logging.Ben Kibbey1-1/+1
* src/assuan-logging.c (_assuan_log_control_channel): Use gpgrt_malloc. Signed-off-by: Ben Kibbey <[email protected]>
2017-11-15Add an SPDX tag to all core files.Werner Koch1-17/+18
--
2017-05-31Use gpgrt_free to release memory allocated by gpgrt_asprintf.NIIBE Yutaka1-1/+1
* src/assuan-logging.c (_assuan_log_control_channel): Use gpgrt_free. * src/debug.c (_assuan_debug, _assuan_debug_add, _assuan_debug_end): Likewise. Signed-off-by: NIIBE Yutaka <[email protected]>
2015-11-03Use asprintf function from libgpg-error.Werner Koch1-7/+7
* configure.ac: Require libgpg-error 1.17. (vasprintf): Remove ac_replace. * src/assuan-defs.h [!HAVE_VASPRINTF]: Remove replace wrapper. * src/assuan-logging.c (_assuan_log_control_channel): (_assuan_log_control_channel): s/asprintf/gpgrt_asprintf/. * src/debug.c (_assuan_debug): s/vasprintf/gpgrt_vasprintf/. (_assuan_debug_begin): Ditto. (_assuan_debug_add): Ditto. s/asprintf/gpgrt_asprintf/. -- We plan to move more code into libgpg-error/gpgrt anyway thus this is a good start which also fixes this bug: GnuPG-bug-id: 1477 Signed-off-by: Werner Koch <[email protected]>
2010-11-01Changes to allow building the CE version with MSC.Werner Koch1-1/+4
2010-09-01Add a no_logging flag.Werner Koch1-1/+3
2010-03-11Cleaned up the loggingWerner Koch1-39/+150
2010-01-28Cleanups for W32CE.Werner Koch1-0/+2
Implement getenv replacement for W32CE.
2010-01-22Prepare for a port to WindowsCE.Werner Koch1-1/+1
2009-12-032009-12-03 Marcus Brinkmann <[email protected]>Marcus Brinkmann1-2/+19
* assuan-logging.c: (log_cats): New static variable. (TEST_LOG_CAT): New macro. (_assuan_log_handler): Check log category. (assuan_set_assuan_log_stream): Check ASSUAN_DEBUG for logging categories. (assuan_set_log_stream): Call assuan_set_assuan_log_stream.
2009-11-272009-11-27 Marcus Brinkmann <[email protected]>Marcus Brinkmann1-1/+11
* assuan.h (assuan_set_assuan_log_stream): Add prototype. * libassuan.def, libassuan.vers: Add back assuan_set_assuan_log_stream. * assuan-logging.c (assuan_set_assuan_log_stream): Add back. * context.c (assuan_get_pointer): Don't output debug info here. (assuan_get_peercred, assuan_get_pid): But do here. * system.c: Improve debug output. * assuan-defs.h (struct assuan_context_s): Rename pipe_mode to max_accepts. * assuan-listen.c (assuan_accept): Rework max accepts logic. * assuan-socket-server.c (assuan_init_socket_server), assuan-socket-connect.c (assuan_socket_connect), assuan-pipe-server.c (assuan_init_pipe_server), assuan-pipe-connect.c (socketpair_connect): Add debug output, set max_accepts instead of pipe_mode.
2009-09-212009-09-19 Marcus Brinkmann <[email protected]>Marcus Brinkmann1-121/+35
* tests/fdpassing.c: Update to new API. * configure.ac: Check for stdint.h and inttypes.h. Invoke AC_TYPE_UINTPTR_T. doc/ 2009-09-21 Marcus Brinkmann <[email protected]> * assuan.texi: Update to new API. src/ 2009-09-19 Marcus Brinkmann <[email protected]> * src/libassuan.vers, src/libassuan.def: Update to new API. * assuan.c, context.c, system.c, debug.c: New files. * Makefile.am (common_sources): Add assuan.c, context.c, system.c and debug.c. * assuan.h: Include <stdarg.h>. Fix inclusion of <gpg-error.h>. (_ASSUAN_EXT_SYM_PREFIX, _ASSUAN_PREFIX1, _ASSUAN_PREFIX2) (_ASSUAN_PREFIX): Remove support for renaming the whole library, now that we have a stable shared library interface that can evolve to cover all needs (particularly those of GPGME). (assuan_malloc_hooks, assuan_malloc_hooks_t, assuan_log_cb_t) (assuan_io_monitor_t): New types. (ASSUAN_LOG_INIT, ASSUAN_LOG_CTX, ASSUAN_LOG_ENGINE) (ASSUAN_LOG_DATA, ASSUAN_LOG_SYSIO, ASSUAN_IO_FROM_PEER) (ASSUAN_IO_TO_PEER, ASSUAN_IO_MONITOR_NOLOG) (ASSUAN_IO_MONITOR_IGNORE): New symbols. (assuan_set_gpg_err_source, assuan_get_gpg_err_source) (assuan_get_malloc_hooks, assuan_set_log_cb, assuan_get_log_cb) (assuan_new, assuan_new_ext, assuan_release): New function prototypes. (assuan_init_pipe_server, assuan_init_socket_server) (assuan_init_socket_server_ext, assuan_pipe_connect) (assuan_pipe_connect_ext, assuan_socket_connect) (assuan_socket_connect_ext): Take a context argument instead of pointer to context. (assuan_deinit_server, assuan_disconnect) (assuan_set_assuan_err_source): Remove function prototypes. * assuan-defs.h (ASSUAN_GCC_A_PURE): Moved here from XXX (_assuan_error): New macro. (struct assuan_context_s): New members err_source, w32_strerror, malloc_hooks, log_cb, log_cb_data: New members. Move confidential into flags. New member engine. (_assuan_log_handler, _assuan_error_default, _assuan_disconnect): New prototypes. (_assuan_new_context): Remove prototype. (_assuan_malloc, _assuan_calloc, _assuan_realloc, _assuan_free): Add context argument to prototype. * assuan-util.c (alloc_func, realloc_func, free_func): Remove global variables. (assuan_set_malloc_hooks, _assuan_malloc, _assuan_realloc) (_assuan_calloc, _assuan_free, assuan_set_pointer) (assuan_get_pointer, assuan_begin_confidential) (assuan_end_confidential, assuan_set_io_monitor, assuan_set_flag) (assuan_get_flag): Move functions to ... * assuan-client.c: Add ctx argument to all invocations of _assuan_error. * assuan-socket-server.c, assuan-socket-connect.c, assuan-connect.c: Likewise. * assuan-buffer.c: Likewise. Also update access to confidential flag. * assuan-uds.c: Add ctx argument to all invocations of _assuan_malloc, _assuan_realloc, _assuan_calloc, _assuan_free and _assuan_error. * assuan_listen.c, assuan-inquire.c, assuan-handler.c: Likewise. * assuan-error.c (err_source): Remove global variable. (assuan_set_assuan_err_source): Removed function. (_assuan_w32_strerror): Moved here from assuan-logging.c and made thread-safe. (_assuan_error): Removed function (is now macro). * assuan-handler.c: Update access to confidential flag. * assuan-socket-server.c (accept_connection_bottom): Update access to confidential flag in context. (assuan_init_socket_server, assuan_init_socket_server_ext): Take ctx argument instead of pointer to ctx. * assuan-inquire.c (init_membuf, put_membuf, get_membuf) (free_membuf): Take context argument and change all callers. * assuan-socket-server.c (assuan_socket_connect) (assuan_socket_connect_ext): Take ctx argument instead of pointer to ctx. * assuan-pipe-connect.c (initial_handshake, pipe_connect_unix) (socketpair_connect, assuan_pipe_connect) (assuan_pipe_connect_ext): Likewise. (socketpair_connect): Now that ctx is not a pointer argument anymore, return if we are server or client in the argv argument. * assuan-logging.c (_assuan_log_handler): New function. (_assuan_w32_strerror): Move to assuan-error.c * assuan-connect.c (assuan_disconnect): Renamed to ... (_assuan_disconnect): ... this. * assuan-pipe-server.c (_assuan_new_context): Removed function. (assuan_init_pipe_server): Take ctx argument instead of pointer to ctx. (_assuan_release_context): Removed function. (_assuan_deinit_server): Reimplement.
2009-08-262009-08-26 Marcus Brinkmann <[email protected]>Marcus Brinkmann1-62/+16
* configure.ac: Test for versioned symbols support. (LIBASSUAN_LT_CURRENT, LIBASSUAN_LT_AGE) (LIBASSUAN_LT_REVISION): New, set to 0. (LIBASSUAN_CONFIG_API_VERSION): Bump to 2. (AC_CONFIG_MACRO_DIR, AC_DISABLE_STATIC, AC_LIBTOOL_WIN32_DLL) (AC_LIBTOOL_RC, AC_PROG_LIBTOOL, AM_PATH_GPG_ERROR): Invoke. (AC_PROG_RANLIB): Don't invoke. (HAVE_W32_SYSTEM): New AM conditional. (AC_CONFIG_FILES): Add src/versioninfo.rc. * ltmain.sh, m4/libtool.m4, m4/ltoptions.m4, m4/ltsugar.m4, m4/ltversion.m4, m4/lt~obsolete.m4: New files from libtool 2.2.6. * tests/Makefile.am (AM_CFLAGS, LDADD): Add gpg-error. * tests/fdpassing.c: Change error values to gpg-error ones. src/ 2009-08-26 Marcus Brinkmann <[email protected]> * libassuan-config.in: Add gpg-error. * assuan-buffer.c, assuan-inquire.c, assuan-handler.c, assuan-util.c, assuan-client.c, assuan-socket-connect.c, assuan-pipe-connect.c, assuan-defs.h, assuan-socket.c, assuan-connect.c, assuan-uds.c, assuan-socket-server.c, assuan-listen.c, assuan-pipe-server.c: Return gpg_error_t instead assuan_error_t everywhere. Return gpg error codes everywhere. Replace xtrymalloc, xfree, etc with _assuan_malloc, _assuan_free etc. Protect include <config.h> by HAVE_CONFIG_H where not done so already. * versioninfo.rc.in, libassuan.vers, libassuan.def, assuan-error.c: New files. * Makefile.am: Add libtool handling and gpg-error (also for W32). (EXTRA_DIST): Remove mkerrors, add libassuan.vers, versioninfo.rc.in and libassuan.def. (BUILT_SOURCES, MOSTLYCLEANFILES): Removed. (common_sources): Remove assuan-errors.c, add assuan-error.c. * assuan.h: Include <gpg-error.h>. [_ASSUAN_ONLY_GPG_ERRORS]: Feature removed. (assuan_init_connected_socket_server, assuan_strerror) (assuan_pipe_connect2): Removed obsolete interfaces. (assuan_error_t): Removed type. (assuan_flag_t): Changed from enum to unsigned int. (ASSUAN_NO_WAITPID, ASSUAN_CONFIDENTIAL): Changed from enum to macro. (assuan_process): Return gpg_error_t instead of int. (assuan_set_assuan_err_source): Change argument type from int to gpg_err_source_t. * assuan-defs.h (_assuan_error): Change types to gpg_error_t. (err_code, err_is_eof, xtrymalloc, xtrycalloc, xtryrealloc) (xfree): Removed. (set_error): Adjust for gpg-error codes. (_assuan_gpg_strerror_r, _assuan_gpg_strsource): Removed. (struct assuan_context_s): Remove member os_errno. * assuan-socket-server.c (accept_connection): Don't set CTX->os_errno. * mkerrors: Removed file. * assuan-io-pth.c (_assuan_simple_sendmsg) (_assuan_simple_recvmsg), assuan-io.c (_assuan_simple_sendmsg, _assuan_simple_recvmsg): Set errno instead returning error directly (and return -1). * assuan-handler.c (assuan_process_done): Remove handling for old style error values. (process_request, assuan_process): Change return type from int to gpg_error_t. * assuan-client.c (assuan_transact): Remove support for old style error values. * assuan-pipe-connect.c (assuan_pipe_connect2): Removed. * assuan-logging.c (my_strerror_r, my_strsource) (load_libgpg_error, _assuan_gpg_strerror_r) (_assuan_gpg_strsource): Removed.
2008-11-032008-11-03 Marcus Brinkmann <[email protected]>Marcus Brinkmann1-8/+8
* tests/fdpassing.c (register_commands): Add missing initializer to silence gcc -W warning. src/ 2008-11-03 Marcus Brinkmann <[email protected]> * assuan-handler.c (std_handler_help): Make I unsigned to silence gcc -W warning. * assuan-logging.c (_assuan_log_print_buffer): Likewise for N. * funopen.c (_assuan_funopen): Remove initializer to silence gcc -W warning. * assuan-handler.c (std_cmd_table): Add missing initializer to silence gcc -W warning. * assuan-socket-server.c (io): Likewise. * assuan-socket-connect.c (assuan_socket_connect_ext): Likewise.
2008-10-15Typo fix.Werner Koch1-0/+5
flush full debug lines.
2007-10-01Add socket wrapper API.Werner Koch1-2/+2
Changed the ABI ofthe W32 socket emulation.
2007-08-24Preparing 1.0.3Werner Koch1-1/+1
2007-07-05Switched to LGPLv3.libassuan-1.0.2Werner Koch1-4/+2
2007-07-04A couple of Changes for WindowsWerner Koch1-1/+48
2006-09-10fixesWerner Koch1-1/+129
2006-09-06Changes to support gpg-error style error codes.Werner Koch1-5/+5
2005-10-24Fixed and clarified copyright noticesWerner Koch1-1/+2
2004-12-18* autogen.sh: Add Option --build-w32.Werner Koch1-2/+22
* assuan-logging.c (_assuan_w32_strerror): New. * assuan-defs.h (w32_strerror): new. * assuan-pipe-connect.c (assuan_pipe_connect2, fix_signals): Factored signal code out to new function. (build_w32_commandline, create_inheritable_pipe): New. Taken from gnupg 1.9. (assuan_pipe_connect2) [W32]: Implemented for W32.
2004-12-07* configure.ac: Define HAVE_W32_SYSTEM and HAVE_DOSISH_SYSTEM.Werner Koch1-0/+4
Add -lwsock2 to the config lib flags for W32. * assuan-logging.c, assuan-io.c: Include config.h * assuan-pipe-connect.c (assuan_pipe_connect2) [_WIN32]: Return error Not Imlemented.
2004-11-24* assuan-logging.c (_assuan_log_printf): New.Werner Koch1-1/+23
* assuan-domain-connect.c (LOG): Removed and replaced all callers by _assuan_log_printf. This is needed for C89 and gcc 2.95 which both don't have C99 style variable arg macros. * assuan-pipe-connect.c (LOG): Ditto. * assuan-socket-connect.c (LOG): Ditto. * assuan-socket.c[!_WIN32]: Fixed includes.
2004-04-29* assuan-socket-connect.c: Include string.h.Werner Koch1-0/+1
* assuan-logging.c: Ditto.
2003-12-16* assuan-buffer.c: Changed formatting of the debug output prefix.Werner Koch1-1/+24
* assuan-util.c (assuan_set_log_stream): Set global log stream if it has not been done yet. * assuan-logging.c (_assuan_set_default_log_stream): New. (assuan_set_assuan_log_prefix): New.
2003-02-182003-02-17 Neal H. Walfield <[email protected]>Neal Walfield1-22/+18
* Makefile.am (lib_LIBRARIES): Use this instead of . . . (noinst_LIBRARIES): . . . this. (include_HEADERS): New variable. (libassuan_a_SOURCES): Remove assuan.h, add assuan-logging.c. * assuan.h (assuan_set_assuan_log_stream): New prototype. (assuan_get_assuan_log_stream): Likewise. (assuan_get_assuan_log_prefix): Likewise. * assuan-logging.c: New file. * assuan-buffer.c [HAVE_JNLIB_LOGGIN]: Do not include "../jnlib/logging.h". (my_log_prefix): Remove function. (_assuan_read_line): Use assuan_get_assuan_log_prefix in lieu of my_log_prefix. (assuan_write_line): Likewise. (_assuan_cookie_write_data): Likewise. (_assuan_cookie_write_flush): Likewise. * assuan-domain-connect.c (LOGERROR, LOGERROR1, LOGERROR2, LOGERRORX): Remove. (LOG): New macro. (domain_reader): Use it. (domain_writer): Likewise. (domain_sendfd): Likewise. (domain_receivefd): Likewise. (_assuan_domain_init): Likewise. (assuan_domain_connect): Likewise. * assuan-pipe-connect.c [HAVE_JNLIB_LOGGIN]: Do not include "../jnlib/logging.h". (LOGERROR, LOGERROR1, LOGERROR2, LOGERRORX): Remove. (LOG): New macro. (assuan_pipe_connect): Use it. * assuan-socket-connect.c [HAVE_JNLIB_LOGGIN]: Do not include "../jnlib/logging.h". (LOGERROR, LOGERROR1, LOGERROR2, LOGERRORX): Remove. (LOG): New macro. (assuan_socket_connect): Use it. (socket_reader): Remove dead code. (socket_writer): Likewise. * assuan-util.c [HAVE_JNLIB_LOGGIN]: Do not include "../jnlib/logging.h". (_assuan_log_sanitized_string): Use assuan_get_assuan_log_stream, not jnlib.
2002-11-242002-11-24 Neal H. Walfield <[email protected]>Neal Walfield1-8/+2
* assuan-domain-connect.c (do_finish): Remove. (_assuan_domain_init): Use default handlers where possible. Add an assert and update comments. * assuan-domain-server.c (accept_connection): Remove. (assuan_init_domain_server): Use default handlers where possible. Put the server in pipe mode: it can only be used by a single client.
2002-11-242002-11-24 Neal H. Walfield <[email protected]>Neal Walfield1-14/+25
* assuan.h: Add prototype for assuan_domain_connect and assuan_init_domain_server. * assuan-defs.h: Include <unistd.h>. Add prototype for _assuan_domain_init. * assuan-domain-connect.c: New file. * assuan-domain-server.c: New file. * Makefile.am (libassuan_a_SOURCES): Add assuan-domain-connect.c and assuan-domain-server.c
2002-11-232002-11-23 Neal H. Walfield <[email protected]>Neal Walfield1-28/+15
* Makefile.am (libassuan_a_SOURCES): Add assuan-io.c. * assuan-io.c: Restore. (_assuan_simple_read): Rename from _assuan_read. (_assuan_simple_write): Rename from _assuan_write. * assuan-defs.h (_assuan_simple_read): New prototype. (_assuan_simple_write): Likewise. * assuan-pipe-server.c (pipe_reader): Remove. (pipe_writer): Remove. (_assuan_new_context): Initialize IO is with _assuan_simple_read and _assuan_simple_write. * assuan-socket-connect.c (socket_reader): Remove. (socket_writer): Remove. (assuan_socket_connect): Initialize IO is with _assuan_simple_read and _assuan_simple_write. * assuan-socket-server.c (io): New local variable. (assuan_init_socket_server): Initialize CTX->io. (assuan_init_connected_socket_server): Likewise.
2002-07-30Changed the lincese for Assuan to LGPL.V0-3-10NEWPG-0-3-10Werner Koch1-13/+13
2002-01-21* assuan-connect.c: Move all except assuan_get_pid to...Werner Koch1-201/+9
* assuan-pipe-connect.c: this. (assuan_pipe_disconnect): Removed. (do_finish, do_deinit): New (assuan_pipe_connect): and set them into the context. * assuan-socket-connect.c: New. * assuan-util.c (_assuan_log_sanitized_string): New. * assuan-pipe-server.c (assuan_init_pipe_server): Factored most code out to ... (_assuan_new_context): new func. (_assuan_release_context): New * assuan-connect.c (assuan_pipe_connect): Use the new functions.
2002-01-19* assuan-buffer.c (_assuan_read_line): Add output logging.Werner Koch1-3/+3
(assuan_write_line): Ditto. (_assuan_cookie_write_data): Ditto. (_assuan_cookie_write_flush): Ditto. * assuan-util.c (_assuan_log_print_buffer): New. (assuan_set_log_stream): New. (assuan_begin_confidential): New. (assuan_end_confidential): New. * assuan-defs.h: Add a few handler variables. * assuan-pipe-server.c (assuan_deinit_pipe_server): Removed. (deinit_pipe_server): New. (assuan_deinit_server): New. Changed all callers to use this. * assuan-listen.c (assuan_accept): Use the accept handler. * assuan-handler.c (process_request): Use the close Handler. * assuan-socket-server.c: New.
2001-12-19assuan/Marcus Brinkmann1-3/+14
2001-12-14 Marcus Brinkmann <[email protected]> * assuan-buffer.c (_assuan_read_line): New variable ATTICLEN, use it to save the length of the attic line. Rediddle the code a bit to make it more clear what happens. agent/ 2001-12-19 Marcus Brinkmann <[email protected]> * query.c (start_pinentry): Add new argument to assuan_pipe_connect. sm/ 2001-12-19 Marcus Brinkmann <[email protected]> * call-agent.c (start_agent): Add new argument to assuan_pipe_connect.
2001-12-12* assuan-connect.c (assuan_pipe_connect): Implemented the initalWerner Koch1-19/+22
handshake. * assuan-client.c (read_from_server): Renamed to (_assuan_read_from_server): this and made external. * assuan-listen.c (assuan_set_hello_line): New. (assuan_accept): Use a custom hello line is available. * assuan-buffer.c (assuan_read_line): New. (assuan_pending_line): New. (_assuan_write_line): Renamed to .. (assuan_write_line): this, made public and changed all callers.
2001-12-05assuan-connect.c (assuan_pipe_connect): Add more error reporting.Werner Koch1-15/+112
assuan-client.c: New. assuan-inquire.c: New. assuan-handler.c (process_request): Check for nested invocations.
2001-11-24* assuan-connect.c (assuan_get_pid): New - actually done by Marcus in gpgme.Werner Koch1-0/+6
Set the line length back to the old value.
2001-11-19 * assuan-connect.c (assuan_pipe_connect): Require NAME to be set.Marcus Brinkmann1-6/+2
Using ARGV[0] automatically is bad mojo.
2001-11-19 * assuan-connect.c (assuan_pipe_connect): New function.Marcus Brinkmann1-0/+106
(assuan_pipe_disconnect): Likewise. * assuan-defs.h (struct assuan_context_s): New member PID.
2001-11-07Assuan server mode is now basically usableWerner Koch1-19/+2
2001-11-06First chunk of code for the Assuan libraryWerner Koch1-0/+44