diff options
author | Jelmer Vernooij <jelmer@samba.org> | 2005-08-20 23:30:10 +0000 |
---|---|---|
committer | Jelmer Vernooij <jelmer@samba.org> | 2005-08-20 23:30:10 +0000 |
commit | 18ea842ed42fec8efdaf19c1f24e7145bcc25946 (patch) | |
tree | f4ebdb434e28de43423479e8e569fa043e299c70 /source | |
parent | c3a3e184b4f839da4a29e69bc5f7d1e95b0e6073 (diff) | |
download | samba-18ea842ed42fec8efdaf19c1f24e7145bcc25946.tar.gz samba-18ea842ed42fec8efdaf19c1f24e7145bcc25946.tar.xz samba-18ea842ed42fec8efdaf19c1f24e7145bcc25946.zip |
r9438: Add initial files for ldb_map
Diffstat (limited to 'source')
-rw-r--r-- | source/lib/ldb/ldb_map/README | 29 | ||||
-rw-r--r-- | source/lib/ldb/ldb_map/ldb_map.h | 29 |
2 files changed, 58 insertions, 0 deletions
diff --git a/source/lib/ldb/ldb_map/README b/source/lib/ldb/ldb_map/README new file mode 100644 index 00000000000..3c7e30a3317 --- /dev/null +++ b/source/lib/ldb/ldb_map/README @@ -0,0 +1,29 @@ +This directory contains a skeleton backend for ldb backends that allow +using an LDAP server while mapping the attributes in that schema to +another schema. This backend will never be used itself but instead have +other backends based on it (e.g. ldb_samba3 for a Samba3-LDAP-to-samdb +backend) + +Each backend that uses this skeleton has to specify an array of +struct objectclass_mapping's (see ldb_map.h). + +If no mappings are defined for an objectclass, it will be kept as is. + +Special mapping routine for dn's (calls rdn mapping routine) +Special mapping routine for rdn's + +Keep cache of mapped dn's so we don't have to traverse the tree each time + +search + Simply uses search_bytree + +search_bytree + Map all attributes in parse_tree + +add +modify + Map ldb_message to LDAPMod + +rename +delete + Simply map dn diff --git a/source/lib/ldb/ldb_map/ldb_map.h b/source/lib/ldb/ldb_map/ldb_map.h new file mode 100644 index 00000000000..6d6e47873c1 --- /dev/null +++ b/source/lib/ldb/ldb_map/ldb_map.h @@ -0,0 +1,29 @@ +struct objectclass_mapping { + char *local_name; + char *remote_name; + + char *key; /* Name of attribute used in rdn */ + + /* For mapping attributes used in searches */ + struct local_attribute_mapping { + char *local_name; + + /* Attributes to request from the server for this attribute, + * needed by generate */ + char *required_attributes[]; + + /* If not set, the value for the first element of + * required_attributes will simply be used here */ + struct ldb_message_element *(*generate) (LDAPMessage *msg); + } *local_attribute_mappings; + + /* Generate LDAPMod for adds and modifies */ + LDAPMod *(*generate_mod)(struct ldb_message *); +} + +struct ldb_map_backend { + struct objectclass_mapping *objectclass_mappings; +}; + +const char *ldb_map_dn(const char *old); +const char *ldb_map_rdn(const char *old); |