~james-page/ubuntu/maverick/openldap/fix-666028

« back to all changes in this revision

Viewing changes to libraries/libldap/init.c

  • Committer: Bazaar Package Importer
  • Author(s): Mathias Gug
  • Date: 2010-02-18 00:58:13 UTC
  • mfrom: (1.1.6 upstream)
  • Revision ID: james.westby@ubuntu.com-20100218005813-8230cn0y207m8wzy
Tags: 2.4.21-0ubuntu1
* New upstream release.
* debian/rules, debian/schema/extra/: 
  Fix get-orig-source rule to supports extra schemas shipped as part of the
  debian/schema/ directory.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $OpenLDAP: pkg/ldap/libraries/libldap/init.c,v 1.102.2.12 2009/08/12 23:40:55 quanah Exp $ */
 
1
/* $OpenLDAP: pkg/ldap/libraries/libldap/init.c,v 1.102.2.13 2009/11/17 17:29:13 quanah Exp $ */
2
2
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
3
3
 *
4
4
 * Copyright 1998-2009 The OpenLDAP Foundation.
427
427
                        ldap_int_sasl_config( gopts, attrs[i].offset, value );
428
428
#endif                          
429
429
                        break;
 
430
                case ATTR_GSSAPI:
 
431
#ifdef HAVE_GSSAPI
 
432
                        ldap_int_gssapi_config( gopts, attrs[i].offset, value );
 
433
#endif
 
434
                        break;
430
435
                case ATTR_TLS:
431
436
#ifdef HAVE_TLS
432
437
                        ldap_int_tls_config( NULL, attrs[i].offset, value );
433
438
#endif                          
434
439
                        break;
 
440
                case ATTR_OPT_TV: {
 
441
                        struct timeval tv;
 
442
                        char *next;
 
443
                        tv.tv_usec = 0;
 
444
                        tv.tv_sec = strtol( value, &next, 10 );
 
445
                        if ( next != value && next[ 0 ] == '\0' && tv.tv_sec > 0 ) {
 
446
                                (void)ldap_set_option( NULL, attrs[i].offset, (const void *)&tv );
 
447
                        }
 
448
                        } break;
 
449
                case ATTR_OPT_INT: {
 
450
                        long l;
 
451
                        char *next;
 
452
                        l = strtol( value, &next, 10 );
 
453
                        if ( next != value && next[ 0 ] == '\0' && l > 0 && (long)((int)l) == l ) {
 
454
                                int v = (int)l;
 
455
                                (void)ldap_set_option( NULL, attrs[i].offset, (const void *)&v );
 
456
                        }
 
457
                        } break;
435
458
                }
436
459
        }
437
460
}