summaryrefslogtreecommitdiff
path: root/source4/libcli/util
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2007-12-27 07:47:11 -0600
committerStefan Metzmacher <metze@samba.org>2007-12-27 01:51:05 -0600
commit70cb5ac03c476110c0348881f49ad0697037ca38 (patch)
treeb9f358620285d8c23f320ff9abdbecc0a4bfadf3 /source4/libcli/util
parentf5bc88d40be1b01c319c4db30ada8de1ffd9f3f1 (diff)
downloadsamba-70cb5ac03c476110c0348881f49ad0697037ca38.tar.gz
samba-70cb5ac03c476110c0348881f49ad0697037ca38.tar.bz2
samba-70cb5ac03c476110c0348881f49ad0697037ca38.zip
r26613: Add a function to write a DATA_BLOB into an LDAPString.
This respects the length set in the DATA_BLOB, rather than hoping to see NULL termination of the data pointer. (found testing the Ambigious Name Resolution code against OpenLDAP). Andrew Bartlett (This used to be commit bc0022e8c7357b126dc91a945f0e53e4e4108e7d)
Diffstat (limited to 'source4/libcli/util')
-rw-r--r--source4/libcli/util/asn1.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/source4/libcli/util/asn1.c b/source4/libcli/util/asn1.c
index 58cb5f07be..ca6f0dc031 100644
--- a/source4/libcli/util/asn1.c
+++ b/source4/libcli/util/asn1.c
@@ -285,6 +285,13 @@ bool asn1_write_LDAPString(struct asn1_data *data, const char *s)
return !data->has_error;
}
+/* write a LDAP string from a DATA_BLOB */
+bool asn1_write_DATA_BLOB_LDAPString(struct asn1_data *data, const DATA_BLOB *s)
+{
+ asn1_write(data, s->data, s->length);
+ return !data->has_error;
+}
+
/* write a general string */
bool asn1_write_GeneralString(struct asn1_data *data, const char *s)
{