summaryrefslogtreecommitdiff
path: root/common/debug.c
Commit message (Collapse)AuthorAgeFilesLines
* build: Don't use locale funcs if locale_t is not defined in locale.hDaiki Ueno2018-05-281-2/+2
| | | | | | On macOS, locale_t is not defined in <locale.h>. Although it is defined in <xlocale.h>, we rather not use locales at all for POSIX compliance.
* library: Use dedicated locale object for printing errorDaiki Ueno2018-05-011-7/+7
|
* Revert "build: Check strerror_l() and uselocale() seperately"Daiki Ueno2018-05-011-7/+2
| | | | | | | | | This reverts commit 173ad93cc54057886b2055f3d73ea64a047127d1. We should rather use newlocale() when per-thread locale is not set. Otherwise uselocale() could return LC_GLOBAL_LOCALE on some platforms (e.g. musl-libc) and calling strerror_l() with it leads to an undefined behavior.
* build: Check strerror_l() and uselocale() seperatelyDaiki Ueno2018-04-191-2/+7
| | | | | | NetBSD deliberately doesn't support per-thread locale and our thread-safe replacement of strerror() using strerror_l() cannot be used. Fallback to strerror_r() in that case.
* debug: Add p11_debug_err to prevent use of strerrorDaiki Ueno2017-06-121-0/+35
|
* common: Use secure_getenv() implementation when setuidStef Walter2014-10-021-1/+2
| | | | | In anything security sensitive, use secure_getenv() implementation for retrieving environment variables.
* rpc: Implement PKCS#11 messages/client/server codeStef Walter2014-07-081-0/+1
| | | | | | | | | | | | * This enables passing around bytes which represent PKCS#11 RPC calls. * Caller is responsible for connecting/disconnecting and so on. * Client side caller gets a mixin from p11_rpc_client_init() to call into, which generates callbacks with byte arrays to be transported. * Server side calls p11_rpc_server_handle() with a CK_FUNCTION_LIST_PTR on which relevant methods get called. * Doesn't yet implement the actual daemon or clients etc... https://bugs.freedesktop.org/show_bug.cgi?id=54105
* debug: Allow debug lines longer than 512 charactersStef Walter2013-08-281-4/+3
| | | | | | Since fprintf (stderr, ...) already doesn't print atomically, we don't lose any atomicity here. If we want to print atomically this will need some further reworking anyway.
* debug: Add missing 'tool' flag to debug flagsStef Walter2013-08-281-0/+1
|
* Make preconditions abort unconditionally when scanning with coverityStef Walter2013-07-181-0/+4
| | | | | | | | | | | | This reflects that preconditions are invalid/unreachable on a functioning system and with valid input. We do not try to recover from such conditions. In addition teach coverity about how our test suite fails See http://p11-glue.freedesktop.org/doc/p11-kit/devel-building-style.html https://bugzilla.redhat.com/show_bug.cgi?id=985005
* Add basic trust moduleStef Walter2013-02-051-0/+1
| | | | | | This is based off the roots-store from gnome-keyring and loads certificates from a root directory and exposes them as PKCS#11 objects.
* Use the stdbool.h C99 bool typeStef Walter2013-01-231-4/+4
| | | | | | It was getting really wild knowing whether a function returning an int would return -1 on failure or 0 or whether the int return value was actually a number etc..
* Move debug and library code into the common/ subdirectoryStef Walter2013-01-091-0/+151
Start using p11_ as our internal prefix rather than _p11_. We explicitly export p11_kit_ so this is fine as far as visibility. Move the threading, mutex, and module compat, dict, and array code into the common directory too. Take this opportunity to clean up a bit of internal API as well, since so many lines are being touched internally.