Commit 7447ff8a authored by Kurt Zeilenga's avatar Kurt Zeilenga
Browse files

Misc changes from HEAD

parent 11c1dea4
OpenLDAP 2.3 Change Log
OpenLDAP 2.3.20 Engineering
Added libldap SASL workaround for broken LDAP servers
Added libldap SASL workaround for broken LDAP servers (ITS#4391)
Fixed slapo-auditlog crash (ITS#4394)
Fixed slapd-bdb/hdb wake listener on runqueue submit (ITS#4385)
Fixed slurpd reject error formating (ITS#4382)
OpenLDAP 2.3.19 Release
Fixed libldap disable DH key exchange with DH params (ITS#4354)
......
......@@ -642,6 +642,7 @@ bdb_cache_lru_add(
rtask.arg = bdb;
bdb_cache_lru_purge( NULL, &rtask );
} else {
int wake = 0;
ldap_pvt_thread_mutex_lock( &slapd_rq.rq_mutex );
if ( bdb->bi_cache_task ) {
if ( !ldap_pvt_runqueue_isrunning( &slapd_rq,
......@@ -652,13 +653,18 @@ bdb_cache_lru_add(
0 );
/* But don't try to reschedule it while it's running */
bdb->bi_cache_task->interval.tv_sec = 3600;
wake = 1;
}
} else {
bdb->bi_cache_task = ldap_pvt_runqueue_insert( &slapd_rq, 3600,
bdb_cache_lru_purge, bdb, "bdb_cache_lru_purge",
bdb->bi_dbenv_home );
wake = 1;
}
ldap_pvt_thread_mutex_unlock( &slapd_rq.rq_mutex );
/* Don't bother waking if the purge task is already running */
if ( wake )
slap_wake_listener();
}
}
}
......
......@@ -1497,6 +1497,8 @@ int config_generic_wrapper( Backend *be, const char *fname, int lineno,
c.argc = argc;
c.argv = argv;
c.valx = -1;
c.line = line;
c.op = SLAP_CONFIG_ADD;
snprintf( c.log, sizeof( c.log ), "%s: line %d", fname, lineno );
rc = SLAP_CONF_UNKNOWN;
......
......@@ -2088,7 +2088,7 @@ slapd_daemon_task(
#endif
for (i=0; i<ns; i++) {
int rc = 1, fd;
int rc = 1, fd, waswrite = 0;
if ( SLAP_EVENT_IS_LISTENER(i) ) {
#ifdef SLAP_LIGHTWEIGHT_DISPATCHER
......@@ -2118,6 +2118,8 @@ slapd_daemon_task(
"daemon: write active on %d\n",
fd, 0, 0 );
waswrite = 1;
#ifdef SLAP_LIGHTWEIGHT_DISPATCHER
connection_write_activate( fd );
#else
......@@ -2132,7 +2134,8 @@ slapd_daemon_task(
}
#endif
}
if( SLAP_EVENT_IS_READ( i ) ) {
/* If event is a read or an error */
if( SLAP_EVENT_IS_READ( i ) || !waswrite ) {
Debug( LDAP_DEBUG_CONNS,
"daemon: read active on %d\n",
fd, 0, 0 );
......
This directory contains a number of SLAPD overlays, some
project-maintained, some not. Some are generally usable,
others are purely experimental.
others are purely experimental. Additional overlays can
be found in the contrib/slapd-modules directory.
......@@ -1112,7 +1112,7 @@ accesslog_unbind( Operation *op, SlapReply *rs )
slap_overinst *on = (slap_overinst *)op->o_bd->bd_info;
if ( op->o_conn->c_authz_backend == on->on_info->oi_origdb ) {
log_info *li = on->on_bi.bi_private;
Operation op2;
Operation op2 = {0};
void *cids[SLAP_MAX_CIDS];
SlapReply rs2 = {REP_RESULT};
Entry *e;
......@@ -1132,7 +1132,6 @@ accesslog_unbind( Operation *op, SlapReply *rs )
op2.o_callback = &nullsc;
op2.o_controls = cids;
memset(cids, 0, sizeof( cids ));
memset(op2.o_ctrlflag, 0, sizeof( op2.o_ctrlflag ));
op2.o_bd->be_add( &op2, &rs2 );
entry_free( e );
......@@ -1145,7 +1144,7 @@ accesslog_abandon( Operation *op, SlapReply *rs )
{
slap_overinst *on = (slap_overinst *)op->o_bd->bd_info;
log_info *li = on->on_bi.bi_private;
Operation op2;
Operation op2 = {0};
void *cids[SLAP_MAX_CIDS];
SlapReply rs2 = {REP_RESULT};
Entry *e;
......@@ -1171,7 +1170,6 @@ accesslog_abandon( Operation *op, SlapReply *rs )
op2.o_callback = &nullsc;
op2.o_controls = cids;
memset(cids, 0, sizeof( cids ));
memset(op2.o_ctrlflag, 0, sizeof( op2.o_ctrlflag ));
op2.o_bd->be_add( &op2, &rs2 );
entry_free( e );
......
......@@ -36,7 +36,7 @@ typedef struct auditlog_data {
char *ad_logfile;
} auditlog_data;
int fprint_ldif(FILE *f, char *name, char *val, ber_len_t len) {
static int fprint_ldif(FILE *f, char *name, char *val, ber_len_t len) {
char *s;
if((s = ldif_put(LDIF_PUT_VALUE, name, val, len)) == NULL)
return(-1);
......@@ -45,7 +45,7 @@ int fprint_ldif(FILE *f, char *name, char *val, ber_len_t len) {
return(0);
}
int auditlog_response(Operation *op, SlapReply *rs) {
static int auditlog_response(Operation *op, SlapReply *rs) {
slap_overinst *on = (slap_overinst *)op->o_bd->bd_info;
auditlog_data *ad = on->on_bi.bi_private;
FILE *f;
......@@ -78,7 +78,9 @@ int auditlog_response(Operation *op, SlapReply *rs) {
case LDAP_REQ_MODIFY:
what = "modify";
for(m = op->orm_modlist; m; m = m->sml_next)
if( m->sml_desc == slap_schema.si_ad_modifiersName ) {
if( m->sml_desc == slap_schema.si_ad_modifiersName &&
( m->sml_op == LDAP_MOD_ADD ||
m->sml_op == LDAP_MOD_REPLACE )) {
who = m->sml_values[0].bv_val;
break;
}
......
......@@ -272,7 +272,7 @@ attributetype ( 2.5.4.40 NAME 'crossCertificatePair'
DESC 'RFC2256: X.509 cross certificate pair, use ;binary'
SYNTAX 1.3.6.1.4.1.1466.115.121.1.10 )
# 2.5.4.41 is defined above as it's used for subtyping
# system schema
#attributetype ( 2.5.4.41 NAME 'name'
# EQUALITY caseIgnoreMatch
# SUBSTR caseIgnoreSubstringsMatch
......@@ -311,7 +311,7 @@ attributetype ( 2.5.4.48 NAME 'protocolInformation'
EQUALITY protocolInformationMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.42 )
# 2.5.4.49 is defined above as it's used for subtyping
# system schema
#attributetype ( 2.5.4.49 NAME 'distinguishedName'
# EQUALITY distinguishedNameMatch
# SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )
......
......@@ -293,13 +293,13 @@ pblock_get_param_class( int param )
static void
pblock_lock( Slapi_PBlock *pb )
{
ldap_pvt_thread_mutex_lock(&pb->pb_mutex);
ldap_pvt_thread_mutex_lock( &pb->pb_mutex );
}
static void
pblock_unlock( Slapi_PBlock *pb )
{
ldap_pvt_thread_mutex_unlock(&pb->pb_mutex);
ldap_pvt_thread_mutex_unlock( &pb->pb_mutex );
}
static int
......
......@@ -153,8 +153,12 @@ int asserted_value_validate_normalize(
rc = (mr->smr_syntax->ssyn_pretty)( mr->smr_syntax, in, &pval, ctx );
in = &pval;
} else {
} else if ( mr->smr_syntax->ssyn_validate ) {
rc = (mr->smr_syntax->ssyn_validate)( mr->smr_syntax, in );
} else {
*text = "inappropriate matching request";
return LDAP_INAPPROPRIATE_MATCHING;
}
if( rc != LDAP_SUCCESS ) {
......
......@@ -13,15 +13,15 @@
* top-level directory of the distribution or, alternatively, at
* <http://www.OpenLDAP.org/license.html>.
*/
/* Copyright 2004 IBM Corporation
/* Portions Copyright 2004 IBM Corporation
* All rights reserved.
* Redisribution and use in source and binary forms, with or without
* modification, are permitted only as authorizd by the OpenLDAP
* Redistribution and use in source and binary forms, with or without
* modification, are permitted only as authorized by the OpenLDAP
* Public License.
*/
/* ACKNOWLEDGEMENTS
* This work originally developed by Jong-Hyuk Choi
* 2004/12/09 jongchoi@OpenLDAP.org
* This work originally developed by Jong-Hyuk Choi for inclusion in
* OpenLDAP Software.
*/
#include "portable.h"
......
......@@ -39,6 +39,7 @@
#include <stdio.h>
#include <ac/stdlib.h>
#include <ac/string.h>
#include <ac/errno.h>
#include <ac/unistd.h>
......@@ -48,6 +49,9 @@
#include "slurp.h"
#include "globals.h"
#include "lber_pvt.h"
#include "lutil.h"
#ifdef _WIN32
#define PORTSEP ","
#else
......@@ -96,12 +100,45 @@ write_reject(
Debug( LDAP_DEBUG_ANY, "Error: cannot open reject file \"%s\"\n",
rejfile, 0, 0 );
} else {
fseek( rfp, 0, 2 );
fprintf( rfp, "%s: %s", ERROR_STR, ldap_err2string( lderr ));
struct berval bv = BER_BVNULL,
errstrbv,
errmsgbv = BER_BVNULL;
char *ptr;
ber_str2bv( ldap_err2string( lderr ), 0, 0, &errstrbv );
if ( errmsg && *errmsg ) {
fprintf( rfp, ": %s", errmsg );
ber_str2bv( errmsg, 0, 0, &errmsgbv );
bv.bv_len = errstrbv.bv_len
+ STRLENOF( ": " ) + errmsgbv.bv_len;
ptr = bv.bv_val = ber_memalloc( bv.bv_len + 1 );
ptr = lutil_strcopy( ptr, errstrbv.bv_val );
ptr = lutil_strcopy( ptr, ": " );
ptr = lutil_strcopy( ptr, errmsgbv.bv_val );
} else {
bv = errstrbv;
}
fprintf( rfp, "\n" );
fseek( rfp, 0, 2 );
ptr = ldif_put( LDIF_PUT_VALUE, ERROR_STR, bv.bv_val, bv.bv_len );
if ( bv.bv_val != errstrbv.bv_val ) {
ber_memfree( bv.bv_val );
}
if ( ptr == NULL ) {
Debug( LDAP_DEBUG_ANY,
"Error: cannot convert error message(s) \"%s%s%s\" "
"into LDIF format\n",
errstrbv.bv_val,
BER_BVISNULL( &errmsgbv ) ? "" : ": ",
BER_BVISNULL( &errmsgbv ) ? "" : errmsgbv.bv_val );
return;
}
fputs( ptr, rfp );
ber_memfree( ptr );
if ((rc = re->re_write( ri, re, rfp )) < 0 ) {
Debug( LDAP_DEBUG_ANY,
"Error: cannot write reject file \"%s\"\n",
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment