sysdb.h revision bba1a5fd62cffcae076d1351df5a83fbc4a6ec17
6fe2db325e5923d8420a87e76d99fe114271ebbelgentis System Database Header
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor Copyright (C) Simo Sorce <ssorce@redhat.com> 2008
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor This program is free software; you can redistribute it and/or modify
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor it under the terms of the GNU General Public License as published by
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor the Free Software Foundation; either version 3 of the License, or
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor (at your option) any later version.
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor This program is distributed in the hope that it will be useful,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor but WITHOUT ANY WARRANTY; without even the implied warranty of
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor GNU General Public License for more details.
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor You should have received a copy of the GNU General Public License
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor along with this program. If not, see <http://www.gnu.org/licenses/>.
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor#define SYSDB_TMPL_USER_BASE SYSDB_USERS_CONTAINER","SYSDB_DOM_BASE
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor#define SYSDB_TMPL_GROUP_BASE SYSDB_GROUPS_CONTAINER","SYSDB_DOM_BASE
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor#define SYSDB_TMPL_CUSTOM_BASE SYSDB_CUSTOM_CONTAINER","SYSDB_DOM_BASE
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor#define SYSDB_TMPL_NETGROUP_BASE SYSDB_NETGROUP_CONTAINER","SYSDB_DOM_BASE
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor#define SYSDB_TMPL_RANGE_BASE SYSDB_RANGE_CONTAINER","SYSDB_BASE
3016c72ae8173bcfc0989ff1b297d4f27f445108lgentis#define SYSDB_TRUSTED_AD_DOMAIN_RANGE_CLASS "TrustedADDomainRange"
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor#define SYSDB_FAILED_LOGIN_ATTEMPTS "failedLoginAttempts"
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor#define SYSDB_ORIG_NETGROUP_MEMBER "originalMemberNisNetgroup"
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor#define SYSDB_ORIG_NETGROUP_EXTERNAL_HOST "originalExternalHost"
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor#define SYSDB_PWNAM_FILTER "(&("SYSDB_UC")(|("SYSDB_NAME_ALIAS"=%s)("SYSDB_NAME"=%s)))"
3016c72ae8173bcfc0989ff1b297d4f27f445108lgentis#define SYSDB_PWUID_FILTER "(&("SYSDB_UC")("SYSDB_UIDNUM"=%lu))"
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor#define SYSDB_GRNAM_FILTER "(&("SYSDB_GC")(|("SYSDB_NAME_ALIAS"=%s)("SYSDB_NAME"=%s)))"
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor#define SYSDB_GRGID_FILTER "(&("SYSDB_GC")("SYSDB_GIDNUM"=%lu))"
3016c72ae8173bcfc0989ff1b297d4f27f445108lgentis#define SYSDB_GRNAM_MPG_FILTER "(&("SYSDB_MPGC")(|("SYSDB_NAME_ALIAS"=%s)("SYSDB_NAME"=%s)))"
3016c72ae8173bcfc0989ff1b297d4f27f445108lgentis#define SYSDB_GRGID_MPG_FILTER "(&("SYSDB_MPGC")("SYSDB_GIDNUM"=%lu))"
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor#define SYSDB_INITGR_FILTER "(&("SYSDB_GC")("SYSDB_GIDNUM"=*))"
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor#define SYSDB_NETGR_FILTER "(&("SYSDB_NC")(|("SYSDB_NAME_ALIAS"=%s)("SYSDB_NAME"=%s)))"
3016c72ae8173bcfc0989ff1b297d4f27f445108lgentis#define SYSDB_NETGR_TRIPLES_FILTER "(|("SYSDB_NAME"=%s)("SYSDB_NAME_ALIAS"=%s)("SYSDB_MEMBEROF"=%s))"
3016c72ae8173bcfc0989ff1b297d4f27f445108lgentis#define SYSDB_GRSRC_ATTRS {SYSDB_NAME, SYSDB_GIDNUM, \
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor#define SYSDB_NETGR_ATTRS {SYSDB_NAME, SYSDB_NETGROUP_TRIPLE, \
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor#define SYSDB_INITGR_ATTRS {SYSDB_GIDNUM, SYSDB_POSIX, \
3016c72ae8173bcfc0989ff1b297d4f27f445108lgentis#define SYSDB_TMPL_USER SYSDB_NAME"=%s,"SYSDB_TMPL_USER_BASE
3016c72ae8173bcfc0989ff1b297d4f27f445108lgentis#define SYSDB_TMPL_GROUP SYSDB_NAME"=%s,"SYSDB_TMPL_GROUP_BASE
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor#define SYSDB_TMPL_NETGROUP SYSDB_NAME"=%s,"SYSDB_TMPL_NETGROUP_BASE
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor#define SYSDB_TMPL_CUSTOM_SUBTREE "cn=%s,"SYSDB_TMPL_CUSTOM_BASE
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor#define SYSDB_TMPL_CUSTOM SYSDB_NAME"=%s,cn=%s,"SYSDB_TMPL_CUSTOM_BASE
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor#define SYSDB_TMPL_RANGE SYSDB_NAME"=%s,"SYSDB_TMPL_RANGE_BASE
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor/* sysdb version check macros */
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor ERROR("Removing cache files in "DB_PATH" should fix the issue, " \
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor "but note that removing cache files will also remove all of your " \
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor "cached credentials.\n")
3016c72ae8173bcfc0989ff1b297d4f27f445108lgentis ERROR("Lower version of database is expected!\n"); \
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor ERROR("Higher version of database is expected!\n"); \
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor ERROR("In order to upgrade the database, you must run SSSD.\n"); \
3016c72ae8173bcfc0989ff1b297d4f27f445108lgentis/* use this in daemons */
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor/* use this in tools */
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor/* sysdb_attrs helper functions */
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzorstruct sysdb_attrs *sysdb_new_attrs(TALLOC_CTX *mem_ctx);
3016c72ae8173bcfc0989ff1b297d4f27f445108lgentis/* values are copied in the structure, allocated on "attrs" */
3016c72ae8173bcfc0989ff1b297d4f27f445108lgentisint sysdb_attrs_add_time_t(struct sysdb_attrs *attrs,
3016c72ae8173bcfc0989ff1b297d4f27f445108lgentis const char *name);
3016c72ae8173bcfc0989ff1b297d4f27f445108lgentisint sysdb_attrs_get_el(struct sysdb_attrs *attrs, const char *name,
3016c72ae8173bcfc0989ff1b297d4f27f445108lgentisint sysdb_attrs_get_el_ext(struct sysdb_attrs *attrs, const char *name,
3016c72ae8173bcfc0989ff1b297d4f27f445108lgentisint sysdb_attrs_steal_string(struct sysdb_attrs *attrs,
3016c72ae8173bcfc0989ff1b297d4f27f445108lgentisint sysdb_attrs_get_string(struct sysdb_attrs *attrs, const char *name,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor const char **string);
3016c72ae8173bcfc0989ff1b297d4f27f445108lgentisint sysdb_attrs_get_string_array(struct sysdb_attrs *attrs, const char *name,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzorerrno_t sysdb_attrs_get_bool(struct sysdb_attrs *attrs, const char *name,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzorint sysdb_attrs_get_uint16_t(struct sysdb_attrs *attrs, const char *name,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzorint sysdb_attrs_get_uint32_t(struct sysdb_attrs *attrs, const char *name,
3016c72ae8173bcfc0989ff1b297d4f27f445108lgentisint sysdb_attrs_replace_name(struct sysdb_attrs *attrs, const char *oldname,
3016c72ae8173bcfc0989ff1b297d4f27f445108lgentis const char *newname);
3016c72ae8173bcfc0989ff1b297d4f27f445108lgentisint sysdb_attrs_users_from_str_list(struct sysdb_attrs *attrs,
3016c72ae8173bcfc0989ff1b297d4f27f445108lgentis const char *attr_name,
3016c72ae8173bcfc0989ff1b297d4f27f445108lgentis const char *domain,
3016c72ae8173bcfc0989ff1b297d4f27f445108lgentis const char *const *list);
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzorerrno_t sysdb_attrs_primary_name(struct sysdb_ctx *sysdb,
3016c72ae8173bcfc0989ff1b297d4f27f445108lgentis const char *ldap_attr,
3016c72ae8173bcfc0989ff1b297d4f27f445108lgentis const char **_primary);
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor const char *primary,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor const char ***_aliases);
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzorerrno_t sysdb_attrs_primary_name_list(struct sysdb_ctx *sysdb,
d63adaad22c2f1639677506e340a5a683f63244flgentis const char *ldap_attr,
1f8ff58254f12b4a0756dc2bd173fcd4a401d3e2lgentis const char *name,
d63adaad22c2f1639677506e340a5a683f63244flgentis const char **_cname);
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzorerrno_t sysdb_msg2attrs(TALLOC_CTX *mem_ctx, size_t count,
d63adaad22c2f1639677506e340a5a683f63244flgentis/* convert an ldb error into an errno error */
d63adaad22c2f1639677506e340a5a683f63244flgentis/* DNs related helper functions */
d63adaad22c2f1639677506e340a5a683f63244flgentiserrno_t sysdb_get_rdn(struct sysdb_ctx *sysdb, TALLOC_CTX *mem_ctx,
d63adaad22c2f1639677506e340a5a683f63244flgentisstruct ldb_dn *sysdb_user_dn(struct sysdb_ctx *sysdb, TALLOC_CTX *mem_ctx,
d63adaad22c2f1639677506e340a5a683f63244flgentisstruct ldb_dn *sysdb_group_dn(struct sysdb_ctx *sysdb, TALLOC_CTX *mem_ctx,
d63adaad22c2f1639677506e340a5a683f63244flgentisstruct ldb_dn *sysdb_netgroup_dn(struct sysdb_ctx *sysdb, TALLOC_CTX *mem_ctx,
d63adaad22c2f1639677506e340a5a683f63244flgentisstruct ldb_dn *sysdb_netgroup_base_dn(struct sysdb_ctx *sysdb,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzorerrno_t sysdb_group_dn_name(struct sysdb_ctx *sysdb, TALLOC_CTX *mem_ctx,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzorstruct ldb_dn *sysdb_domain_dn(struct sysdb_ctx *sysdb, TALLOC_CTX *mem_ctx,
d63adaad22c2f1639677506e340a5a683f63244flgentisstruct ldb_dn *sysdb_base_dn(struct sysdb_ctx *sysdb, TALLOC_CTX *mem_ctx);
d63adaad22c2f1639677506e340a5a683f63244flgentisstruct ldb_dn *sysdb_custom_dn(struct sysdb_ctx *sysdb, TALLOC_CTX *mem_ctx,
d63adaad22c2f1639677506e340a5a683f63244flgentis const char *subtree_name);
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzorstruct ldb_dn *sysdb_custom_subtree_dn(struct sysdb_ctx *sysdb,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor const char *subtree_name);
5a884cb4f4b177e207554c26334ef853c5665e79lgentisstruct ldb_context *sysdb_ctx_get_ldb(struct sysdb_ctx *sysdb);
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzorint compare_ldb_dn_comp_num(const void *m1, const void *m2);
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor/* functions to start and finish transactions */
3016c72ae8173bcfc0989ff1b297d4f27f445108lgentisint sysdb_transaction_commit(struct sysdb_ctx *sysdb);
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzorint sysdb_transaction_cancel(struct sysdb_ctx *sysdb);
3016c72ae8173bcfc0989ff1b297d4f27f445108lgentis/* functions related to subdomains */
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzorerrno_t sysdb_domain_create(struct sysdb_ctx *sysdb, const char *domain_name);
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzorerrno_t sysdb_subdomain_store(struct sysdb_ctx *sysdb,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzorerrno_t sysdb_update_subdomains(struct sss_domain_info *domain);
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzorerrno_t sysdb_master_domain_update(struct sss_domain_info *domain);
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzorerrno_t sysdb_master_domain_add_info(struct sss_domain_info *domain,
c3a2738228cb6ba4a48c425711e728d3410a458elgentis const char *id);
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzorerrno_t sysdb_subdomain_delete(struct sysdb_ctx *sysdb, const char *name);
3016c72ae8173bcfc0989ff1b297d4f27f445108lgentiserrno_t sysdb_get_ranges(TALLOC_CTX *mem_ctx, struct sysdb_ctx *sysdb,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzorerrno_t sysdb_range_create(struct sysdb_ctx *sysdb, struct range_info *range);
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor/* Sysdb initialization.
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor * call this function *only* once to initialize the database and get
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor * the sysdb ctx */
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor/* used to initialize only one domain database.
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor * Do NOT use if sysdb_init has already been called */
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor const char *db_path,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor/* functions to retrieve information from sysdb
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor * These functions automatically starts an operation
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor * therefore they cannot be called within a transaction */
3016c72ae8173bcfc0989ff1b297d4f27f445108lgentis const char *name,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor const char *name,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor enum {SYSDB_NETGROUP_TRIPLE_VAL, SYSDB_NETGROUP_GROUP_VAL} type;
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor const char *netgroup,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor const char *name,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor const char *name,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor const char **attributes,
3016c72ae8173bcfc0989ff1b297d4f27f445108lgentis const char *netgrname,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor const char **attributes,
25cbd52bee363a7adb7068e44cd92fdbfad2b6f2lgentis/* functions that modify the databse
c3a2738228cb6ba4a48c425711e728d3410a458elgentis * they have to be called within a transaction
25cbd52bee363a7adb7068e44cd92fdbfad2b6f2lgentis * See sysdb_transaction_send()/_recv() */
25cbd52bee363a7adb7068e44cd92fdbfad2b6f2lgentis/* Permissive modify */
c3a2738228cb6ba4a48c425711e728d3410a458elgentisint sss_ldb_modify_permissive(struct ldb_context *ldb,
25cbd52bee363a7adb7068e44cd92fdbfad2b6f2lgentis/* Delete Entry */
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor/* Search Entry */
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor const char *filter,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor const char **attrs,
3016c72ae8173bcfc0989ff1b297d4f27f445108lgentis/* Search User (by uid or name) */
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor const char *name,
c3a2738228cb6ba4a48c425711e728d3410a458elgentis const char **attrs,
c3a2738228cb6ba4a48c425711e728d3410a458elgentis const char **attrs,
c3a2738228cb6ba4a48c425711e728d3410a458elgentis/* Search Group (by gid or name) */
c3a2738228cb6ba4a48c425711e728d3410a458elgentis const char *name,
c3a2738228cb6ba4a48c425711e728d3410a458elgentis const char **attrs,
c3a2738228cb6ba4a48c425711e728d3410a458elgentis const char **attrs,
c3a2738228cb6ba4a48c425711e728d3410a458elgentis/* Search Netgroup (by name) */
c3a2738228cb6ba4a48c425711e728d3410a458elgentisint sysdb_search_netgroup_by_name(TALLOC_CTX *mem_ctx,
25cbd52bee363a7adb7068e44cd92fdbfad2b6f2lgentis const char *name,
c3a2738228cb6ba4a48c425711e728d3410a458elgentis const char **attrs,
25cbd52bee363a7adb7068e44cd92fdbfad2b6f2lgentis/* Replace entry attrs */
c3a2738228cb6ba4a48c425711e728d3410a458elgentis/* Replace user attrs */
c3a2738228cb6ba4a48c425711e728d3410a458elgentis const char *name,
c3a2738228cb6ba4a48c425711e728d3410a458elgentis/* Replace group attrs */
c3a2738228cb6ba4a48c425711e728d3410a458elgentis const char *name,
c3a2738228cb6ba4a48c425711e728d3410a458elgentis/* Replace netgroup attrs */
c3a2738228cb6ba4a48c425711e728d3410a458elgentis const char *name,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor/* Allocate a new id */
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor/* Add user (only basic attrs and w/o checks) */
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor const char *name,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor const char *gecos,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor const char *homedir,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor const char *shell);
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor/* Add user (all checks) */
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor const char *name,
3016c72ae8173bcfc0989ff1b297d4f27f445108lgentis const char *gecos,
3016c72ae8173bcfc0989ff1b297d4f27f445108lgentis const char *homedir,
3016c72ae8173bcfc0989ff1b297d4f27f445108lgentis const char *shell,
3016c72ae8173bcfc0989ff1b297d4f27f445108lgentis const char *orig_dn,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor/* Add group (only basic attrs and w/o checks) */
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor/* Add group (all checks) */
3016c72ae8173bcfc0989ff1b297d4f27f445108lgentisint sysdb_add_incomplete_group(struct sysdb_ctx *sysdb,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor const char *name,
3016c72ae8173bcfc0989ff1b297d4f27f445108lgentis/* Add netgroup (only basic attrs and w/o checks) */
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor const char *name,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor/* mod_op must be either LDB_FLAG_MOD_ADD or LDB_FLAG_MOD_DELETE */
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor const char *name,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor const char *pwd,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor const char *gecos,
3016c72ae8173bcfc0989ff1b297d4f27f445108lgentis const char *homedir,
3016c72ae8173bcfc0989ff1b297d4f27f445108lgentis const char *shell,
3016c72ae8173bcfc0989ff1b297d4f27f445108lgentis const char *orig_dn,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor const char *name,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor const char *group,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor const char *member,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzorint sysdb_remove_group_member(struct sysdb_ctx *sysdb,
3016c72ae8173bcfc0989ff1b297d4f27f445108lgentis const char *group,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor const char *member,
3016c72ae8173bcfc0989ff1b297d4f27f445108lgentiserrno_t sysdb_update_members(struct sysdb_ctx *sysdb,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor const char *member,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor const char *const *add_groups,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor const char *const *del_groups);
fb25b82560b7fcaffa006cb4738d86acc561b6f4lgentis/* Password caching function.
fb25b82560b7fcaffa006cb4738d86acc561b6f4lgentis * If you are in a transaction ignore sysdb and pass in the handle.
fb25b82560b7fcaffa006cb4738d86acc561b6f4lgentis * If you are not in a transaction pass NULL in handle and provide sysdb,
fb25b82560b7fcaffa006cb4738d86acc561b6f4lgentis * in this case a transaction will be automatically started and the
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor * function will be completely wrapped in it's own sysdb transaction */
fb25b82560b7fcaffa006cb4738d86acc561b6f4lgentis const char *username,
fb25b82560b7fcaffa006cb4738d86acc561b6f4lgentis const char *password);
fb25b82560b7fcaffa006cb4738d86acc561b6f4lgentiserrno_t check_failed_login_attempts(struct confdb_ctx *cdb,
fb25b82560b7fcaffa006cb4738d86acc561b6f4lgentis const char *name,
fb25b82560b7fcaffa006cb4738d86acc561b6f4lgentis const char *password,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor const char *filter,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor const char **attrs,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor const char **attrs,
1b1b6ae3d9cf8a22cd74249fe56d4fab443f9e21lgentis const char *subtree_name);
3016c72ae8173bcfc0989ff1b297d4f27f445108lgentis const char **attrs,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor const char *sub_filter,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor const char **attrs,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor const char **attrs,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor const char *sub_filter,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor const char **attrs,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor const char *name);
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor const char *attr_name,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzorerrno_t sysdb_dn_sanitize(TALLOC_CTX *mem_ctx, const char *input,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor const char *attr_name,
3016c72ae8173bcfc0989ff1b297d4f27f445108lgentis const char *cn_value,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor const char *attr_name,
3016c72ae8173bcfc0989ff1b297d4f27f445108lgentiserrno_t sysdb_set_enumerated(struct sysdb_ctx *sysdb,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor const char *name,
3016c72ae8173bcfc0989ff1b297d4f27f445108lgentiserrno_t sysdb_get_direct_parents(TALLOC_CTX *mem_ctx,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor const char *name,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor/* === Functions related to ID-mapping === */
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor#define SYSDB_IDMAP_FILTER "(objectClass="SYSDB_IDMAP_MAPPING_OC")"
f6edf426ed6b8912be700db47d65a001d091909flgentis#define SYSDB_TMPL_IDMAP_BASE SYSDB_IDMAP_CONTAINER",cn=%s,"SYSDB_BASE
3016c72ae8173bcfc0989ff1b297d4f27f445108lgentis#define SYSDB_TMPL_IDMAP SYSDB_IDMAP_SID_ATTR"=%s,"SYSDB_TMPL_IDMAP_BASE
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzorerrno_t sysdb_idmap_store_mapping(struct sysdb_ctx *sysdb,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor const char *dom_name,
ee310fab1ff1ed24942136c5e7423bfae0ff01eagryzor const char *dom_sid,
3016c72ae8173bcfc0989ff1b297d4f27f445108lgentis#endif /* __SYS_DB_H__ */