864cdac4c7fbe768d768da5e01b7518eb02836d9 |
|
17-Aug-2016 |
Petr Cech <pcech@redhat.com> |
LDAP: Adding SIGCHLD callback
This patch adds SIGCHLD callback for ldap_child. So if timeout is
reached and ldap_child is terminated by handler we have debug message
about it.
Resolves:
https://fedorahosted.org/sssd/ticket/3106
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> |
b9a0959c274367dcf69bba6b0a942a1682c74f73 |
|
17-Aug-2016 |
Petr Cech <pcech@redhat.com> |
LDAP: Adding SIGTERM signal before SIGKILL
We add better termination of ldap_child. If ldap_child reaches
the timeout for termination parent sents SIGTERM signal. Child
has 2 seconds for removing temporary file and exit.
If it is not sufficient there is SIGKILL send to the child.
Resolves:
https://fedorahosted.org/sssd/ticket/3106
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> |
45e11be651dbd3855a35de4abd2922e5b9d4b963 |
|
31-May-2016 |
Jakub Hrozek <jhrozek@redhat.com> |
Do not leak fds in case of failures setting up a child process
Resolves:
https://fedorahosted.org/sssd/ticket/3006
The handling of open pipes in failure cases was suboptimal. Moreover,
the faulty logic was copied all over the place. This patch introduces
helper macros to:
- initialize the pipe endpoints to -1
- close an open pipe fd and set it to -1 afterwards
- close both ends unless already closed
These macros are used in the child handling code.
The patch also uses child_io_destructor in the p11_child code for safer
fd handling.
Reviewed-by: Petr Cech <pcech@redhat.com> |
de8815aba87d08b6b7ac5d502dcb1755787e0857 |
|
19-May-2016 |
Jakub Hrozek <jhrozek@redhat.com> |
UTIL: exit() the forked process if exec()-ing a child process fails
When exec() fails, we should not attempt to continue, but just kill the
forked process. The patch adds this logic to the exec_child() and
exec_child_ex() functions to avoid code duplication
Resolves:
https://fedorahosted.org/sssd/ticket/3016
Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> |
9f0bffebd070115ab47a92eadc6890a721c7b78d |
|
31-Aug-2015 |
Michal Židek <mzidek@redhat.com> |
sssd: incorrect checks on length values during packet decoding
https://fedorahosted.org/sssd/ticket/1697
It is safer to isolate the checked (unknown/untrusted)
value on the left hand side in the conditions
to avoid overflows/underflows.
Reviewed-by: Petr Cech <pcech@redhat.com> |
f3d91181d4ee9da3f8bbf4ddf8782951c0ae46c1 |
|
15-Jan-2015 |
Jakub Hrozek <jhrozek@redhat.com> |
UTIL: Unify the fd_nonblocking implementation
The responder and child_common modules each had their own
implementation. Unify it instead and add a unit test.
Reviewed-by: Pavel Březina <pbrezina@redhat.com> |
752227a75c0349089f1d7fdd3a09c8d4a77f425d |
|
15-Jan-2015 |
Jakub Hrozek <jhrozek@redhat.com> |
LDAP: Use child_io_destructor instead of child_cleanup in a custom desctructor
ldap_child was the only child process that used child_cleanup instead of
the common child_io_destructor. Unify the implementation to use the
common function instead.
Reviewed-by: Pavel Březina <pbrezina@redhat.com> |
16cb0969f0a9ea71524d852077d6a480740d4f12 |
|
13-Jan-2015 |
Jakub Hrozek <jhrozek@redhat.com> |
UTIL: Allow dup-ing child pipe to a different FD
Related to:
https://fedorahosted.org/sssd/ticket/2544
Adds a new function exec_child_ex and moves setting the extra_argv[]
to exec_child_ex() along with specifying the input and output fds.
Reviewed-by: Sumit Bose <sbose@redhat.com> |
b4f87b42b18888c396e44e7359f7aafb092221bf |
|
03-Dec-2014 |
Jakub Hrozek <jhrozek@redhat.com> |
Add extra_args to exec_child()
Related:
https://fedorahosted.org/sssd/ticket/2503
Currently all child processes use the same arguments, the construction
of argv[] is even hardcoded in exec_child(). Add an extra_args[] array
that extends the common set of argvs so that we can have child-specific
arguments. Also adds a unit test.
Reviewed-by: Sumit Bose <sbose@redhat.com> |
77b13371c87702aee3f858f6b2b73826cf5a01bd |
|
05-Nov-2014 |
Jakub Hrozek <jhrozek@redhat.com> |
UTIL: Remove more code duplication setting up child processes
All our child processes duplicated the same code that set up the
debugging all around. Instead of adding yet another copy for the
selinux_child, add a common utility function.
Reviewed-by: Michal Židek <mzidek@redhat.com> |
936940720b1b0e701a2317abc4c2d05a78338f33 |
|
05-Nov-2014 |
Jakub Hrozek <jhrozek@redhat.com> |
LDAP: Drop privileges after kinit in ldap_child
After ldap_child initializes privileges using root-owned keytab, it
drops privileges to the SSSD user, minimizing the amount of code that
runs as root.
Reviewed-by: Michal Židek <mzidek@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> |
0e65abe5cf2abf5d4b431cf6bd161b419f07901d |
|
11-Sep-2013 |
Lukas Slebodnik <lslebodn@redhat.com> |
Fix formating of variables with type: size_t |
711bba7e2f72a816774effa389ad13bcc46e7843 |
|
17-Jul-2013 |
Pavel Březina <pbrezina@redhat.com> |
SIGCHLD handler: do not call callback when pvt data where freed
https://fedorahosted.org/sssd/ticket/1992 |
eb64d3406c15dcc5cb42c94488737bdbb9a15655 |
|
20-May-2013 |
Jakub Hrozek <jhrozek@redhat.com> |
Remove unneeded parameter of setup_child and namespace it
setup_child() was accepting a parameter it didn't use. Also the function
name was too generic, so I added a sdap prefix. |
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() |
e7a24374d97e1d1c32d3e18561a20e8c5e6319ec |
|
12-Oct-2012 |
Jakub Hrozek <jhrozek@redhat.com> |
Collect krb5 trace on high debug levels
If the debug level contains SSSDBG_TRACE_ALL, then the logs would also
include tracing information from libkrb5.
https://fedorahosted.org/sssd/ticket/1539 |
e6e0d5a663a133b16938cea263557bf67d544e9c |
|
04-Oct-2012 |
Jakub Hrozek <jhrozek@redhat.com> |
Remove unused variable |
798a227df11f49147fa43e515910ec11e21e0caa |
|
02-Oct-2012 |
Pavel Březina <pbrezina@redhat.com> |
remove left over principal selection
https://fedorahosted.org/sssd/ticket/1303
Domain start up was taking too long when there are many principals
in a kerberos keytab. We were looking up in the keytab two times.
The first time we try to select a proper principal and remember it.
The second call happens almost right after the first one and
it is just a check if the principal exists in the keytab, without
any output information other than success/failure. It is
probably a left over from https://fedorahosted.org/sssd/ticket/781.
This patch removes the second call. |
c8a124ac1b03d83016bda02cad5a369ce6fb1cd7 |
|
01-May-2012 |
Stef Walter <stefw@gnome.org> |
execv, excvp and exec_child never return EOK
* So don't need to handle that case |
87c07559af5cfcd2752295ef7c425bd3205f426f |
|
19-Dec-2011 |
Stephen Gallagher <sgallagh@redhat.com> |
Move child_common routines to util |
4a6a5421113ab662a665c62ed6a24b61a5a36950 |
|
28-Sep-2011 |
Jakub Hrozek <jhrozek@redhat.com> |
Multiline macro cleanup
This is mostly a cosmetic patch.
The purpose of wrapping a multi-line macro in a do { } while(0) is to
make the macro usable as a regular statement, not a compound statement.
When the while(0) is terminated with a semicolon, the do { } while(0);
block becomes a compound statement again. |
e81a816cddab4a62f263d1a0274d5d3f101e8e0f |
|
25-Apr-2011 |
Jan Zeleny <jzeleny@redhat.com> |
Modify principal selection for keytab authentication
Currently we construct the principal as host/fqdn@REALM. The problem
with this is that this principal doesn't have to be in the keytab. In
that case the provider fails to start. It is better to scan the keytab
and find the most suitable principal to use. Only in case no suitable
principal is found the backend should fail to start.
The second issue solved by this patch is that the realm we are
authenticating the machine to can be in general different from the realm
our users are part of (in case of cross Kerberos trust).
The patch adds new configuration option SDAP_SASL_REALM.
https://fedorahosted.org/sssd/ticket/781 |
64783bdc0aff447a356c5169c027dadc05dfb312 |
|
13-Oct-2010 |
Jakub Hrozek <jhrozek@redhat.com> |
Make ldap_child report kerberos return code to parent |
2f4e8fbdf1d4ba1e00fcab93af91fe4f4f40250d |
|
03-Aug-2010 |
Jakub Hrozek <jhrozek@redhat.com> |
Validate keytab at startup
In addition to validating the keytab everytime a TGT is requested, we
also validate the keytab on back end startup to give early warning that
the keytab is not usable.
Fixes: #556 |
a2cabe1873c4d01c18ef6617b6b1f10a0ce3560e |
|
09-Jul-2010 |
eindenbom <eindenbom@gmail.com> |
GSSAPI ticket expiry time is returned from ldap_child and stored in sdap_handle for future reference. |
711fc7d00135cb5fb202efe1a0b77c61b4f2c099 |
|
09-Jun-2010 |
Jakub Hrozek <jhrozek@redhat.com> |
Fix realm_str dereference
Fixes: #508 |
ebb6e30d687a4d6626c735234c85cbb5b06a26aa |
|
16-May-2010 |
Sumit Bose <sbose@redhat.com> |
Add ldap_krb5_ticket_lifetime option |
af971fb6cf853c3a5f41aa00918013903aba1ff3 |
|
16-May-2010 |
Stephen Gallagher <sgallagh@redhat.com> |
Properly set up SIGCHLD handlers
Instead of having all-purpose SIGCHLD handlers that try to catch
every occurrence, we instead create a per-PID handler. This will
allow us to specify callbacks to occur when certain children exit. |
6adf5b8a078f2b37f2d3d91cd060b891c2a7efaa |
|
03-Mar-2010 |
Simo Sorce <ssorce@redhat.com> |
Improve safe alignment buffer handling macros
Make the counter optional so that alignment safe macros can be used also where
there is no counter to update.
Change arguments names so that they are not deceiving (ptr normlly identify a
pointer)
Turn the memcpy substitute into an inline function so that passing a pointer to
rp and checking for it doesn't make the compiler spit lots of warnings. |
1c48b5a62f73234ed26bb20f0ab345ab61cda0ab |
|
18-Feb-2010 |
Stephen Gallagher <sgallagh@redhat.com> |
Rename server/ directory to src/
Also update BUILD.txt |