pike.git / lib / modules / Protocols.pmod / LDAP.pmod / client.pike

version» Context lines:

pike.git/lib/modules/Protocols.pmod/LDAP.pmod/client.pike:1:   #pike __REAL_VERSION__      // LDAP client protocol implementation for Pike.   // - // $Id: client.pike,v 1.88 2005/03/24 14:57:12 mast Exp $ + // $Id: client.pike,v 1.89 2005/03/29 17:40:00 mast Exp $   //   // Honza Petrous, hop@unibase.cz   //   // ----------------------------------------------------------------------   //   // History:   //   // v0.0 1998-05-25 Starting up!   // v1.0 1998-06-21 Core functions (open, bind, unbind, delete, add,   // compare, search), only V2 operations,
pike.git/lib/modules/Protocols.pmod/LDAP.pmod/client.pike:174:    array(string) referrals;       static array decode_entries (array(string) rawres)    {    array(mapping(string:array(string))) res = ({});      #define DECODE_ENTRIES(SET_DN, SET_ATTR) do { \    foreach (rawres, string rawent) { \    object derent = .ldap_privates.ldap_der_decode (rawent)->elements[1]; \    if (array(object) derattribs = ASN1_GET_ATTR_ARRAY (derent)) { \ -  mapping(string:array) attrs = (["dn": ({SET_DN})]); \ +  string dn = (SET_DN); \ +  mapping(string:array) attrs = (["dn": ({dn})]); \    foreach (derattribs, object derattr) \    {SET_ATTR;} \    res += ({attrs}); \    } \    } \    } while (0)       if (ldap_version < 3) {    // Use the values raw.    if (flags & SEARCH_LOWER_ATTRS)
pike.git/lib/modules/Protocols.pmod/LDAP.pmod/client.pike:204:    }       else {    // LDAPv3: Decode values as appropriate according to the    // schema. Note that attributes with the ";binary" option    // won't be matched by get_attr_type_descr and are therefore    // left untouched.    if (flags & SEARCH_LOWER_ATTRS)    DECODE_ENTRIES (utf8_to_string (ASN1_GET_DN (derent)), {    string attr = lower_case (ASN1_GET_ATTR_NAME (derattr)); -  if (function(string:string) decoder = get_attr_decoder (attr)) +  if (function(string:string) decoder = +  // Microsoft AD has several attributes in its root DSE +  // that they have not bothered to include in their +  // schema. So if this is the root being fetched then +  // send the nowarn flag to get_attr_encoder to avoid +  // complaints about that. +  get_attr_decoder (attr, DO_IF_DEBUG (dn == "")))    attrs[attr] = map (ASN1_GET_ATTR_VALUES (derattr), decoder);    else    attrs[attr] = ASN1_GET_ATTR_VALUES (derattr);    });    else    DECODE_ENTRIES (utf8_to_string (ASN1_GET_DN (derent)), {    string attr = ASN1_GET_ATTR_NAME (derattr); -  if (function(string:string) decoder = get_attr_decoder (attr)) +  if (function(string:string) decoder = +  get_attr_decoder (attr, DO_IF_DEBUG (dn == "")))    attrs[attr] = map (ASN1_GET_ATTR_VALUES (derattr), decoder);    else    attrs[attr] = ASN1_GET_ATTR_VALUES (derattr);    });    }      #undef DECODE_ENTRIES       return res;    }
pike.git/lib/modules/Protocols.pmod/LDAP.pmod/client.pike:480: Inside #if undefined(PARSE_RFCS)
   //! 2255.    //!    //! @param context    //! TLS context of connection    //!    //! @seealso    //! @[LDAP.client.bind], @[LDAP.client.search]    void create(string|void url, object|void context)    {    -  info = ([ "code_revision" : ("$Revision: 1.88 $"/" ")[1] ]); +  info = ([ "code_revision" : ("$Revision: 1.89 $"/" ")[1] ]);       if(!url || !sizeof(url))    url = LDAP_DEFAULT_URL;       lauth = parse_url(url);       if(!stringp(lauth->scheme) ||    ((lauth->scheme != "ldap")   #if constant(SSL.Cipher.CipherAlgorithm)    && (lauth->scheme != "ldaps")