summaryrefslogtreecommitdiff
path: root/lib/ldb/ldb_map/ldb_map.c
diff options
context:
space:
mode:
authorHoward Chu <hyc@symas.com>2013-09-18 16:50:34 -0700
committerNadezhda Ivanova <nivanova@symas.com>2013-09-23 18:40:25 -0700
commit93f3aba5e083976a791b982b2064b619800ce110 (patch)
tree20e327c5a25c39758e3a81eaf87f8476dfd75c28 /lib/ldb/ldb_map/ldb_map.c
parentbc1503a96656f1274aa93ac7cab88401c96cac60 (diff)
downloadsamba-93f3aba5e083976a791b982b2064b619800ce110.tar.gz
samba-93f3aba5e083976a791b982b2064b619800ce110.tar.bz2
samba-93f3aba5e083976a791b982b2064b619800ce110.zip
Add LDB_MAP_RENDROP option
Like LDB_MAP_RENAME, but drop the attribute if it occurs in an Add request. Used for distinguishedName attribute, is read-only and generated but for some bizarre reason AD allows it in an Add request. Signed-off-by: Howard Chu <hyc@symas.com> Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Nadezhda Ivanova <nivanova@symas.com>
Diffstat (limited to 'lib/ldb/ldb_map/ldb_map.c')
-rw-r--r--lib/ldb/ldb_map/ldb_map.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/ldb/ldb_map/ldb_map.c b/lib/ldb/ldb_map/ldb_map.c
index ce2d660c87..52b483bafe 100644
--- a/lib/ldb/ldb_map/ldb_map.c
+++ b/lib/ldb/ldb_map/ldb_map.c
@@ -332,6 +332,7 @@ const struct ldb_map_attribute *map_attr_find_remote(const struct ldb_map_contex
break;
case LDB_MAP_RENAME:
+ case LDB_MAP_RENDROP:
case LDB_MAP_CONVERT:
if (ldb_attr_cmp(map->u.rename.remote_name, name) == 0) {
return map;
@@ -383,6 +384,7 @@ const char *map_attr_map_local(void *mem_ctx, const struct ldb_map_attribute *ma
return talloc_strdup(mem_ctx, attr);
case LDB_MAP_RENAME:
+ case LDB_MAP_RENDROP:
case LDB_MAP_CONVERT:
return talloc_strdup(mem_ctx, map->u.rename.remote_name);
@@ -524,6 +526,7 @@ struct ldb_dn *ldb_dn_map_local(struct ldb_module *module, void *mem_ctx, struct
/* fall through */
case LDB_MAP_KEEP:
case LDB_MAP_RENAME:
+ case LDB_MAP_RENDROP:
name = map_attr_map_local(newdn, map, ldb_dn_get_component_name(dn, i));
if (name == NULL) goto failed;
@@ -599,6 +602,7 @@ struct ldb_dn *ldb_dn_map_remote(struct ldb_module *module, void *mem_ctx, struc
/* fall through */
case LDB_MAP_KEEP:
case LDB_MAP_RENAME:
+ case LDB_MAP_RENDROP:
name = map_attr_map_remote(newdn, map, ldb_dn_get_component_name(dn, i));
if (name == NULL) goto failed;