This off-by-one bug would hit us especially when using the negative
cache, I guess it was because we would strdup and later retrieve
something else than intended..
The same bug does not exist in the similar parse_getservbyport function.
I managed to reproduce the bug with by queriying the SSSD for services
quite fast. The services/protocols were based on data from the crash
for s in smtp/dccp rpcbind/dccp rpcbind/udplite rpcbind/sctp
rpcbind/sctp 47117/udp rpcbind/dccp; do getent services $s; sleep 1;
okos on IRC pointed out this comment does not reflect the code anymore.
The comment is old and need to be removed as the logic it refers to has
Simo Sorce * Red Hat, Inc * New York
I was looking for some reusable code and found static function
send_sighup in sss_debuglevel.c. This function can be useful in
other tools as well, so I renamed it to signal_sssd, added
signum parameter and put it to tools_util.c/h. It can be used
to send any signal to sssd monitor.
Patch is in attachment.
We check the presence of the directory /etc/selinux/targeted/logins to
determine if the platform supports per-user SELinux logins.
However, I forgot to BuildRequire that directory, so RPMs built in mock
failed to detect it completely unlike my test RPMs built locally.
The other alternative I was considering was a simple switch that would
be disabled on old platforms and enabled on new platforms but a) I don't
lke the idea of yet another switch and b) I'd like the feature to work
correctly on all platforms automatically, even on other distributions.
I noticed (using valgrind) that the sysdb tests access memory outside
the array allocated as a result of the functions in subject. The attached
patch NULL-terminates the array so that it's safe to loop over the results.