f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio Fabiano Fidêncio <fidencio@redhat.com>
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio Copyright (C) 2017 Red Hat
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio This program is free software; you can redistribute it and/or modify
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio it under the terms of the GNU General Public License as published by
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio the Free Software Foundation; either version 3 of the License, or
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio (at your option) any later version.
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio This program is distributed in the hope that it will be useful,
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio but WITHOUT ANY WARRANTY; without even the implied warranty of
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio GNU General Public License for more details.
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio You should have received a copy of the GNU General Public License
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio along with this program. If not, see <http://www.gnu.org/licenses/>.
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio#include "providers/ipa/ipa_deskprofile_private.h"
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio#include "providers/ipa/ipa_deskprofile_config.h"
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncioipa_deskprofile_get_config_done(struct tevent_req *subreq);
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncioipa_deskprofile_get_config_send(TALLOC_CTX *mem_ctx,
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio const char *attrs[] = { IPA_DESKPROFILE_PRIORITY, NULL };
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio DEBUG(SSSDBG_CRIT_FAILURE, "tevent_req_create() failed.\n");
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio rule_filter = talloc_asprintf(state, "(objectclass=%s)",
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio subreq = sdap_get_generic_send(state, ev, opts, sh,
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio DEBUG(SSSDBG_CRIT_FAILURE, "sdap_get_generic_send failed.\n");
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio tevent_req_set_callback(subreq, ipa_deskprofile_get_config_done, req);
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncioipa_deskprofile_get_config_done(struct tevent_req *subreq)
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio struct ipa_deskprofile_config_state *state;
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio req = tevent_req_callback_data(subreq, struct tevent_req);
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio state = tevent_req_data(req, struct ipa_deskprofile_config_state);
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio ret = sdap_get_generic_recv(subreq, state, &reply_count, &reply);
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio "Could not retrieve Desktop Profile config\n");
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio * When connecting to an old server that doesn't support Desktop
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio * Profile, the reply_count will be zero.
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio * In order to not throw a unnecessary error and fail let's just
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio * return ENOENT and print a debug message about it.
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio "Server doesn't support Desktop Profile.\n");
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio "Unexpected number of results, expected 1, got %zu.\n",
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncioipa_deskprofile_get_config_recv(struct tevent_req *req,
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio struct ipa_deskprofile_config_state *state;
f982039c75ec064894deb676ae53ee57de868590Fabiano Fidêncio state = tevent_req_data(req, struct ipa_deskprofile_config_state);