diff options
author | Stephen Gallagher <sgallagh@redhat.com> | 2012-04-21 17:21:38 -0400 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2012-05-03 14:09:13 -0400 |
commit | 817b1bcafff27cc67630dd0cbd36df708c05fccc (patch) | |
tree | b913b3f2ce36e351271a601cfc71e81c0782c1cf /src/db/sysdb.h | |
parent | d38cd6a211d3b68036ceb7bc875f832433afd035 (diff) | |
download | sssd-817b1bcafff27cc67630dd0cbd36df708c05fccc.tar.gz sssd-817b1bcafff27cc67630dd0cbd36df708c05fccc.tar.xz sssd-817b1bcafff27cc67630dd0cbd36df708c05fccc.zip |
SYSDB: Add sysdb routines for ID-mapping
Diffstat (limited to 'src/db/sysdb.h')
-rw-r--r-- | src/db/sysdb.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/db/sysdb.h b/src/db/sysdb.h index e4df69c5e..eb7cfd781 100644 --- a/src/db/sysdb.h +++ b/src/db/sysdb.h @@ -822,4 +822,35 @@ errno_t sysdb_get_direct_parents(TALLOC_CTX *mem_ctx, const char *name, char ***_direct_parents); +/* === Functions related to ID-mapping === */ + +#define SYSDB_IDMAP_CONTAINER "cn=id_mappings" + +#define SYSDB_IDMAP_SUBTREE "idmap" +#define SYSDB_IDMAP_MAPPING_OC "id_mapping" +#define SYSDB_IDMAP_FILTER "(objectClass="SYSDB_IDMAP_MAPPING_OC")" +#define SYSDB_IDMAP_SID_ATTR "objectSID" +#define SYSDB_IDMAP_SLICE_ATTR "slice" + +#define SYSDB_IDMAP_ATTRS { \ + SYSDB_NAME, \ + SYSDB_IDMAP_SID_ATTR, \ + SYSDB_IDMAP_SLICE_ATTR, \ + NULL } + +#define SYSDB_TMPL_IDMAP_BASE SYSDB_IDMAP_CONTAINER",cn=%s,"SYSDB_BASE +#define SYSDB_TMPL_IDMAP SYSDB_IDMAP_SID_ATTR"=%s,"SYSDB_TMPL_IDMAP_BASE + +struct ldb_dn *sysdb_idmap_dn(TALLOC_CTX *mem_ctx, struct sysdb_ctx *sysdb, + const char *object_sid); + +errno_t sysdb_idmap_store_mapping(struct sysdb_ctx *sysdb, + const char *dom_name, + const char *dom_sid, + id_t slice_num); + +errno_t sysdb_idmap_get_mappings(TALLOC_CTX *mem_ctx, + struct sysdb_ctx *sysdb, + struct ldb_result **_result); + #endif /* __SYS_DB_H__ */ |