The Samba-Bugzilla – Attachment 9251 Details for
Bug 8077
userParameters needs not to be converted to utf8
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
patch for master
0001-dsdb-Set-syntax-of-userParameters-to-binary-string-n.patch (text/plain), 2.35 KB, created by
Andrew Bartlett
on 2013-10-04 03:34:50 UTC
(
hide
)
Description:
patch for master
Filename:
MIME Type:
Creator:
Andrew Bartlett
Created:
2013-10-04 03:34:50 UTC
Size:
2.35 KB
patch
obsolete
>From fea133b39d5fd5f9813a7ff79400dc039b236bce Mon Sep 17 00:00:00 2001 >From: Andrew Bartlett <abartlet@samba.org> >Date: Tue, 24 Sep 2013 10:12:24 -0700 >Subject: [PATCH] dsdb: Set syntax of userParameters to binary string, not > unicode string > >This means we continue to store the values as given on SAMR, assuming >that the SAMR buffer is little endian. The syntax for this specific >object is forced to be a binary blob, so that it is not converted on >DRSUAPI. > >This commit does not fix existing databases, nor pdb_samba_dsdb (used >by classicupgrade). > >Andrew Bartlett > >Signed-off-by: Andrew Bartlett <abartlet@samba.org> >--- > source4/dsdb/schema/schema.h | 1 + > source4/dsdb/schema/schema_syntax.c | 10 ++++++++++ > 2 files changed, 11 insertions(+) > >diff --git a/source4/dsdb/schema/schema.h b/source4/dsdb/schema/schema.h >index 538b858..8d92815 100644 >--- a/source4/dsdb/schema/schema.h >+++ b/source4/dsdb/schema/schema.h >@@ -74,6 +74,7 @@ struct dsdb_syntax { > const struct dsdb_attribute *attr, > const struct ldb_message_element *in); > bool auto_normalise; >+ bool userParameters; /* Indicates the syntax userParameters should be forced to */ > }; > > struct dsdb_attribute { >diff --git a/source4/dsdb/schema/schema_syntax.c b/source4/dsdb/schema/schema_syntax.c >index c2e0208..e0b5d42 100644 >--- a/source4/dsdb/schema/schema_syntax.c >+++ b/source4/dsdb/schema/schema_syntax.c >@@ -2395,6 +2395,7 @@ static const struct dsdb_syntax dsdb_syntaxes[] = { > .validate_ldb = dsdb_syntax_DATA_BLOB_validate_ldb, > .equality = "octetStringMatch", > .comment = "Octet String", >+ .userParameters = true > },{ > .name = "String(Sid)", > .ldap_oid = LDB_SYNTAX_OCTET_STRING, >@@ -2665,6 +2666,15 @@ const struct dsdb_syntax *dsdb_syntax_for_attribute(const struct dsdb_attribute > unsigned int i; > > for (i=0; i < ARRAY_SIZE(dsdb_syntaxes); i++) { >+ /* >+ * We must pretend that userParamters was declared >+ * binary string, so we can store the 'UTF16' (not >+ * really string) structure as given over SAMR to samba >+ */ >+ if ((strcasecmp(attr->lDAPDisplayName, "userParameters") == 0) >+ && dsdb_syntaxes[i].userParameters) { >+ return &dsdb_syntaxes[i]; >+ } > if (attr->oMSyntax != dsdb_syntaxes[i].oMSyntax) continue; > > if (attr->oMObjectClass.length != dsdb_syntaxes[i].oMObjectClass.length) continue; >-- >1.8.4.rc3 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 8077
:
6597
|
6599
|
9243
|
9244
| 9251