From 9512640155f3f249e4fd5ad076375592cbd65fc6 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Wed, 18 Mar 2009 15:29:02 +1100 Subject: s3:smbldap Remove smbldap_get_dn MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This removes one more caller to pull_utf8_allocate() Signed-off-by: Günther Deschner --- source3/lib/smbldap.c | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) (limited to 'source3/lib/smbldap.c') diff --git a/source3/lib/smbldap.c b/source3/lib/smbldap.c index e24d35818c..1dfb02035d 100644 --- a/source3/lib/smbldap.c +++ b/source3/lib/smbldap.c @@ -1649,41 +1649,19 @@ NTSTATUS smbldap_init(TALLOC_CTX *mem_ctx, struct event_context *event_ctx, return NT_STATUS_OK; } -/******************************************************************* - Return a copy of the DN for a LDAPMessage. Convert from utf8 to CH_UNIX. -********************************************************************/ -char *smbldap_get_dn(LDAP *ld, LDAPMessage *entry) -{ - char *utf8_dn, *unix_dn; - size_t converted_size; - - utf8_dn = ldap_get_dn(ld, entry); - if (!utf8_dn) { - DEBUG (5, ("smbldap_get_dn: ldap_get_dn failed\n")); - return NULL; - } - if (!pull_utf8_allocate(&unix_dn, utf8_dn, &converted_size)) { - DEBUG (0, ("smbldap_get_dn: String conversion failure utf8 " - "[%s]\n", utf8_dn)); - return NULL; - } - ldap_memfree(utf8_dn); - return unix_dn; -} - - const char *smbldap_talloc_dn(TALLOC_CTX *mem_ctx, LDAP *ld, - LDAPMessage *entry) + char *smbldap_talloc_dn(TALLOC_CTX *mem_ctx, LDAP *ld, + LDAPMessage *entry) { char *utf8_dn, *unix_dn; size_t converted_size; utf8_dn = ldap_get_dn(ld, entry); if (!utf8_dn) { - DEBUG (5, ("smbldap_get_dn: ldap_get_dn failed\n")); + DEBUG (5, ("smbldap_talloc_dn: ldap_get_dn failed\n")); return NULL; } if (!pull_utf8_talloc(mem_ctx, &unix_dn, utf8_dn, &converted_size)) { - DEBUG (0, ("smbldap_get_dn: String conversion failure utf8 " + DEBUG (0, ("smbldap_talloc_dn: String conversion failure utf8 " "[%s]\n", utf8_dn)); return NULL; } -- cgit