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.47 2003/07/01 15:21:52 anders Exp $ + // $Id: client.pike,v 1.48 2004/06/14 09:14:59 grubba 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:353:    //! @tt{"ldap://hostname/basedn?attrlist?scope?ext"@}    //!    //! @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.47 $"/" ")[1] ]); +  info = ([ "code_revision" : ("$Revision: 1.48 $"/" ")[1] ]);       if(!url || !sizeof(url))    url = LDAP_DEFAULT_URL;       lauth = parse_url(url);       if(!stringp(lauth->scheme) ||    ((lauth->scheme != "ldap")   #if constant(SSL.sslfile)    && (lauth->scheme != "ldaps")
pike.git/lib/modules/Protocols.pmod/LDAP.pmod/client.pike:399:    seterr (LDAP_SERVER_DOWN);    DWRITE("client.create: ERROR: can't open socket.\n");    //ldapfd->destroy();    //ldap=0;    //ok = 0;    //if(con_fail)    // con_fail(this_object(), @extra_args);    THROW(({"Failed to connect to LDAP server.\n",backtrace()}));    }    - #if constant(SSL.sslfile) +     if(lauth->scheme == "ldaps") { -  + #if constant(SSL.sslfile)    context->random = Crypto.randomness.reasonably_random()->read; -  ::create(SSL.sslfile(::_fd, context, 1,1)); +  ::create(SSL.sslfile(this, context, 1,1));    info->tls_version = ldapfd->version; -  } else -  ::create(::_fd); +    #else -  if(lauth->scheme == "ldaps") { -  THROW(({"LDAP: LDAPS is not available without SSL support.\n",backtrace()})); -  } -  else -  ::create(::_fd); +  error("LDAP: LDAPS is not available without SSL support.\n");   #endif -  +  } else +  ::create(::_fd);       DWRITE("client.create: connected!\n");       DWRITE(sprintf("client.create: remote = %s\n", query_address()));    DWRITE_HI("client.OPEN: " + lauth->host + ":" + (string)(lauth->port) + " - OK\n");       binded = 0;       if(lauth->scope)    set_scope(lauth->scope);