works for openldap
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
Use pkg-config for Mozilla NSS library detection
|
||||
|
||||
Author: Jan Vcelak <jvcelak@redhat.com>
|
||||
|
||||
---
|
||||
configure.in | 22 +++++-----------------
|
||||
1 file changed, 5 insertions(+), 17 deletions(-)
|
||||
|
||||
diff --git a/configure.in b/configure.in
|
||||
index ecffe30..2a9cfb4 100644
|
||||
--- a/configure.in
|
||||
+++ b/configure.in
|
||||
@@ -1223,28 +1223,16 @@ if test $ol_link_tls = no ; then
|
||||
fi
|
||||
fi
|
||||
|
||||
-dnl NOTE: caller must specify -I/path/to/nspr4 and -I/path/to/nss3
|
||||
-dnl and -L/path/to/nspr4 libs and -L/path/to/nss3 libs if those libs
|
||||
-dnl are not in the default system location
|
||||
if test $ol_link_tls = no ; then
|
||||
if test $ol_with_tls = moznss || test $ol_with_tls = auto ; then
|
||||
- have_moznss=no
|
||||
- AC_CHECK_HEADERS([nssutil.h])
|
||||
- if test "$ac_cv_header_nssutil_h" = yes ; then
|
||||
- AC_CHECK_LIB([nss3], [NSS_Initialize],
|
||||
- [ have_moznss=yes ], [ have_moznss=no ])
|
||||
- fi
|
||||
+ PKG_CHECK_MODULES(MOZNSS, [nss nspr], [have_moznss=yes], [have_moznss=no])
|
||||
|
||||
- if test "$have_moznss" = yes ; then
|
||||
+ if test $have_moznss = yes ; then
|
||||
ol_with_tls=moznss
|
||||
ol_link_tls=yes
|
||||
- AC_DEFINE(HAVE_MOZNSS, 1,
|
||||
- [define if you have MozNSS])
|
||||
- TLS_LIBS="-lssl3 -lsmime3 -lnss3 -lnssutil3 -lplds4 -lplc4 -lnspr4"
|
||||
- else
|
||||
- if test $ol_with_tls = moznss ; then
|
||||
- AC_MSG_ERROR([MozNSS not found - please specify the location to the NSPR and NSS header files in CPPFLAGS and the location to the NSPR and NSS libraries in LDFLAGS (if not in the system location)])
|
||||
- fi
|
||||
+ AC_DEFINE(HAVE_MOZNSS, 1, [define if you have MozNSS])
|
||||
+ TLS_LIBS="$MOZNSS_LIBS"
|
||||
+ CFLAGS="$CFLAGS $MOZNSS_CFLAGS"
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
--
|
||||
1.7.11.7
|
||||
|
||||
@@ -0,0 +1,192 @@
|
||||
Implement priority/weight for DNS SRV records
|
||||
|
||||
From RFC 2782:
|
||||
|
||||
A client MUST attempt to contact the target host with the
|
||||
lowest-numbered priority it can reach.
|
||||
|
||||
This patch sorts the DNS SRV records by their priority, and
|
||||
additionally gives records with a larger weight a higher probability
|
||||
of appearing earlier. This way, the DNS SRV records are tried in the
|
||||
order of their priority.
|
||||
|
||||
Author: James M Leddy <james.leddy@redhat.com>
|
||||
Upstream ITS: #7027
|
||||
Resolves: #733078
|
||||
|
||||
---
|
||||
libraries/libldap/dnssrv.c | 106 ++++++++++++++++++++++++++++++++++----------
|
||||
1 files changed, 83 insertions(+), 23 deletions(-)
|
||||
|
||||
diff --git a/libraries/libldap/dnssrv.c b/libraries/libldap/dnssrv.c
|
||||
index 16b1544..40f93b4 100644
|
||||
--- a/libraries/libldap/dnssrv.c
|
||||
+++ b/libraries/libldap/dnssrv.c
|
||||
@@ -174,6 +174,46 @@ int ldap_domain2dn(
|
||||
return LDAP_SUCCESS;
|
||||
}
|
||||
|
||||
+#ifdef HAVE_RES_QUERY
|
||||
+#define DNSBUFSIZ (64*1024)
|
||||
+typedef struct srv_record {
|
||||
+ u_short priority;
|
||||
+ u_short weight;
|
||||
+ u_short port;
|
||||
+ char hostname[DNSBUFSIZ];
|
||||
+} srv_record;
|
||||
+
|
||||
+
|
||||
+static int srv_cmp(const void *aa, const void *bb){
|
||||
+ srv_record *a=(srv_record *)aa;
|
||||
+ srv_record *b=(srv_record *)bb;
|
||||
+ u_long total;
|
||||
+
|
||||
+ if(a->priority < b->priority) {
|
||||
+ return -1;
|
||||
+ }
|
||||
+ if(a->priority > b->priority) {
|
||||
+ return 1;
|
||||
+ }
|
||||
+ if(a->priority == b->priority){
|
||||
+ /* targets with same priority are in psudeo random order */
|
||||
+ if (a->weight == 0 && b->weight == 0) {
|
||||
+ if (rand() % 2) {
|
||||
+ return -1;
|
||||
+ } else {
|
||||
+ return 1;
|
||||
+ }
|
||||
+ }
|
||||
+ total = a->weight + b->weight;
|
||||
+ if (rand() % total < a->weight) {
|
||||
+ return -1;
|
||||
+ } else {
|
||||
+ return 1;
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+#endif /* HAVE_RES_QUERY */
|
||||
+
|
||||
/*
|
||||
* Lookup and return LDAP servers for domain (using the DNS
|
||||
* SRV record _ldap._tcp.domain).
|
||||
@@ -183,15 +223,16 @@ int ldap_domain2hostlist(
|
||||
char **list )
|
||||
{
|
||||
#ifdef HAVE_RES_QUERY
|
||||
-#define DNSBUFSIZ (64*1024)
|
||||
- char *request;
|
||||
- char *hostlist = NULL;
|
||||
+ char *request;
|
||||
+ char *hostlist = NULL;
|
||||
+ srv_record *hostent_head=NULL;
|
||||
+ int i;
|
||||
int rc, len, cur = 0;
|
||||
unsigned char reply[DNSBUFSIZ];
|
||||
+ int hostent_count=0;
|
||||
|
||||
assert( domain != NULL );
|
||||
assert( list != NULL );
|
||||
-
|
||||
if( *domain == '\0' ) {
|
||||
return LDAP_PARAM_ERROR;
|
||||
}
|
||||
@@ -223,8 +264,7 @@ int ldap_domain2hostlist(
|
||||
unsigned char *p;
|
||||
char host[DNSBUFSIZ];
|
||||
int status;
|
||||
- u_short port;
|
||||
- /* int priority, weight; */
|
||||
+ u_short port, priority, weight;
|
||||
|
||||
/* Parse out query */
|
||||
p = reply;
|
||||
@@ -263,40 +303,56 @@ int ldap_domain2hostlist(
|
||||
size = (p[0] << 8) | p[1];
|
||||
p += 2;
|
||||
if (type == T_SRV) {
|
||||
- int buflen;
|
||||
status = dn_expand(reply, reply + len, p + 6, host, sizeof(host));
|
||||
if (status < 0) {
|
||||
goto out;
|
||||
}
|
||||
- /* ignore priority and weight for now */
|
||||
- /* priority = (p[0] << 8) | p[1]; */
|
||||
- /* weight = (p[2] << 8) | p[3]; */
|
||||
+
|
||||
+ /* Get priority weight and port */
|
||||
+ priority = (p[0] << 8) | p[1];
|
||||
+ weight = (p[2] << 8) | p[3];
|
||||
port = (p[4] << 8) | p[5];
|
||||
|
||||
if ( port == 0 || host[ 0 ] == '\0' ) {
|
||||
goto add_size;
|
||||
}
|
||||
|
||||
- buflen = strlen(host) + STRLENOF(":65355 ");
|
||||
- hostlist = (char *) LDAP_REALLOC(hostlist, cur + buflen + 1);
|
||||
- if (hostlist == NULL) {
|
||||
- rc = LDAP_NO_MEMORY;
|
||||
- goto out;
|
||||
+ hostent_head = (srv_record *) LDAP_REALLOC(hostent_head, (hostent_count+1)*(sizeof(srv_record)));
|
||||
+ if(hostent_head==NULL){
|
||||
+ rc=LDAP_NO_MEMORY;
|
||||
+ goto out;
|
||||
+
|
||||
}
|
||||
- if (cur > 0) {
|
||||
- /* not first time around */
|
||||
- hostlist[cur++] = ' ';
|
||||
- }
|
||||
- cur += sprintf(&hostlist[cur], "%s:%hu", host, port);
|
||||
+ hostent_head[hostent_count].priority=priority;
|
||||
+ hostent_head[hostent_count].weight=weight;
|
||||
+ hostent_head[hostent_count].port=port;
|
||||
+ strncpy(hostent_head[hostent_count].hostname, host,255);
|
||||
+ hostent_count=hostent_count+1;
|
||||
}
|
||||
add_size:;
|
||||
p += size;
|
||||
}
|
||||
}
|
||||
+ qsort(hostent_head, hostent_count, sizeof(srv_record), srv_cmp);
|
||||
+
|
||||
+ for(i=0; i<hostent_count; i++){
|
||||
+ int buflen;
|
||||
+ buflen = strlen(hostent_head[i].hostname) + STRLENOF(":65355" );
|
||||
+ hostlist = (char *) LDAP_REALLOC(hostlist, cur+buflen+1);
|
||||
+ if (hostlist == NULL) {
|
||||
+ rc = LDAP_NO_MEMORY;
|
||||
+ goto out;
|
||||
+ }
|
||||
+ if(cur>0){
|
||||
+ hostlist[cur++]=' ';
|
||||
+ }
|
||||
+ cur += sprintf(&hostlist[cur], "%s:%hd", hostent_head[i].hostname, hostent_head[i].port);
|
||||
+ }
|
||||
+
|
||||
if (hostlist == NULL) {
|
||||
- /* No LDAP servers found in DNS. */
|
||||
- rc = LDAP_UNAVAILABLE;
|
||||
- goto out;
|
||||
+ /* No LDAP servers found in DNS. */
|
||||
+ rc = LDAP_UNAVAILABLE;
|
||||
+ goto out;
|
||||
}
|
||||
|
||||
rc = LDAP_SUCCESS;
|
||||
@@ -308,8 +364,12 @@ add_size:;
|
||||
if (request != NULL) {
|
||||
LDAP_FREE(request);
|
||||
}
|
||||
+ if (hostent_head != NULL) {
|
||||
+ LDAP_FREE(hostent_head);
|
||||
+ }
|
||||
if (rc != LDAP_SUCCESS && hostlist != NULL) {
|
||||
LDAP_FREE(hostlist);
|
||||
+
|
||||
}
|
||||
return rc;
|
||||
#else
|
||||
--
|
||||
1.7.6
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
From 69709289b083c53ba41d2cef7d65120220f8c59b Mon Sep 17 00:00:00 2001
|
||||
From: Sumit Bose <sbose@redhat.com>
|
||||
Date: Tue, 7 May 2013 17:02:57 +0200
|
||||
Subject: [PATCH] LDAPI SASL fix
|
||||
|
||||
Resolves: #960222
|
||||
---
|
||||
libraries/libldap/cyrus.c | 19 ++++++++++++++++---
|
||||
1 Datei geändert, 16 Zeilen hinzugefügt(+), 3 Zeilen entfernt(-)
|
||||
|
||||
diff --git a/libraries/libldap/cyrus.c b/libraries/libldap/cyrus.c
|
||||
index 28c241b..a9acf36 100644
|
||||
--- a/libraries/libldap/cyrus.c
|
||||
+++ b/libraries/libldap/cyrus.c
|
||||
@@ -394,6 +394,8 @@ ldap_int_sasl_bind(
|
||||
struct berval ccred = BER_BVNULL;
|
||||
int saslrc, rc;
|
||||
unsigned credlen;
|
||||
+ char my_hostname[HOST_NAME_MAX + 1];
|
||||
+ int free_saslhost = 0;
|
||||
|
||||
Debug( LDAP_DEBUG_TRACE, "ldap_int_sasl_bind: %s\n",
|
||||
mechs ? mechs : "<null>", 0, 0 );
|
||||
@@ -454,14 +456,25 @@ ldap_int_sasl_bind(
|
||||
|
||||
/* If we don't need to canonicalize just use the host
|
||||
* from the LDAP URI.
|
||||
+ * Always use the result of gethostname() for LDAPI.
|
||||
*/
|
||||
- if ( nocanon )
|
||||
+ if (ld->ld_defconn->lconn_server->lud_scheme != NULL &&
|
||||
+ strcmp("ldapi", ld->ld_defconn->lconn_server->lud_scheme) == 0) {
|
||||
+ rc = gethostname(my_hostname, HOST_NAME_MAX + 1);
|
||||
+ if (rc == 0) {
|
||||
+ saslhost = my_hostname;
|
||||
+ } else {
|
||||
+ saslhost = "localhost";
|
||||
+ }
|
||||
+ } else if ( nocanon )
|
||||
saslhost = ld->ld_defconn->lconn_server->lud_host;
|
||||
- else
|
||||
+ else {
|
||||
saslhost = ldap_host_connected_to( ld->ld_defconn->lconn_sb,
|
||||
"localhost" );
|
||||
+ free_saslhost = 1;
|
||||
+ }
|
||||
rc = ldap_int_sasl_open( ld, ld->ld_defconn, saslhost );
|
||||
- if ( !nocanon )
|
||||
+ if ( free_saslhost )
|
||||
LDAP_FREE( saslhost );
|
||||
}
|
||||
|
||||
--
|
||||
1.7.11.7
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
Disables opening of ldaprc file in current directory.
|
||||
|
||||
Resolves: #38402
|
||||
Upstream: ITS #1131
|
||||
Author: Henning Schmiedehausen <hps@intermeta.de>
|
||||
|
||||
diff --git a/libraries/libldap/init.c b/libraries/libldap/init.c
|
||||
index 8617527..e6b17b4 100644
|
||||
--- a/libraries/libldap/init.c
|
||||
+++ b/libraries/libldap/init.c
|
||||
@@ -352,9 +352,6 @@ static void openldap_ldap_init_w_userconf(const char *file)
|
||||
if(path != NULL) {
|
||||
LDAP_FREE(path);
|
||||
}
|
||||
-
|
||||
- /* try file */
|
||||
- openldap_ldap_init_w_conf(file, 1);
|
||||
}
|
||||
|
||||
static void openldap_ldap_init_w_env(
|
||||
@@ -0,0 +1,86 @@
|
||||
MozNSS: load certificates from certdb, fallback to PEM
|
||||
|
||||
If TLS_CACERT pointed to a PEM file and TLS_CACERTDIR was set to NSS
|
||||
certificate database, the backend assumed that the certificate is always
|
||||
located in the certificate database. This assumption might be wrong.
|
||||
|
||||
This patch makes the library to try to load the certificate from NSS
|
||||
database and fallback to PEM file if unsuccessfull.
|
||||
|
||||
Author: Jan Vcelak <jvcelak@redhat.com>
|
||||
Upstream ITS: #7389
|
||||
Resolves: #857455
|
||||
|
||||
diff --git a/libraries/libldap/tls_m.c b/libraries/libldap/tls_m.c
|
||||
index 6847bea..8339391 100644
|
||||
--- a/libraries/libldap/tls_m.c
|
||||
+++ b/libraries/libldap/tls_m.c
|
||||
@@ -1412,7 +1412,7 @@ tlsm_ctx_load_private_key( tlsm_ctx *ctx )
|
||||
/* prefer unlocked key, then key from opened certdb, then any other */
|
||||
if ( unlocked_key )
|
||||
ctx->tc_private_key = unlocked_key;
|
||||
- else if ( ctx->tc_certdb_slot )
|
||||
+ else if ( ctx->tc_certdb_slot && !ctx->tc_using_pem )
|
||||
ctx->tc_private_key = PK11_FindKeyByDERCert( ctx->tc_certdb_slot, ctx->tc_certificate, pin_arg );
|
||||
else
|
||||
ctx->tc_private_key = PK11_FindKeyByAnyCert( ctx->tc_certificate, pin_arg );
|
||||
@@ -1909,8 +1909,6 @@ tlsm_deferred_init( void *arg )
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
-
|
||||
- ctx->tc_using_pem = PR_TRUE;
|
||||
}
|
||||
|
||||
NSS_SetDomesticPolicy();
|
||||
@@ -2363,15 +2361,9 @@ tlsm_deferred_ctx_init( void *arg )
|
||||
|
||||
/* set up our cert and key, if any */
|
||||
if ( lt->lt_certfile ) {
|
||||
- /* if using the PEM module, load the PEM file specified by lt_certfile */
|
||||
- /* otherwise, assume this is the name of a cert already in the db */
|
||||
- if ( ctx->tc_using_pem ) {
|
||||
- /* this sets ctx->tc_certificate to the correct value */
|
||||
- int rc = tlsm_add_cert_from_file( ctx, lt->lt_certfile, PR_FALSE );
|
||||
- if ( rc ) {
|
||||
- return rc;
|
||||
- }
|
||||
- } else {
|
||||
+
|
||||
+ /* first search in certdb (lt_certfile is nickname) */
|
||||
+ if ( ctx->tc_certdb ) {
|
||||
char *tmp_certname;
|
||||
|
||||
if ( tlsm_is_tokenname_certnick( lt->lt_certfile )) {
|
||||
@@ -2391,8 +2383,31 @@ tlsm_deferred_ctx_init( void *arg )
|
||||
Debug( LDAP_DEBUG_ANY,
|
||||
"TLS: error: the certificate '%s' could not be found in the database - error %d:%s.\n",
|
||||
lt->lt_certfile, errcode, PR_ErrorToString( errcode, PR_LANGUAGE_I_DEFAULT ) );
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ /* fallback to PEM module (lt_certfile is filename) */
|
||||
+ if ( !ctx->tc_certificate ) {
|
||||
+ if ( !pem_module && tlsm_init_pem_module() ) {
|
||||
+ int pem_errcode = PORT_GetError();
|
||||
+ Debug( LDAP_DEBUG_ANY,
|
||||
+ "TLS: fallback to PEM impossible, module cannot be loaded - error %d:%s.\n",
|
||||
+ pem_errcode, PR_ErrorToString( pem_errcode, PR_LANGUAGE_I_DEFAULT ), 0 );
|
||||
return -1;
|
||||
}
|
||||
+
|
||||
+ /* this sets ctx->tc_certificate to the correct value */
|
||||
+ if ( !tlsm_add_cert_from_file( ctx, lt->lt_certfile, PR_FALSE ) ) {
|
||||
+ ctx->tc_using_pem = PR_TRUE;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ if ( ctx->tc_certificate ) {
|
||||
+ Debug( LDAP_DEBUG_ANY,
|
||||
+ "TLS: certificate '%s' successfully loaded from %s.\n", lt->lt_certfile,
|
||||
+ ctx->tc_using_pem ? "PEM file" : "moznss database", 0);
|
||||
+ } else {
|
||||
+ return -1;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
MozNSS: ignore certdb database type prefix when checking existence of the directory
|
||||
|
||||
If the certdb is specified including the database type prefix (e.g.
|
||||
sql:, dbm:), the prefix has to be ignored when checking the
|
||||
certificate directory existence.
|
||||
|
||||
Author: Jan Vcelak <jvcelak@redhat.com>
|
||||
Upstream ITS: #7388
|
||||
Resolves: #857373
|
||||
|
||||
---
|
||||
libraries/libldap/tls_m.c | 11 ++++++++++-
|
||||
1 file changed, 10 insertions(+), 1 deletion(-)
|
||||
|
||||
diff --git a/libraries/libldap/tls_m.c b/libraries/libldap/tls_m.c
|
||||
index 49a3f8f..5ee21a2 100644
|
||||
--- a/libraries/libldap/tls_m.c
|
||||
+++ b/libraries/libldap/tls_m.c
|
||||
@@ -1633,6 +1633,7 @@ tlsm_get_certdb_prefix( const char *certdir, char **realcertdir, char **prefix )
|
||||
{
|
||||
char sep = PR_GetDirectorySeparator();
|
||||
char *ptr = NULL;
|
||||
+ char *chkpath = NULL;
|
||||
struct PRFileInfo prfi;
|
||||
PRStatus prc;
|
||||
|
||||
@@ -1643,8 +1644,16 @@ tlsm_get_certdb_prefix( const char *certdir, char **realcertdir, char **prefix )
|
||||
return;
|
||||
}
|
||||
|
||||
- prc = PR_GetFileInfo( certdir, &prfi );
|
||||
+ /* ignore database type prefix (e.g. sql:, dbm:) if provided */
|
||||
+ chkpath = strchr( certdir, ':' );
|
||||
+ if ( chkpath != NULL ) {
|
||||
+ chkpath += 1;
|
||||
+ } else {
|
||||
+ chkpath = certdir;
|
||||
+ }
|
||||
+
|
||||
/* if certdir exists (file or directory) then it cannot specify a prefix */
|
||||
+ prc = PR_GetFileInfo( chkpath, &prfi );
|
||||
if ( prc == PR_SUCCESS ) {
|
||||
return;
|
||||
}
|
||||
--
|
||||
1.7.11.7
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
Resolves: #929357
|
||||
|
||||
From 6330d1b87a45b447f33fe8ffd6fbbce9e60bb0ec Mon Sep 17 00:00:00 2001
|
||||
From: Rich Megginson <rmeggins@redhat.com>
|
||||
Date: Thu, 28 Mar 2013 19:05:02 -0600
|
||||
Subject: [PATCH] must call PK11_FreeSlot after SECMOD_CloseUserDB to remove ref to slot
|
||||
|
||||
---
|
||||
libraries/libldap/tls_m.c | 2 ++
|
||||
1 files changed, 2 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/libraries/libldap/tls_m.c b/libraries/libldap/tls_m.c
|
||||
index 072d41d..c59d303 100644
|
||||
--- a/libraries/libldap/tls_m.c
|
||||
+++ b/libraries/libldap/tls_m.c
|
||||
@@ -2063,6 +2063,8 @@ tlsm_ctx_free ( tls_ctx *ctx )
|
||||
"TLS: could not close certdb slot - error %d:%s.\n",
|
||||
errcode, PR_ErrorToString( errcode, PR_LANGUAGE_I_DEFAULT ), 0 );
|
||||
}
|
||||
+ PK11_FreeSlot( c->tc_certdb_slot );
|
||||
+ c->tc_certdb_slot = NULL;
|
||||
}
|
||||
PL_strfree( c->tc_pin_file );
|
||||
c->tc_pin_file = NULL;
|
||||
--
|
||||
1.7.1
|
||||
|
||||
@@ -0,0 +1,91 @@
|
||||
MozNSS: better file name matching for hashed CA certificate directory
|
||||
|
||||
CA certificate files in OpenSSL compatible CACERTDIR were loaded if the file extension was '.0'. However the file name
|
||||
should be 8 letters long certificate hash of the certificate subject name, followed by a numeric suffix which is used
|
||||
to differentiate between two certificates with the same subject name.
|
||||
|
||||
Wit this patch, certificate file names are matched correctly (using regular expressions).
|
||||
|
||||
Author: Jan Vcelak <jvcelak@redhat.com>
|
||||
Upstream ITS: #7374
|
||||
Resolves: #852786
|
||||
|
||||
diff --git a/libraries/libldap/tls_m.c b/libraries/libldap/tls_m.c
|
||||
index 5e49fc5..61d71d4 100644
|
||||
--- a/libraries/libldap/tls_m.c
|
||||
+++ b/libraries/libldap/tls_m.c
|
||||
@@ -38,6 +38,7 @@
|
||||
#include <ac/unistd.h>
|
||||
#include <ac/param.h>
|
||||
#include <ac/dirent.h>
|
||||
+#include <ac/regex.h>
|
||||
|
||||
#include "ldap-int.h"
|
||||
#include "ldap-tls.h"
|
||||
@@ -118,9 +119,7 @@ static const PRIOMethods tlsm_PR_methods;
|
||||
|
||||
#define PEM_LIBRARY "nsspem"
|
||||
#define PEM_MODULE "PEM"
|
||||
-/* hash files for use with cacertdir have this file name suffix */
|
||||
-#define PEM_CA_HASH_FILE_SUFFIX ".0"
|
||||
-#define PEM_CA_HASH_FILE_SUFFIX_LEN 2
|
||||
+#define PEM_CA_HASH_FILE_REGEX "^[0-9a-f]{8}\\.[0-9]+$"
|
||||
|
||||
static SECMODModule *pem_module;
|
||||
|
||||
@@ -1541,6 +1540,7 @@ tlsm_init_ca_certs( tlsm_ctx *ctx, const char *cacertfile, const char *cacertdir
|
||||
PRDir *dir;
|
||||
PRDirEntry *entry;
|
||||
PRStatus fistatus = PR_FAILURE;
|
||||
+ regex_t hashfile_re;
|
||||
|
||||
memset( &fi, 0, sizeof(fi) );
|
||||
fistatus = PR_GetFileInfo( cacertdir, &fi );
|
||||
@@ -1570,20 +1570,30 @@ tlsm_init_ca_certs( tlsm_ctx *ctx, const char *cacertfile, const char *cacertdir
|
||||
goto done;
|
||||
}
|
||||
|
||||
+ if ( regcomp( &hashfile_re, PEM_CA_HASH_FILE_REGEX, REG_NOSUB|REG_EXTENDED ) != 0 ) {
|
||||
+ Debug( LDAP_DEBUG_ANY, "TLS: cannot compile regex for CA hash files matching\n", 0, 0, 0 );
|
||||
+ goto done;
|
||||
+ }
|
||||
+
|
||||
do {
|
||||
entry = PR_ReadDir( dir, PR_SKIP_BOTH | PR_SKIP_HIDDEN );
|
||||
if ( ( NULL != entry ) && ( NULL != entry->name ) ) {
|
||||
char *fullpath = NULL;
|
||||
- char *ptr;
|
||||
+ int match;
|
||||
|
||||
- ptr = PL_strrstr( entry->name, PEM_CA_HASH_FILE_SUFFIX );
|
||||
- if ( ( ptr == NULL ) || ( *(ptr + PEM_CA_HASH_FILE_SUFFIX_LEN) != '\0' ) ) {
|
||||
+ match = regexec( &hashfile_re, entry->name, 0, NULL, 0 );
|
||||
+ if ( match == REG_NOMATCH ) {
|
||||
Debug( LDAP_DEBUG_TRACE,
|
||||
- "TLS: file %s does not end in [%s] - does not appear to be a CA certificate "
|
||||
- "directory file with a properly hashed file name - skipping.\n",
|
||||
- entry->name, PEM_CA_HASH_FILE_SUFFIX, 0 );
|
||||
+ "TLS: skipping '%s' - filename does not have expected format "
|
||||
+ "(certificate hash with numeric suffix)\n", entry->name, 0, 0 );
|
||||
+ continue;
|
||||
+ } else if ( match != 0 ) {
|
||||
+ Debug( LDAP_DEBUG_ANY,
|
||||
+ "TLS: cannot execute regex for CA hash file matching (%d).\n",
|
||||
+ match, 0, 0 );
|
||||
continue;
|
||||
}
|
||||
+
|
||||
fullpath = PR_smprintf( "%s/%s", cacertdir, entry->name );
|
||||
if ( !tlsm_add_cert_from_file( ctx, fullpath, isca ) ) {
|
||||
Debug( LDAP_DEBUG_TRACE,
|
||||
@@ -1599,6 +1609,7 @@ tlsm_init_ca_certs( tlsm_ctx *ctx, const char *cacertfile, const char *cacertdir
|
||||
PR_smprintf_free( fullpath );
|
||||
}
|
||||
} while ( NULL != entry );
|
||||
+ regfree ( &hashfile_re );
|
||||
PR_CloseDir( dir );
|
||||
}
|
||||
done:
|
||||
--
|
||||
1.7.11.4
|
||||
|
||||
@@ -0,0 +1,193 @@
|
||||
MozNSS: update list of supported cipher suites
|
||||
|
||||
The updated list includes all ciphers implemented in Mozilla NSS 3.13.15
|
||||
|
||||
Author: Jan Vcelak <jvcelak@redhat.com>
|
||||
Upstream ITS: #7374
|
||||
|
||||
diff --git a/libraries/libldap/tls_m.c b/libraries/libldap/tls_m.c
|
||||
index 1422ce2..5e49fc5 100644
|
||||
--- a/libraries/libldap/tls_m.c
|
||||
+++ b/libraries/libldap/tls_m.c
|
||||
@@ -211,27 +211,34 @@ typedef struct {
|
||||
int num; /* The cipher id */
|
||||
int attr; /* cipher attributes: algorithms, etc */
|
||||
int version; /* protocol version valid for this cipher */
|
||||
- int bits; /* bits of strength */
|
||||
- int alg_bits; /* bits of the algorithm */
|
||||
int strength; /* LOW, MEDIUM, HIGH */
|
||||
int enabled; /* Enabled by default? */
|
||||
} cipher_properties;
|
||||
|
||||
/* cipher attributes */
|
||||
-#define SSL_kRSA 0x00000001L
|
||||
-#define SSL_aRSA 0x00000002L
|
||||
-#define SSL_aDSS 0x00000004L
|
||||
-#define SSL_DSS SSL_aDSS
|
||||
-#define SSL_eNULL 0x00000008L
|
||||
-#define SSL_DES 0x00000010L
|
||||
-#define SSL_3DES 0x00000020L
|
||||
-#define SSL_RC4 0x00000040L
|
||||
-#define SSL_RC2 0x00000080L
|
||||
-#define SSL_AES 0x00000100L
|
||||
-#define SSL_MD5 0x00000200L
|
||||
-#define SSL_SHA1 0x00000400L
|
||||
-#define SSL_SHA SSL_SHA1
|
||||
-#define SSL_RSA (SSL_kRSA|SSL_aRSA)
|
||||
+#define SSL_kRSA 0x00000001L
|
||||
+#define SSL_aRSA 0x00000002L
|
||||
+#define SSL_RSA (SSL_kRSA|SSL_aRSA)
|
||||
+#define SSL_aDSA 0x00000004L
|
||||
+#define SSL_DSA SSL_aDSA
|
||||
+#define SSL_eNULL 0x00000008L
|
||||
+#define SSL_DES 0x00000010L
|
||||
+#define SSL_3DES 0x00000020L
|
||||
+#define SSL_RC4 0x00000040L
|
||||
+#define SSL_RC2 0x00000080L
|
||||
+#define SSL_AES128 0x00000100L
|
||||
+#define SSL_AES256 0x00000200L
|
||||
+#define SSL_AES (SSL_AES128|SSL_AES256)
|
||||
+#define SSL_MD5 0x00000400L
|
||||
+#define SSL_SHA1 0x00000800L
|
||||
+#define SSL_kEDH 0x00001000L
|
||||
+#define SSL_CAMELLIA128 0x00002000L
|
||||
+#define SSL_CAMELLIA256 0x00004000L
|
||||
+#define SSL_CAMELLIA (SSL_CAMELLIA128|SSL_CAMELLIA256)
|
||||
+#define SSL_SEED 0x00008000L
|
||||
+#define SSL_kECDH 0x00010000L
|
||||
+#define SSL_kECDHE 0x00020000L
|
||||
+#define SSL_aECDSA 0x00040000L
|
||||
|
||||
/* cipher strength */
|
||||
#define SSL_NULL 0x00000001L
|
||||
@@ -248,29 +255,70 @@ typedef struct {
|
||||
|
||||
/* Cipher translation */
|
||||
static cipher_properties ciphers_def[] = {
|
||||
- /* SSL 2 ciphers */
|
||||
- {"DES-CBC3-MD5", SSL_EN_DES_192_EDE3_CBC_WITH_MD5, SSL_kRSA|SSL_aRSA|SSL_3DES|SSL_MD5, SSL2, 168, 168, SSL_HIGH, SSL_ALLOWED},
|
||||
- {"RC2-CBC-MD5", SSL_EN_RC2_128_CBC_WITH_MD5, SSL_kRSA|SSL_aRSA|SSL_RC2|SSL_MD5, SSL2, 128, 128, SSL_MEDIUM, SSL_ALLOWED},
|
||||
- {"RC4-MD5", SSL_EN_RC4_128_WITH_MD5, SSL_kRSA|SSL_aRSA|SSL_RC4|SSL_MD5, SSL2, 128, 128, SSL_MEDIUM, SSL_ALLOWED},
|
||||
- {"DES-CBC-MD5", SSL_EN_DES_64_CBC_WITH_MD5, SSL_kRSA|SSL_aRSA|SSL_DES|SSL_MD5, SSL2, 56, 56, SSL_LOW, SSL_ALLOWED},
|
||||
- {"EXP-RC2-CBC-MD5", SSL_EN_RC2_128_CBC_EXPORT40_WITH_MD5, SSL_kRSA|SSL_aRSA|SSL_RC2|SSL_MD5, SSL2, 40, 128, SSL_EXPORT40, SSL_ALLOWED},
|
||||
- {"EXP-RC4-MD5", SSL_EN_RC4_128_EXPORT40_WITH_MD5, SSL_kRSA|SSL_aRSA|SSL_RC4|SSL_MD5, SSL2, 40, 128, SSL_EXPORT40, SSL_ALLOWED},
|
||||
-
|
||||
- /* SSL3 ciphers */
|
||||
- {"RC4-MD5", SSL_RSA_WITH_RC4_128_MD5, SSL_kRSA|SSL_aRSA|SSL_RC4|SSL_MD5, SSL3, 128, 128, SSL_MEDIUM, SSL_ALLOWED},
|
||||
- {"RC4-SHA", SSL_RSA_WITH_RC4_128_SHA, SSL_kRSA|SSL_aRSA|SSL_RC4|SSL_SHA1, SSL3, 128, 128, SSL_MEDIUM, SSL_ALLOWED},
|
||||
- {"DES-CBC3-SHA", SSL_RSA_WITH_3DES_EDE_CBC_SHA, SSL_kRSA|SSL_aRSA|SSL_3DES|SSL_SHA1, SSL3, 168, 168, SSL_HIGH, SSL_ALLOWED},
|
||||
- {"DES-CBC-SHA", SSL_RSA_WITH_DES_CBC_SHA, SSL_kRSA|SSL_aRSA|SSL_DES|SSL_SHA1, SSL3, 56, 56, SSL_LOW, SSL_ALLOWED},
|
||||
- {"EXP-RC4-MD5", SSL_RSA_EXPORT_WITH_RC4_40_MD5, SSL_kRSA|SSL_aRSA|SSL_RC4|SSL_MD5, SSL3, 40, 128, SSL_EXPORT40, SSL_ALLOWED},
|
||||
- {"EXP-RC2-CBC-MD5", SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5, SSL_kRSA|SSL_aRSA|SSL_RC2|SSL_MD5, SSL3, 0, 0, SSL_EXPORT40, SSL_ALLOWED},
|
||||
- {"NULL-MD5", SSL_RSA_WITH_NULL_MD5, SSL_kRSA|SSL_aRSA|SSL_eNULL|SSL_MD5, SSL3, 0, 0, SSL_NULL, SSL_NOT_ALLOWED},
|
||||
- {"NULL-SHA", SSL_RSA_WITH_NULL_SHA, SSL_kRSA|SSL_aRSA|SSL_eNULL|SSL_SHA1, SSL3, 0, 0, SSL_NULL, SSL_NOT_ALLOWED},
|
||||
+
|
||||
+ /*
|
||||
+ * Use the same DEFAULT cipher list as OpenSSL, which is defined as: ALL:!aNULL:!eNULL:!SSLv2
|
||||
+ */
|
||||
+
|
||||
+ /* SSLv2 ciphers */
|
||||
+ {"DES-CBC-MD5", SSL_EN_DES_64_CBC_WITH_MD5, SSL_kRSA|SSL_aRSA|SSL_DES|SSL_MD5, SSL2, SSL_LOW, SSL_NOT_ALLOWED},
|
||||
+ {"DES-CBC3-MD5", SSL_EN_DES_192_EDE3_CBC_WITH_MD5, SSL_kRSA|SSL_aRSA|SSL_3DES|SSL_MD5, SSL2, SSL_HIGH, SSL_NOT_ALLOWED},
|
||||
+ {"RC2-CBC-MD5", SSL_EN_RC2_128_CBC_WITH_MD5, SSL_kRSA|SSL_aRSA|SSL_RC2|SSL_MD5, SSL2, SSL_MEDIUM, SSL_NOT_ALLOWED},
|
||||
+ {"RC4-MD5", SSL_EN_RC4_128_WITH_MD5, SSL_kRSA|SSL_aRSA|SSL_RC4|SSL_MD5, SSL2, SSL_MEDIUM, SSL_NOT_ALLOWED},
|
||||
+ {"EXP-RC2-CBC-MD5", SSL_EN_RC2_128_CBC_EXPORT40_WITH_MD5, SSL_kRSA|SSL_aRSA|SSL_RC2|SSL_MD5, SSL2, SSL_EXPORT40, SSL_NOT_ALLOWED},
|
||||
+ {"EXP-RC4-MD5", SSL_EN_RC4_128_EXPORT40_WITH_MD5, SSL_kRSA|SSL_aRSA|SSL_RC4|SSL_MD5, SSL2, SSL_EXPORT40, SSL_NOT_ALLOWED},
|
||||
+
|
||||
+ /* SSLv3 ciphers */
|
||||
+ {"NULL-MD5", SSL_RSA_WITH_NULL_MD5, SSL_kRSA|SSL_aRSA|SSL_eNULL|SSL_MD5, SSL3, SSL_NULL, SSL_NOT_ALLOWED},
|
||||
+ {"NULL-SHA", SSL_RSA_WITH_NULL_SHA, SSL_kRSA|SSL_aRSA|SSL_eNULL|SSL_SHA1, SSL3, SSL_NULL, SSL_NOT_ALLOWED},
|
||||
+ {"DES-CBC-SHA", SSL_RSA_WITH_DES_CBC_SHA, SSL_kRSA|SSL_aRSA|SSL_DES|SSL_SHA1, SSL3, SSL_LOW, SSL_ALLOWED},
|
||||
+ {"DES-CBC3-SHA", SSL_RSA_WITH_3DES_EDE_CBC_SHA, SSL_kRSA|SSL_aRSA|SSL_3DES|SSL_SHA1, SSL3, SSL_HIGH, SSL_ALLOWED},
|
||||
+ {"RC4-MD5", SSL_RSA_WITH_RC4_128_MD5, SSL_kRSA|SSL_aRSA|SSL_RC4|SSL_MD5, SSL3, SSL_MEDIUM, SSL_ALLOWED},
|
||||
+ {"RC4-SHA", SSL_RSA_WITH_RC4_128_SHA, SSL_kRSA|SSL_aRSA|SSL_RC4|SSL_SHA1, SSL3, SSL_MEDIUM, SSL_ALLOWED},
|
||||
+ {"EXP-RC2-CBC-MD5", SSL_RSA_EXPORT_WITH_RC2_CBC_40_MD5, SSL_kRSA|SSL_aRSA|SSL_RC2|SSL_MD5, SSL3, SSL_EXPORT40, SSL_ALLOWED},
|
||||
+ {"EXP-RC4-MD5", SSL_RSA_EXPORT_WITH_RC4_40_MD5, SSL_kRSA|SSL_aRSA|SSL_RC4|SSL_MD5, SSL3, SSL_EXPORT40, SSL_ALLOWED},
|
||||
+ {"EDH-RSA-DES-CBC-SHA", SSL_DHE_RSA_WITH_DES_CBC_SHA, SSL_kEDH|SSL_aRSA|SSL_DES|SSL_SHA1, SSL3, SSL_LOW, SSL_ALLOWED},
|
||||
+ {"EDH-RSA-DES-CBC3-SHA", SSL_DHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_kEDH|SSL_aRSA|SSL_3DES|SSL_SHA1, SSL3, SSL_HIGH, SSL_ALLOWED},
|
||||
+ {"EDH-DSS-DES-CBC-SHA", SSL_DHE_DSS_WITH_DES_CBC_SHA, SSL_kEDH|SSL_aDSA|SSL_DES|SSL_SHA1, SSL3, SSL_LOW, SSL_ALLOWED},
|
||||
+ {"EDH-DSS-DES-CBC3-SHA", SSL_DHE_DSS_WITH_3DES_EDE_CBC_SHA, SSL_kEDH|SSL_aDSA|SSL_3DES|SSL_SHA1, SSL3, SSL_HIGH, SSL_ALLOWED},
|
||||
|
||||
/* TLSv1 ciphers */
|
||||
- {"EXP1024-DES-CBC-SHA", TLS_RSA_EXPORT1024_WITH_DES_CBC_SHA, SSL_kRSA|SSL_aRSA|SSL_DES|SSL_SHA, TLS1, 56, 56, SSL_EXPORT56, SSL_ALLOWED},
|
||||
- {"EXP1024-RC4-SHA", TLS_RSA_EXPORT1024_WITH_RC4_56_SHA, SSL_kRSA|SSL_aRSA|SSL_RC4|SSL_SHA, TLS1, 56, 56, SSL_EXPORT56, SSL_ALLOWED},
|
||||
- {"AES128-SHA", TLS_RSA_WITH_AES_128_CBC_SHA, SSL_kRSA|SSL_aRSA|SSL_AES|SSL_SHA, TLS1, 128, 128, SSL_HIGH, SSL_ALLOWED},
|
||||
- {"AES256-SHA", TLS_RSA_WITH_AES_256_CBC_SHA, SSL_kRSA|SSL_aRSA|SSL_AES|SSL_SHA, TLS1, 256, 256, SSL_HIGH, SSL_ALLOWED},
|
||||
+ {"EXP1024-DES-CBC-SHA", TLS_RSA_EXPORT1024_WITH_DES_CBC_SHA, SSL_kRSA|SSL_aRSA|SSL_DES|SSL_SHA1, TLS1, SSL_EXPORT56, SSL_ALLOWED},
|
||||
+ {"EXP1024-RC4-SHA", TLS_RSA_EXPORT1024_WITH_RC4_56_SHA, SSL_kRSA|SSL_aRSA|SSL_RC4|SSL_SHA1, TLS1, SSL_EXPORT56, SSL_ALLOWED},
|
||||
+ {"SEED-SHA", TLS_RSA_WITH_SEED_CBC_SHA, SSL_kRSA|SSL_aRSA|SSL_SEED|SSL_SHA1, TLS1, SSL_MEDIUM, SSL_ALLOWED},
|
||||
+ {"AES128-SHA", TLS_RSA_WITH_AES_128_CBC_SHA, SSL_kRSA|SSL_aRSA|SSL_AES128|SSL_SHA1, TLS1, SSL_HIGH, SSL_ALLOWED},
|
||||
+ {"AES256-SHA", TLS_RSA_WITH_AES_256_CBC_SHA, SSL_kRSA|SSL_aRSA|SSL_AES256|SSL_SHA1, TLS1, SSL_HIGH, SSL_ALLOWED},
|
||||
+ {"CAMELLIA256-SHA", TLS_RSA_WITH_CAMELLIA_256_CBC_SHA, SSL_kRSA|SSL_aRSA|SSL_CAMELLIA|SSL_SHA1, TLS1, SSL_HIGH, SSL_ALLOWED},
|
||||
+ {"CAMELLIA128-SHA", TLS_RSA_WITH_CAMELLIA_128_CBC_SHA, SSL_kRSA|SSL_aRSA|SSL_CAMELLIA|SSL_SHA1, TLS1, SSL_HIGH, SSL_ALLOWED},
|
||||
+ {"DHE-RSA-AES128-SHA", TLS_DHE_RSA_WITH_AES_128_CBC_SHA, SSL_kEDH|SSL_aRSA|SSL_AES128|SSL_SHA1, TLS1, SSL_HIGH, SSL_ALLOWED},
|
||||
+ {"DHE-RSA-AES256-SHA", TLS_DHE_RSA_WITH_AES_256_CBC_SHA, SSL_kEDH|SSL_aRSA|SSL_AES256|SSL_SHA1, TLS1, SSL_HIGH, SSL_ALLOWED},
|
||||
+ {"DHE-RSA-CAMELLIA128-SHA", TLS_DHE_RSA_WITH_CAMELLIA_128_CBC_SHA, SSL_kEDH|SSL_aRSA|SSL_CAMELLIA128|SSL_SHA1, TLS1, SSL_HIGH, SSL_ALLOWED},
|
||||
+ {"DHE-RSA-CAMELLIA256-SHA", TLS_DHE_RSA_WITH_CAMELLIA_256_CBC_SHA, SSL_kEDH|SSL_aRSA|SSL_CAMELLIA256|SSL_SHA1, TLS1, SSL_HIGH, SSL_ALLOWED},
|
||||
+ {"DHE-DSS-RC4-SHA", TLS_DHE_DSS_WITH_RC4_128_SHA, SSL_kEDH|SSL_aDSA|SSL_RC4|SSL_SHA1, TLS1, SSL_MEDIUM, SSL_ALLOWED},
|
||||
+ {"DHE-DSS-AES128-SHA", TLS_DHE_DSS_WITH_AES_128_CBC_SHA, SSL_kEDH|SSL_aDSA|SSL_AES128|SSL_SHA1, TLS1, SSL_HIGH, SSL_ALLOWED},
|
||||
+ {"DHE-DSS-AES256-SHA", TLS_DHE_DSS_WITH_AES_256_CBC_SHA, SSL_kEDH|SSL_aDSA|SSL_AES256|SSL_SHA1, TLS1, SSL_HIGH, SSL_ALLOWED},
|
||||
+ {"DHE-DSS-CAMELLIA128-SHA", TLS_DHE_DSS_WITH_CAMELLIA_128_CBC_SHA, SSL_kEDH|SSL_aDSA|SSL_CAMELLIA128|SSL_SHA1, TLS1, SSL_HIGH, SSL_ALLOWED},
|
||||
+ {"DHE-DSS-CAMELLIA256-SHA", TLS_DHE_DSS_WITH_CAMELLIA_256_CBC_SHA, SSL_kEDH|SSL_aDSA|SSL_CAMELLIA256|SSL_SHA1, TLS1, SSL_HIGH, SSL_ALLOWED},
|
||||
+ {"ECDH-RSA-NULL-SHA", TLS_ECDH_RSA_WITH_NULL_SHA, SSL_kECDH|SSL_aRSA|SSL_eNULL|SSL_SHA1, TLS1, SSL_NULL, SSL_NOT_ALLOWED},
|
||||
+ {"ECDH-RSA-RC4-SHA", TLS_ECDH_RSA_WITH_RC4_128_SHA, SSL_kECDH|SSL_aRSA|SSL_RC4|SSL_SHA1, TLS1, SSL_MEDIUM, SSL_ALLOWED},
|
||||
+ {"ECDH-RSA-DES-CBC3-SHA", TLS_ECDH_RSA_WITH_3DES_EDE_CBC_SHA, SSL_kECDH|SSL_aRSA|SSL_3DES|SSL_SHA1, TLS1, SSL_HIGH, SSL_ALLOWED},
|
||||
+ {"ECDH-RSA-AES128-SHA", TLS_ECDH_RSA_WITH_AES_128_CBC_SHA, SSL_kECDH|SSL_aRSA|SSL_AES128|SSL_SHA1, TLS1, SSL_HIGH, SSL_ALLOWED},
|
||||
+ {"ECDH-RSA-AES256-SHA", TLS_ECDH_RSA_WITH_AES_256_CBC_SHA, SSL_kECDH|SSL_aRSA|SSL_AES256|SSL_SHA1, TLS1, SSL_HIGH, SSL_ALLOWED},
|
||||
+ {"ECDH-ECDSA-NULL-SHA", TLS_ECDH_ECDSA_WITH_NULL_SHA, SSL_kECDH|SSL_aECDSA|SSL_eNULL|SSL_SHA1, TLS1, SSL_NULL, SSL_NOT_ALLOWED},
|
||||
+ {"ECDH-ECDSA-RC4-SHA", TLS_ECDH_ECDSA_WITH_RC4_128_SHA, SSL_kECDH|SSL_aECDSA|SSL_RC4|SSL_SHA1, TLS1, SSL_MEDIUM, SSL_ALLOWED},
|
||||
+ {"ECDH-ECDSA-DES-CBC3-SHA", TLS_ECDH_ECDSA_WITH_3DES_EDE_CBC_SHA, SSL_kECDH|SSL_aECDSA|SSL_3DES|SSL_SHA1, TLS1, SSL_HIGH, SSL_ALLOWED},
|
||||
+ {"ECDH-ECDSA-AES128-SHA", TLS_ECDH_ECDSA_WITH_AES_128_CBC_SHA, SSL_kECDH|SSL_aECDSA|SSL_AES128|SSL_SHA1, TLS1, SSL_HIGH, SSL_ALLOWED},
|
||||
+ {"ECDH-ECDSA-AES256-SHA", TLS_ECDH_ECDSA_WITH_AES_256_CBC_SHA, SSL_kECDH|SSL_aECDSA|SSL_AES256|SSL_SHA1, TLS1, SSL_HIGH, SSL_ALLOWED},
|
||||
+ {"ECDHE-RSA-NULL-SHA", TLS_ECDHE_RSA_WITH_NULL_SHA, SSL_kECDHE|SSL_aRSA|SSL_eNULL|SSL_SHA1, TLS1, SSL_NULL, SSL_NOT_ALLOWED},
|
||||
+ {"ECDHE-RSA-RC4-SHA", TLS_ECDHE_RSA_WITH_RC4_128_SHA, SSL_kECDHE|SSL_aRSA|SSL_RC4|SSL_SHA1, TLS1, SSL_MEDIUM, SSL_ALLOWED},
|
||||
+ {"ECDHE-RSA-DES-CBC3-SHA", TLS_ECDHE_RSA_WITH_3DES_EDE_CBC_SHA, SSL_kECDHE|SSL_aRSA|SSL_3DES|SSL_SHA1, TLS1, SSL_HIGH, SSL_ALLOWED},
|
||||
+ {"ECDHE-RSA-AES128-SHA", TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA, SSL_kECDHE|SSL_aRSA|SSL_AES128|SSL_SHA1, TLS1, SSL_HIGH, SSL_ALLOWED},
|
||||
+ {"ECDHE-RSA-AES256-SHA", TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA, SSL_kECDHE|SSL_aRSA|SSL_AES256|SSL_SHA1, TLS1, SSL_HIGH, SSL_ALLOWED},
|
||||
+ {"ECDHE-ECDSA-NULL-SHA", TLS_ECDHE_ECDSA_WITH_NULL_SHA, SSL_kECDHE|SSL_aECDSA|SSL_eNULL|SSL_SHA1, TLS1, SSL_NULL, SSL_NOT_ALLOWED},
|
||||
+ {"ECDHE-ECDSA-RC4-SHA", TLS_ECDHE_ECDSA_WITH_RC4_128_SHA, SSL_kECDHE|SSL_aECDSA|SSL_RC4|SSL_SHA1, TLS1, SSL_MEDIUM, SSL_ALLOWED},
|
||||
+ {"ECDHE-ECDSA-DES-CBC3-SHA", TLS_ECDHE_ECDSA_WITH_3DES_EDE_CBC_SHA, SSL_kECDHE|SSL_aECDSA|SSL_3DES|SSL_SHA1, TLS1, SSL_HIGH, SSL_ALLOWED},
|
||||
+ {"ECDHE-ECDSA-AES128-SHA", TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA, SSL_kECDHE|SSL_aECDSA|SSL_AES128|SSL_SHA1, TLS1, SSL_HIGH, SSL_ALLOWED},
|
||||
+ {"ECDHE-ECDSA-AES256-SHA", TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA, SSL_kECDHE|SSL_aECDSA|SSL_AES256|SSL_SHA1, TLS1, SSL_HIGH, SSL_ALLOWED},
|
||||
};
|
||||
|
||||
#define ciphernum (sizeof(ciphers_def)/sizeof(cipher_properties))
|
||||
@@ -577,6 +625,10 @@ nss_parse_ciphers(const char *cipherstr, int cipher_list[ciphernum])
|
||||
mask |= SSL_RSA;
|
||||
} else if ((!strcmp(cipher, "NULL")) || (!strcmp(cipher, "eNULL"))) {
|
||||
mask |= SSL_eNULL;
|
||||
+ } else if (!strcmp(cipher, "AES128")) {
|
||||
+ mask |= SSL_AES128;
|
||||
+ } else if (!strcmp(cipher, "AES256")) {
|
||||
+ mask |= SSL_AES256;
|
||||
} else if (!strcmp(cipher, "AES")) {
|
||||
mask |= SSL_AES;
|
||||
} else if (!strcmp(cipher, "3DES")) {
|
||||
@@ -591,6 +643,24 @@ nss_parse_ciphers(const char *cipherstr, int cipher_list[ciphernum])
|
||||
mask |= SSL_MD5;
|
||||
} else if ((!strcmp(cipher, "SHA")) || (!strcmp(cipher, "SHA1"))) {
|
||||
mask |= SSL_SHA1;
|
||||
+ } else if (!strcmp(cipher, "EDH")) {
|
||||
+ mask |= SSL_kEDH;
|
||||
+ } else if (!strcmp(cipher, "DSS")) {
|
||||
+ mask |= SSL_aDSA;
|
||||
+ } else if (!strcmp(cipher, "CAMELLIA128")) {
|
||||
+ mask |= SSL_CAMELLIA128;
|
||||
+ } else if (!strcmp(cipher, "CAMELLIA256")) {
|
||||
+ mask |= SSL_CAMELLIA256;
|
||||
+ } else if (!strcmp(cipher, "CAMELLIA")) {
|
||||
+ mask |= SSL_CAMELLIA;
|
||||
+ } else if (!strcmp(cipher, "SEED")) {
|
||||
+ mask |= SSL_SEED;
|
||||
+ } else if (!strcmp(cipher, "ECDH")) {
|
||||
+ mask |= SSL_kECDH;
|
||||
+ } else if (!strcmp(cipher, "ECDHE")) {
|
||||
+ mask |= SSL_kECDHE;
|
||||
+ } else if (!strcmp(cipher, "ECDSA")) {
|
||||
+ mask |= SSL_aECDSA;
|
||||
} else if (!strcmp(cipher, "SSLv2")) {
|
||||
protocol |= SSL2;
|
||||
} else if (!strcmp(cipher, "SSLv3")) {
|
||||
--
|
||||
1.7.11.4
|
||||
|
||||
@@ -0,0 +1,33 @@
|
||||
The non-reentrant gethostbyXXXX() functions deadlock if called recursively, for
|
||||
example if libldap needs to be initialized from within gethostbyXXXX() (which
|
||||
actually happens if nss_ldap is used for hostname resolution and earlier
|
||||
modules can't resolve the local host name), so use the reentrant versions of
|
||||
the functions, even if we're not being compiled for use in libldap_r
|
||||
|
||||
Resolves: #179730
|
||||
Author: Jeffery Layton <jlayton@redhat.com>
|
||||
|
||||
diff --git a/libraries/libldap/util-int.c b/libraries/libldap/util-int.c
|
||||
index 373c81c..a012062 100644
|
||||
--- a/libraries/libldap/util-int.c
|
||||
+++ b/libraries/libldap/util-int.c
|
||||
@@ -52,8 +52,8 @@ extern int h_errno;
|
||||
#ifndef LDAP_R_COMPILE
|
||||
# undef HAVE_REENTRANT_FUNCTIONS
|
||||
# undef HAVE_CTIME_R
|
||||
-# undef HAVE_GETHOSTBYNAME_R
|
||||
-# undef HAVE_GETHOSTBYADDR_R
|
||||
+/* # undef HAVE_GETHOSTBYNAME_R */
|
||||
+/* # undef HAVE_GETHOSTBYADDR_R */
|
||||
|
||||
#else
|
||||
# include <ldap_pvt_thread.h>
|
||||
@@ -317,7 +317,7 @@ ldap_pvt_csnstr(char *buf, size_t len, unsigned int replica, unsigned int mod)
|
||||
#define BUFSTART (1024-32)
|
||||
#define BUFMAX (32*1024-32)
|
||||
|
||||
-#if defined(LDAP_R_COMPILE)
|
||||
+#if defined(LDAP_R_COMPILE) || defined(HAVE_GETHOSTBYNAME_R) && defined(HAVE_GETHOSTBYADDR_R)
|
||||
static char *safe_realloc( char **buf, int len );
|
||||
|
||||
#if !(defined(HAVE_GETHOSTBYNAME_R) && defined(HAVE_GETHOSTBYADDR_R))
|
||||
@@ -0,0 +1,14 @@
|
||||
Removes unnecessary linking of SQL libraries into slapd. This makes openldap-servers package
|
||||
independent on libodbc. (SQL backend is packaged separately in openldap-servers-sql.)
|
||||
|
||||
--- openldap-2.4.24.orig/build/top.mk
|
||||
+++ openldap-2.4.24/build/top.mk
|
||||
@@ -201,7 +201,7 @@ SLAPD_SQL_LDFLAGS = @SLAPD_SQL_LDFLAGS@
|
||||
SLAPD_SQL_INCLUDES = @SLAPD_SQL_INCLUDES@
|
||||
SLAPD_SQL_LIBS = @SLAPD_SQL_LIBS@
|
||||
|
||||
-SLAPD_LIBS = @SLAPD_LIBS@ @SLAPD_PERL_LDFLAGS@ @SLAPD_SQL_LDFLAGS@ @SLAPD_SQL_LIBS@ @SLAPD_SLP_LIBS@ @SLAPD_GMP_LIBS@ $(ICU_LIBS)
|
||||
+SLAPD_LIBS = @SLAPD_LIBS@ @SLAPD_PERL_LDFLAGS@ @SLAPD_SLP_LIBS@ @SLAPD_GMP_LIBS@ $(ICU_LIBS)
|
||||
|
||||
# Our Defaults
|
||||
CC = $(AC_CC)
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
From: Jan-Marek Glogowski <jan-marek.glogowski@muenchen.de>
|
||||
Date: Tue, 18 May 2010 17:47:05 +0200
|
||||
Subject: [PATCH] Switch to lt_dlopenadvise() to get RTLD_GLOBAL set.
|
||||
|
||||
Proof of concept for fixing http://bugs.debian.org/327585
|
||||
(patch ported from freeradius bug http://bugs.debian.org/416266)
|
||||
|
||||
Resolves: #960048
|
||||
---
|
||||
--- openldap/servers/slapd/module.c.orig 2010-05-18 17:42:04.000000000 +0200
|
||||
+++ openldap/servers/slapd/module.c 2010-05-18 17:45:46.000000000 +0200
|
||||
@@ -117,6 +117,20 @@
|
||||
return -1; /* not found */
|
||||
}
|
||||
|
||||
+static lt_dlhandle slapd_lt_dlopenext_global( const char *filename )
|
||||
+{
|
||||
+ lt_dlhandle handle = 0;
|
||||
+ lt_dladvise advise;
|
||||
+
|
||||
+ if (!lt_dladvise_init (&advise) && !lt_dladvise_ext (&advise)
|
||||
+ && !lt_dladvise_global (&advise))
|
||||
+ handle = lt_dlopenadvise (filename, advise);
|
||||
+
|
||||
+ lt_dladvise_destroy (&advise);
|
||||
+
|
||||
+ return handle;
|
||||
+}
|
||||
+
|
||||
int module_load(const char* file_name, int argc, char *argv[])
|
||||
{
|
||||
module_loaded_t *module;
|
||||
@@ -180,7 +194,7 @@
|
||||
* to calling Debug. This is because Debug is a macro that expands
|
||||
* into multiple function calls.
|
||||
*/
|
||||
- if ((module->lib = lt_dlopenext(file)) == NULL) {
|
||||
+ if ((module->lib = slapd_lt_dlopenext_global(file)) == NULL) {
|
||||
error = lt_dlerror();
|
||||
#ifdef HAVE_EBCDIC
|
||||
strcpy( ebuf, error );
|
||||
@@ -0,0 +1,62 @@
|
||||
allow unsetting of tls_* syncrepl options
|
||||
|
||||
Author: Patrick Monnerat <pm@datasphere.ch>
|
||||
Upstream ITS: #7042
|
||||
Resolves: #734187
|
||||
|
||||
diff --git a/libraries/libldap/tls2.c b/libraries/libldap/tls2.c
|
||||
index 654a4bf..10b993b 100644
|
||||
--- a/libraries/libldap/tls2.c
|
||||
+++ b/libraries/libldap/tls2.c
|
||||
@@ -735,27 +735,27 @@ ldap_pvt_tls_set_option( LDAP *ld, int option, void *arg )
|
||||
return 0;
|
||||
case LDAP_OPT_X_TLS_CACERTFILE:
|
||||
if ( lo->ldo_tls_cacertfile ) LDAP_FREE( lo->ldo_tls_cacertfile );
|
||||
- lo->ldo_tls_cacertfile = arg ? LDAP_STRDUP( (char *) arg ) : NULL;
|
||||
+ lo->ldo_tls_cacertfile = (arg && *(char *)arg) ? LDAP_STRDUP( (char *) arg ) : NULL;
|
||||
return 0;
|
||||
case LDAP_OPT_X_TLS_CACERTDIR:
|
||||
if ( lo->ldo_tls_cacertdir ) LDAP_FREE( lo->ldo_tls_cacertdir );
|
||||
- lo->ldo_tls_cacertdir = arg ? LDAP_STRDUP( (char *) arg ) : NULL;
|
||||
+ lo->ldo_tls_cacertdir = (arg && *(char *)arg) ? LDAP_STRDUP( (char *) arg ) : NULL;
|
||||
return 0;
|
||||
case LDAP_OPT_X_TLS_CERTFILE:
|
||||
if ( lo->ldo_tls_certfile ) LDAP_FREE( lo->ldo_tls_certfile );
|
||||
- lo->ldo_tls_certfile = arg ? LDAP_STRDUP( (char *) arg ) : NULL;
|
||||
+ lo->ldo_tls_certfile = (arg && *(char *)arg) ? LDAP_STRDUP( (char *) arg ) : NULL;
|
||||
return 0;
|
||||
case LDAP_OPT_X_TLS_KEYFILE:
|
||||
if ( lo->ldo_tls_keyfile ) LDAP_FREE( lo->ldo_tls_keyfile );
|
||||
- lo->ldo_tls_keyfile = arg ? LDAP_STRDUP( (char *) arg ) : NULL;
|
||||
+ lo->ldo_tls_keyfile = (arg && *(char *)arg) ? LDAP_STRDUP( (char *) arg ) : NULL;
|
||||
return 0;
|
||||
case LDAP_OPT_X_TLS_DHFILE:
|
||||
if ( lo->ldo_tls_dhfile ) LDAP_FREE( lo->ldo_tls_dhfile );
|
||||
- lo->ldo_tls_dhfile = arg ? LDAP_STRDUP( (char *) arg ) : NULL;
|
||||
+ lo->ldo_tls_dhfile = (arg && *(char *)arg) ? LDAP_STRDUP( (char *) arg ) : NULL;
|
||||
return 0;
|
||||
case LDAP_OPT_X_TLS_CRLFILE: /* GnuTLS only */
|
||||
if ( lo->ldo_tls_crlfile ) LDAP_FREE( lo->ldo_tls_crlfile );
|
||||
- lo->ldo_tls_crlfile = arg ? LDAP_STRDUP( (char *) arg ) : NULL;
|
||||
+ lo->ldo_tls_crlfile = (arg && *(char *)arg) ? LDAP_STRDUP( (char *) arg ) : NULL;
|
||||
return 0;
|
||||
case LDAP_OPT_X_TLS_REQUIRE_CERT:
|
||||
if ( !arg ) return -1;
|
||||
@@ -783,7 +783,7 @@ ldap_pvt_tls_set_option( LDAP *ld, int option, void *arg )
|
||||
#endif
|
||||
case LDAP_OPT_X_TLS_CIPHER_SUITE:
|
||||
if ( lo->ldo_tls_ciphersuite ) LDAP_FREE( lo->ldo_tls_ciphersuite );
|
||||
- lo->ldo_tls_ciphersuite = arg ? LDAP_STRDUP( (char *) arg ) : NULL;
|
||||
+ lo->ldo_tls_ciphersuite = (arg && *(char *)arg) ? LDAP_STRDUP( (char *) arg ) : NULL;
|
||||
return 0;
|
||||
|
||||
case LDAP_OPT_X_TLS_PROTOCOL_MIN:
|
||||
@@ -794,7 +794,7 @@ ldap_pvt_tls_set_option( LDAP *ld, int option, void *arg )
|
||||
if ( ld != NULL )
|
||||
return -1;
|
||||
if ( lo->ldo_tls_randfile ) LDAP_FREE (lo->ldo_tls_randfile );
|
||||
- lo->ldo_tls_randfile = arg ? LDAP_STRDUP( (char *) arg ) : NULL;
|
||||
+ lo->ldo_tls_randfile = (arg && *(char *)arg) ? LDAP_STRDUP( (char *) arg ) : NULL;
|
||||
break;
|
||||
case LDAP_OPT_X_TLS_NEWCTX:
|
||||
if ( !arg ) return -1;
|
||||
@@ -0,0 +1,92 @@
|
||||
TLS: do not reuse tls_session if hostname check fails
|
||||
|
||||
If multiple servers are specified, the connection to the first one succeeds, and the hostname verification fails,
|
||||
*tls_session is not dropped, but reused when connecting to the second server.
|
||||
|
||||
This is a problem with Mozilla NSS backend because another handshake cannot be performed on the same file descriptor.
|
||||
From this reason, hostname checking was moved into ldap_int_tls_connect() before connection error handling.
|
||||
|
||||
Author: Jan Vcelak <jvcelak@redhat.com>
|
||||
Upstream ITS: #7373
|
||||
Resolves: #852476
|
||||
|
||||
diff --git a/libraries/libldap/tls2.c b/libraries/libldap/tls2.c
|
||||
index 10b993b..a3cd590 100644
|
||||
--- a/libraries/libldap/tls2.c
|
||||
+++ b/libraries/libldap/tls2.c
|
||||
@@ -320,7 +320,7 @@ update_flags( Sockbuf *sb, tls_session * ssl, int rc )
|
||||
*/
|
||||
|
||||
static int
|
||||
-ldap_int_tls_connect( LDAP *ld, LDAPConn *conn )
|
||||
+ldap_int_tls_connect( LDAP *ld, LDAPConn *conn, const char *host )
|
||||
{
|
||||
Sockbuf *sb = conn->lconn_sb;
|
||||
int err;
|
||||
@@ -365,6 +365,10 @@ ldap_int_tls_connect( LDAP *ld, LDAPConn *conn )
|
||||
errno = WSAGetLastError();
|
||||
#endif
|
||||
|
||||
+ if ( err == 0 ) {
|
||||
+ err = ldap_pvt_tls_check_hostname( ld, ssl, host );
|
||||
+ }
|
||||
+
|
||||
if ( err < 0 )
|
||||
{
|
||||
char buf[256], *msg;
|
||||
@@ -495,7 +499,15 @@ ldap_pvt_tls_check_hostname( LDAP *ld, void *s, const char *name_in )
|
||||
{
|
||||
tls_session *session = s;
|
||||
|
||||
- return tls_imp->ti_session_chkhost( ld, session, name_in );
|
||||
+ if (ld->ld_options.ldo_tls_require_cert != LDAP_OPT_X_TLS_NEVER &&
|
||||
+ ld->ld_options.ldo_tls_require_cert != LDAP_OPT_X_TLS_ALLOW) {
|
||||
+ ld->ld_errno = tls_imp->ti_session_chkhost( ld, session, name_in );
|
||||
+ if (ld->ld_errno != LDAP_SUCCESS) {
|
||||
+ return ld->ld_errno;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ return LDAP_SUCCESS;
|
||||
}
|
||||
|
||||
int
|
||||
@@ -857,7 +869,7 @@ ldap_int_tls_start ( LDAP *ld, LDAPConn *conn, LDAPURLDesc *srv )
|
||||
#endif /* LDAP_USE_NON_BLOCKING_TLS */
|
||||
|
||||
ld->ld_errno = LDAP_SUCCESS;
|
||||
- ret = ldap_int_tls_connect( ld, conn );
|
||||
+ ret = ldap_int_tls_connect( ld, conn, host );
|
||||
|
||||
#ifdef LDAP_USE_NON_BLOCKING_TLS
|
||||
while ( ret > 0 ) { /* this should only happen for non-blocking io */
|
||||
@@ -878,7 +890,7 @@ ldap_int_tls_start ( LDAP *ld, LDAPConn *conn, LDAPURLDesc *srv )
|
||||
} else {
|
||||
/* ldap_int_poll called ldap_pvt_ndelay_off */
|
||||
ber_sockbuf_ctrl( ld->ld_sb, LBER_SB_OPT_SET_NONBLOCK, sb );
|
||||
- ret = ldap_int_tls_connect( ld, conn );
|
||||
+ ret = ldap_int_tls_connect( ld, conn, host );
|
||||
if ( ret > 0 ) { /* need to call tls_connect once more */
|
||||
struct timeval curr_time_tv, delta_tv;
|
||||
|
||||
@@ -935,20 +947,6 @@ ldap_int_tls_start ( LDAP *ld, LDAPConn *conn, LDAPURLDesc *srv )
|
||||
return (ld->ld_errno);
|
||||
}
|
||||
|
||||
- ssl = ldap_pvt_tls_sb_ctx( sb );
|
||||
- assert( ssl != NULL );
|
||||
-
|
||||
- /*
|
||||
- * compare host with name(s) in certificate
|
||||
- */
|
||||
- if (ld->ld_options.ldo_tls_require_cert != LDAP_OPT_X_TLS_NEVER &&
|
||||
- ld->ld_options.ldo_tls_require_cert != LDAP_OPT_X_TLS_ALLOW) {
|
||||
- ld->ld_errno = ldap_pvt_tls_check_hostname( ld, ssl, host );
|
||||
- if (ld->ld_errno != LDAP_SUCCESS) {
|
||||
- return ld->ld_errno;
|
||||
- }
|
||||
- }
|
||||
-
|
||||
return LDAP_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,92 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
||||
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en'>
|
||||
<head>
|
||||
<title>openldap.git - openldap</title>
|
||||
<meta name='generator' content='cgit v0.9.2'/>
|
||||
<meta name='robots' content='index, nofollow'/>
|
||||
<link rel='stylesheet' type='text/css' href='/cgit-data/cgit.css'/>
|
||||
<link rel='alternate' title='Atom feed' href='http://pkgs.fedoraproject.org/cgit/openldap.git/atom/openldap-userconfig-setgid.patch?h=master' type='application/atom+xml'/>
|
||||
</head>
|
||||
<body>
|
||||
<div id='cgit'><table id='header'>
|
||||
<tr>
|
||||
<td class='logo' rowspan='2'><a href='/cgit/'><img src='/cgit-data/cgit.png' alt='cgit logo'/></a></td>
|
||||
<td class='main'><a href='/cgit/'>index</a> : <a title='openldap.git' href='/cgit/openldap.git/'>openldap.git</a></td><td class='form'><form method='get' action=''>
|
||||
<select name='h' onchange='this.form.submit();'>
|
||||
<option value='FC-4-split'>FC-4-split</option>
|
||||
<option value='f10'>f10</option>
|
||||
<option value='f11'>f11</option>
|
||||
<option value='f12'>f12</option>
|
||||
<option value='f13'>f13</option>
|
||||
<option value='f14'>f14</option>
|
||||
<option value='f15'>f15</option>
|
||||
<option value='f16'>f16</option>
|
||||
<option value='f17'>f17</option>
|
||||
<option value='f18'>f18</option>
|
||||
<option value='f19'>f19</option>
|
||||
<option value='f20'>f20</option>
|
||||
<option value='f7'>f7</option>
|
||||
<option value='f8'>f8</option>
|
||||
<option value='f9'>f9</option>
|
||||
<option value='master' selected='selected'>master</option>
|
||||
<option value='private-moznss-f17'>private-moznss-f17</option>
|
||||
</select> <input type='submit' name='' value='switch'/></form></td></tr>
|
||||
<tr><td class='sub'>openldap</td><td class='sub right'>Jesse Keating</td></tr></table>
|
||||
<table class='tabs'><tr><td>
|
||||
<a href='/cgit/openldap.git/'>summary</a><a href='/cgit/openldap.git/refs/'>refs</a><a href='/cgit/openldap.git/log/openldap-userconfig-setgid.patch'>log</a><a class='active' href='/cgit/openldap.git/tree/openldap-userconfig-setgid.patch'>tree</a><a href='/cgit/openldap.git/commit/openldap-userconfig-setgid.patch'>commit</a><a href='/cgit/openldap.git/diff/openldap-userconfig-setgid.patch'>diff</a><a href='/cgit/openldap.git/stats/openldap-userconfig-setgid.patch'>stats</a></td><td class='form'><form class='right' method='get' action='/cgit/openldap.git/log/openldap-userconfig-setgid.patch'>
|
||||
<select name='qt'>
|
||||
<option value='grep'>log msg</option>
|
||||
<option value='author'>author</option>
|
||||
<option value='committer'>committer</option>
|
||||
<option value='range'>range</option>
|
||||
</select>
|
||||
<input class='txt' type='text' size='10' name='q' value=''/>
|
||||
<input type='submit' value='search'/>
|
||||
</form>
|
||||
</td></tr></table>
|
||||
<div class='path'>path: <a href='/cgit/openldap.git/tree/'>root</a>/<a href='/cgit/openldap.git/tree/openldap-userconfig-setgid.patch'>openldap-userconfig-setgid.patch</a></div><div class='content'>blob: 70f0d28ecab7c4152aa414adde93e462179ba0f8 (<a href='/cgit/openldap.git/plain/openldap-userconfig-setgid.patch'>plain</a>)
|
||||
<table summary='blob content' class='blob'>
|
||||
<tr><td class='linenumbers'><pre><a class='no' id='n1' name='n1' href='#n1'>1</a>
|
||||
<a class='no' id='n2' name='n2' href='#n2'>2</a>
|
||||
<a class='no' id='n3' name='n3' href='#n3'>3</a>
|
||||
<a class='no' id='n4' name='n4' href='#n4'>4</a>
|
||||
<a class='no' id='n5' name='n5' href='#n5'>5</a>
|
||||
<a class='no' id='n6' name='n6' href='#n6'>6</a>
|
||||
<a class='no' id='n7' name='n7' href='#n7'>7</a>
|
||||
<a class='no' id='n8' name='n8' href='#n8'>8</a>
|
||||
<a class='no' id='n9' name='n9' href='#n9'>9</a>
|
||||
<a class='no' id='n10' name='n10' href='#n10'>10</a>
|
||||
<a class='no' id='n11' name='n11' href='#n11'>11</a>
|
||||
<a class='no' id='n12' name='n12' href='#n12'>12</a>
|
||||
<a class='no' id='n13' name='n13' href='#n13'>13</a>
|
||||
<a class='no' id='n14' name='n14' href='#n14'>14</a>
|
||||
<a class='no' id='n15' name='n15' href='#n15'>15</a>
|
||||
<a class='no' id='n16' name='n16' href='#n16'>16</a>
|
||||
<a class='no' id='n17' name='n17' href='#n17'>17</a>
|
||||
<a class='no' id='n18' name='n18' href='#n18'>18</a>
|
||||
</pre></td>
|
||||
<td class='lines'><pre><code>Normally, skips reading of user configuration file when running with different effective UID.
|
||||
This patch adds the same behavior for GID.
|
||||
|
||||
Author: Nalin Dahyabhai <nalin@redhat.com>
|
||||
|
||||
diff --git a/libraries/libldap/init.c b/libraries/libldap/init.c
|
||||
index e6b17b4..fbf4829 100644
|
||||
--- a/libraries/libldap/init.c
|
||||
+++ b/libraries/libldap/init.c
|
||||
@@ -678,7 +678,7 @@ void ldap_int_initialize( struct ldapoptions *gopts, int *dbglvl )
|
||||
openldap_ldap_init_w_sysconf(LDAP_CONF_FILE);
|
||||
|
||||
#ifdef HAVE_GETEUID
|
||||
- if ( geteuid() != getuid() )
|
||||
+ if ( geteuid() != getuid() || getegid() != getgid() )
|
||||
return;
|
||||
#endif
|
||||
|
||||
</code></pre></td></tr></table>
|
||||
</div> <!-- class=content -->
|
||||
<div class='footer'>generated by cgit v0.9.2 at 2014-01-09 14:22:50 (GMT)</div>
|
||||
</div> <!-- id=cgit -->
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user