summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2009-11-10 15:20:07 +1100
committerAndrew Bartlett <abartlet@samba.org>2009-11-12 16:34:11 +1100
commit9ba1870fb9ae784b429b8e13b4ab0cc3def06aee (patch)
treefd8f67cbf2cefe572bc5acd76b874f5b639928da
parent6b0b3fed3127dd2da15a79eabea62708e82cc941 (diff)
downloadsamba-9ba1870fb9ae784b429b8e13b4ab0cc3def06aee.tar.gz
samba-9ba1870fb9ae784b429b8e13b4ab0cc3def06aee.tar.bz2
samba-9ba1870fb9ae784b429b8e13b4ab0cc3def06aee.zip
s4:Fix regression in dsdb_dn code - all parses of the DN would be rejected
This is most likely the cause of the DRS replication failures I observed with my changes. Andrew Bartlett
-rw-r--r--source4/dsdb/schema/schema_syntax.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/source4/dsdb/schema/schema_syntax.c b/source4/dsdb/schema/schema_syntax.c
index d50044acd0..41d4e297aa 100644
--- a/source4/dsdb/schema/schema_syntax.c
+++ b/source4/dsdb/schema/schema_syntax.c
@@ -1298,7 +1298,11 @@ static WERROR dsdb_syntax_DN_BINARY_drsuapi_to_ldb(struct ldb_context *ldb,
/* set binary stuff */
dsdb_dn = dsdb_dn_construct(tmp_ctx, dn, id3.binary, attr->syntax->ldap_oid);
-
+ if (!dsdb_dn) {
+ /* If this fails, it must be out of memory, we know the ldap_oid is valid */
+ talloc_free(tmp_ctx);
+ W_ERROR_HAVE_NO_MEMORY(dsdb_dn);
+ }
out->values[i] = data_blob_string_const(dsdb_dn_get_extended_linearized(out->values, dsdb_dn, 1));
talloc_free(tmp_ctx);
}
@@ -1342,7 +1346,7 @@ static WERROR dsdb_syntax_DN_BINARY_ldb_to_drsuapi(struct ldb_context *ldb,
dsdb_dn = dsdb_dn_parse(tmp_ctx, ldb, &in->values[i], attr->syntax->ldap_oid);
- if (dsdb_dn) {
+ if (!dsdb_dn) {
talloc_free(tmp_ctx);
return ntstatus_to_werror(NT_STATUS_INVALID_PARAMETER);
}