On Thu, Jun 30, 2016 at 02:10:47PM +0200, Pavel Březina wrote:
Failover patches for the sssctl tool. The output looks like:
[master.ipa.pb: ~]$ sudo sssctl domain-status ad.pb Online status: Online
Active servers: AD Global Catalog: root-dc.ad.pb AD Domain Controller: root-dc.ad.pb IPA: master.ipa.pb
Discovered AD Global Catalog servers:
- root-dc.ad.pb
- invalid.ad.pb
- root-dc.ad.pb
Discovered AD Domain Controller servers:
- root-dc.ad.pb
Discovered IPA servers:
- master.ipa.pb
This is the best output format I could thing of so far, but I'm opened for suggestions.
I'm sorry for the late review. I started by sending the patches to CI which found some failures: http://sssd-ci.duckdns.org/logs/job/49/69/summary.html and also Coverity complains: Error: CHECKED_RETURN (CWE-252): sssd-1.14.1/src/lib/sifp/sss_sifp_dbus.c:51: check_return: Calling "dbus_message_append_args_valist" without checking return value (as is done elsewhere 4 out of 5 times). sssd-1.14.1/src/responder/common/data_provider/rdp_message.c:59: example_assign: Example 1: Assigning: "bret" = return value from "dbus_message_append_args_valist(msg, first_arg_type, va)". sssd-1.14.1/src/responder/common/data_provider/rdp_message.c:60: example_checked: Example 1 (cont.): "bret" has its value checked in "bret". sssd-1.14.1/src/sbus/sssd_dbus_request.c:163: example_assign: Example 2: Assigning: "dbret" = return value from "dbus_message_append_args_valist(reply, first_arg_type, va)". sssd-1.14.1/src/sbus/sssd_dbus_request.c:166: example_checked: Example 2 (cont.): "dbret" has its value checked in "dbret". sssd-1.14.1/src/sbus/sssd_dbus_utils.c:141: example_assign: Example 3: Assigning: "bret" = return value from "dbus_message_append_args_valist(msg, first_arg_type, va)". sssd-1.14.1/src/sbus/sssd_dbus_utils.c:142: example_checked: Example 3 (cont.): "bret" has its value checked in "bret". sssd-1.14.1/src/tools/sssctl/sssctl_sifp.c:142: example_assign: Example 4: Assigning: "bret" = return value from "dbus_message_append_args_valist(msg, first_arg_type, va)". sssd-1.14.1/src/tools/sssctl/sssctl_sifp.c:143: example_checked: Example 4 (cont.): "bret" has its value checked in "bret". # 49| # 50| if (first_arg_type != DBUS_TYPE_INVALID) { # 51|-> dbus_message_append_args_valist(msg, first_arg_type, ap); # 52| } # 53|
Error: UNINIT (CWE-457): sssd-1.14.1/src/providers/data_provider/dp_iface_failover.c:182: var_decl: Declaring variable "ad_found" without initializer. sssd-1.14.1/src/providers/data_provider/dp_iface_failover.c:236: uninit_use: Using uninitialized value "ad_found". # 234| # 235| /* Fill the list. */ # 236|-> if ((ad_found && ipa_found) || (!ad_found && !ipa_found)) { # 237| /* If AD and IPA was found it is some complicated configuration, # 238| * we return everything. Otherwise it's LDAP. */
Error: UNINIT (CWE-457): sssd-1.14.1/src/providers/data_provider/dp_iface_failover.c:183: var_decl: Declaring variable "ipa_found" without initializer. sssd-1.14.1/src/providers/data_provider/dp_iface_failover.c:236: uninit_use: Using uninitialized value "ipa_found". # 234| # 235| /* Fill the list. */ # 236|-> if ((ad_found && ipa_found) || (!ad_found && !ipa_found)) { # 237| /* If AD and IPA was found it is some complicated configuration, # 238| * we return everything. Otherwise it's LDAP. */
Error: VARARGS (CWE-237): sssd-1.14.1/src/tools/sssctl/sssctl_sifp.c:141: va_init: Initializing va_list "va". sssd-1.14.1/src/tools/sssctl/sssctl_sifp.c:163: missing_va_end: va_end was not called for "va". # 161| done: # 162| dbus_message_unref(msg); # 163|-> return error; # 164| }