"Fossies" - the Fresh Open Source Software Archive

Member "sssd-2.2.3/src/providers/ad/ad_sudo.c" (30 Nov 2019, 1794 Bytes) of package /linux/misc/sssd-2.2.3.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) C and C++ source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "ad_sudo.c" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 2.2.2_vs_2.2.3.

    1 /*
    2     SSSD
    3 
    4     AD SUDO Provider Initialization functions
    5 
    6     Authors:
    7         Sumit Bose <sbose@redhat.com>
    8 
    9     Copyright (C) 2014 Red Hat
   10 
   11     This program is free software; you can redistribute it and/or modify
   12     it under the terms of the GNU General Public License as published by
   13     the Free Software Foundation; either version 3 of the License, or
   14     (at your option) any later version.
   15 
   16     This program is distributed in the hope that it will be useful,
   17     but WITHOUT ANY WARRANTY; without even the implied warranty of
   18     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   19     GNU General Public License for more details.
   20 
   21     You should have received a copy of the GNU General Public License
   22     along with this program.  If not, see <http://www.gnu.org/licenses/>.
   23 */
   24 
   25 #include "providers/ad/ad_common.h"
   26 #include "providers/ad/ad_opts.h"
   27 #include "providers/ldap/sdap_sudo.h"
   28 
   29 errno_t ad_sudo_init(TALLOC_CTX *mem_ctx,
   30                     struct be_ctx *be_ctx,
   31                     struct ad_id_ctx *id_ctx,
   32                     struct dp_method *dp_methods)
   33 {
   34     errno_t ret;
   35     struct ad_options *ad_options;
   36     struct sdap_options *ldap_options;
   37 
   38     DEBUG(SSSDBG_TRACE_INTERNAL, "Initializing sudo AD back end\n");
   39 
   40     ret = sdap_sudo_init(mem_ctx,
   41                          be_ctx,
   42                          id_ctx->sdap_id_ctx,
   43                          ad_sudorule_map,
   44                          dp_methods);
   45     if (ret != EOK) {
   46         DEBUG(SSSDBG_OP_FAILURE, "Cannot initialize LDAP SUDO [%d]: %s\n",
   47                                  ret, sss_strerror(ret));
   48         return ret;
   49     }
   50 
   51     ad_options = id_ctx->ad_options;
   52     ldap_options = id_ctx->sdap_id_ctx->opts;
   53 
   54     ad_options->id->sudorule_map = ldap_options->sudorule_map;
   55     return EOK;
   56 }