]> git.sur5r.net Git - openldap/commitdiff
cleanup dead code
authorHoward Chu <hyc@openldap.org>
Fri, 31 Mar 2006 21:07:53 +0000 (21:07 +0000)
committerHoward Chu <hyc@openldap.org>
Fri, 31 Mar 2006 21:07:53 +0000 (21:07 +0000)
libraries/libldap/options.c
libraries/libldap/request.c
libraries/libldap/schema.c

index 9d608c9c2c759403de25839c466de90f44c3a4b2..4b76a0c5f7aa2553620e10f5bc1a4919f03be70f 100644 (file)
@@ -452,58 +452,6 @@ ldap_set_option(
                        }
                } return LDAP_OPT_SUCCESS;
 
-       /* Only accessed from inside this function by ldap_set_rebind_proc() */
-       case LDAP_OPT_REBIND_PROC: {
-                       lo->ldo_rebind_proc = (LDAP_REBIND_PROC *)invalue;              
-               } return LDAP_OPT_SUCCESS;
-       case LDAP_OPT_REBIND_PARAMS: {
-                       lo->ldo_rebind_params = (void *)invalue;                
-               } return LDAP_OPT_SUCCESS;
-
-       /* Only accessed from inside this function by ldap_set_nextref_proc() */
-       case LDAP_OPT_NEXTREF_PROC: {
-                       lo->ldo_nextref_proc = (LDAP_NEXTREF_PROC *)invalue;            
-               } return LDAP_OPT_SUCCESS;
-       case LDAP_OPT_NEXTREF_PARAMS: {
-                       lo->ldo_nextref_params = (void *)invalue;               
-               } return LDAP_OPT_SUCCESS;
-       }
-
-       if(invalue == NULL) {
-               /* no place to set from */
-               return LDAP_OPT_ERROR;
-       }
-
-       /* options which cannot withstand invalue == NULL */
-
-       switch(option) {
-       case LDAP_OPT_API_INFO:
-       case LDAP_OPT_DESC:
-               /* READ ONLY */
-               break;
-
-       case LDAP_OPT_DEREF:
-               lo->ldo_deref = * (const int *) invalue;
-               return LDAP_OPT_SUCCESS;
-
-       case LDAP_OPT_SIZELIMIT:
-               lo->ldo_sizelimit = * (const int *) invalue;
-               return LDAP_OPT_SUCCESS;
-
-       case LDAP_OPT_TIMELIMIT:
-               lo->ldo_timelimit = * (const int *) invalue;
-               return LDAP_OPT_SUCCESS;
-
-       case LDAP_OPT_PROTOCOL_VERSION: {
-                       int vers = * (const int *) invalue;
-                       if (vers < LDAP_VERSION_MIN || vers > LDAP_VERSION_MAX) {
-                               /* not supported */
-                               break;
-                       }
-                       lo->ldo_version = vers;
-               } return LDAP_OPT_SUCCESS;
-
-
        case LDAP_OPT_HOST_NAME: {
                        const char *host = (const char *) invalue;
                        LDAPURLDesc *ludlist = NULL;
@@ -594,6 +542,57 @@ ldap_set_option(
                        return rc;
                }
 
+       /* Only accessed from inside this function by ldap_set_rebind_proc() */
+       case LDAP_OPT_REBIND_PROC: {
+                       lo->ldo_rebind_proc = (LDAP_REBIND_PROC *)invalue;              
+               } return LDAP_OPT_SUCCESS;
+       case LDAP_OPT_REBIND_PARAMS: {
+                       lo->ldo_rebind_params = (void *)invalue;                
+               } return LDAP_OPT_SUCCESS;
+
+       /* Only accessed from inside this function by ldap_set_nextref_proc() */
+       case LDAP_OPT_NEXTREF_PROC: {
+                       lo->ldo_nextref_proc = (LDAP_NEXTREF_PROC *)invalue;            
+               } return LDAP_OPT_SUCCESS;
+       case LDAP_OPT_NEXTREF_PARAMS: {
+                       lo->ldo_nextref_params = (void *)invalue;               
+               } return LDAP_OPT_SUCCESS;
+       }
+
+       if(invalue == NULL) {
+               /* no place to set from */
+               return LDAP_OPT_ERROR;
+       }
+
+       /* options which cannot withstand invalue == NULL */
+
+       switch(option) {
+       case LDAP_OPT_API_INFO:
+       case LDAP_OPT_DESC:
+               /* READ ONLY */
+               break;
+
+       case LDAP_OPT_DEREF:
+               lo->ldo_deref = * (const int *) invalue;
+               return LDAP_OPT_SUCCESS;
+
+       case LDAP_OPT_SIZELIMIT:
+               lo->ldo_sizelimit = * (const int *) invalue;
+               return LDAP_OPT_SUCCESS;
+
+       case LDAP_OPT_TIMELIMIT:
+               lo->ldo_timelimit = * (const int *) invalue;
+               return LDAP_OPT_SUCCESS;
+
+       case LDAP_OPT_PROTOCOL_VERSION: {
+                       int vers = * (const int *) invalue;
+                       if (vers < LDAP_VERSION_MIN || vers > LDAP_VERSION_MAX) {
+                               /* not supported */
+                               break;
+                       }
+                       lo->ldo_version = vers;
+               } return LDAP_OPT_SUCCESS;
+
        case LDAP_OPT_ERROR_NUMBER: {
                        int err = * (const int *) invalue;
 
index 9a16858d93c568bc0f31c722e3dd4ca29b48833e..a3849da871a42a9878cc59f1b803a1a878a1007e 100644 (file)
@@ -93,7 +93,6 @@ ldap_send_initial_request(
        BerElement *ber,
        ber_int_t msgid)
 {
-       LDAPURLDesc     *servers;
        int rc;
 
        Debug( LDAP_DEBUG_TRACE, "ldap_send_initial_request\n", 0, 0, 0 );
@@ -112,14 +111,6 @@ ldap_send_initial_request(
                        0, 0, 0 );
        }
 
-       {
-               /*
-                * use of DNS is turned off or this is an X.500 DN...
-                * use our default connection
-                */
-               servers = NULL;
-       }       
-
 #ifdef LDAP_CONNECTIONLESS
        if (LDAP_IS_UDP(ld)) {
                if (msgtype == LDAP_REQ_BIND) {
@@ -136,12 +127,10 @@ ldap_send_initial_request(
        ldap_pvt_thread_mutex_lock( &ld->ld_req_mutex );
 #endif
        rc = ldap_send_server_request( ld, ber, msgid, NULL,
-               servers, NULL, NULL );
+               NULL, NULL, NULL );
 #ifdef LDAP_R_COMPILE
        ldap_pvt_thread_mutex_unlock( &ld->ld_req_mutex );
 #endif
-       if (servers)
-               ldap_free_urllist(servers);
        return(rc);
 }
 
index 9e04633b009f73e3245fd20a34322a847fbf1860..46271968e663fa2fb965fe59dbbadc10474f2e2a 100644 (file)
@@ -3235,6 +3235,21 @@ ldap_str2nameform( LDAP_CONST char * s,
                                seen_obsolete = 1;
                                nf->nf_obsolete = LDAP_SCHEMA_YES;
                                parse_whsp(&ss);
+                       } else if ( !strcasecmp(sval,"OC") ) {
+                               LDAP_FREE(sval);
+                               if ( seen_class ) {
+                                       *code = LDAP_SCHERR_DUPOPT;
+                                       *errp = ss;
+                                       ldap_nameform_free(nf);
+                                       return(NULL);
+                               }
+                               seen_class = 1;
+                               nf->nf_objectclass = parse_woid(&ss,code);
+                               if ( !nf->nf_objectclass ) {
+                                       *errp = ss;
+                                       ldap_nameform_free(nf);
+                                       return NULL;
+                               }
                        } else if ( !strcasecmp(sval,"MUST") ) {
                                LDAP_FREE(sval);
                                if ( seen_must ) {