From: Howard Chu Date: Fri, 5 Nov 2004 07:10:44 +0000 (+0000) Subject: ITS#3376 Fix prev commit, handling of replogfile X-Git-Tag: OPENLDAP_REL_ENG_2_3_0ALPHA~367 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=1d35c8f8eccf2ef16abc70b9382d5a89e1db144c;p=openldap ITS#3376 Fix prev commit, handling of replogfile --- diff --git a/servers/slapd/config.c b/servers/slapd/config.c index 769cb096f9..e2d2f8da7a 100644 --- a/servers/slapd/config.c +++ b/servers/slapd/config.c @@ -48,7 +48,6 @@ */ slap_mask_t global_allows = 0; slap_mask_t global_disallows = 0; -char *replogfile; int global_gentlehup = 0; int global_idletimeout = 0; char *global_host = NULL; @@ -218,7 +217,7 @@ ConfigTable SystemConfiguration[] = { { "replicationInterval", 0, 0, 0, NULL, ARG_IGNORED, NULL, NULL, NULL, NULL }, { "updatedn", 2, 2, 0, "dn", ARG_DB|ARG_MAGIC, &config_updatedn, NULL, NULL, NULL }, { "updateref", 2, 2, 0, "url", ARG_DB|ARG_MAGIC, &config_updateref, NULL, NULL, NULL }, - { "replogfile", 2, 2, 0, "filename", ARG_MAGIC|CFG_REPLOG, &config_generic, NULL, NULL, NULL }, + { "replogfile", 2, 2, 0, "filename", ARG_MAGIC|ARG_STRING|CFG_REPLOG, &config_generic, NULL, NULL, NULL }, { "rootDSE", 2, 2, 0, "filename", ARG_MAGIC|CFG_ROOTDSE, &config_generic, NULL, NULL, NULL }, { "lastmod", 2, 2, 0, "on|off", ARG_DB|ARG_ON_OFF|ARG_MAGIC|CFG_LASTMOD, &config_generic, NULL, NULL, NULL }, #ifdef SIGHUP diff --git a/servers/slapd/proto-slap.h b/servers/slapd/proto-slap.h index 5aa62876e8..82d0596b6a 100644 --- a/servers/slapd/proto-slap.h +++ b/servers/slapd/proto-slap.h @@ -1343,7 +1343,6 @@ LDAP_SLAPD_V (slap_mask_t) global_allows; LDAP_SLAPD_V (slap_mask_t) global_disallows; LDAP_SLAPD_V (BerVarray) default_referral; -LDAP_SLAPD_V (char *) replogfile; LDAP_SLAPD_V (const char) Versionstr[]; LDAP_SLAPD_V (int) global_gentlehup; diff --git a/servers/slapd/repl.c b/servers/slapd/repl.c index f8ac323a84..9cf8c1cac1 100644 --- a/servers/slapd/repl.c +++ b/servers/slapd/repl.c @@ -134,14 +134,16 @@ replog( Operation *op ) #endif int subsets = 0; long now = slap_get_time(); + char *replogfile; - if ( op->o_bd->be_replogfile == NULL && replogfile == NULL ) { + replogfile = op->o_bd->be_replogfile ? op->o_bd->be_replogfile : + frontendDB->be_replogfile; + if ( !replogfile ) { return; } ldap_pvt_thread_mutex_lock( &replog_mutex ); - if ( (fp = lock_fopen( op->o_bd->be_replogfile ? op->o_bd->be_replogfile : - replogfile, "a", &lfp )) == NULL ) { + if ( (fp = lock_fopen( replogfile, "a", &lfp )) == NULL ) { ldap_pvt_thread_mutex_unlock( &replog_mutex ); return; }