e157b9f6cb370e1b94bcac2044d26ad66d640fbaPavel Březina Pavel Březina <pbrezina@redhat.com>
e157b9f6cb370e1b94bcac2044d26ad66d640fbaPavel Březina Copyright (C) 2016 Red Hat
e157b9f6cb370e1b94bcac2044d26ad66d640fbaPavel Březina This program is free software; you can redistribute it and/or modify
e157b9f6cb370e1b94bcac2044d26ad66d640fbaPavel Březina it under the terms of the GNU General Public License as published by
e157b9f6cb370e1b94bcac2044d26ad66d640fbaPavel Březina the Free Software Foundation; either version 3 of the License, or
e157b9f6cb370e1b94bcac2044d26ad66d640fbaPavel Březina (at your option) any later version.
e157b9f6cb370e1b94bcac2044d26ad66d640fbaPavel Březina This program is distributed in the hope that it will be useful,
e157b9f6cb370e1b94bcac2044d26ad66d640fbaPavel Březina but WITHOUT ANY WARRANTY; without even the implied warranty of
e157b9f6cb370e1b94bcac2044d26ad66d640fbaPavel Březina MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
e157b9f6cb370e1b94bcac2044d26ad66d640fbaPavel Březina GNU General Public License for more details.
e157b9f6cb370e1b94bcac2044d26ad66d640fbaPavel Březina You should have received a copy of the GNU General Public License
e157b9f6cb370e1b94bcac2044d26ad66d640fbaPavel Březina along with this program. If not, see <http://www.gnu.org/licenses/>.
e157b9f6cb370e1b94bcac2044d26ad66d640fbaPavel Březina#define ERR_SSSD _("Check that SSSD is running and " \
9b86f8f3c07af6fd3d2b08ff66cf9dcce61e7abfJustin Stephenson "the InfoPipe responder is enabled. " \
9b86f8f3c07af6fd3d2b08ff66cf9dcce61e7abfJustin Stephenson "Make sure 'ifp' is listed in the " \
9b86f8f3c07af6fd3d2b08ff66cf9dcce61e7abfJustin Stephenson "'services' option in sssd.conf.\n")
e157b9f6cb370e1b94bcac2044d26ad66d640fbaPavel Březinastatic int sssctl_sifp_data_destructor(struct sssctl_sifp_data *ctx)
e157b9f6cb370e1b94bcac2044d26ad66d640fbaPavel Březinastatic void *sssctl_sifp_talloc(size_t size, void *pvt)
e157b9f6cb370e1b94bcac2044d26ad66d640fbaPavel Březinastatic void sssctl_sifp_talloc_free(void *ptr, void *pvt)
e157b9f6cb370e1b94bcac2044d26ad66d640fbaPavel Březinasss_sifp_error sssctl_sifp_init(struct sss_tool_ctx *tool_ctx,
e157b9f6cb370e1b94bcac2044d26ad66d640fbaPavel Březina sifp_data = talloc_zero(tool_ctx, struct sssctl_sifp_data);
e157b9f6cb370e1b94bcac2044d26ad66d640fbaPavel Březina error = sss_sifp_init_ex(sifp_data, sssctl_sifp_talloc,
e157b9f6cb370e1b94bcac2044d26ad66d640fbaPavel Březina talloc_set_destructor(sifp_data, sssctl_sifp_data_destructor);
e157b9f6cb370e1b94bcac2044d26ad66d640fbaPavel Březina dbus_code = sss_sifp_get_last_io_error_name(sifp);
e157b9f6cb370e1b94bcac2044d26ad66d640fbaPavel Březina dbus_msg = sss_sifp_get_last_io_error_message(sifp);
e157b9f6cb370e1b94bcac2044d26ad66d640fbaPavel Březina fprintf(stderr, "%s [%d]: %s\n", message, error, sifp_msg);
e157b9f6cb370e1b94bcac2044d26ad66d640fbaPavel Březina fprintf(stderr, "%s: %s\n", dbus_code, dbus_msg);
e157b9f6cb370e1b94bcac2044d26ad66d640fbaPavel Březina if (strcmp(dbus_code, DBUS_ERROR_SERVICE_UNKNOWN) == 0) {
e157b9f6cb370e1b94bcac2044d26ad66d640fbaPavel Březina if (strcmp(dbus_code, DBUS_ERROR_SPAWN_CHILD_EXITED) == 0) {
e157b9f6cb370e1b94bcac2044d26ad66d640fbaPavel Březina if (strcmp(dbus_code, DBUS_ERROR_NO_REPLY) == 0) {
e157b9f6cb370e1b94bcac2044d26ad66d640fbaPavel Březina fprintf(stderr, "%s [%d]: %s\n", message, error, sifp_msg);
9b74009c1260e6f3b1031a6ae110bf1d957cba81Pavel Březinasss_sifp_error _sssctl_sifp_send(TALLOC_CTX *mem_ctx,
9b74009c1260e6f3b1031a6ae110bf1d957cba81Pavel Březina msg = sss_sifp_create_message(path, iface, method);
9b74009c1260e6f3b1031a6ae110bf1d957cba81Pavel Březina DEBUG(SSSDBG_CRIT_FAILURE, "Unable to create D-Bus message\n");
9b74009c1260e6f3b1031a6ae110bf1d957cba81Pavel Březina bret = dbus_message_append_args_valist(msg, first_arg_type, va);
9b74009c1260e6f3b1031a6ae110bf1d957cba81Pavel Březina DEBUG(SSSDBG_CRIT_FAILURE, "Failed to build message\n");
9b74009c1260e6f3b1031a6ae110bf1d957cba81Pavel Březina error = sss_sifp_send_message(sifp, msg, _reply);