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)
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,
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();
}
}
}
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;
#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
"daemon: write active on %d\n",
fd, 0, 0 );
+ waswrite = 1;
+
#ifdef SLAP_LIGHTWEIGHT_DISPATCHER
connection_write_activate( fd );
#else
}
#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.
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;
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 );
{
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;
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 );
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);
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;
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;
}
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
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 )
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
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 ) {
* 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"
#include <stdio.h>
#include <ac/stdlib.h>
+#include <ac/string.h>
#include <ac/errno.h>
#include <ac/unistd.h>
#include "slurp.h"
#include "globals.h"
+#include "lber_pvt.h"
+#include "lutil.h"
+
#ifdef _WIN32
#define PORTSEP ","
#else
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",