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.109 2007/10/08 16:47:09 mast Exp $ + // $Id: client.pike,v 1.110 2008/01/13 17:02:43 nilsson 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:656: Inside #if undefined(PARSE_RFCS)
   //! @[Protocol.LDAP.parse_ldap_url].    //!    //! @param context    //! TLS context of connection    //!    //! @seealso    //! @[LDAP.client.bind], @[LDAP.client.search]    void create(string|mapping(string:mixed)|void url, object|void context)    {    -  info = ([ "code_revision" : ("$Revision: 1.109 $"/" ")[1] ]); +  info = ([ "code_revision" : ("$Revision: 1.110 $"/" ")[1] ]);       if(!url || !sizeof(url))    url = LDAP_DEFAULT_URL;       if (mappingp (url))    lauth = url;    else    lauth = parse_ldap_url(url);       if(!stringp(lauth->scheme) ||
pike.git/lib/modules/Protocols.pmod/LDAP.pmod/client.pike:744:    set_basedn (lauth->basedn);    ldap_deref = 0;    ldap_sizelimit = 0;    ldap_timelimit = 0;    last_rv = 0;   }       private mixed send_bind_op(string name, string password) {    // Simple BIND operation    -  object msgval, vers, namedn, auth, app; +  object msgval, vers, namedn, auth;    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, pass);    // SASL credentials ommited       msgval = ASN1_APPLICATION_SEQUENCE(0, ({vers, namedn, auth}));   
pike.git/lib/modules/Protocols.pmod/LDAP.pmod/client.pike:808:    //! If the connection is already secure, this call will fail.    //!    //! @param context    //! an optional SSL.context object to provide to the    //! SSL/TLS connection client.    //!    //! Returns @expr{1@} on success, @expr{0@} otherwise.    //!    int start_tls (void|SSL.context context) {    -  int id; -  mixed raw; +     if(ldap_version < 3)    {    seterr (LDAP_PROTOCOL_ERROR);    THROW(({"LDAP: Unknown/unsupported protocol version.\n",backtrace()}));    return -ldap_errno;    }       return send_starttls_op(context||UNDEFINED);       return 1;
pike.git/lib/modules/Protocols.pmod/LDAP.pmod/client.pike:857:    //!    //! @note    //! Only simple authentication type is implemented. So be warned    //! clear text passwords are sent to the directory server.    //!    //! @note    //! The API change: the returning code was changed in Pike 7.3+    //! to follow his logic better.    int bind (string|void dn, string|void password, int|void version) {    -  int id; +     mixed raw;    string pass = password;    password = "censored";       if (!version)    version = LDAP_DEFAULT_VERSION;    if (chk_ver())    return 0;       if (bound_dn && ldap_version <= 2) {
pike.git/lib/modules/Protocols.pmod/LDAP.pmod/client.pike:953:    //! The distinguished name of deleted entry.    //!    //! @returns    //! Returns @expr{1@} on success, @expr{0@} otherwise.    //!    //! @note    //! The API change: the returning code was changed in Pike 7.3+    //! to follow his logic better.    int delete (string dn) {    -  int id; +     mixed raw;       if (chk_ver())    return 0;    if (chk_binded())    return 0;    if (chk_dn(dn))    return 0;    if(ldap_version == 3) {    dn = string_to_utf8(dn);
pike.git/lib/modules/Protocols.pmod/LDAP.pmod/client.pike:1025:    //! This function has changed arguments since version 7.6. From    //! 7.3 to 7.6 it was effectively useless since it always returned    //! true.    //!    //! @note    //! The equality matching rule for the attribute governs the    //! comparison. There are attributes where the assertion syntax    //! used here isn't the same as the attribute value syntax.    int compare (string dn, string attr, string value) {    -  int id; +     mixed raw;       // if (!aval || sizeof(aval)<2)    // error    if (chk_ver())    return 0;    if (chk_binded())    return 0;    if (chk_dn(dn))    return 0;
pike.git/lib/modules/Protocols.pmod/LDAP.pmod/client.pike:1102:    //! automatically.    //!    //! @returns    //! Returns @expr{1@} on success, @expr{0@} otherwise.    //!    //! @note    //! The API change: the returning code was changed in Pike 7.3+    //! to follow his logic better.    int add (string dn, mapping(string:array(string)) attrs) {    -  int id; +     mixed raw;       if (chk_ver())    return 0;    if (chk_binded())    return 0;    if (chk_dn(dn))    return 0;    if(ldap_version == 3) {    dn = string_to_utf8(dn);
pike.git/lib/modules/Protocols.pmod/LDAP.pmod/client.pike:1319:   }       private object|int make_search_op(string basedn, int scope, int deref,    int sizelimit, int timelimit,    int attrsonly, object filter,    void|array(string) attrs)    {    // SEARCH    // limitations: !!! sizelimit and timelimit should be unsigned int !!!    -  object msgval; +     array(object) ohlp;       ohlp = ({filter});    if (arrayp(attrs)) { //explicitly defined attributes    array(object) o2 = ({});    foreach(attrs, string s2)    o2 += ({Standards.ASN1.Types.asn1_octet_string(s2)});    ohlp += ({Standards.ASN1.Types.asn1_sequence(o2)});    } else    ohlp += ({Standards.ASN1.Types.asn1_sequence(({}))});
pike.git/lib/modules/Protocols.pmod/LDAP.pmod/client.pike:1406:    //! to follow his logic better.    //!    //! @seealso    //! @[result], @[result.fetch], @[read], @[get_supported_controls],    //! @[Protocols.LDAP.quote_filter_value], @[Protocols.LDAP.make_filter]    result|int search (string|object|void filter, array(string)|void attrs,    int|void attrsonly,    void|mapping(string:array(int|string)) controls,    void|int flags) {    -  int id,nv; +  int id;    object entry;    array(object) entries = ({});       DWRITE_HI(sprintf ("client.SEARCH: %O\n", filter));    if (chk_ver())    return 0;    if (chk_binded())    return 0;       if (!objectp (filter))
pike.git/lib/modules/Protocols.pmod/LDAP.pmod/client.pike:1975:    //! syntaxes are encoded automatically.    //!    //! @returns    //! Returns @expr{1@} on success, @expr{0@} otherwise.    //!    //! @note    //! The API change: the returning code was changed in Pike 7.3+    //! to follow his logic better.    int modify (string dn, mapping(string:array(int(0..2)|string)) attropval) {    -  int id; +     mixed raw;       if (chk_ver())    return 0;    if (chk_binded())    return 0;    if (chk_dn(dn))    return 0;    if(ldap_version == 3) {    dn = string_to_utf8(dn);