03b859510dc13a13a456ca4aa94c0561a0e9684cJakub Hrozek/*
03b859510dc13a13a456ca4aa94c0561a0e9684cJakub Hrozek SSSD
03b859510dc13a13a456ca4aa94c0561a0e9684cJakub Hrozek
03b859510dc13a13a456ca4aa94c0561a0e9684cJakub Hrozek AD autofs Provider Initialization functions
03b859510dc13a13a456ca4aa94c0561a0e9684cJakub Hrozek
03b859510dc13a13a456ca4aa94c0561a0e9684cJakub Hrozek Copyright (C) 2015 Red Hat
03b859510dc13a13a456ca4aa94c0561a0e9684cJakub Hrozek
03b859510dc13a13a456ca4aa94c0561a0e9684cJakub Hrozek This program is free software; you can redistribute it and/or modify
03b859510dc13a13a456ca4aa94c0561a0e9684cJakub Hrozek it under the terms of the GNU General Public License as published by
03b859510dc13a13a456ca4aa94c0561a0e9684cJakub Hrozek the Free Software Foundation; either version 3 of the License, or
03b859510dc13a13a456ca4aa94c0561a0e9684cJakub Hrozek (at your option) any later version.
03b859510dc13a13a456ca4aa94c0561a0e9684cJakub Hrozek
03b859510dc13a13a456ca4aa94c0561a0e9684cJakub Hrozek This program is distributed in the hope that it will be useful,
03b859510dc13a13a456ca4aa94c0561a0e9684cJakub Hrozek but WITHOUT ANY WARRANTY; without even the implied warranty of
03b859510dc13a13a456ca4aa94c0561a0e9684cJakub Hrozek MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
03b859510dc13a13a456ca4aa94c0561a0e9684cJakub Hrozek GNU General Public License for more details.
03b859510dc13a13a456ca4aa94c0561a0e9684cJakub Hrozek
03b859510dc13a13a456ca4aa94c0561a0e9684cJakub Hrozek You should have received a copy of the GNU General Public License
03b859510dc13a13a456ca4aa94c0561a0e9684cJakub Hrozek along with this program. If not, see <http://www.gnu.org/licenses/>.
03b859510dc13a13a456ca4aa94c0561a0e9684cJakub Hrozek*/
03b859510dc13a13a456ca4aa94c0561a0e9684cJakub Hrozek
03b859510dc13a13a456ca4aa94c0561a0e9684cJakub Hrozek#include "providers/ad/ad_common.h"
03b859510dc13a13a456ca4aa94c0561a0e9684cJakub Hrozek#include "providers/ldap/sdap_autofs.h"
03b859510dc13a13a456ca4aa94c0561a0e9684cJakub Hrozek
dea636af4d1902a081ee891f1b19ee2f8729d759Pavel Březinaerrno_t ad_autofs_init(TALLOC_CTX *mem_ctx,
dea636af4d1902a081ee891f1b19ee2f8729d759Pavel Březina struct be_ctx *be_ctx,
dea636af4d1902a081ee891f1b19ee2f8729d759Pavel Březina struct ad_id_ctx *id_ctx,
dea636af4d1902a081ee891f1b19ee2f8729d759Pavel Březina struct dp_method *dp_methods)
03b859510dc13a13a456ca4aa94c0561a0e9684cJakub Hrozek{
03b859510dc13a13a456ca4aa94c0561a0e9684cJakub Hrozek int ret;
03b859510dc13a13a456ca4aa94c0561a0e9684cJakub Hrozek
03b859510dc13a13a456ca4aa94c0561a0e9684cJakub Hrozek DEBUG(SSSDBG_TRACE_INTERNAL, "Initializing autofs AD back end\n");
03b859510dc13a13a456ca4aa94c0561a0e9684cJakub Hrozek
dea636af4d1902a081ee891f1b19ee2f8729d759Pavel Březina ret = sdap_autofs_init(mem_ctx, be_ctx, id_ctx->sdap_id_ctx, dp_methods);
03b859510dc13a13a456ca4aa94c0561a0e9684cJakub Hrozek if (ret != EOK) {
03b859510dc13a13a456ca4aa94c0561a0e9684cJakub Hrozek DEBUG(SSSDBG_OP_FAILURE, "Cannot initialize AD autofs [%d]: %s\n",
03b859510dc13a13a456ca4aa94c0561a0e9684cJakub Hrozek ret, sss_strerror(ret));
03b859510dc13a13a456ca4aa94c0561a0e9684cJakub Hrozek return ret;
03b859510dc13a13a456ca4aa94c0561a0e9684cJakub Hrozek }
03b859510dc13a13a456ca4aa94c0561a0e9684cJakub Hrozek
03b859510dc13a13a456ca4aa94c0561a0e9684cJakub Hrozek ret = ad_get_autofs_options(id_ctx->ad_options, be_ctx->cdb,
03b859510dc13a13a456ca4aa94c0561a0e9684cJakub Hrozek be_ctx->conf_path);
03b859510dc13a13a456ca4aa94c0561a0e9684cJakub Hrozek if (ret != EOK) {
03b859510dc13a13a456ca4aa94c0561a0e9684cJakub Hrozek DEBUG(SSSDBG_OP_FAILURE, "Cannot initialize AD autofs [%d]: %s\n",
03b859510dc13a13a456ca4aa94c0561a0e9684cJakub Hrozek ret, sss_strerror(ret));
03b859510dc13a13a456ca4aa94c0561a0e9684cJakub Hrozek return ret;
03b859510dc13a13a456ca4aa94c0561a0e9684cJakub Hrozek }
03b859510dc13a13a456ca4aa94c0561a0e9684cJakub Hrozek
03b859510dc13a13a456ca4aa94c0561a0e9684cJakub Hrozek return EOK;
03b859510dc13a13a456ca4aa94c0561a0e9684cJakub Hrozek}