"Fossies" - the Fresh Open Source Software Archive

Member "sssd-2.2.3/src/providers/ad/ad_common.h" (30 Nov 2019, 7897 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_common.h" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 2.2.0_vs_2.2.1.

    1 /*
    2     SSSD
    3 
    4     Authors:
    5         Stephen Gallagher <sgallagh@redhat.com>
    6 
    7     Copyright (C) 2012 Red Hat
    8 
    9     This program is free software; you can redistribute it and/or modify
   10     it under the terms of the GNU General Public License as published by
   11     the Free Software Foundation; either version 3 of the License, or
   12     (at your option) any later version.
   13 
   14     This program is distributed in the hope that it will be useful,
   15     but WITHOUT ANY WARRANTY; without even the implied warranty of
   16     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
   17     GNU General Public License for more details.
   18 
   19     You should have received a copy of the GNU General Public License
   20     along with this program.  If not, see <http://www.gnu.org/licenses/>.
   21 */
   22 
   23 #ifndef AD_COMMON_H_
   24 #define AD_COMMON_H_
   25 
   26 #include "util/util.h"
   27 #include "providers/ldap/ldap_common.h"
   28 
   29 #define AD_SERVICE_NAME    "AD"
   30 #define AD_GC_SERVICE_NAME "AD_GC"
   31 /* The port the Global Catalog runs on */
   32 #define AD_GC_PORT      3268
   33 
   34 #define AD_AT_OBJECT_SID "objectSID"
   35 #define AD_AT_DNS_DOMAIN "DnsDomain"
   36 #define AD_AT_NT_VERSION "NtVer"
   37 #define AD_AT_NETLOGON   "netlogon"
   38 
   39 #define MASTER_DOMAIN_SID_FILTER "objectclass=domain"
   40 
   41 struct ad_options;
   42 
   43 enum ad_basic_opt {
   44     AD_DOMAIN = 0,
   45     AD_ENABLED_DOMAINS,
   46     AD_SERVER,
   47     AD_BACKUP_SERVER,
   48     AD_HOSTNAME,
   49     AD_KEYTAB,
   50     AD_KRB5_REALM,
   51     AD_ENABLE_DNS_SITES,
   52     AD_ACCESS_FILTER,
   53     AD_ENABLE_GC,
   54     AD_GPO_ACCESS_CONTROL,
   55     AD_GPO_IMPLICIT_DENY,
   56     AD_GPO_IGNORE_UNREADABLE,
   57     AD_GPO_CACHE_TIMEOUT,
   58     AD_GPO_MAP_INTERACTIVE,
   59     AD_GPO_MAP_REMOTE_INTERACTIVE,
   60     AD_GPO_MAP_NETWORK,
   61     AD_GPO_MAP_BATCH,
   62     AD_GPO_MAP_SERVICE,
   63     AD_GPO_MAP_PERMIT,
   64     AD_GPO_MAP_DENY,
   65     AD_GPO_DEFAULT_RIGHT,
   66     AD_SITE,
   67     AD_KRB5_CONFD_PATH,
   68     AD_MAXIMUM_MACHINE_ACCOUNT_PASSWORD_AGE,
   69     AD_MACHINE_ACCOUNT_PASSWORD_RENEWAL_OPTS,
   70 
   71     AD_OPTS_BASIC /* opts counter */
   72 };
   73 
   74 struct ad_id_ctx {
   75     struct sdap_id_ctx *sdap_id_ctx;
   76     struct sdap_id_conn_ctx *ldap_ctx;
   77     struct sdap_id_conn_ctx *gc_ctx;
   78     struct ad_options *ad_options;
   79 };
   80 
   81 struct ad_service {
   82     struct sdap_service *sdap;
   83     struct sdap_service *gc;
   84     struct krb5_service *krb5_service;
   85 };
   86 
   87 struct ad_options {
   88     /* Common options */
   89     struct dp_option *basic;
   90     struct ad_service *service;
   91 
   92     /* ID Provider */
   93     struct sdap_options *id;
   94     struct ad_id_ctx *id_ctx;
   95 
   96     /* Auth and chpass Provider */
   97     struct krb5_ctx *auth_ctx;
   98 
   99     /* Dynamic DNS updates */
  100     struct be_resolv_ctx *be_res;
  101     struct be_nsupdate_ctx *dyndns_ctx;
  102 };
  103 
  104 errno_t
  105 ad_get_common_options(TALLOC_CTX *mem_ctx,
  106                       struct confdb_ctx *cdb,
  107                       const char *conf_path,
  108                       struct sss_domain_info *dom,
  109                       struct ad_options **_opts);
  110 
  111 /* FIXME: ad_get_common_options and ad_create_options are
  112  * similar. The later is subdomain specific. It may be
  113  * good to merge the two into one more generic funtion. */
  114 struct ad_options *ad_create_options(TALLOC_CTX *mem_ctx,
  115                                      struct confdb_ctx *cdb,
  116                                      const char *conf_path,
  117                                      struct data_provider *dp,
  118                                      struct sss_domain_info *subdom);
  119 
  120 struct ad_options *ad_create_2way_trust_options(TALLOC_CTX *mem_ctx,
  121                                                 struct confdb_ctx *cdb,
  122                                                 const char *conf_path,
  123                                                 struct data_provider *dp,
  124                                                 const char *realm,
  125                                                 struct sss_domain_info *subdom,
  126                                                 const char *hostname,
  127                                                 const char *keytab);
  128 
  129 struct ad_options *ad_create_1way_trust_options(TALLOC_CTX *mem_ctx,
  130                                                 struct confdb_ctx *cdb,
  131                                                 const char *conf_path,
  132                                                 struct data_provider *dp,
  133                                                 struct sss_domain_info *subdom,
  134                                                 const char *hostname,
  135                                                 const char *keytab,
  136                                                 const char *sasl_authid);
  137 
  138 errno_t ad_set_search_bases(struct sdap_options *id_opts,
  139                             struct sdap_domain *sdap);
  140 
  141 errno_t
  142 ad_failover_init(TALLOC_CTX *mem_ctx, struct be_ctx *ctx,
  143                  const char *primary_servers,
  144                  const char *backup_servers,
  145                  const char *krb5_realm,
  146                  const char *ad_service,
  147                  const char *ad_gc_service,
  148                  const char *ad_domain,
  149                  bool use_kdcinfo,
  150                  size_t n_lookahead_primary,
  151                  size_t n_lookahead_backup,
  152                  struct ad_service **_service);
  153 
  154 void
  155 ad_failover_reset(struct be_ctx *bectx,
  156                   struct ad_service *adsvc);
  157 
  158 errno_t
  159 ad_get_id_options(struct ad_options *ad_opts,
  160                    struct confdb_ctx *cdb,
  161                    const char *conf_path,
  162                    struct data_provider *dp,
  163                    struct sdap_options **_opts);
  164 errno_t
  165 ad_get_autofs_options(struct ad_options *ad_opts,
  166                       struct confdb_ctx *cdb,
  167                       const char *conf_path);
  168 errno_t
  169 ad_get_auth_options(TALLOC_CTX *mem_ctx,
  170                     struct ad_options *ad_opts,
  171                     struct be_ctx *bectx,
  172                     struct dp_option **_opts);
  173 
  174 errno_t
  175 ad_get_dyndns_options(struct be_ctx *be_ctx,
  176                       struct ad_options *ad_opts);
  177 
  178 struct ad_id_ctx *
  179 ad_id_ctx_init(struct ad_options *ad_opts, struct be_ctx *bectx);
  180 
  181 struct sdap_id_conn_ctx **
  182 ad_gc_conn_list(TALLOC_CTX *mem_ctx, struct ad_id_ctx *ad_ctx,
  183                struct sss_domain_info *dom);
  184 
  185 struct sdap_id_conn_ctx **
  186 ad_ldap_conn_list(TALLOC_CTX *mem_ctx,
  187                   struct ad_id_ctx *ad_ctx,
  188                   struct sss_domain_info *dom);
  189 
  190 struct sdap_id_conn_ctx **
  191 ad_user_conn_list(TALLOC_CTX *mem_ctx,
  192                   struct ad_id_ctx *ad_ctx,
  193                   struct sss_domain_info *dom);
  194 
  195 struct sdap_id_conn_ctx *
  196 ad_get_dom_ldap_conn(struct ad_id_ctx *ad_ctx, struct sss_domain_info *dom);
  197 
  198 /* AD dynamic DNS updates */
  199 errno_t ad_dyndns_init(struct be_ctx *be_ctx,
  200                        struct ad_options *ctx);
  201 
  202 errno_t ad_sudo_init(TALLOC_CTX *mem_ctx,
  203                     struct be_ctx *be_ctx,
  204                     struct ad_id_ctx *id_ctx,
  205                     struct dp_method *dp_methods);
  206 
  207 errno_t ad_autofs_init(TALLOC_CTX *mem_ctx,
  208                        struct be_ctx *be_ctx,
  209                        struct ad_id_ctx *id_ctx,
  210                        struct dp_method *dp_methods);
  211 
  212 errno_t ad_machine_account_password_renewal_init(struct be_ctx *be_ctx,
  213                                                  struct ad_options *ad_opts);
  214 
  215 errno_t netlogon_get_domain_info(TALLOC_CTX *mem_ctx,
  216                                  struct sysdb_attrs *reply,
  217                                  bool check_next_nearest_site_as_well,
  218                                  char **_flat_name,
  219                                  char **_site,
  220                                  char **_forest);
  221 
  222 errno_t ad_inherit_opts_if_needed(struct dp_option *parent_opts,
  223                                   struct dp_option *suddom_opts,
  224                                   struct confdb_ctx *cdb,
  225                                   const char *subdom_conf_path,
  226                                   int opt_id);
  227 
  228 errno_t ad_refresh_init(struct be_ctx *be_ctx,
  229                         struct ad_id_ctx *id_ctx);
  230 
  231 #endif /* AD_COMMON_H_ */