Branch: Tag:

2003-07-01

2003-07-01 15:34:45 by Anders Johansson <anders@roxen.com>

Hide LDAP passwords from backtrases.

Rev: lib/modules/Protocols.pmod/LDAP.pmod/client.pike:1.49

2:      // LDAP client protocol implementation for Pike.   // - // $Id: client.pike,v 1.48 2003/04/07 17:12:02 nilsson Exp $ + // $Id: client.pike,v 1.49 2003/07/01 15:21:59 anders Exp $   //   // Honza Petrous, hop@unibase.cz   //
360:    void create(string|void url, object|void context)    {    -  info = ([ "code_revision" : ("$Revision: 1.48 $"/" ")[1] ]); +  info = ([ "code_revision" : ("$Revision: 1.49 $"/" ")[1] ]);       if(!url || !sizeof(url))    url = LDAP_DEFAULT_URL;
439:    // Simple BIND operation       object msgval, vers, namedn, auth, app; +  string pass = password; +  password = "censored";       vers = Standards.ASN1.Types.asn1_integer(ldap_version);    namedn = Standards.ASN1.Types.asn1_octet_string(name); -  auth = ASN1_CONTEXT_OCTET_STRING(0, password); +  auth = ASN1_CONTEXT_OCTET_STRING(0, pass);    // SASL credentials ommited       msgval = ASN1_APPLICATION_SEQUENCE(0, ({vers, namedn, auth}));
486:       int id;    mixed raw; +  string pass = password; +  password = "censored";       if (!version)    version = LDAP_DEFAULT_VERSION;
493:    return(0);    if (!stringp(dn))    dn = mappingp(lauth->ext) ? lauth->ext->bindname||"" : ""; -  if (!stringp(password)) -  password = ""; +  if (!stringp(pass)) +  pass = "";    ldap_version = version;    if(ldap_version == 3) {    dn = string_to_utf8(dn); -  password = string_to_utf8(password); +  pass = string_to_utf8(pass);    } -  if(intp(raw = send_bind_op(dn, password))) { +  if(intp(raw = send_bind_op(dn, pass))) {    THROW(({error_string()+"\n",backtrace()}));    return(-ldap_errno);    }