summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2011-06-22 11:56:40 +1000
committerAndrew Tridgell <tridge@samba.org>2011-06-22 14:47:07 +1000
commitc46f80824b649647b5a61364a1b8fe26267bbdd9 (patch)
tree8c0cc2792ac9edd13552e5465a17590e8cb7ca71
parentc173e6e80db7505ccc71d95ed602804133d602d7 (diff)
downloadsamba-c46f80824b649647b5a61364a1b8fe26267bbdd9.tar.gz
samba-c46f80824b649647b5a61364a1b8fe26267bbdd9.tar.bz2
samba-c46f80824b649647b5a61364a1b8fe26267bbdd9.zip
s4-dsdb: don't add zero GUID to BINARY_DN
When converting from DRS to ldb format for a BINARY_DN, don't add the GUID extended DN element if the GUID is all zeros. Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
-rw-r--r--source4/dsdb/schema/schema_syntax.c20
1 files changed, 11 insertions, 9 deletions
diff --git a/source4/dsdb/schema/schema_syntax.c b/source4/dsdb/schema/schema_syntax.c
index 75dc16252b..f542f670f1 100644
--- a/source4/dsdb/schema/schema_syntax.c
+++ b/source4/dsdb/schema/schema_syntax.c
@@ -1983,16 +1983,18 @@ static WERROR dsdb_syntax_DN_BINARY_drsuapi_to_ldb(const struct dsdb_syntax_ctx
W_ERROR_HAVE_NO_MEMORY(dn);
}
- status = GUID_to_ndr_blob(&id3.guid, tmp_ctx, &guid_blob);
- if (!NT_STATUS_IS_OK(status)) {
- talloc_free(tmp_ctx);
- return ntstatus_to_werror(status);
- }
+ if (!GUID_all_zero(&id3.guid)) {
+ status = GUID_to_ndr_blob(&id3.guid, tmp_ctx, &guid_blob);
+ if (!NT_STATUS_IS_OK(status)) {
+ talloc_free(tmp_ctx);
+ return ntstatus_to_werror(status);
+ }
- ret = ldb_dn_set_extended_component(dn, "GUID", &guid_blob);
- if (ret != LDB_SUCCESS) {
- talloc_free(tmp_ctx);
- return WERR_FOOBAR;
+ ret = ldb_dn_set_extended_component(dn, "GUID", &guid_blob);
+ if (ret != LDB_SUCCESS) {
+ talloc_free(tmp_ctx);
+ return WERR_FOOBAR;
+ }
}
talloc_free(guid_blob.data);