ldap_common.h revision 3d29430867cf92b2d71afa95abb679711231117c
/*
SSSD
LDAP Common utility code
Copyright (C) Simo Sorce <ssorce@redhat.com> 2009
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/>.
*/
#ifndef _LDAP_COMMON_H_
#define _LDAP_COMMON_H_
#include "providers/ldap/sdap_id_op.h"
#include "providers/fail_over.h"
#include "providers/krb5/krb5_common.h"
#include "lib/idmap/sss_idmap.h"
#define PWD_POL_OPT_NONE "none"
#define PWD_POL_OPT_SHADOW "shadow"
#define PWD_POL_OPT_MIT "mit_kerberos"
#define SSS_LDAP_SRV_NAME "ldap"
#define LDAP_STANDARD_URI "ldap://"
#define LDAP_SSL_URI "ldaps://"
#define LDAP_LDAPI_URI "ldapi://"
/* Only the asterisk is allowed in wildcard requests */
#define LDAP_ALLOWED_WILDCARDS "*"
/* a fd the child process would log into */
extern int ldap_child_debug_fd;
struct sdap_id_ctx;
struct sdap_id_conn_ctx {
struct sdap_id_ctx *id_ctx;
struct sdap_service *service;
/* LDAP connection cache */
struct sdap_id_conn_cache *conn_cache;
/* dlinklist pointers */
/* do not go offline, try another connection */
bool ignore_mark_offline;
};
struct sdap_id_ctx {
struct sdap_options *opts;
/* If using GSSAPI */
struct krb5_service *krb5_service;
/* connection to a server */
struct sdap_id_conn_ctx *conn;
struct sdap_server_opts *srv_opts;
};
struct sdap_auth_ctx {
struct sdap_options *opts;
struct sdap_service *service;
struct sdap_service *chpass_service;
};
struct tevent_req *
struct sdap_id_ctx *id_ctx,
void *data,
struct dp_req_params *params);
struct tevent_req *req,
struct dp_reply_std *data);
struct sdap_id_ctx *id_ctx);
/* id */
struct tevent_req *
struct sdap_id_ctx *id_ctx,
struct dp_id_data *data,
struct dp_req_params *params);
struct tevent_req *req,
struct dp_reply_std *data);
struct sdap_id_ctx *ctx,
struct sdap_domain *sdom,
void *pvt);
/* Allow shortcutting an enumeration request */
struct tevent_req *
struct dp_id_data *ar,
struct sdap_id_ctx *id_ctx,
struct sdap_domain *sdom,
struct sdap_id_conn_ctx *conn,
bool noexist_delete);
int *sdap_ret);
struct tevent_req *
struct sdap_auth_ctx *auth_ctx,
struct dp_req_params *params);
struct tevent_req *req,
struct tevent_req *
struct sdap_auth_ctx *auth_ctx,
struct dp_req_params *params);
struct tevent_req *req,
/* autofs */
struct tevent_req *
struct sdap_id_ctx *id_ctx,
struct dp_autofs_data *data,
struct dp_req_params *params);
struct tevent_req *req,
struct dp_reply_std *data);
const char *service_name, const char *dns_service_name,
const char *urls, const char *backup_urls,
struct sdap_service **_service);
struct sdap_service *sdap_service,
struct krb5_service **krb5_service);
const char *realm,
const char *service_name);
struct tevent_context *ev,
const char *realm);
void sdap_remove_kdcinfo_files_callback(void *pvt);
/* options parser */
struct sss_domain_info *dom,
struct confdb_ctx *cdb,
const char *conf_path,
struct sdap_options **_opts);
const char *conf_path,
struct sdap_options *opts,
bool *use_host_filter,
bool *include_regexp,
bool *include_netgroups);
struct confdb_ctx *cdb,
const char *conf_path,
struct sdap_options *opts);
/* Calling ldap_setup_enumeration will set up a periodic task
* send_fn's pvt parameter will be a pointer to ldap_enum_ctx
* structure that contains the request data
*/
struct ldap_enum_ctx {
struct sdap_domain *sdom;
void *pvt;
};
struct sdap_options *opts,
struct sdap_domain *sdom,
void *pvt);
struct tevent_req *
struct tevent_context *ev,
void *pvt);
struct sdap_domain *sdom);
struct sdap_domain *sdom);
struct tevent_context *ev,
struct sdap_id_ctx *ctx,
struct sdap_domain *sdom,
struct sdap_id_conn_ctx *conn,
const char *name,
int filter_type,
int attrs_type,
bool noexist_delete,
bool no_members);
struct tevent_context *ev,
struct sdap_id_ctx *ctx,
struct sdap_domain *sdom,
struct sdap_id_conn_ctx *conn,
const char *name,
bool noexist_delete);
struct tevent_req *
struct tevent_context *ev,
struct sdap_id_ctx *id_ctx,
struct sdap_domain *sdom,
struct sdap_id_conn_ctx *conn,
const char *name,
const char *protocol,
int filter_type,
bool noexist_delete);
/* setup child logging */
int sdap_setup_child(void);
errno_t string_to_shadowpw_days(const char *s, long *d);
struct sdap_attr_map *map,
const char *ldap_name,
char **sysdb_name);
struct sdap_attr_map *map,
struct sysdb_attrs *recvd_attrs,
char ***missing_attrs);
bool sdap_is_secure_uri(const char *uri);
const char *base_filter,
const char *extra_filter);
const char *base_filter,
const char *extra_filter);
const char *base_filter);
struct ldb_message **msgs,
struct sysdb_attrs ***attrs);
struct sss_domain_info *dom,
struct sdap_domain **_sdom);
struct sdap_domain *sdom_list,
struct sss_domain_info *parent);
void
struct sss_domain_info *dom);
struct sss_domain_info *dom);
const char *dn);
struct sdap_search_base ***_search_bases);
const char *unparsed_base,
const char *class_name,
const char *old_filter,
struct sdap_search_base ***_search_bases);
struct sdap_idmap_ctx *idmap_ctx,
struct sysdb_attrs *sysdb_attrs,
const char *sid_attr,
char **_sid_str);
char *default_primary,
char *default_realm,
const char *keytab_path);
struct sdap_id_conn_ctx *
struct sdap_service *sdap_service);
struct sdap_id_ctx *
struct sdap_service *sdap_service);
struct sdap_id_ctx *id_ctx);
#endif /* _LDAP_COMMON_H_ */