]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/init.c
ITS#6254
[openldap] / libraries / libldap / init.c
index 4109b7eb7490b544e23983d5033e94fa9390f5cd..d21f44bb795cac84edff8368d70897e7dc74ac67 100644 (file)
@@ -1,7 +1,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2008 The OpenLDAP Foundation.
+ * Copyright 1998-2009 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
 #include <stdio.h>
 #include <ac/stdlib.h>
 
+#ifdef HAVE_GETEUID
+#include <ac/unistd.h>
+#endif
+
 #include <ac/socket.h>
 #include <ac/string.h>
 #include <ac/ctype.h>
@@ -102,6 +106,7 @@ static const struct ol_attribute {
        {1, ATTR_STRING,        "SASL_AUTHZID",         NULL,
                offsetof(struct ldapoptions, ldo_def_sasl_authzid)},
        {0, ATTR_SASL,          "SASL_SECPROPS",        NULL,   LDAP_OPT_X_SASL_SECPROPS},
+       {0, ATTR_BOOL,          "SASL_NOCANON", NULL,   LDAP_BOOL_SASL_NOCANON},
 #endif
 
 #ifdef HAVE_GSSAPI
@@ -118,6 +123,7 @@ static const struct ol_attribute {
        {0, ATTR_TLS,   "TLS_REQCERT",          NULL,   LDAP_OPT_X_TLS_REQUIRE_CERT},
        {0, ATTR_TLS,   "TLS_RANDFILE",         NULL,   LDAP_OPT_X_TLS_RANDOM_FILE},
        {0, ATTR_TLS,   "TLS_CIPHER_SUITE",     NULL,   LDAP_OPT_X_TLS_CIPHER_SUITE},
+       {0, ATTR_TLS,   "TLS_PROTOCOL_MIN",     NULL,   LDAP_OPT_X_TLS_PROTOCOL_MIN},
 
 #ifdef HAVE_OPENSSL_CRL
        {0, ATTR_TLS,   "TLS_CRLCHECK",         NULL,   LDAP_OPT_X_TLS_CRLCHECK},
@@ -539,6 +545,9 @@ void ldap_int_initialize_global_options( struct ldapoptions *gopts, int *dbglvl
        gopts->ldo_tls_connect_arg = NULL;
        gopts->ldo_tls_require_cert = LDAP_OPT_X_TLS_DEMAND;
 #endif
+       gopts->ldo_keepalive_probes = 0;
+       gopts->ldo_keepalive_interval = 0;
+       gopts->ldo_keepalive_idle = 0;
 
        gopts->ldo_valid = LDAP_INITIALIZED;
        return;
@@ -629,6 +638,12 @@ void ldap_int_initialize( struct ldapoptions *gopts, int *dbglvl )
 #endif
 
        openldap_ldap_init_w_sysconf(LDAP_CONF_FILE);
+
+#ifdef HAVE_GETEUID
+       if ( geteuid() != getuid() )
+               return;
+#endif
+
        openldap_ldap_init_w_userconf(LDAP_USERRC_FILE);
 
        {