diff options
author | Stefan Metzmacher <metze@samba.org> | 2006-12-20 16:53:29 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 14:29:32 -0500 |
commit | 089eda9585dfcb36bc6a7fb3c714289bb17cd5e9 (patch) | |
tree | 74b34b330ef19cea1da0dcff9682d8a54fbd957b /source4/librpc/ndr | |
parent | 64ba98bbd4699ac6d826eafd46782eceba2e85d2 (diff) | |
download | samba-089eda9585dfcb36bc6a7fb3c714289bb17cd5e9.tar.gz samba-089eda9585dfcb36bc6a7fb3c714289bb17cd5e9.tar.bz2 samba-089eda9585dfcb36bc6a7fb3c714289bb17cd5e9.zip |
r20286: handle the non oid string cases for pushing too
metze
(This used to be commit 0777a8e749e8df88dd1b9f7be9e4f3012559243b)
Diffstat (limited to 'source4/librpc/ndr')
-rw-r--r-- | source4/librpc/ndr/ndr_drsuapi.c | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/source4/librpc/ndr/ndr_drsuapi.c b/source4/librpc/ndr/ndr_drsuapi.c index dbbdd842f2..5a8acf8dab 100644 --- a/source4/librpc/ndr/ndr_drsuapi.c +++ b/source4/librpc/ndr/ndr_drsuapi.c @@ -91,8 +91,17 @@ NTSTATUS ndr_push_drsuapi_DsReplicaOID(struct ndr_push *ndr, int ndr_flags, cons if (r->oid) { DATA_BLOB blob; - _OID_PUSH_CHECK(ber_write_OID_String(&blob, r->oid)); - talloc_steal(ndr, blob.data); + if (strncasecmp("ff", r->oid, 2) == 0) { + blob = strhex_to_data_blob(r->oid); + if (!blob.data) { + return ndr_push_error(ndr, NDR_ERR_SUBCONTEXT, + "HEX String Conversion Error: %s\n", + __location__); + } + } else { + _OID_PUSH_CHECK(ber_write_OID_String(&blob, r->oid)); + talloc_steal(ndr, blob.data); + } NDR_CHECK(ndr_push_uint32(ndr, NDR_SCALARS, blob.length)); NDR_CHECK(ndr_push_array_uint8(ndr, NDR_SCALARS, blob.data, blob.length)); @@ -157,10 +166,16 @@ size_t ndr_size_drsuapi_DsReplicaOID_oid(const char *oid, int flags) if (!oid) return 0; - if (ber_write_OID_String(&_blob, oid)) { - ret = _blob.length; + if (strncasecmp("ff", oid, 2) == 0) { + _blob = strhex_to_data_blob(oid); + if (_blob.data) { + ret = _blob.length; + } + } else { + if (ber_write_OID_String(&_blob, oid)) { + ret = _blob.length; + } } - data_blob_free(&_blob); return ret; } |