summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2021-12-20 17:48:44 +0100
committerJeremy Allison <jra@samba.org>2022-01-12 03:09:52 +0000
commit8c0391d38e53a356aabc6e2c9fdf747a1f1f16d5 (patch)
tree2a6850305e5c91a65cd143ae1eaa54b61c5bcc71 /source4
parent8026efd647957bdb63e2ba98ea736ccaf3a71f4c (diff)
downloadsamba-8c0391d38e53a356aabc6e2c9fdf747a1f1f16d5.tar.gz
dsdb/schema: let dsdb_syntax_DN_BINARY_drsuapi_to_ldb return WERR_DS_INVALID_ATTRIBUTE_SYNTAX
When Object(OR-Name) uses dsdb_syntax_DN_BINARY_drsuapi_to_ldb() it should genrate WERR_DS_INVALID_ATTRIBUTE_SYNTAX if the binary part is not empty. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed Jan 12 03:09:52 UTC 2022 on sn-devel-184
Diffstat (limited to 'source4')
-rw-r--r--source4/dsdb/schema/schema_syntax.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/source4/dsdb/schema/schema_syntax.c b/source4/dsdb/schema/schema_syntax.c
index 82b42908135..b3df10a0217 100644
--- a/source4/dsdb/schema/schema_syntax.c
+++ b/source4/dsdb/schema/schema_syntax.c
@@ -2055,7 +2055,15 @@ static WERROR dsdb_syntax_DN_BINARY_drsuapi_to_ldb(const struct dsdb_syntax_ctx
/* 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 */
+ if (errno == EINVAL) {
+ /*
+ * This might be Object(OR-Name)
+ * failing because of a non empty
+ * binary part.
+ */
+ talloc_free(tmp_ctx);
+ return WERR_DS_INVALID_ATTRIBUTE_SYNTAX;
+ }
talloc_free(tmp_ctx);
W_ERROR_HAVE_NO_MEMORY(dsdb_dn);
}