]> git.sur5r.net Git - openldap/commitdiff
ITS#6283 add missing env options
authorHoward Chu <hyc@openldap.org>
Sun, 15 Nov 2009 21:48:49 +0000 (21:48 +0000)
committerHoward Chu <hyc@openldap.org>
Sun, 15 Nov 2009 21:48:49 +0000 (21:48 +0000)
libraries/libldap/init.c

index 7349e113aea22021793c89b6c69cb3c75bed4e16..eb1eb6f787be336bcb5d40d6ecea660a82780d5f 100644 (file)
@@ -427,11 +427,34 @@ static void openldap_ldap_init_w_env(
                        ldap_int_sasl_config( gopts, attrs[i].offset, value );
 #endif                         
                        break;
+               case ATTR_GSSAPI:
+#ifdef HAVE_GSSAPI
+                       ldap_int_gssapi_config( gopts, attrs[i].offset, value );
+#endif
+                       break;
                case ATTR_TLS:
 #ifdef HAVE_TLS
                        ldap_pvt_tls_config( NULL, attrs[i].offset, value );
 #endif                         
                        break;
+               case ATTR_OPT_TV: {
+                       struct timeval tv;
+                       char *next;
+                       tv.tv_usec = 0;
+                       tv.tv_sec = strtol( value, &next, 10 );
+                       if ( next != value && next[ 0 ] == '\0' && tv.tv_sec > 0 ) {
+                               (void)ldap_set_option( NULL, attrs[i].offset, (const void *)&tv );
+                       }
+                       } break;
+               case ATTR_OPT_INT: {
+                       long l;
+                       char *next;
+                       l = strtol( value, &next, 10 );
+                       if ( next != value && next[ 0 ] == '\0' && l > 0 && (long)((int)l) == l ) {
+                               int v = (int)l;
+                               (void)ldap_set_option( NULL, attrs[i].offset, (const void *)&v );
+                       }
+                       } break;
                }
        }
 }