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> |
9dcc7dbf04466cd8cd90aa0bb8acbebef9aca832 |
|
19-Jan-2016 |
Sumit Bose <sbose@redhat.com> |
UTIL: allow to skip default options for child processes
Currently the SSSD default options like e.g. --debug-level are added
unconditionally to the command line options of a child process when
started with the child helper functions.
If a binary from a different source should be started as a child by SSSD
those options might not be known or used differently. This patch adds an
option to exec_child_ex() which allows to skip the default options and
only add specific options.
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com> |
5085d263f2f084778b1314fc5e808668c3758d82 |
|
11-Feb-2015 |
Lukas Slebodnik <lslebodn@redhat.com> |
Fix warning: equality comparison with extraneous parentheses
Example of warning:
src/sss_client/libwbclient/wbc_pwd_sssd.c:246:23:
error: equality comparison with extraneous parentheses
[-Werror,-Wparentheses-equality]
if (((wbc_status) == WBC_ERR_SUCCESS)) {
~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
src/sss_client/libwbclient/wbc_pwd_sssd.c:246:23:
note: remove extraneous parentheses around the comparison
to silence this warning
if (((wbc_status) == WBC_ERR_SUCCESS)) {
~ ^ ~
src/sss_client/libwbclient/wbc_pwd_sssd.c:246:23:
note: use '=' to turn this equality comparison into an assignment
if (((wbc_status) == WBC_ERR_SUCCESS)) {
^~
=
The reason is definition of some macros which were used in if conditions.
Reviewed-by: Michal Židek <mzidek@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> |
0e8a48e38e467b05951d2719956f8c0d5aed76b3 |
|
15-Jan-2015 |
Jakub Hrozek <jhrozek@redhat.com> |
UTIL: Remove child_cleanup
Not used anymore after previous patch.
Reviewed-by: Pavel Březina <pbrezina@redhat.com> |
dc7d8ab0f796239338ea67cf6698e0bc6b619174 |
|
15-Jan-2015 |
Jakub Hrozek <jhrozek@redhat.com> |
UTIL: Make two child_common.c functions static
Two functions were only used internally, makes no sense to keep them in the
child_common module API.
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> |
8e44ddfccebe61728d8a2c1dafce36dfa944bc90 |
|
03-Dec-2014 |
Jakub Hrozek <jhrozek@redhat.com> |
sss_atomic_write_s() return value is signed
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> |
06f10b2a0ebb26f2460cd445f8040e9205de7500 |
|
05-Nov-2014 |
Jakub Hrozek <jhrozek@redhat.com> |
UTIL: Remove code duplication of struct io
We had struct io and the associated destructor copied twice in the code
already and need it again in the SELinux provider. Instead of adding
another copy, move the code to a shared subtree under util/
Reviewed-by: Michal Židek <mzidek@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> |
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 |
71e234151ddc6b50576364c30bda2b72264b1083 |
|
11-Sep-2013 |
Lukas Slebodnik <lslebodn@redhat.com> |
Fix formating of variables with type: ssize_t |
6f6f757d31ddbab13e5b4c2c1aad3e7d0dae722a |
|
22-Aug-2013 |
Lukas Slebodnik <lslebodn@redhat.com> |
Use brackets around macros.
warnings reported by cppcheck. |
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 |
325dace7e2a0ae1f4d477416e9e8f05f7c843fdf |
|
24-Apr-2013 |
Jakub Hrozek <jhrozek@redhat.com> |
Do not keep growing event context |
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 |
9d7d4458d94d0aac0a7edf999368eb18f89cb76a |
|
20-Apr-2012 |
Jakub Hrozek <jhrozek@redhat.com> |
Convert read and write operations to sss_atomic_read
https://fedorahosted.org/sssd/ticket/1209 |
87c07559af5cfcd2752295ef7c425bd3205f426f |
|
19-Dec-2011 |
Stephen Gallagher <sgallagh@redhat.com> |
Move child_common routines to util |