ldap/servers
by Noriko Hosoi
ldap/servers/plugins/replication/windows_protocol_util.c | 20 ++++++++++++---
1 file changed, 16 insertions(+), 4 deletions(-)
New commits:
commit 1c888bf957de4b88734d1796caa338ef944b7c7a
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Tue Aug 26 11:19:28 2014 -0700
Ticket #47879 - coverity defects in plugins/replication/windows_protocol_util.c
Description:
Defect type: CLANG_WARNING
1. ldap/servers/plugins/replication/windows_protocol_util.c:6024:warning – Value stored to 'rc' is never read
# rc = windows_process_dirsync_entry(prp,e,0);
# ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Removed the unnecessary assignment.
2. ldap/servers/plugins/replication/windows_protocol_util.c:1713:warning – Value stored to 'return_value' is never read
# return_value = windows_conn_send_rename(prp->conn, slapi_sdn_get_dn(remote_dn),
# ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Added return_value checking code.
3. ldap/servers/plugins/replication/windows_protocol_util.c:629:warning – Value stored to 'return_value' is never read
Removed the unnecessary assignment to return_value.
https://fedorahosted.org/389/ticket/47879
Reviewed by mreynolds(a)redhat.com (Thank you, Mark!!)
diff --git a/ldap/servers/plugins/replication/windows_protocol_util.c b/ldap/servers/plugins/replication/windows_protocol_util.c
index caeb388..c424590 100644
--- a/ldap/servers/plugins/replication/windows_protocol_util.c
+++ b/ldap/servers/plugins/replication/windows_protocol_util.c
@@ -626,7 +626,6 @@ windows_acquire_replica(Private_Repl_Protocol *prp, RUV **ruv, int check_ruv)
slapi_log_error(SLAPI_LOG_FATAL, windows_repl_plugin_name,
"%s: Remote replica already acquired\n",
agmt_get_long_name(prp->agmt));
- return_value = ACQUIRE_FATAL_ERROR;
LDAPDebug( LDAP_DEBUG_TRACE, "<= windows_acquire_replica\n", 0, 0, 0 );
return ACQUIRE_SUCCESS;
}
@@ -1662,6 +1661,8 @@ windows_replay_update(Private_Repl_Protocol *prp, slapi_operation_parameters *op
{
LDAPMod **mapped_mods = NULL;
char *newrdn = NULL;
+ int ldap_op = 0;
+ int ldap_result_code = 0;
/*
* If the magic objectclass and attributes have been added to the entry
@@ -1707,12 +1708,24 @@ windows_replay_update(Private_Repl_Protocol *prp, slapi_operation_parameters *op
/* Check if a naming attribute is being modified. */
if (windows_check_mods_for_rdn_change(prp, op->p.p_modify.modify_mods, local_entry, remote_dn, &newrdn)) {
/* Issue MODRDN */
+ /*
+ * remote_dn is in GUID format. Thus, this MODRDN does not change the remote_dn but the DN on AD only.
+ * Thus, no need to "rename" remote_dn for the following windows_conn_send_modify.
+ */
slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name, "%s: renaming remote entry \"%s\" with new RDN of \"%s\"\n",
agmt_get_long_name(prp->agmt), slapi_sdn_get_dn(remote_dn), newrdn);
return_value = windows_conn_send_rename(prp->conn, slapi_sdn_get_dn(remote_dn),
newrdn, NULL, 1 /* delete old RDN */,
NULL, NULL /* returned controls */);
slapi_ch_free_string(&newrdn);
+ windows_conn_get_error(prp->conn, &ldap_op, &ldap_result_code);
+ if (return_value != CONN_OPERATION_SUCCESS) {
+ if (!ldap_result_code) {
+ /* op failed but no ldap error code ??? */
+ ldap_result_code = LDAP_OPERATIONS_ERROR;
+ }
+ goto bail_modify;
+ }
}
/* It's possible that the mapping process results in an empty mod list, in which case we don't bother with the replay */
@@ -1721,8 +1734,6 @@ windows_replay_update(Private_Repl_Protocol *prp, slapi_operation_parameters *op
return_value = CONN_OPERATION_SUCCESS;
} else
{
- int ldap_op = 0;
- int ldap_result_code = 0;
if (slapi_is_loglevel_set(SLAPI_LOG_REPL))
{
int i = 0;
@@ -1761,6 +1772,7 @@ windows_replay_update(Private_Repl_Protocol *prp, slapi_operation_parameters *op
windows_conn_set_error(prp->conn, ldap_result_code);
}
}
+bail_modify:
if (mapped_mods)
{
ldap_mods_free(mapped_mods,1);
@@ -6013,7 +6025,7 @@ windows_dirsync_inc_run(Private_Repl_Protocol *prp)
while ( (e = windows_conn_get_search_result(prp->conn) ) != NULL)
{
- rc = windows_process_dirsync_entry(prp,e,0);
+ (void)windows_process_dirsync_entry(prp,e,0);
if (e)
{
slapi_entry_free(e);
9 years, 8 months
Branch '389-ds-base-1.3.2' - ldap/servers
by Ludwig Krispenz
ldap/servers/plugins/dna/dna.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
New commits:
commit f23781293f4670ed84ef0fc5a496ad33dfe334d0
Author: Ludwig Krispenz <lkrispen(a)redhat.com>
Date: Wed Aug 27 15:05:36 2014 +0200
Ticket 47866 - Errors after upgrading related to attribute "dnaremotebindmethod"
Bug Description: the dnaSharedConfig entries can contain "(null)" values
Fix Description: check if remoteBindDn and remoteConnProtocol are set, before
creating a vaue for teh entries.
NOTE: if these values aready have been created they have to be
deleted and the server restarted
https://fedorahosted.org/389/ticket/47866
Reviewed by: mark, thanks
diff --git a/ldap/servers/plugins/dna/dna.c b/ldap/servers/plugins/dna/dna.c
index ab0fc5d..d427dd3 100644
--- a/ldap/servers/plugins/dna/dna.c
+++ b/ldap/servers/plugins/dna/dna.c
@@ -2503,12 +2503,16 @@ dna_get_shared_config_attr_val(struct configEntry *config_entry, char *attr, cha
while (server) {
if(slapi_sdn_compare(server->sdn, server_sdn) == 0){
if(strcmp(attr, DNA_REMOTE_BIND_METHOD) == 0){
- PR_snprintf(value, DNA_REMOTE_BUFSIZ, "%s", server->remote_bind_method);
- found = 1;
+ if (server->remote_bind_method) {
+ PR_snprintf(value, DNA_REMOTE_BUFSIZ, "%s", server->remote_bind_method);
+ found = 1;
+ }
break;
} else if(strcmp(attr, DNA_REMOTE_CONN_PROT) == 0){
- PR_snprintf(value, DNA_REMOTE_BUFSIZ, "%s", server->remote_conn_prot);
- found = 1;
+ if (server->remote_conn_prot) {
+ PR_snprintf(value, DNA_REMOTE_BUFSIZ, "%s", server->remote_conn_prot);
+ found = 1;
+ }
break;
}
}
9 years, 8 months
ldap/servers
by Ludwig Krispenz
ldap/servers/plugins/dna/dna.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
New commits:
commit 3dcf4a91464b47b9bc06476c0db0ce27d7dd11c8
Author: Ludwig Krispenz <lkrispen(a)redhat.com>
Date: Wed Aug 27 15:05:36 2014 +0200
Ticket 47866 - Errors after upgrading related to attribute "dnaremotebindmethod"
Bug Description: the dnaSharedConfig entries can contain "(null)" values
Fix Description: check if remoteBindDn and remoteConnProtocol are set, before
creating a vaue for teh entries.
NOTE: if these values aready have been created they have to be
deleted and the server restarted
https://fedorahosted.org/389/ticket/47866
Reviewed by: mark, thanks
diff --git a/ldap/servers/plugins/dna/dna.c b/ldap/servers/plugins/dna/dna.c
index 6162137..b42150a 100644
--- a/ldap/servers/plugins/dna/dna.c
+++ b/ldap/servers/plugins/dna/dna.c
@@ -2474,12 +2474,16 @@ dna_get_shared_config_attr_val(struct configEntry *config_entry, char *attr, cha
while (server) {
if(slapi_sdn_compare(server->sdn, server_sdn) == 0){
if(strcmp(attr, DNA_REMOTE_BIND_METHOD) == 0){
- PR_snprintf(value, DNA_REMOTE_BUFSIZ, "%s", server->remote_bind_method);
- found = 1;
+ if (server->remote_bind_method) {
+ PR_snprintf(value, DNA_REMOTE_BUFSIZ, "%s", server->remote_bind_method);
+ found = 1;
+ }
break;
} else if(strcmp(attr, DNA_REMOTE_CONN_PROT) == 0){
- PR_snprintf(value, DNA_REMOTE_BUFSIZ, "%s", server->remote_conn_prot);
- found = 1;
+ if (server->remote_conn_prot) {
+ PR_snprintf(value, DNA_REMOTE_BUFSIZ, "%s", server->remote_conn_prot);
+ found = 1;
+ }
break;
}
}
9 years, 8 months
lib/libadminutil
by Mark Reynolds
lib/libadminutil/admutil.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 069de33671fd49732c9baeb7fb0007eb7518d97e
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Wed Aug 27 10:25:30 2014 -0400
Ticket 47881 - crash during debug session in adminutil
Bug Description: Encountered a crash at admin server startup when
attempting to debug the admin server. The crash
was in the adminutil code.
Fix Description: The was an uninitialized pointer that upon error
was being dereferenced. I've had problems reproducing
it since, but it is just a one line fix.
https://fedorahosted.org/389/ticket/47881
Reviewed by: rmeggins(Thanks!)
diff --git a/lib/libadminutil/admutil.c b/lib/libadminutil/admutil.c
index 839ab2d..1ab0151 100644
--- a/lib/libadminutil/admutil.c
+++ b/lib/libadminutil/admutil.c
@@ -1210,7 +1210,7 @@ admldapBuildInfoOnly(char* configRoot, int *errorcode)
char buf[MAX_LEN],
*name= NULL, *password=NULL;
int status;
- LDAPURLDesc *ldapInfo;
+ LDAPURLDesc *ldapInfo = NULL;
*errorcode = ADMUTIL_OP_OK;
9 years, 8 months
389-console.8 389-console.spec build.xml
by Mark Reynolds
389-console.8 | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
389-console.spec | 5 ++-
build.xml | 10 +++++--
3 files changed, 90 insertions(+), 3 deletions(-)
New commits:
commit 23e0e74c245604e69f2153c48028fde3aee2103a
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Tue Aug 26 10:34:25 2014 -0400
Ticket 97 - 389-console should provide man page
Bug Description: The console is missing a man page.
Fix Description: Add man page, and deploy it the man8 directory.
https://fedorahosted.org/389/ticket/97
Reviewed by: rmeggins & nhosoi(Thanks!!)
diff --git a/389-console.8 b/389-console.8
new file mode 100644
index 0000000..6230e90
--- /dev/null
+++ b/389-console.8
@@ -0,0 +1,78 @@
+.\" Hey, EMACS: -*- nroff -*-
+.\" First parameter, NAME, should be all caps
+.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
+.\" other parameters are allowed: see man(7), man(1)
+.TH 389-console 8 "Aug 25, 2014"
+.\" Please adjust this date whenever revising the manpage.
+.\"
+.\" Some roff macros, for reference:
+.\" .nh disable hyphenation
+.\" .hy enable hyphenation
+.\" .ad l left justify
+.\" .ad b justify to both left and right margins
+.\" .nf disable filling
+.\" .fi enable filling
+.\" .br insert line break
+.\" .sp <n> insert n+1 empty lines
+.\" for manpage-specific macros, see man(7)
+.SH NAME
+389-console - The 389 Directory Server UI
+.SH SYNOPSIS
+389-console [-a <URL>] [-A <local URL>] [-D <debug level>] [-f <output file>] [-h]
+[-l <Language Code>] [-s <SIE DN>] [-u <username/Bind DN>] [-w <password> | - (prompt for password)]
+[-x <options>] [-y <password file>]
+.SH DESCRIPTION
+A Java based remote management console used for Managing the Directory Server and Administration Server.
+.SH OPTIONS
+A summary of options is included below:
+.TP
+.B \fB\-a\fR \fIURL\fR
+Administration Server base URL.
+.TP
+.B \fB\-A\fR \fIURL\fR
+Local Administration Server URL.
+.TP
+.B \fB\-D\fR \fIDebug_Level\fR
+Debug level: 1 - 9
+.TP
+.B \fB\-f\fR \fIDebug_Output_File\fR
+Specifies the output file for the debug logging.
+.TP
+.B \fB\-h\fR
+.br
+Display usage.
+.TP
+.B \fB\-l\fR \fILanguage code\fR
+Language code.
+.TP
+.B \fB\-s\fR \fIServer DN/Identifier\fR
+server DN (cn=...) or instance ID (e.g. slapd-host)
+.TP
+.B \fB\-u\fR \fIusername/BiNd DN\fR
+The user name or bind DN to log into the console.
+.TP
+.B \fB\-w\fR \fIpassword\fR
+Password for the bind DN specified with the -u option.
+.TP
+.B \fB\-w\fR \fB\\\-\fR
+.br
+Prompt for the user password.
+.TP
+.B \fB\-x\fR \fIOption\fR
+Extra options (javalaf, nowinpos, nologo)
+.TP
+.B \fB\-y\fR \fIPassword_File\fR
+File containing user password.
+
+.SH EXAMPLE
+.TP
+389-console -a http://host.domain.com:9830 -u "cn=directory manager" -f ./passwd.txt -l en
+.TP
+389-console -D 9 -f /tmp/debug-output.txt -x nologo
+
+.SH AUTHOR
+389-console was written by the 389 Project.
+.SH "REPORTING BUGS"
+Report bugs to http://bugzilla.redhat.com.
+.SH COPYRIGHT
+Copyright \(co 2014 Red Hat, Inc.
diff --git a/389-console.spec b/389-console.spec
index 3ed2811..9f5100c 100755
--- a/389-console.spec
+++ b/389-console.spec
@@ -32,7 +32,7 @@ Administration Server and 389 Directory Server.
%build
%{ant} \
- -Dbuilt.dir=`pwd`/built
+ -Dbuilt.dir=`pwd`/built -Dman.dir=`pwd`/built%{_mandir}
# add -Dlib.dir and -Dneed_libdir on those platforms where
# jss is installed in a non-standard location
@@ -44,6 +44,8 @@ install -d $RPM_BUILD_ROOT%{_javadir}
install -m644 built/*.jar $RPM_BUILD_ROOT%{_javadir}
install -d $RPM_BUILD_ROOT%{_bindir}
install -m755 built/%{name} $RPM_BUILD_ROOT/%{_bindir}
+install -d $RPM_BUILD_ROOT%{_mandir}/man8
+install -m built%{_mandir}/man8/* $RPM_BUILD_ROOT%{_mandir}/man8
# create symlinks
pushd $RPM_BUILD_ROOT%{_javadir}
@@ -61,6 +63,7 @@ rm -rf $RPM_BUILD_ROOT
%{_javadir}/%{name}-%{major_version}_en.jar
%{_javadir}/%{name}_en.jar
%{_bindir}/%{name}
+%{_mandir}
%changelog
* Wed May 13 2009 Rich Megginson <rmeggins(a)redhat.com> 1.1.3-2
diff --git a/build.xml b/build.xml
index 5cb516f..2e4a4ab 100644
--- a/build.xml
+++ b/build.xml
@@ -40,6 +40,7 @@ END COPYRIGHT BLOCK
<property name="console.local.location" value="/usr/share/java"/>
<property name="lib.dir" value="/usr/lib"/>
<property name="need_libdir" value=""/>
+ <property name="man.dir" value="/usr/share/man"/>
<!-- Verify that the required jars exist -->
<fail message="LDAP JDK (${ldapjdk.jar.name}) does not exist in ${ldapjdk.local.location}">
@@ -85,8 +86,8 @@ END COPYRIGHT BLOCK
</target>
<!-- Build -->
- <target name="build" depends="prepare,buildjar,buildscript"/>
- <target name="buildnoscript" depends="prepare,buildjar"/>
+ <target name="build" depends="prepare,buildjar,buildscript,buildman"/>
+ <target name="buildnoscript" depends="prepare,buildjar,buildman"/>
<target name="buildjar" depends="prepare">
<!-- Create the theme jar file -->
@@ -116,4 +117,9 @@ END COPYRIGHT BLOCK
<replacefilter token="@need_libdir@" value="${need_libdir}"/>
</replace>
</target>
+ <target name="buildman">
+ <!-- Man Page -->
+ <copy file="389-console.8" tofile="${man.dir}/man8/389-console.8"/>
+ <chmod file="${man.dir}/man8/389-console.8" perm="644"/>
+ </target>
</project>
9 years, 8 months
Branch '389-ds-base-1.3.2' - ldap/admin ldap/ldif Makefile.am Makefile.in
by Ludwig Krispenz
Makefile.am | 2
Makefile.in | 2
ldap/admin/src/scripts/50targetuniqueid.ldif | 7 +++
ldap/admin/src/scripts/82targetuniqueidindex.pl | 52 ++++++++++++++++++++++++
ldap/ldif/template-dse.ldif.in | 7 +++
5 files changed, 70 insertions(+)
New commits:
commit abc947a00520d6428de4e595973f6f2059663bb8
Author: Ludwig Krispenz <lkrispen(a)redhat.com>
Date: Mon Aug 25 13:19:09 2014 +0200
Ticket 47816 -v2- internal syncrepl searches are flagged as unindexed
Bug Description: if syncrepl is enabled it uses an attribute targetuniqueid
for internal searches. this is not indexed and
lot of warnings are logged
Fix Description: add an equality index to the default indexes
for exising instances tit will add the index
to the changelog backend and trigge a reindex
https://fedorahosted.org/389/ticket/47816
Reviewed by: ?
Conflicts:
ldap/ldif/template-dse.ldif.in
diff --git a/Makefile.am b/Makefile.am
index be5a4f9..b0c811a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -560,6 +560,7 @@ update_DATA = ldap/admin/src/scripts/exampleupdate.pl \
ldap/admin/src/scripts/50fixNsState.pl \
ldap/admin/src/scripts/50telexnumbersyntaxplugin.ldif \
ldap/admin/src/scripts/50guidesyntaxplugin.ldif \
+ ldap/admin/src/scripts/50targetuniqueid.ldif \
ldap/ldif/50replication-plugins.ldif \
ldap/admin/src/scripts/50linkedattrsplugin.ldif \
$(POSIX_WINSYNC_PLUGIN_LDIF) \
@@ -574,6 +575,7 @@ update_DATA = ldap/admin/src/scripts/exampleupdate.pl \
ldap/admin/src/scripts/70upgradefromldif.pl \
ldap/admin/src/scripts/80upgradednformat.pl \
ldap/admin/src/scripts/81changelog.pl \
+ ldap/admin/src/scripts/82targetuniqueidindex.pl \
ldap/admin/src/scripts/90subtreerename.pl \
ldap/admin/src/scripts/91subtreereindex.pl \
ldap/admin/src/scripts/dnaplugindepends.ldif
diff --git a/Makefile.in b/Makefile.in
index 073a142..3e990a3 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1851,6 +1851,7 @@ update_DATA = ldap/admin/src/scripts/exampleupdate.pl \
ldap/admin/src/scripts/50fixNsState.pl \
ldap/admin/src/scripts/50telexnumbersyntaxplugin.ldif \
ldap/admin/src/scripts/50guidesyntaxplugin.ldif \
+ ldap/admin/src/scripts/50targetuniqueid.ldif \
ldap/ldif/50replication-plugins.ldif \
ldap/admin/src/scripts/50linkedattrsplugin.ldif \
$(POSIX_WINSYNC_PLUGIN_LDIF) \
@@ -1865,6 +1866,7 @@ update_DATA = ldap/admin/src/scripts/exampleupdate.pl \
ldap/admin/src/scripts/70upgradefromldif.pl \
ldap/admin/src/scripts/80upgradednformat.pl \
ldap/admin/src/scripts/81changelog.pl \
+ ldap/admin/src/scripts/82targetuniqueidindex.pl \
ldap/admin/src/scripts/90subtreerename.pl \
ldap/admin/src/scripts/91subtreereindex.pl \
ldap/admin/src/scripts/dnaplugindepends.ldif
diff --git a/ldap/admin/src/scripts/50targetuniqueid.ldif b/ldap/admin/src/scripts/50targetuniqueid.ldif
new file mode 100644
index 0000000..8f5cbc3
--- /dev/null
+++ b/ldap/admin/src/scripts/50targetuniqueid.ldif
@@ -0,0 +1,7 @@
+dn: cn=targetuniqueid,cn=default indexes,cn=config,cn=ldbm database,cn=plugins,cn=config
+changetype: add
+objectclass: top
+objectclass: nsIndex
+cn: targetuniqueid
+nssystemindex: true
+nsindextype: eq
diff --git a/ldap/admin/src/scripts/82targetuniqueidindex.pl b/ldap/admin/src/scripts/82targetuniqueidindex.pl
new file mode 100644
index 0000000..a0bffe6
--- /dev/null
+++ b/ldap/admin/src/scripts/82targetuniqueidindex.pl
@@ -0,0 +1,52 @@
+use Mozilla::LDAP::Conn;
+use Mozilla::LDAP::Utils qw(normalizeDN);
+use Mozilla::LDAP::API qw(:constant ldap_url_parse ldap_explode_dn);
+use DSUpdate qw(isOffline);
+
+sub runinst {
+ my ($inf, $inst, $dseldif, $conn) = @_;
+
+ my $rc, @errs;
+
+ my $config = $conn->search("cn=config", "base", "(objectclass=*)");
+ if (!$config) {
+ push @errs, ['error_finding_config_entry', 'cn=config',
+ $conn->getErrorString()];
+ return @errs;
+ }
+
+ ($rc, @errs) = isOffline($inf, $inst, $conn);
+ if (!$rc) {
+ return @errs;
+ }
+
+ my $retrocldb = $conn->search("cn=changelog,cn=ldbm database,cn=plugins,cn=config", "base", "(objectclass=*)");
+ if (!$retrocldb) {
+ return (); # retrocl is not enabled; do nothing
+ }
+
+ my $indexdn = "cn=targetuniqueid,cn=index,cn=changelog,cn=ldbm database,cn=plugins,cn=config";
+ my $targetuiniqidindex = $conn->search($indexdn, "base", "(objectclass=*)");
+ if ($targetuiniqidindex) {
+ return (); # targetuiniqidindex is alredy defined; do nothing
+ }
+
+ # add the targetuniqeid index to the retrocl backend
+
+ my $entry = new Mozilla::LDAP::Entry();
+ $entry->setDN($indexdn);
+ $entry->setValues('objectclass', 'top', 'nsIndex');
+ $entry->setValues('cn', 'targetuniqueid');
+ $entry->setValues('nsSystemIndex', 'false');
+ $entry->setValues('nsIndexType', 'eq');
+ $conn->add($entry);
+
+ # reindex targetuniquueid
+ my $instancedir = $config->getValues('nsslapd-instancedir');
+ my $reindex = $instancedir . "/db2index";
+
+ my $rc = system("$reindex -n changelog -t targetuniqeid");
+
+
+ return @errs;
+}
diff --git a/ldap/ldif/template-dse.ldif.in b/ldap/ldif/template-dse.ldif.in
index 17555a3..38d60e6 100644
--- a/ldap/ldif/template-dse.ldif.in
+++ b/ldap/ldif/template-dse.ldif.in
@@ -965,6 +965,13 @@ cn: uniquemember
nssystemindex: false
nsindextype: eq
+dn: cn=targetuniqueid,cn=default indexes, cn=config,cn=ldbm database,cn=plugins,cn=config
+objectclass: top
+objectclass: nsIndex
+cn: targetuniqueid
+nssystemindex: true
+nsindextype: eq
+
dn: cn=monitor, cn=ldbm database, cn=plugins, cn=config
objectclass: top
objectclass: extensibleObject
9 years, 8 months
Branch '389-ds-base-1.3.2' - ldap/admin
by Ludwig Krispenz
ldap/admin/src/scripts/DSUtil.pm.in | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
New commits:
commit dabb80743473d2cdb12b8065b7ee9c901fb753d5
Author: Ludwig Krispenz <lkrispen(a)redhat.com>
Date: Mon Aug 25 13:04:57 2014 +0200
Ticket 47877 - check_and_add_entry fails for changetype: add and existing entry
Bug Description: If an ldif file in the updates directory contains
changetype: add, the add fails if the entry
already exist
Fix Description: ignore existing entries also in case of
explicite changetype
https://fedorahosted.org/389/ticket/47877
Reviewed by: ?
diff --git a/ldap/admin/src/scripts/DSUtil.pm.in b/ldap/admin/src/scripts/DSUtil.pm.in
index d40d889..818fafa 100644
--- a/ldap/admin/src/scripts/DSUtil.pm.in
+++ b/ldap/admin/src/scripts/DSUtil.pm.in
@@ -406,7 +406,8 @@ sub check_and_add_entry
my $sentry = $conn->search($aentry->{dn}, "base", "(objectclass=*)", 0, ("*", "aci"));
if ($sentry) {
debug(3, "check_and_add_entry: Found entry " . $sentry->getDN() . "\n");
- if (! @ctypes) { # entry exists, and this is not a modify op
+ if ( (! @ctypes) or ("add" eq lc($ctypes[0])) ) { # entry exists, and this is not a modify op
+ # or add is explicitely specified
debug(3, "check_and_add_entry: skipping entry " . $sentry->getDN() . "\n");
return 1; # ignore - return success
}
9 years, 8 months
ldap/servers
by Noriko Hosoi
ldap/servers/slapd/tools/mmldif.c | 16 +++-------------
1 file changed, 3 insertions(+), 13 deletions(-)
New commits:
commit 29684ac505f9d64d396aee34590aa71249709333
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Thu Aug 21 15:10:39 2014 -0700
Ticket #47876 - coverity defects in slapd/tools/mmldif.c
Fix Description:
Defect type: CLANG_WARNING
1. ldap/servers/slapd/tools/mmldif.c:1404:5:warning Value stored to 'att' is never read
Removed unnecessary att initialization.
2. ldap/servers/slapd/tools/mmldif.c:1322:5:warning Value stored to 'rc' is never read
Removed unnecessary rc assignment.
3. ldap/servers/slapd/tools/mmldif.c:1148:25:warning Access to field 'next' results in a dereference of a null pointer (loaded from variable 'a')
false positive.
(cmp < 0) means 'a' is not NULL.
4. ldap/servers/slapd/tools/mmldif.c:522:9:warning Value stored to 'count' is never read
Removed unused count.
5. ldap/servers/slapd/tools/mmldif.c:518:9:warning Value stored to 'pmask' is never read
Removed unused pmask.
6. ldap/servers/slapd/tools/mmldif.c:517:9:warning Value stored to 'pindex' is never read
Removed unused pindex.
7. ldap/servers/slapd/tools/mmldif.c:447:9:warning Value stored to 'pmask' is never read
Removed unused pmask.
8. ldap/servers/slapd/tools/mmldif.c:446:9:warning Value stored to 'pindex' is never read
Removed unused pindex.
https://fedorahosted.org/389/ticket/47876
Reviewed by tbordaz(a)redhat.com (Thank you Thierry!!)
diff --git a/ldap/servers/slapd/tools/mmldif.c b/ldap/servers/slapd/tools/mmldif.c
index 4213e65..bf20945 100644
--- a/ldap/servers/slapd/tools/mmldif.c
+++ b/ldap/servers/slapd/tools/mmldif.c
@@ -333,7 +333,6 @@ int mm_diff(stats_t *statsp)
entry_t * hashentry2;
char fingerprint[16];
int stat;
- int count;
int records = 0;
int added;
struct entryblock *block, *next;
@@ -443,12 +442,9 @@ int mm_diff(stats_t *statsp)
for (i = 0; i < ndirectories; i++) {
rewind(edfin[i].fp);
edfin[i].end = FALSE;
- pindex = i / 32;
- pmask = 1 << (i % 32);
LDAPDebug(LDAP_DEBUG_TRACE,
"loading authoritative data from directory %d\n", i, 0, 0);
- count = 0;
while (TRUE) {
stat = readrec(&edfin[i], &attrib);
if (stat == IDDS_MM_ABSENT) {
@@ -476,7 +472,6 @@ int mm_diff(stats_t *statsp)
}
if (!(hashentry->flags & LOADED))
{
- count++;
hashentry->first = newrecord(attrib);
hashentry->flags |= LOADED;
LDAPDebug(LDAP_DEBUG_TRACE, " ...data loaded\n", 0, 0, 0);
@@ -514,12 +509,9 @@ int mm_diff(stats_t *statsp)
for (i = 0; i < ndirectories; i++) {
rewind(edfin[i].fp);
edfin[i].end = FALSE;
- pindex = i / 32;
- pmask = 1 << (i % 32);
LDAPDebug(LDAP_DEBUG_TRACE,
"generating differences for directory %d\n", i, 0, 0);
- count = 0;
while (TRUE) {
stat = readrec(&edfin[i], &attrib);
if (stat == IDDS_MM_ABSENT) {
@@ -1319,9 +1311,9 @@ putvalue(
b64 = initEnc64((unsigned char *)value, valuelen);
*lptr = ':';
*(lptr+1) = ' ';
- rc = Enc64(b64, (unsigned char *)(lptr+2), 80-(lptr-line), &len);
- *(lptr +len+2) = '\n';
- *(lptr + len +3) = 0;
+ Enc64(b64, (unsigned char *)(lptr+2), 80-(lptr-line), &len);
+ *(lptr+len+2) = '\n';
+ *(lptr+len+3) = 0;
return_code = fputs(line, fh);
if (return_code < 0)
goto return_bit;
@@ -1401,8 +1393,6 @@ mm_getvalue(
return FALSE;
}
- att = &first->data;
-
for (attnum = 1, att = &first->data;
attnum <= first->nattrs;
attnum++, att = attribnext(att)) {
9 years, 8 months
ldap/admin ldap/ldif Makefile.am Makefile.in
by Ludwig Krispenz
Makefile.am | 2
Makefile.in | 2
ldap/admin/src/scripts/50targetuniqueid.ldif | 7 +++
ldap/admin/src/scripts/82targetuniqueidindex.pl | 52 ++++++++++++++++++++++++
ldap/ldif/template-dse.ldif.in | 7 +++
5 files changed, 70 insertions(+)
New commits:
commit 0a69c4dfbe11d988914acf16167c7d91da68d2d0
Author: Ludwig Krispenz <lkrispen(a)redhat.com>
Date: Mon Aug 25 13:19:09 2014 +0200
Ticket 47816 -v2- internal syncrepl searches are flagged as unindexed
Bug Description: if syncrepl is enabled it uses an attribute targetuniqueid
for internal searches. this is not indexed and
lot of warnings are logged
Fix Description: add an equality index to the default indexes
for exising instances tit will add the index
to the changelog backend and trigge a reindex
https://fedorahosted.org/389/ticket/47816
Reviewed by: ?
diff --git a/Makefile.am b/Makefile.am
index cae8ec7..049ff74 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -565,6 +565,7 @@ update_DATA = ldap/admin/src/scripts/exampleupdate.pl \
ldap/admin/src/scripts/50fixNsState.pl \
ldap/admin/src/scripts/50telexnumbersyntaxplugin.ldif \
ldap/admin/src/scripts/50guidesyntaxplugin.ldif \
+ ldap/admin/src/scripts/50targetuniqueid.ldif \
ldap/ldif/50replication-plugins.ldif \
ldap/admin/src/scripts/50linkedattrsplugin.ldif \
$(POSIX_WINSYNC_PLUGIN_LDIF) \
@@ -579,6 +580,7 @@ update_DATA = ldap/admin/src/scripts/exampleupdate.pl \
ldap/admin/src/scripts/70upgradefromldif.pl \
ldap/admin/src/scripts/80upgradednformat.pl \
ldap/admin/src/scripts/81changelog.pl \
+ ldap/admin/src/scripts/82targetuniqueidindex.pl \
ldap/admin/src/scripts/90subtreerename.pl \
ldap/admin/src/scripts/91subtreereindex.pl \
ldap/admin/src/scripts/50updateconfig.ldif \
diff --git a/Makefile.in b/Makefile.in
index 2165d3e..24a9ddf 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1973,6 +1973,7 @@ update_DATA = ldap/admin/src/scripts/exampleupdate.pl \
ldap/admin/src/scripts/50fixNsState.pl \
ldap/admin/src/scripts/50telexnumbersyntaxplugin.ldif \
ldap/admin/src/scripts/50guidesyntaxplugin.ldif \
+ ldap/admin/src/scripts/50targetuniqueid.ldif \
ldap/ldif/50replication-plugins.ldif \
ldap/admin/src/scripts/50linkedattrsplugin.ldif \
$(POSIX_WINSYNC_PLUGIN_LDIF) \
@@ -1987,6 +1988,7 @@ update_DATA = ldap/admin/src/scripts/exampleupdate.pl \
ldap/admin/src/scripts/70upgradefromldif.pl \
ldap/admin/src/scripts/80upgradednformat.pl \
ldap/admin/src/scripts/81changelog.pl \
+ ldap/admin/src/scripts/82targetuniqueidindex.pl \
ldap/admin/src/scripts/90subtreerename.pl \
ldap/admin/src/scripts/91subtreereindex.pl \
ldap/admin/src/scripts/50updateconfig.ldif \
diff --git a/ldap/admin/src/scripts/50targetuniqueid.ldif b/ldap/admin/src/scripts/50targetuniqueid.ldif
new file mode 100644
index 0000000..8f5cbc3
--- /dev/null
+++ b/ldap/admin/src/scripts/50targetuniqueid.ldif
@@ -0,0 +1,7 @@
+dn: cn=targetuniqueid,cn=default indexes,cn=config,cn=ldbm database,cn=plugins,cn=config
+changetype: add
+objectclass: top
+objectclass: nsIndex
+cn: targetuniqueid
+nssystemindex: true
+nsindextype: eq
diff --git a/ldap/admin/src/scripts/82targetuniqueidindex.pl b/ldap/admin/src/scripts/82targetuniqueidindex.pl
new file mode 100644
index 0000000..a0bffe6
--- /dev/null
+++ b/ldap/admin/src/scripts/82targetuniqueidindex.pl
@@ -0,0 +1,52 @@
+use Mozilla::LDAP::Conn;
+use Mozilla::LDAP::Utils qw(normalizeDN);
+use Mozilla::LDAP::API qw(:constant ldap_url_parse ldap_explode_dn);
+use DSUpdate qw(isOffline);
+
+sub runinst {
+ my ($inf, $inst, $dseldif, $conn) = @_;
+
+ my $rc, @errs;
+
+ my $config = $conn->search("cn=config", "base", "(objectclass=*)");
+ if (!$config) {
+ push @errs, ['error_finding_config_entry', 'cn=config',
+ $conn->getErrorString()];
+ return @errs;
+ }
+
+ ($rc, @errs) = isOffline($inf, $inst, $conn);
+ if (!$rc) {
+ return @errs;
+ }
+
+ my $retrocldb = $conn->search("cn=changelog,cn=ldbm database,cn=plugins,cn=config", "base", "(objectclass=*)");
+ if (!$retrocldb) {
+ return (); # retrocl is not enabled; do nothing
+ }
+
+ my $indexdn = "cn=targetuniqueid,cn=index,cn=changelog,cn=ldbm database,cn=plugins,cn=config";
+ my $targetuiniqidindex = $conn->search($indexdn, "base", "(objectclass=*)");
+ if ($targetuiniqidindex) {
+ return (); # targetuiniqidindex is alredy defined; do nothing
+ }
+
+ # add the targetuniqeid index to the retrocl backend
+
+ my $entry = new Mozilla::LDAP::Entry();
+ $entry->setDN($indexdn);
+ $entry->setValues('objectclass', 'top', 'nsIndex');
+ $entry->setValues('cn', 'targetuniqueid');
+ $entry->setValues('nsSystemIndex', 'false');
+ $entry->setValues('nsIndexType', 'eq');
+ $conn->add($entry);
+
+ # reindex targetuniquueid
+ my $instancedir = $config->getValues('nsslapd-instancedir');
+ my $reindex = $instancedir . "/db2index";
+
+ my $rc = system("$reindex -n changelog -t targetuniqeid");
+
+
+ return @errs;
+}
diff --git a/ldap/ldif/template-dse.ldif.in b/ldap/ldif/template-dse.ldif.in
index 9f6a45c..720ebad 100644
--- a/ldap/ldif/template-dse.ldif.in
+++ b/ldap/ldif/template-dse.ldif.in
@@ -974,6 +974,13 @@ cn: nsTombstoneCSN
nssystemindex: true
nsindextype: eq
+dn: cn=targetuniqueid,cn=default indexes, cn=config,cn=ldbm database,cn=plugins,cn=config
+objectclass: top
+objectclass: nsIndex
+cn: targetuniqueid
+nssystemindex: true
+nsindextype: eq
+
dn: cn=monitor, cn=ldbm database, cn=plugins, cn=config
objectclass: top
objectclass: extensibleObject
9 years, 8 months
ldap/admin
by Ludwig Krispenz
ldap/admin/src/scripts/DSUtil.pm.in | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
New commits:
commit 50c05b4be3792af3d3726a130984395b8059a762
Author: Ludwig Krispenz <lkrispen(a)redhat.com>
Date: Mon Aug 25 13:04:57 2014 +0200
Ticket 47877 - check_and_add_entry fails for changetype: add and existing entry
Bug Description: If an ldif file in the updates directory contains
changetype: add, the add fails if the entry
already exist
Fix Description: ignore existing entries also in case of
explicite changetype
https://fedorahosted.org/389/ticket/47877
Reviewed by: ?
diff --git a/ldap/admin/src/scripts/DSUtil.pm.in b/ldap/admin/src/scripts/DSUtil.pm.in
index d40d889..818fafa 100644
--- a/ldap/admin/src/scripts/DSUtil.pm.in
+++ b/ldap/admin/src/scripts/DSUtil.pm.in
@@ -406,7 +406,8 @@ sub check_and_add_entry
my $sentry = $conn->search($aentry->{dn}, "base", "(objectclass=*)", 0, ("*", "aci"));
if ($sentry) {
debug(3, "check_and_add_entry: Found entry " . $sentry->getDN() . "\n");
- if (! @ctypes) { # entry exists, and this is not a modify op
+ if ( (! @ctypes) or ("add" eq lc($ctypes[0])) ) { # entry exists, and this is not a modify op
+ # or add is explicitely specified
debug(3, "check_and_add_entry: skipping entry " . $sentry->getDN() . "\n");
return 1; # ignore - return success
}
9 years, 8 months