summaryrefslogtreecommitdiff
path: root/source4/lib/ldb
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2008-08-20 16:00:54 +1000
committerAndrew Tridgell <tridge@samba.org>2008-08-20 16:00:54 +1000
commit9dffeab5a8770de7c97e1b4e88fda372e5760147 (patch)
treeb90ed31dde36e7a7a043ea31e4b603536cee4f22 /source4/lib/ldb
parentf96f623854d3cd8bdaacd25979618f1cb53b8f93 (diff)
downloadsamba-9dffeab5a8770de7c97e1b4e88fda372e5760147.tar.gz
samba-9dffeab5a8770de7c97e1b4e88fda372e5760147.tar.bz2
samba-9dffeab5a8770de7c97e1b4e88fda372e5760147.zip
don't overwrite fixed attributes with @ATTRIBUTES
(This used to be commit e860fc171fd127d73df23336089c1479911953da)
Diffstat (limited to 'source4/lib/ldb')
-rw-r--r--source4/lib/ldb/common/ldb_attributes.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source4/lib/ldb/common/ldb_attributes.c b/source4/lib/ldb/common/ldb_attributes.c
index 1e69f412df..3b9d01682c 100644
--- a/source4/lib/ldb/common/ldb_attributes.c
+++ b/source4/lib/ldb/common/ldb_attributes.c
@@ -64,6 +64,10 @@ int ldb_schema_attribute_add_with_syntax(struct ldb_context *ldb,
for (i = 0; i < ldb->schema.num_attributes; i++) {
int cmp = ldb_attr_cmp(attribute, a[i].name);
if (cmp == 0) {
+ /* silently ignore attempts to overwrite fixed attributes */
+ if (a[i].flags & LDB_ATTR_FLAG_FIXED) {
+ return 0;
+ }
if (a[i].flags & LDB_ATTR_FLAG_ALLOCATED) {
talloc_free(discard_const_p(char, a[i].name));
}