summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2006-12-20 14:44:14 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:29:30 -0500
commit037e158938d70826ccd087136cbbdcb143d0bf87 (patch)
treee2b9d07424275d8ae6636ee72e84af88ca775c78
parentaaccc47c0e827668e9d2df9626397bdcf801efe6 (diff)
downloadsamba-037e158938d70826ccd087136cbbdcb143d0bf87.tar.gz
samba-037e158938d70826ccd087136cbbdcb143d0bf87.tar.bz2
samba-037e158938d70826ccd087136cbbdcb143d0bf87.zip
r20280: if the uint8_t array starts with 0xFF, then it's not a OID
and we return the array as hexstring. this is always in the last array member of the meppings array, and I is always 21 bytes long w2k in mixed mode: FF0000000000000000000000000000000000000000 w2k3 in mixed mode: FF00000002A5DA73B101C43B449028E2F832FE466F w2k3 in native mode: FF00000001635D94BDE62E2C4C9BAC9D6AFA4F69F8 I assume it's some kind of schema version... metze (This used to be commit db16f6382da50167b6cefdaeb8488b00a45fb928)
-rw-r--r--source4/librpc/ndr/ndr_drsuapi.c32
1 files changed, 20 insertions, 12 deletions
diff --git a/source4/librpc/ndr/ndr_drsuapi.c b/source4/librpc/ndr/ndr_drsuapi.c
index 37c78a2c80..50d227ca00 100644
--- a/source4/librpc/ndr/ndr_drsuapi.c
+++ b/source4/librpc/ndr/ndr_drsuapi.c
@@ -124,9 +124,6 @@ NTSTATUS ndr_pull_drsuapi_DsReplicaOID(struct ndr_pull *ndr, int ndr_flags, stru
if (r->oid) {
DATA_BLOB _oid_array;
const char *_oid;
- struct asn1_data _asn1;
-
- ZERO_STRUCT(_asn1);
_mem_save_oid_0 = NDR_PULL_GET_MEM_CTX(ndr);
NDR_PULL_SET_MEM_CTX(ndr, ndr, 0);
@@ -136,15 +133,26 @@ NTSTATUS ndr_pull_drsuapi_DsReplicaOID(struct ndr_pull *ndr, int ndr_flags, stru
NDR_CHECK(ndr_pull_array_uint8(ndr, NDR_SCALARS, _oid_array.data, _oid_array.length));
NDR_PULL_SET_MEM_CTX(ndr, _mem_save_oid_0, 0);
- _ASN1_PULL_CHECK(asn1_load(&_asn1, _oid_array));
- talloc_steal(ndr, _asn1.data);
- data_blob_free(&_oid_array);
- _ASN1_PULL_CHECK(asn1_start_fake_tag(&_asn1));
- _ASN1_PULL_CHECK(asn1_read_OID_String(&_asn1, &_oid));
- talloc_steal(r->oid, _oid);
- r->oid = _oid;
- _ASN1_PULL_CHECK(asn1_end_tag(&_asn1));
- asn1_free(&_asn1);
+ if (_oid_array.length && _oid_array.data[0] == 0xFF) {
+ _oid = data_blob_hex_string(ndr, &_oid_array);
+ NT_STATUS_HAVE_NO_MEMORY(_oid);
+ data_blob_free(&_oid_array);
+ talloc_steal(r->oid, _oid);
+ r->oid = _oid;
+ } else {
+ struct asn1_data _asn1;
+ ZERO_STRUCT(_asn1);
+ _ASN1_PULL_CHECK(asn1_load(&_asn1, _oid_array));
+ talloc_steal(ndr, _asn1.data);
+ data_blob_free(&_oid_array);
+ _ASN1_PULL_CHECK(asn1_start_fake_tag(&_asn1));
+ _ASN1_PULL_CHECK(asn1_read_OID_String(&_asn1, &_oid));
+ talloc_steal(r->oid, _oid);
+ r->oid = _oid;
+ _ASN1_PULL_CHECK(asn1_end_tag(&_asn1));
+ asn1_free(&_asn1);
+ }
+ DEBUG(0,("oid: %s\n", r->oid));
}
if (r->oid) {
NDR_CHECK(ndr_check_array_size(ndr, (void*)&r->oid, r->__ndr_size));