[PATCH] LDAP_EXOP charset fix
Stefan (metze) Metzmacher
metze at metzemix.de
Thu Sep 18 06:59:41 GMT 2003
Dariush Forouher schrieb:
> Samba gives the password to ldap_extended_operation in unicode, while it
> should be saved in local charset (e.g. ISO-8859-15) instead. The current
> behaviour causes problems with other ldap clients like pam_ldap, because
> they don't transcode the password to unicode. Attached patch should fix
> this.
>
> ciao
> Dariush
>
>
>
>
> ------------------------------------------------------------------------
>
> --- pdb_ldap.c.orig 2003-09-09 06:07:15.000000000 +0200
> +++ pdb_ldap.c 2003-09-17 18:01:58.000000000 +0200
> @@ -1238,38 +1238,30 @@
> struct berval *bv;
> char *retoid;
> struct berval *retdata;
> - char *utf8_password;
> char *utf8_dn;
>
> - if (push_utf8_allocate(&utf8_password, pdb_get_plaintext_passwd(newpwd)) == (size_t)-1) {
> - return NT_STATUS_NO_MEMORY;
> - }
> -
> if (push_utf8_allocate(&utf8_dn, dn) == (size_t)-1) {
> return NT_STATUS_NO_MEMORY;
> }
>
> if ((ber = ber_alloc_t(LBER_USE_DER))==NULL) {
> DEBUG(0,("ber_alloc_t returns NULL\n"));
> - SAFE_FREE(utf8_password);
> return NT_STATUS_UNSUCCESSFUL;
> }
I'm wondering why we don't call SAFE_FREE(utf8_dn); on failure...
and we should return NT_STATUS_NO_MEMORY.
can someone fix that please.
--
metze
-------------------------------------------
Stefan (metze) Metzmacher <metze at metzemix.de>
More information about the samba-technical
mailing list