cb75b275d15beedd1fdecc1f8ced657fba282218 |
|
03-Nov-2017 |
Lukas Slebodnik <lslebodn@redhat.com> |
Add parameter --logger to daemons
Different binary handled information about logging differently
e,g, --debug-to-files --debug-to-stderr
And logging to journald was a special case of previous options
(!debug_file && !debug_to_stderr). It was also tied to the monitor option
"--daemon" and therefore loggind to stderr was used in interactive mode
+ systemd Type=notify.
Resolves:
https://pagure.io/SSSD/sssd/issue/3433
Reviewed-by: Justin Stephenson <jstephen@redhat.com>
Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com> |
09e3f0af96cecb94be69084c025f0355b3111993 |
|
03-Nov-2017 |
Lukas Slebodnik <lslebodn@redhat.com> |
UTIL: Add wrapper function to configure logger
Let's use one enum for logger type instead of many integers (debug_to_file,
debug_to_stderr plus some weird combination for journald).
Old variable were also transformed to enum for backward compatibility
Reviewed-by: Fabiano Fidêncio <fidencio@redhat.com> |
7c30eade4ae794ed809845f2ef70dda849b6e7c9 |
|
23-Mar-2016 |
Lukas Slebodnik <lslebodn@redhat.com> |
UTIL: Allow to append new line in sss_vdebug_fn
libldb is not consistent with appending line feed
in debug messages. AS a result of this two messages can be on the same line
in sssd log files. Which makes analyzing log files more difficult.
Reviewed-by: Pavel Březina <pbrezina@redhat.com> |
74cc3797e311fd5dc12473678f499041ade7784f |
|
23-Feb-2016 |
Lukas Slebodnik <lslebodn@redhat.com> |
DEBUG: Ignore ENOENT for change owner of log files
Resolves:
https://fedorahosted.org/sssd/ticket/2493
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> |
211539459651cbfb0cb03c800ce876c20420a195 |
|
23-Feb-2016 |
Lukas Slebodnik <lslebodn@redhat.com> |
Revert "DEBUG: Preventing chown_debug_file if journald on"
This reverts commit 6e2822b151c21ce6e3287a0cf25d40e9f10a6127.
The function chown_debug_file is called before initialization
of debug stuff in sssd. Therefore variable debug_file cannot be
initialized. Therefore reverted commit completely turned off
changing owner of debug files. Side effect of this change
was that annoying error messages was not logged in case of
journald.
Resolves:
https://fedorahosted.org/sssd/ticket/2938
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> |
f6c1f6a561bdd5b4bba03c02988a724da3dad387 |
|
23-Feb-2016 |
Lukas Slebodnik <lslebodn@redhat.com> |
UTIL: Use sss_vdebug_fn for callbacks
Reviewed-by: Pavel Březina <pbrezina@redhat.com> |
22bbd95a48d21452fa5bb1a96b43334503bf8132 |
|
23-Feb-2016 |
Lukas Slebodnik <lslebodn@redhat.com> |
UTIL: Provide varargs version of debug_fn
Reviewed-by: Pavel Březina <pbrezina@redhat.com> |
2a44a8c6683cfea218ee5329bcfad953dfeb6746 |
|
23-Feb-2016 |
Lukas Slebodnik <lslebodn@redhat.com> |
UTIL: Use prefix for debug function
Reviewed-by: Pavel Březina <pbrezina@redhat.com> |
152fed23797c8950ca18cf6dc2bddb61a3f615c8 |
|
27-Oct-2015 |
Petr Cech <pcech@redhat.com> |
DEBUG: Preventing chown_debug_file if journald on
There is function chown_debug_file() which didn't check
if the SSSD is compiled with journald support.
This patch add simple checking of this state.
Resolves:
https://fedorahosted.org/sssd/ticket/2493
Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> |
c299f997e20011536e365bc18e59e73f68629d2c |
|
14-Oct-2015 |
Petr Cech <pcech@redhat.com> |
REFACTOR: umask(0177) --> umask(SSS_DFL_UMASK)
There are many calls of umask function with 0177 argument. This patch
add new constant SSS_DFL_UMASK which stands for 0177. So all occurences
of umask(0177) (except responder code) are replaced by constant
SSS_DFL_UMASK.
Resolves:
https://fedorahosted.org/sssd/ticket/2424
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> |
c4fb8f55f2894de431478ccfec63f9a97e090d0e |
|
14-Aug-2015 |
Michal Židek <mzidek@redhat.com> |
DEBUG: Add new debug category for fail over.
Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> |
843a66170a4e51e0a614498e74f3526afc4bff52 |
|
14-Apr-2015 |
Jakub Hrozek <jhrozek@redhat.com> |
UTIL: Add a simple function to get the fd of debug_file
Reviewed-by: Pavel Reichl <preichl@redhat.com> |
87f8bee53ee1b4ca87b602ff8536bc5fd5b5b595 |
|
17-Mar-2015 |
Lukas Slebodnik <lslebodn@redhat.com> |
Add missing new lines to debug messages
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> |
4546e283498ffe2511cb566b9159714c671e326b |
|
20-Oct-2014 |
Jakub Hrozek <jhrozek@redhat.com> |
SSSD: Chown the log files
We need to chown the log files before dropping root to make sure they
are usable by the SSSD user. Unfortunately, we can't just rely on
passing the fd opened by root, because we need to be also able to rotate
the log files.
Reviewed-by: Pavel Reichl <preichl@redhat.com> |
9a990aa9f7e8c105e0cfeea8d8cbdc776c2d5d7a |
|
09-Jul-2014 |
Jakub Hrozek <jhrozek@redhat.com> |
SSSD: Send debug to stderr when running on foreground
https://fedorahosted.org/sssd/ticket/2348
When SSSD is running in interactive mode, we should print DEBUG messages
directly to stderr, not journal.
Reviewed-by: Michal Židek <mzidek@redhat.com> |
3ddbc81148d8bae386beb987195086ade9355f38 |
|
21-Feb-2014 |
Lukas Slebodnik <lslebodn@redhat.com> |
Fix warning unused variable ap_fallback
The variable ap_fallback is used only if sssd is build with journald, but
this variable was declared outside of "#ifdef WITH_JOURNALD"
Reviewed-by: Pavel Březina <pbrezina@redhat.com> |
aa41947da76750427cdc4402cc60097063eb668e |
|
20-Feb-2014 |
Lukas Slebodnik <lslebodn@redhat.com> |
DEBUG: Fix crash after fallback from journal log
if journal_send fail we should not use the same va_list in the fallback
functions. va_list can be modiefied and it may cause crashes im some
cases e.g. printing string.
This patch use copy of initialised va_list for debug_vprintf function.
Reviewed-by: Sumit Bose <sbose@redhat.com>
Reviewed-by: Stephen Gallagher <sgallagh@redhat.com> |
9688383806aac671c7ae0faddaf96ec35c9a455b |
|
19-Feb-2014 |
Jakub Hrozek <jhrozek@redhat.com> |
DEBUG: Fix build without journald
Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> |
60df591b865831a71e93eb57f4c353c4555b66cf |
|
19-Feb-2014 |
Stephen Gallagher <sgallagh@redhat.com> |
DEBUG: Enable sending structured debug logs to journald
We are now able to send structured debug logs to journald, tagged with
the code file, line number and domain that the log pertains to. To
enable this functionality, SSSD must be configured at build-time with
--with-syslog=journald and must be launched without -f/--debug-to-files
This behavior is nearly identical to how SSSD will function today on a
systemd-based system if --debug-to-files is disabled, since it will
redirect stdout and stderr into journald. This patch merely enhances
the situation to send structured logs instead of simple string messages.
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> |
41354b0b972df187d5b6f6b02b26b736ec6bce23 |
|
19-Feb-2014 |
Stephen Gallagher <sgallagh@redhat.com> |
DEBUG: Allow debug_fn to process __FILE__ and __LINE__
In preparation for enabling journald support for the DEBUG logs, we
will need to be able to pass in certain additional arguments that will
be required, specifically the code file and line number.
We will be able to optionally enable this in the file-based logs as well
if we so choose, but for right now we will avoid breaking the log
format on disk.
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> |
5c233380e1ebf641f6106a34d7b94f9e9a606589 |
|
12-Feb-2014 |
Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com> |
Remove DEBUG macro support for old debug levels
Remove support for specifying old debug levels to the DEBUG macro:
* remove debug_get_level function which was used for conversion,
* remove debug_get_level tests,
* remove mentions of old/new levels from DEBUG and DEBUG_IS_SET
macro descriptions,
* rename "newlevel" argument of debug_fn to just "level".
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Reviewed-by: Stephen Gallagher <sgallagh@redhat.com>
Reviewed-by: Simo Sorce <simo@redhat.com> |
83bf46f4066e3d5e838a32357c201de9bd6ecdfd |
|
12-Feb-2014 |
Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com> |
Update DEBUG* invocations to use new levels
Use a script to update DEBUG* macro invocations, which use literal
numbers for levels, to use bitmask macros instead:
grep -rl --include '*.[hc]' DEBUG . |
while read f; do
mv "$f"{,.orig}
perl -e 'use strict;
use File::Slurp;
my @map=qw"
SSSDBG_FATAL_FAILURE
SSSDBG_CRIT_FAILURE
SSSDBG_OP_FAILURE
SSSDBG_MINOR_FAILURE
SSSDBG_CONF_SETTINGS
SSSDBG_FUNC_DATA
SSSDBG_TRACE_FUNC
SSSDBG_TRACE_LIBS
SSSDBG_TRACE_INTERNAL
SSSDBG_TRACE_ALL
";
my $text=read_file(\*STDIN);
my $repl;
$text=~s/
^
(
.*
\b
(DEBUG|DEBUG_PAM_DATA|DEBUG_GR_MEM)
\s*
\(\s*
)(
[0-9]
)(
\s*,
)
(
\s*
)
(
.*
)
$
/
$repl = $1.$map[$3].$4.$5.$6,
length($repl) <= 80
? $repl
: $1.$map[$3].$4."\n".(" " x length($1)).$6
/xmge;
print $text;
' < "$f.orig" > "$f"
rm "$f.orig"
done
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Reviewed-by: Stephen Gallagher <sgallagh@redhat.com>
Reviewed-by: Simo Sorce <simo@redhat.com> |
a3c8390d19593b1e5277d95bfb4ab206d4785150 |
|
12-Feb-2014 |
Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com> |
Make DEBUG macro invocations variadic
Use a script to update DEBUG macro invocations to use it as a variadic
macro, supplying format string and its arguments directly, instead of
wrapping them in parens.
This script was used to update the code:
grep -rwl --include '*.[hc]' DEBUG . |
while read f; do
mv "$f"{,.orig}
perl -e \
'use strict;
use File::Slurp;
my $text=read_file(\*STDIN);
$text=~s#(\bDEBUG\s*\([^(]+)\((.*?)\)\s*\)\s*;#$1$2);#gs;
print $text;' < "$f.orig" > "$f"
rm "$f.orig"
done
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Reviewed-by: Stephen Gallagher <sgallagh@redhat.com>
Reviewed-by: Simo Sorce <simo@redhat.com> |
1eedbd1bd2037437f5b9aed1f4061af396ef6733 |
|
12-Feb-2014 |
Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com> |
Cleanup debug_fn
Cleanup debug_fn to better match coding conventions.
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Reviewed-by: Stephen Gallagher <sgallagh@redhat.com>
Reviewed-by: Simo Sorce <simo@redhat.com> |
63ec0cbd668b251708fad23b60cf557163963dc4 |
|
12-Feb-2014 |
Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com> |
Remove extra flushing from debug message output
Remove extra fflush(3) invocation when outputting debug messages.
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Reviewed-by: Stephen Gallagher <sgallagh@redhat.com>
Reviewed-by: Simo Sorce <simo@redhat.com> |
fb0332565892bc10998ca98b567d4dde2213844d |
|
12-Feb-2014 |
Nikolai Kondrashov <Nikolai.Kondrashov@redhat.com> |
Move DEBUG macro body to debug_fn
Move DEBUG macro body to the debug_fn function, adding "function"
argument to the latter.
Rename "debug_fn" in sssd_krb5_locator_plugin.c to "plugin_debug_fn" to
remove conflict with the sssd debug_fn.
Replace DEBUG_MSG macro usage with debug_fn function usage.
Remove DEBUG_MSG macro along with tests.
The above makes the total size of binaries drop by 20% for the standard
Fedora build and by 44% for a build configured according to Debian
packaging script.
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Reviewed-by: Stephen Gallagher <sgallagh@redhat.com>
Reviewed-by: Simo Sorce <simo@redhat.com> |
0b2e2888b1b68742e91a64bbec8540c7bfa3f179 |
|
19-Jul-2013 |
Lukas Slebodnik <lslebodn@redhat.com> |
Fix clang format string warning.
warning: format string is not a string literal (potentially insecure)
[-Wformat-security] |
7800c9da75ad0dc3b4a530b15adce86d6c4f26e5 |
|
13-Mar-2013 |
Lukas Slebodnik <lslebodn@redhat.com> |
More generalized function open_debug_file_ex()
Function open_debug_file_ex() set flag FD_CLOEXEC to opened
file according to the value of third parameter.
Removed duplicity of unsetting FD_CLOEXEC after calling function
open_debug_file_ex() |
3831f866292da4118e87e204ac8c02244825bf43 |
|
20-Dec-2012 |
Jakub Hrozek <jhrozek@redhat.com> |
Free resources if fileno failed |
449fd66aa70c284dd91d51c49363ef9e941dba8d |
|
18-Dec-2012 |
Jakub Hrozek <jhrozek@redhat.com> |
Set cloexec flag for log files
https://fedorahosted.org/sssd/ticket/1708
The services kept the fd to /var/log/sssd/sssd.log open. I don't think
there's any point in keeping the logfiles open after exec-ing for the
child, so I set the CLOEXEC flag. |
9e2c64c6d4f5560e27207193efea6536a566865e |
|
29-Oct-2012 |
Michal Zidek <mzidek@redhat.com> |
Include talloc log in our debug facility
https://fedorahosted.org/sssd/ticket/1495 |
1821a0d507d5aadf725d4af4757819119c91cc68 |
|
29-Jun-2012 |
Stephen Gallagher <sgallagh@redhat.com> |
DEBUG: Log to syslog if we are unable to open a debug fd |
1a7529bf5f867b43e0475f7f9ac0cd8671fb16f1 |
|
08-Sep-2011 |
Pavel Březina <pbrezina@redhat.com> |
DEBUG timestamps offer higher precision
https://fedorahosted.org/sssd/ticket/956
Added: --debug-microseconds=0/1
Added: debug_microseconds to sssd.conf |
89caf5edcc99f5731e89bd51e6ffaad3ec11c304 |
|
25-Aug-2011 |
Pavel Březina <pbrezina@redhat.com> |
New DEBUG facility - SSSDBG_UNRESOLVED changed from -1 to 0
Removed:
SSS_UNRESOLVED_DEBUG_LEVEL (completely replaced with SSSDBG_UNRESOLVED)
Added new macro:
CONVERT_AND_SET_DEBUG_LEVEL(new_value)
Changes unresolved debug level value (SSSDBG_UNRESOLVED) from -1 to 0
so DEBUG macro could be reduced by one condition. Anyway, it has a minor
effect, every time you want to load debug_level from command line parameters,
you have to use following pattern:
/* Set debug level to invalid value so we can deside if -d 0 was used. */
debug_level = SSSDBG_INVALID;
pc = poptGetContext(argv[0], argc, argv, long_options, 0);
while((opt = poptGetNextOpt(pc)) != -1) { ... }
CONVERT_AND_SET_DEBUG_LEVEL(debug_level); |
99dd40a885ed3d42af4bbbde7ee2fc98830544d0 |
|
25-Aug-2011 |
Pavel Březina <pbrezina@redhat.com> |
New DEBUG facility - conversion
https://fedorahosted.org/sssd/ticket/925
Conversion of the old debug_level format to the new one.
(only where it was necessary)
Removed:
SSS_DEFAULT_DEBUG_LEVEL (completely replaced with SSSDBG_DEFAULT) |
a32ae272bb0ae0a47ab80d3a2fcc535fd5260754 |
|
25-Aug-2011 |
Pavel Březina <pbrezina@redhat.com> |
New DEBUG facility - new levels
https://fedorahosted.org/sssd/ticket/925
Added functions:
- debug_convert_old_level() to convert levels 0-9 to appropriate bitmask
debug_convert_old_level(5) returns 0x03F0 (= 0 | 1 | 2 | 3 | 4 | 5)
- debug_get_level() to convert old level number to its new value
debug_get_level(5) returns 0x0200 (= 5)
There are several new macros in util/util.h:
- SSSDBG_* to reflect a debug level (same names as in the ticket) - please,
don't use magic numbers anymore |
711c9015c3845eb7ff733ea34829c4ecf32d8ab5 |
|
15-Aug-2011 |
Jakub Hrozek <jhrozek@redhat.com> |
Handle errno properly in set_debug_file_from_fd() |
96ea25cbd9b94d48c57b6173eeda2b3fbe670a70 |
|
08-Aug-2011 |
Pavel Březina <pbrezina@redhat.com> |
debug_timestamps fixes
Fixed: could not overwrite debug_timestamps when set in sssd.conf
Fixed: invalid description of debug_timestamps in sssd man page |
324fb26ba803a999bedc29e93c46c84f27abf5b7 |
|
23-May-2011 |
Sumit Bose <sbose@redhat.com> |
Set _GNU_SOURCE globally |
d818283d39d56204ffe710b6c9b83a2cf497f946 |
|
06-May-2011 |
Stephen Gallagher <sgallagh@redhat.com> |
Allow changing the log level without restart
We will now re-read the confdb debug_level value when processing
the monitor_common_logrotate() function, which occurs when the
monitor receives a SIGHUP. |
d3750f3c3a9e232629c8b634b7b5407114667700 |
|
04-May-2011 |
Stephen Gallagher <sgallagh@redhat.com> |
Override config file debug_level with command-line
This patch also makes the following changes:
1) The [sssd] debug_level setting no longer acts as a default for
all other sections.
2) We will now skip passing the debug argument to the child
processes from the master unless the SSSD was run with a
command-line argument for the debug level.
https://fedorahosted.org/sssd/ticket/764 |
999d9250e7efc15f38448c2929bbe6d19dbb8013 |
|
05-Nov-2010 |
Stephen Gallagher <sgallagh@redhat.com> |
Handle errors during log reopening better |
8715fcb39bd8086cb59d978e9a6ae18aaae1f864 |
|
19-Oct-2010 |
Stephen Gallagher <sgallagh@redhat.com> |
Write log opening failures to the syslog
If there is a problem with reopening the logs, it can be an audit
trail issue. |
71cd2f7ce705561d8d8f3cb7f385a57bedad1ef1 |
|
08-Mar-2010 |
Jakub Hrozek <jhrozek@redhat.com> |
Reopen logs when SIGHUP is caught
Upon receiving SIGHUP, the monitor signals all services to reopen their
debug logs. It is also possible to signal individual services to reopen
their particular files.
Fixes: #332 |
1c48b5a62f73234ed26bb20f0ab345ab61cda0ab |
|
18-Feb-2010 |
Stephen Gallagher <sgallagh@redhat.com> |
Rename server/ directory to src/
Also update BUILD.txt |