responder_get_domains.c revision a3c8390d19593b1e5277d95bfb4ab206d4785150
/*
Authors:
Jan Zeleny <jzeleny@redhat.com>
Copyright (C) 2011 Red Hat
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#include "responder/common/responder.h"
#include "providers/data_provider.h"
/* ========== Get subdomains for a domain ================= */
struct sss_dp_domains_info {
struct sss_domain_info *dom;
const char *hint;
/* The DBus API expects its own Boolean type when formatting argument
* with DBUS_TYPE_BOOLEAN
*/
};
static struct tevent_req *
struct sss_domain_info *dom,
const bool force,
const char *hint)
{
struct tevent_req *req;
struct sss_dp_req_state *state;
struct sss_dp_domains_info *info;
char *key;
return NULL;
}
if (!info) {
goto fail;
}
goto fail;
}
goto fail;
}
return req;
fail:
return req;
}
static DBusMessage *
sss_dp_get_domains_msg(void *pvt)
{
struct sss_dp_domains_info *info;
return NULL;
}
"Sending get domains request for [%s][%sforced][%s]\n",
/* Send the hint argument to provider as well. This will
* be useful for some cases of transitional trust where
* the server might not know all trusted domains
*/
if (!dbret) {
return NULL;
}
return msg;
}
static errno_t
struct tevent_req *req,
char **err_msg)
{
}
/* ====== Iterate over all domains, searching for their subdomains ======= */
struct sss_dp_get_domains_state {
struct sss_domain_info *dom;
const char *hint;
bool force;
};
static void
bool force,
const char *hint)
{
struct tevent_req *req;
struct tevent_req *subreq;
struct sss_dp_get_domains_state *state;
return NULL;
}
goto immediately;
}
if (!force) {
"Last call was too recent, nothing to do!\n");
goto immediately;
goto immediately;
}
}
} else {
goto immediately;
}
}
}
/* All domains were local */
goto immediately;
}
goto immediately;
}
return req;
} else {
}
return req;
}
static void
{
struct tevent_req);
struct sss_dp_get_domains_state);
char *err_msg;
goto fail;
}
"trying next domain.\n");
goto fail;
}
/* Advance to the next domain */
/* Skip local domains */
}
/* All domains were local */
return;
}
goto fail;
}
return;
fail:
return;
}
static errno_t
{
int ret;
"failed.\n");
goto done;
}
}
/* Retrieve all subdomains of this domain from sysdb
* and create their struct sss_domain_info representations
*/
goto done;
}
errno = 0;
if (ret == -1) {
goto done;
}
done:
}
return ret;
}
{
return EOK;
}
{
int ret;
errno = 0;
if (ret == -1) {
}
}
{
struct sss_domain_info *dom;
/* Timeout, expired, fetch domains again */
return EAGAIN;
}
if (!IS_SUBDOMAIN(dom)) {
/* not a subdomain */
continue;
}
/* Timeout, expired, fetch domains again */
return EAGAIN;
}
}
}
}
return EOK;
}
{
int ret;
}
return;
}
struct tevent_immediate *imm,
void *pvt)
{
struct tevent_req *req;
return;
}
return;
}
struct tevent_context *ev,
{
struct tevent_immediate *imm;
return ENOMEM;
}
return EOK;
}