Branch '389-ds-base-1.3.4' - 2 commits - dirsrvtests/tickets ldap/servers
by Noriko Hosoi
dirsrvtests/tickets/ticket48252_test.py | 178 +++++++++++++++++++++++++++++++
ldap/servers/slapd/back-ldbm/ldif2ldbm.c | 66 +++++++----
2 files changed, 222 insertions(+), 22 deletions(-)
New commits:
commit 2231ee4673d52e92c6132daec1ee6e19e38f0c88
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Fri Aug 21 17:00:08 2015 -0700
Ticket #48252 - CI test: added test cases for ticket 48252
Description: db2index creates index entry from deleted records
(cherry picked from commit b011ae3aed0a6d24816708d34f3a5ae578c5cd63)
diff --git a/dirsrvtests/tickets/ticket48252_test.py b/dirsrvtests/tickets/ticket48252_test.py
new file mode 100644
index 0000000..5970d70
--- /dev/null
+++ b/dirsrvtests/tickets/ticket48252_test.py
@@ -0,0 +1,178 @@
+# --- BEGIN COPYRIGHT BLOCK ---
+# Copyright (C) 2015 Red Hat, Inc.
+# All rights reserved.
+#
+# License: GPL (version 3 or any later version).
+# See LICENSE for details.
+# --- END COPYRIGHT BLOCK ---
+#
+import os
+import sys
+import time
+import ldap
+import logging
+import pytest
+from lib389 import DirSrv, Entry, tools, tasks
+from lib389.tools import DirSrvTools
+from lib389._constants import *
+from lib389.properties import *
+from lib389.tasks import *
+
+log = logging.getLogger(__name__)
+
+installation_prefix = None
+
+# Assuming DEFAULT_SUFFIX is "dc=example,dc=com", otherwise it does not work... :(
+USER_NUM = 10
+TEST_USER = "test_user"
+
+class TopologyStandalone(object):
+ def __init__(self, standalone):
+ standalone.open()
+ self.standalone = standalone
+
+
+(a)pytest.fixture(scope="module")
+def topology(request):
+ '''
+ This fixture is used to standalone topology for the 'module'.
+ '''
+ global installation_prefix
+
+ if installation_prefix:
+ args_instance[SER_DEPLOYED_DIR] = installation_prefix
+
+ standalone = DirSrv(verbose=False)
+
+ # Args for the standalone instance
+ args_instance[SER_HOST] = HOST_STANDALONE
+ args_instance[SER_PORT] = PORT_STANDALONE
+ args_instance[SER_SERVERID_PROP] = SERVERID_STANDALONE
+ args_standalone = args_instance.copy()
+ standalone.allocate(args_standalone)
+
+ # Get the status of the instance and restart it if it exists
+ instance_standalone = standalone.exists()
+
+ # Remove the instance
+ if instance_standalone:
+ standalone.delete()
+
+ # Create the instance
+ standalone.create()
+
+ # Used to retrieve configuration information (dbdir, confdir...)
+ standalone.open()
+
+ # clear the tmp directory
+ standalone.clearTmpDir(__file__)
+
+ # Here we have standalone instance up and running
+ return TopologyStandalone(standalone)
+
+def test_ticket48252_setup(topology):
+ """
+ Enable USN plug-in for enabling tombstones
+ Add test entries
+ """
+
+ log.info("Enable the USN plugin...")
+ try:
+ topology.standalone.plugins.enable(name=PLUGIN_USN)
+ except e:
+ log.error("Failed to enable USN Plugin: error " + e.message['desc'])
+ assert False
+
+ log.info("Adding test entries...")
+ for id in range(USER_NUM):
+ name = "%s%d" % (TEST_USER, id)
+ topology.standalone.add_s(Entry(("cn=%s,%s" % (name, SUFFIX), {
+ 'objectclass': "top person".split(),
+ 'sn': name,
+ 'cn': name})))
+def in_index_file(topology, id, index):
+ key = "%s%s" % (TEST_USER, id)
+ log.info(" dbscan - checking %s is in index file %s..." % (key, index))
+ dbscanOut = topology.standalone.dbscan(DEFAULT_BENAME, index)
+
+ if key in dbscanOut:
+ found = True
+ topology.standalone.log.info("Found key %s in dbscan output" % key)
+ else:
+ found = False
+ topology.standalone.log.info("Did not found key %s in dbscan output" % key)
+
+ return found
+
+def test_ticket48252_run_0(topology):
+ """
+ Delete an entry cn=test_entry0
+ Check it is not in the 'cn' index file
+ """
+ log.info("Case 1 - Check deleted entry is not in the 'cn' index file")
+ del_rdn = "cn=%s0" % TEST_USER
+ del_entry = "%s,%s" % (del_rdn, SUFFIX)
+ log.info(" Deleting a test entry %s..." % del_entry)
+ topology.standalone.delete_s(del_entry)
+
+ assert in_index_file(topology, 0, 'cn') == False
+
+ log.info(" db2index - reindexing %s ..." % 'cn')
+ assert topology.standalone.db2index(DEFAULT_BENAME, 'cn')
+
+ assert in_index_file(topology, 0, 'cn') == False
+ log.info(" entry %s is not in the cn index file after reindexed." % del_entry)
+ log.info('Case 1 - PASSED')
+
+def test_ticket48252_run_1(topology):
+ """
+ Delete an entry cn=test_entry1
+ Check it is in the 'objectclass' index file as a tombstone entry
+ """
+ log.info("Case 2 - Check deleted entry is in the 'objectclass' index file as a tombstone entry")
+ del_rdn = "cn=%s1" % TEST_USER
+ del_entry = "%s,%s" % (del_rdn, SUFFIX)
+ log.info(" Deleting a test entry %s..." % del_entry)
+ topology.standalone.delete_s(del_entry)
+
+ entry = topology.standalone.search_s(SUFFIX, ldap.SCOPE_SUBTREE, '(&(objectclass=nstombstone)(%s))' % del_rdn)
+ assert len(entry) == 1
+ log.info(" entry %s is in the objectclass index file." % del_entry)
+
+ log.info(" db2index - reindexing %s ..." % 'objectclass')
+ assert topology.standalone.db2index(DEFAULT_BENAME, 'objectclass')
+
+ entry = topology.standalone.search_s(SUFFIX, ldap.SCOPE_SUBTREE, '(&(objectclass=nstombstone)(%s))' % del_rdn)
+ assert len(entry) == 1
+ log.info(" entry %s is in the objectclass index file after reindexed." % del_entry)
+ log.info('Case 2 - PASSED')
+
+def test_ticket48252_final(topology):
+ topology.standalone.delete()
+ log.info('Testing Ticket 48252 - PASSED.')
+
+def run_isolated():
+ '''
+ run_isolated is used to run these test cases independently of a test scheduler (xunit, py.test..)
+ To run isolated without py.test, you need to
+ - edit this file and comment '@pytest.fixture' line before 'topology' function.
+ - set the installation prefix
+ - run this program
+ '''
+ global installation_prefix
+ installation_prefix = None
+
+ topo = topology(True)
+ log.info('Testing Ticket 48252 - db2index creates index entry from deleted records')
+
+ test_ticket48252_setup(topo)
+
+ test_ticket48252_run_0(topo)
+ test_ticket48252_run_1(topo)
+
+ test_ticket48252_final(topo)
+
+
+if __name__ == '__main__':
+ run_isolated()
+
commit 86b96278871d8b08f7c6a75379935c2183f6668f
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Fri Aug 21 12:10:27 2015 -0700
Ticket #48252 - db2index creates index entry from deleted records
Bug Description: When an entry is deleted, its indexed attribute values
are also removed from each index file. But if the entry is turned to be
a tombstone entry, reindexing adds the removed attribute value back to
the index file.
Fix Description: In the reindexing function ldbm_back_ldbm2index, if the
entry is a tombstone entry, it skips reindexing operation unless the target
attribute is entryrdn or objectclass. If it is reindexing the objectclass,
it indexes just for the key "=nstombstone".
https://fedorahosted.org/389/ticket/48252
Reviewed by mreynolds(a)redhat.com (Thank you, Mark!!)
(cherry picked from commit ca4d38dff3bd820af2bf60c9bcc82fd64aac2556)
diff --git a/ldap/servers/slapd/back-ldbm/ldif2ldbm.c b/ldap/servers/slapd/back-ldbm/ldif2ldbm.c
index a1b4a9f..3d07b2e 100644
--- a/ldap/servers/slapd/back-ldbm/ldif2ldbm.c
+++ b/ldap/servers/slapd/back-ldbm/ldif2ldbm.c
@@ -25,9 +25,12 @@
static char *sourcefile = "ldif2ldbm.c";
-#define DB2INDEX_ANCESTORID 0x1 /* index ancestorid */
-#define DB2INDEX_ENTRYRDN 0x2 /* index entryrdn */
-#define DB2LDIF_ENTRYRDN 0x4 /* export entryrdn */
+#define DB2INDEX_ANCESTORID 0x1 /* index ancestorid */
+#define DB2INDEX_ENTRYRDN 0x2 /* index entryrdn */
+#define DB2LDIF_ENTRYRDN 0x4 /* export entryrdn */
+#define DB2INDEX_OBJECTCLASS 0x10 /* for reindexing "objectclass: nstombstone" */
+
+#define LDIF2LDBM_EXTBITS(x) ((x) & 0xf)
typedef struct _export_args {
struct backentry *ep;
@@ -1675,6 +1678,7 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb)
struct vlvIndex *vlvip = NULL;
back_txn txn;
ID suffixid = NOID; /* holds the id of the suffix entry */
+ Slapi_Value **nstombstone_vals = NULL;
LDAPDebug( LDAP_DEBUG_TRACE, "=> ldbm_back_ldbm2index\n", 0, 0, 0 );
if ( g_get_shutdown() || c_get_shutdown() ) {
@@ -1795,7 +1799,7 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb)
if (strcasecmp(attrs[i]+1, LDBM_ANCESTORID_STR) == 0) {
if (task) {
slapi_task_log_notice(task, "%s: Indexing %s",
- inst->inst_name, LDBM_ENTRYRDN_STR);
+ inst->inst_name, LDBM_ANCESTORID_STR);
}
LDAPDebug2Args(LDAP_DEBUG_ANY, "%s: Indexing %s\n",
inst->inst_name, LDBM_ANCESTORID_STR);
@@ -1848,6 +1852,9 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb)
inst->inst_name, attrs[i] + 1);
}
} else {
+ if (strcasecmp(attrs[i]+1, SLAPI_ATTR_OBJECTCLASS) == 0) {
+ index_ext |= DB2INDEX_OBJECTCLASS;
+ }
charray_add(&indexAttrs, attrs[i]+1);
ai->ai_indexmask |= INDEX_OFFLINE;
if (task) {
@@ -1893,7 +1900,7 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb)
* idl composed from the ancestorid list, instead of traversing the
* entire database.
*/
- if (!indexAttrs && !index_ext && pvlv) {
+ if (!indexAttrs && !LDIF2LDBM_EXTBITS(index_ext) && pvlv) {
int err;
char **suffix_list = NULL;
@@ -2152,11 +2159,13 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb)
/*
* If this entry is a tombstone, update the 'nstombstonecsn' index
*/
- if(ep->ep_entry->e_flags & SLAPI_ENTRY_FLAG_TOMBSTONE){
- const CSN *tombstone_csn = NULL;
+ if (ep->ep_entry->e_flags & SLAPI_ENTRY_FLAG_TOMBSTONE) {
+ const CSN *tombstone_csn = entry_get_deletion_csn(ep->ep_entry);
char deletion_csn_str[CSN_STRSIZE];
- if((tombstone_csn = entry_get_deletion_csn(ep->ep_entry))){
+ nstombstone_vals = (Slapi_Value **) slapi_ch_calloc(2, sizeof(Slapi_Value *));
+ *nstombstone_vals = slapi_value_new_string(SLAPI_ATTR_VALUE_TOMBSTONE);
+ if (tombstone_csn) {
if (!run_from_cmdline) {
rc = dblayer_txn_begin(be, NULL, &txn);
if (0 != rc) {
@@ -2215,18 +2224,31 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb)
/*
* Update the attribute indexes
*/
- if (indexAttrs != NULL) {
+ if (indexAttrs) {
+ if (nstombstone_vals && !(index_ext & (DB2INDEX_ENTRYRDN|DB2INDEX_OBJECTCLASS))) {
+ /* if it is a tombstone entry, just entryrdn or "objectclass: nstombstone"
+ * need to be reindexed. the to-be-indexed list does not contain them. */
+ continue;
+ }
for (i = slapi_entry_first_attr(ep->ep_entry, &attr); i == 0;
i = slapi_entry_next_attr(ep->ep_entry, attr, &attr)) {
Slapi_Value **svals;
slapi_attr_get_type( attr, &type );
for ( j = 0; indexAttrs[j] != NULL; j++ ) {
+ int is_tombstone_obj = 0;
if ( g_get_shutdown() || c_get_shutdown() ) {
goto err_out;
}
- if (slapi_attr_type_cmp(indexAttrs[j], type,
- SLAPI_TYPE_CMP_SUBTYPE) == 0 ) {
+ if (slapi_attr_type_cmp(indexAttrs[j], type, SLAPI_TYPE_CMP_SUBTYPE) == 0) {
+ if (nstombstone_vals) {
+ if (!slapi_attr_type_cmp(indexAttrs[j], SLAPI_ATTR_OBJECTCLASS, SLAPI_TYPE_CMP_SUBTYPE)) {
+ is_tombstone_obj = 1; /* is tombstone && is objectclass. need to index "nstombstone"*/
+ } else if (slapi_attr_type_cmp(indexAttrs[j], LDBM_ENTRYRDN_STR, SLAPI_TYPE_CMP_SUBTYPE)) {
+ /* Entry is a tombstone && this index is not an entryrdn. */
+ continue;
+ }
+ }
svals = attr_get_present_values(attr);
if (!run_from_cmdline) {
@@ -2250,10 +2272,12 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb)
goto err_out;
}
}
- rc = index_addordel_values_sv(
- be, indexAttrs[j], svals,
- NULL, ep->ep_id, BE_INDEX_ADD, &txn);
- if (rc != 0) {
+ if (is_tombstone_obj) {
+ rc = index_addordel_values_sv(be, indexAttrs[j], nstombstone_vals, NULL, ep->ep_id, BE_INDEX_ADD, &txn);
+ } else {
+ rc = index_addordel_values_sv(be, indexAttrs[j], svals, NULL, ep->ep_id, BE_INDEX_ADD, &txn);
+ }
+ if (rc) {
LDAPDebug(LDAP_DEBUG_ANY,
"%s: ERROR: failed to update index '%s'\n",
inst->inst_name, indexAttrs[j], 0);
@@ -2299,18 +2323,16 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb)
}
/*
- * Update the Virtual List View indexes
+ * If it is NOT a tombstone entry, update the Virtual List View indexes.
*/
- for ( vlvidx = 0; vlvidx < numvlv; vlvidx++ ) {
+ for (vlvidx = 0; !nstombstone_vals && (vlvidx < numvlv); vlvidx++) {
char *ai = "Unknown index";
if ( g_get_shutdown() || c_get_shutdown() ) {
goto err_out;
}
- if(indexAttrs){
- if(indexAttrs[vlvidx]){
- ai = indexAttrs[vlvidx];
- }
+ if (indexAttrs && indexAttrs[vlvidx]) {
+ ai = indexAttrs[vlvidx];
}
if (!run_from_cmdline) {
rc = dblayer_txn_begin(be, NULL, &txn);
@@ -2364,7 +2386,7 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb)
/*
* Update the ancestorid and entryrdn index
*/
- if (!entryrdn_get_noancestorid() && index_ext & DB2INDEX_ANCESTORID) {
+ if (!entryrdn_get_noancestorid() && (index_ext & DB2INDEX_ANCESTORID)) {
rc = ldbm_ancestorid_index_entry(be, ep, BE_INDEX_ADD, NULL);
if (rc != 0) {
LDAPDebug(LDAP_DEBUG_ANY,
--
389 commits mailing list
389-commits@%(host_name)s
http://lists.fedoraproject.org/postorius/389-commits@lists.fedoraproject.org
8 years, 7 months
2 commits - dirsrvtests/tickets ldap/servers
by Noriko Hosoi
dirsrvtests/tickets/ticket48252_test.py | 178 +++++++++++++++++++++++++++++++
ldap/servers/slapd/back-ldbm/ldif2ldbm.c | 66 +++++++----
2 files changed, 222 insertions(+), 22 deletions(-)
New commits:
commit b011ae3aed0a6d24816708d34f3a5ae578c5cd63
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Fri Aug 21 17:00:08 2015 -0700
Ticket #48252 - CI test: added test cases for ticket 48252
Description: db2index creates index entry from deleted records
diff --git a/dirsrvtests/tickets/ticket48252_test.py b/dirsrvtests/tickets/ticket48252_test.py
new file mode 100644
index 0000000..5970d70
--- /dev/null
+++ b/dirsrvtests/tickets/ticket48252_test.py
@@ -0,0 +1,178 @@
+# --- BEGIN COPYRIGHT BLOCK ---
+# Copyright (C) 2015 Red Hat, Inc.
+# All rights reserved.
+#
+# License: GPL (version 3 or any later version).
+# See LICENSE for details.
+# --- END COPYRIGHT BLOCK ---
+#
+import os
+import sys
+import time
+import ldap
+import logging
+import pytest
+from lib389 import DirSrv, Entry, tools, tasks
+from lib389.tools import DirSrvTools
+from lib389._constants import *
+from lib389.properties import *
+from lib389.tasks import *
+
+log = logging.getLogger(__name__)
+
+installation_prefix = None
+
+# Assuming DEFAULT_SUFFIX is "dc=example,dc=com", otherwise it does not work... :(
+USER_NUM = 10
+TEST_USER = "test_user"
+
+class TopologyStandalone(object):
+ def __init__(self, standalone):
+ standalone.open()
+ self.standalone = standalone
+
+
+(a)pytest.fixture(scope="module")
+def topology(request):
+ '''
+ This fixture is used to standalone topology for the 'module'.
+ '''
+ global installation_prefix
+
+ if installation_prefix:
+ args_instance[SER_DEPLOYED_DIR] = installation_prefix
+
+ standalone = DirSrv(verbose=False)
+
+ # Args for the standalone instance
+ args_instance[SER_HOST] = HOST_STANDALONE
+ args_instance[SER_PORT] = PORT_STANDALONE
+ args_instance[SER_SERVERID_PROP] = SERVERID_STANDALONE
+ args_standalone = args_instance.copy()
+ standalone.allocate(args_standalone)
+
+ # Get the status of the instance and restart it if it exists
+ instance_standalone = standalone.exists()
+
+ # Remove the instance
+ if instance_standalone:
+ standalone.delete()
+
+ # Create the instance
+ standalone.create()
+
+ # Used to retrieve configuration information (dbdir, confdir...)
+ standalone.open()
+
+ # clear the tmp directory
+ standalone.clearTmpDir(__file__)
+
+ # Here we have standalone instance up and running
+ return TopologyStandalone(standalone)
+
+def test_ticket48252_setup(topology):
+ """
+ Enable USN plug-in for enabling tombstones
+ Add test entries
+ """
+
+ log.info("Enable the USN plugin...")
+ try:
+ topology.standalone.plugins.enable(name=PLUGIN_USN)
+ except e:
+ log.error("Failed to enable USN Plugin: error " + e.message['desc'])
+ assert False
+
+ log.info("Adding test entries...")
+ for id in range(USER_NUM):
+ name = "%s%d" % (TEST_USER, id)
+ topology.standalone.add_s(Entry(("cn=%s,%s" % (name, SUFFIX), {
+ 'objectclass': "top person".split(),
+ 'sn': name,
+ 'cn': name})))
+def in_index_file(topology, id, index):
+ key = "%s%s" % (TEST_USER, id)
+ log.info(" dbscan - checking %s is in index file %s..." % (key, index))
+ dbscanOut = topology.standalone.dbscan(DEFAULT_BENAME, index)
+
+ if key in dbscanOut:
+ found = True
+ topology.standalone.log.info("Found key %s in dbscan output" % key)
+ else:
+ found = False
+ topology.standalone.log.info("Did not found key %s in dbscan output" % key)
+
+ return found
+
+def test_ticket48252_run_0(topology):
+ """
+ Delete an entry cn=test_entry0
+ Check it is not in the 'cn' index file
+ """
+ log.info("Case 1 - Check deleted entry is not in the 'cn' index file")
+ del_rdn = "cn=%s0" % TEST_USER
+ del_entry = "%s,%s" % (del_rdn, SUFFIX)
+ log.info(" Deleting a test entry %s..." % del_entry)
+ topology.standalone.delete_s(del_entry)
+
+ assert in_index_file(topology, 0, 'cn') == False
+
+ log.info(" db2index - reindexing %s ..." % 'cn')
+ assert topology.standalone.db2index(DEFAULT_BENAME, 'cn')
+
+ assert in_index_file(topology, 0, 'cn') == False
+ log.info(" entry %s is not in the cn index file after reindexed." % del_entry)
+ log.info('Case 1 - PASSED')
+
+def test_ticket48252_run_1(topology):
+ """
+ Delete an entry cn=test_entry1
+ Check it is in the 'objectclass' index file as a tombstone entry
+ """
+ log.info("Case 2 - Check deleted entry is in the 'objectclass' index file as a tombstone entry")
+ del_rdn = "cn=%s1" % TEST_USER
+ del_entry = "%s,%s" % (del_rdn, SUFFIX)
+ log.info(" Deleting a test entry %s..." % del_entry)
+ topology.standalone.delete_s(del_entry)
+
+ entry = topology.standalone.search_s(SUFFIX, ldap.SCOPE_SUBTREE, '(&(objectclass=nstombstone)(%s))' % del_rdn)
+ assert len(entry) == 1
+ log.info(" entry %s is in the objectclass index file." % del_entry)
+
+ log.info(" db2index - reindexing %s ..." % 'objectclass')
+ assert topology.standalone.db2index(DEFAULT_BENAME, 'objectclass')
+
+ entry = topology.standalone.search_s(SUFFIX, ldap.SCOPE_SUBTREE, '(&(objectclass=nstombstone)(%s))' % del_rdn)
+ assert len(entry) == 1
+ log.info(" entry %s is in the objectclass index file after reindexed." % del_entry)
+ log.info('Case 2 - PASSED')
+
+def test_ticket48252_final(topology):
+ topology.standalone.delete()
+ log.info('Testing Ticket 48252 - PASSED.')
+
+def run_isolated():
+ '''
+ run_isolated is used to run these test cases independently of a test scheduler (xunit, py.test..)
+ To run isolated without py.test, you need to
+ - edit this file and comment '@pytest.fixture' line before 'topology' function.
+ - set the installation prefix
+ - run this program
+ '''
+ global installation_prefix
+ installation_prefix = None
+
+ topo = topology(True)
+ log.info('Testing Ticket 48252 - db2index creates index entry from deleted records')
+
+ test_ticket48252_setup(topo)
+
+ test_ticket48252_run_0(topo)
+ test_ticket48252_run_1(topo)
+
+ test_ticket48252_final(topo)
+
+
+if __name__ == '__main__':
+ run_isolated()
+
commit ca4d38dff3bd820af2bf60c9bcc82fd64aac2556
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Fri Aug 21 12:10:27 2015 -0700
Ticket #48252 - db2index creates index entry from deleted records
Bug Description: When an entry is deleted, its indexed attribute values
are also removed from each index file. But if the entry is turned to be
a tombstone entry, reindexing adds the removed attribute value back to
the index file.
Fix Description: In the reindexing function ldbm_back_ldbm2index, if the
entry is a tombstone entry, it skips reindexing operation unless the target
attribute is entryrdn or objectclass. If it is reindexing the objectclass,
it indexes just for the key "=nstombstone".
https://fedorahosted.org/389/ticket/48252
Reviewed by mreynolds(a)redhat.com (Thank you, Mark!!)
diff --git a/ldap/servers/slapd/back-ldbm/ldif2ldbm.c b/ldap/servers/slapd/back-ldbm/ldif2ldbm.c
index a1b4a9f..3d07b2e 100644
--- a/ldap/servers/slapd/back-ldbm/ldif2ldbm.c
+++ b/ldap/servers/slapd/back-ldbm/ldif2ldbm.c
@@ -25,9 +25,12 @@
static char *sourcefile = "ldif2ldbm.c";
-#define DB2INDEX_ANCESTORID 0x1 /* index ancestorid */
-#define DB2INDEX_ENTRYRDN 0x2 /* index entryrdn */
-#define DB2LDIF_ENTRYRDN 0x4 /* export entryrdn */
+#define DB2INDEX_ANCESTORID 0x1 /* index ancestorid */
+#define DB2INDEX_ENTRYRDN 0x2 /* index entryrdn */
+#define DB2LDIF_ENTRYRDN 0x4 /* export entryrdn */
+#define DB2INDEX_OBJECTCLASS 0x10 /* for reindexing "objectclass: nstombstone" */
+
+#define LDIF2LDBM_EXTBITS(x) ((x) & 0xf)
typedef struct _export_args {
struct backentry *ep;
@@ -1675,6 +1678,7 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb)
struct vlvIndex *vlvip = NULL;
back_txn txn;
ID suffixid = NOID; /* holds the id of the suffix entry */
+ Slapi_Value **nstombstone_vals = NULL;
LDAPDebug( LDAP_DEBUG_TRACE, "=> ldbm_back_ldbm2index\n", 0, 0, 0 );
if ( g_get_shutdown() || c_get_shutdown() ) {
@@ -1795,7 +1799,7 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb)
if (strcasecmp(attrs[i]+1, LDBM_ANCESTORID_STR) == 0) {
if (task) {
slapi_task_log_notice(task, "%s: Indexing %s",
- inst->inst_name, LDBM_ENTRYRDN_STR);
+ inst->inst_name, LDBM_ANCESTORID_STR);
}
LDAPDebug2Args(LDAP_DEBUG_ANY, "%s: Indexing %s\n",
inst->inst_name, LDBM_ANCESTORID_STR);
@@ -1848,6 +1852,9 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb)
inst->inst_name, attrs[i] + 1);
}
} else {
+ if (strcasecmp(attrs[i]+1, SLAPI_ATTR_OBJECTCLASS) == 0) {
+ index_ext |= DB2INDEX_OBJECTCLASS;
+ }
charray_add(&indexAttrs, attrs[i]+1);
ai->ai_indexmask |= INDEX_OFFLINE;
if (task) {
@@ -1893,7 +1900,7 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb)
* idl composed from the ancestorid list, instead of traversing the
* entire database.
*/
- if (!indexAttrs && !index_ext && pvlv) {
+ if (!indexAttrs && !LDIF2LDBM_EXTBITS(index_ext) && pvlv) {
int err;
char **suffix_list = NULL;
@@ -2152,11 +2159,13 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb)
/*
* If this entry is a tombstone, update the 'nstombstonecsn' index
*/
- if(ep->ep_entry->e_flags & SLAPI_ENTRY_FLAG_TOMBSTONE){
- const CSN *tombstone_csn = NULL;
+ if (ep->ep_entry->e_flags & SLAPI_ENTRY_FLAG_TOMBSTONE) {
+ const CSN *tombstone_csn = entry_get_deletion_csn(ep->ep_entry);
char deletion_csn_str[CSN_STRSIZE];
- if((tombstone_csn = entry_get_deletion_csn(ep->ep_entry))){
+ nstombstone_vals = (Slapi_Value **) slapi_ch_calloc(2, sizeof(Slapi_Value *));
+ *nstombstone_vals = slapi_value_new_string(SLAPI_ATTR_VALUE_TOMBSTONE);
+ if (tombstone_csn) {
if (!run_from_cmdline) {
rc = dblayer_txn_begin(be, NULL, &txn);
if (0 != rc) {
@@ -2215,18 +2224,31 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb)
/*
* Update the attribute indexes
*/
- if (indexAttrs != NULL) {
+ if (indexAttrs) {
+ if (nstombstone_vals && !(index_ext & (DB2INDEX_ENTRYRDN|DB2INDEX_OBJECTCLASS))) {
+ /* if it is a tombstone entry, just entryrdn or "objectclass: nstombstone"
+ * need to be reindexed. the to-be-indexed list does not contain them. */
+ continue;
+ }
for (i = slapi_entry_first_attr(ep->ep_entry, &attr); i == 0;
i = slapi_entry_next_attr(ep->ep_entry, attr, &attr)) {
Slapi_Value **svals;
slapi_attr_get_type( attr, &type );
for ( j = 0; indexAttrs[j] != NULL; j++ ) {
+ int is_tombstone_obj = 0;
if ( g_get_shutdown() || c_get_shutdown() ) {
goto err_out;
}
- if (slapi_attr_type_cmp(indexAttrs[j], type,
- SLAPI_TYPE_CMP_SUBTYPE) == 0 ) {
+ if (slapi_attr_type_cmp(indexAttrs[j], type, SLAPI_TYPE_CMP_SUBTYPE) == 0) {
+ if (nstombstone_vals) {
+ if (!slapi_attr_type_cmp(indexAttrs[j], SLAPI_ATTR_OBJECTCLASS, SLAPI_TYPE_CMP_SUBTYPE)) {
+ is_tombstone_obj = 1; /* is tombstone && is objectclass. need to index "nstombstone"*/
+ } else if (slapi_attr_type_cmp(indexAttrs[j], LDBM_ENTRYRDN_STR, SLAPI_TYPE_CMP_SUBTYPE)) {
+ /* Entry is a tombstone && this index is not an entryrdn. */
+ continue;
+ }
+ }
svals = attr_get_present_values(attr);
if (!run_from_cmdline) {
@@ -2250,10 +2272,12 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb)
goto err_out;
}
}
- rc = index_addordel_values_sv(
- be, indexAttrs[j], svals,
- NULL, ep->ep_id, BE_INDEX_ADD, &txn);
- if (rc != 0) {
+ if (is_tombstone_obj) {
+ rc = index_addordel_values_sv(be, indexAttrs[j], nstombstone_vals, NULL, ep->ep_id, BE_INDEX_ADD, &txn);
+ } else {
+ rc = index_addordel_values_sv(be, indexAttrs[j], svals, NULL, ep->ep_id, BE_INDEX_ADD, &txn);
+ }
+ if (rc) {
LDAPDebug(LDAP_DEBUG_ANY,
"%s: ERROR: failed to update index '%s'\n",
inst->inst_name, indexAttrs[j], 0);
@@ -2299,18 +2323,16 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb)
}
/*
- * Update the Virtual List View indexes
+ * If it is NOT a tombstone entry, update the Virtual List View indexes.
*/
- for ( vlvidx = 0; vlvidx < numvlv; vlvidx++ ) {
+ for (vlvidx = 0; !nstombstone_vals && (vlvidx < numvlv); vlvidx++) {
char *ai = "Unknown index";
if ( g_get_shutdown() || c_get_shutdown() ) {
goto err_out;
}
- if(indexAttrs){
- if(indexAttrs[vlvidx]){
- ai = indexAttrs[vlvidx];
- }
+ if (indexAttrs && indexAttrs[vlvidx]) {
+ ai = indexAttrs[vlvidx];
}
if (!run_from_cmdline) {
rc = dblayer_txn_begin(be, NULL, &txn);
@@ -2364,7 +2386,7 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb)
/*
* Update the ancestorid and entryrdn index
*/
- if (!entryrdn_get_noancestorid() && index_ext & DB2INDEX_ANCESTORID) {
+ if (!entryrdn_get_noancestorid() && (index_ext & DB2INDEX_ANCESTORID)) {
rc = ldbm_ancestorid_index_entry(be, ep, BE_INDEX_ADD, NULL);
if (rc != 0) {
LDAPDebug(LDAP_DEBUG_ANY,
--
389 commits mailing list
389-commits@%(host_name)s
http://lists.fedoraproject.org/postorius/389-commits@lists.fedoraproject.org
8 years, 7 months
Branch '389-ds-base-1.3.4' - ldap/servers
by Noriko Hosoi
ldap/servers/plugins/deref/deref.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
New commits:
commit 626f2d7060390a3234ebb50b92937d1ec5a89481
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Mon Aug 24 16:13:12 2015 -0700
Ticket #47757 - Unable to dereference unqiemember attribute because it is dn [#UID] not dn syntax
Description: In addtion to DN syntax, adding Name and Optional UID
syntax to the deref attr's OID check.
https://fedorahosted.org/389/ticket/47757
Reviewed by mreynolds(a)redhat.com (Thank you, Mark!!)
(cherry picked from commit 2dbbb9df4691590f788049a822c47eb501182c85)
diff --git a/ldap/servers/plugins/deref/deref.c b/ldap/servers/plugins/deref/deref.c
index 35c2564..f476a4d 100644
--- a/ldap/servers/plugins/deref/deref.c
+++ b/ldap/servers/plugins/deref/deref.c
@@ -20,6 +20,9 @@
#ifndef DN_SYNTAX_OID
#define DN_SYNTAX_OID "1.3.6.1.4.1.1466.115.121.1.12"
#endif
+#ifndef NAME_AND_OPTIONAL_UID_SYNTAX_OID
+#define NAME_AND_OPTIONAL_UID_SYNTAX_OID "1.3.6.1.4.1.1466.115.121.1.34"
+#endif
/*
* Plug-in globals
@@ -290,7 +293,7 @@ deref_check_for_dn_syntax(const char *derefattr)
slapi_attr_init(attr, derefattr);
slapi_attr_get_syntax_oid_copy(attr, &oid);
- ret = oid && !strcmp(oid, DN_SYNTAX_OID);
+ ret = oid && (!strcmp(oid, DN_SYNTAX_OID) || !strcmp(oid, NAME_AND_OPTIONAL_UID_SYNTAX_OID));
slapi_ch_free_string(&oid);
slapi_attr_free(&attr);
}
--
389 commits mailing list
389-commits@%(host_name)s
http://lists.fedoraproject.org/postorius/389-commits@lists.fedoraproject.org
8 years, 7 months
ldap/servers
by Noriko Hosoi
ldap/servers/plugins/deref/deref.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
New commits:
commit 2dbbb9df4691590f788049a822c47eb501182c85
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Mon Aug 24 16:13:12 2015 -0700
Ticket #47757 - Unable to dereference unqiemember attribute because it is dn [#UID] not dn syntax
Description: In addtion to DN syntax, adding Name and Optional UID
syntax to the deref attr's OID check.
https://fedorahosted.org/389/ticket/47757
Reviewed by mreynolds(a)redhat.com (Thank you, Mark!!)
diff --git a/ldap/servers/plugins/deref/deref.c b/ldap/servers/plugins/deref/deref.c
index 35c2564..f476a4d 100644
--- a/ldap/servers/plugins/deref/deref.c
+++ b/ldap/servers/plugins/deref/deref.c
@@ -20,6 +20,9 @@
#ifndef DN_SYNTAX_OID
#define DN_SYNTAX_OID "1.3.6.1.4.1.1466.115.121.1.12"
#endif
+#ifndef NAME_AND_OPTIONAL_UID_SYNTAX_OID
+#define NAME_AND_OPTIONAL_UID_SYNTAX_OID "1.3.6.1.4.1.1466.115.121.1.34"
+#endif
/*
* Plug-in globals
@@ -290,7 +293,7 @@ deref_check_for_dn_syntax(const char *derefattr)
slapi_attr_init(attr, derefattr);
slapi_attr_get_syntax_oid_copy(attr, &oid);
- ret = oid && !strcmp(oid, DN_SYNTAX_OID);
+ ret = oid && (!strcmp(oid, DN_SYNTAX_OID) || !strcmp(oid, NAME_AND_OPTIONAL_UID_SYNTAX_OID));
slapi_ch_free_string(&oid);
slapi_attr_free(&attr);
}
--
389 commits mailing list
389-commits@%(host_name)s
http://lists.fedoraproject.org/postorius/389-commits@lists.fedoraproject.org
8 years, 7 months
Branch '389-ds-base-1.3.4' - ldap/admin
by Noriko Hosoi
ldap/admin/src/scripts/bak2db.in | 10 +++++-----
ldap/admin/src/scripts/db2bak.in | 8 ++++----
ldap/admin/src/scripts/db2index.in | 10 +++++-----
ldap/admin/src/scripts/db2ldif.in | 14 +++++++-------
ldap/admin/src/scripts/dbverify.in | 10 +++++-----
ldap/admin/src/scripts/dn2rdn.in | 8 ++++----
ldap/admin/src/scripts/ldif2db.in | 22 +++++++++++-----------
ldap/admin/src/scripts/monitor.in | 8 ++++----
ldap/admin/src/scripts/suffix2instance.in | 4 ++--
ldap/admin/src/scripts/upgradedb.in | 8 ++++----
ldap/admin/src/scripts/upgradednformat.in | 10 +++++-----
ldap/admin/src/scripts/vlvindex.in | 16 ++++++++--------
12 files changed, 64 insertions(+), 64 deletions(-)
New commits:
commit 19b0d4af54e319e3479b16bf1366568271e3daa6
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Tue Aug 25 11:48:31 2015 -0700
Ticket #48254 - Shell CLI fails with usage errors if an argument containing white spaces is given
Description: In addition to the patch:
Ticket #48254 - CLI db2index fails with usage errors
commit 3507c46c9f1156df11b6cf05eba695d81088b416
applying the similar changes to all the shell CLI which could be given
arguments that include white spaces.
https://fedorahosted.org/389/ticket/48254
Reviewed by mreynolds(a)redhat.com (Thank you, Mark!!)
(cherry picked from commit 5fe28921810a53dcd31525ba1f675582b6aba0f7)
diff --git a/ldap/admin/src/scripts/bak2db.in b/ldap/admin/src/scripts/bak2db.in
index a2e54cc..ab7c6b3 100755
--- a/ldap/admin/src/scripts/bak2db.in
+++ b/ldap/admin/src/scripts/bak2db.in
@@ -44,12 +44,12 @@ do
h) usage
exit 0;;
Z) servid=$OPTARG;;
- n) args=$args" -n $OPTARG";;
+ n) args=$args" -n \"$OPTARG\"";;
q) args=$args" -q";;
- d) args=$args" -d $OPTARG";;
+ d) args=$args" -d \"$OPTARG\"";;
v) args=$args" -v";;
- D) args=$args" -D $OPTARG";;
- i) args=$args" -i $OPTARG";;
+ D) args=$args" -D \"$OPTARG\"";;
+ i) args=$args" -i \"$OPTARG\"";;
a) archivedir=$OPTARG;;
S) args=$args" -S";;
?) usage
@@ -76,4 +76,4 @@ else
archivedir=`pwd`/$archivedir
fi
-@sbindir@/ns-slapd archive2db -D $CONFIG_DIR -a $archivedir $args
+eval @sbindir@/ns-slapd archive2db -D $CONFIG_DIR -a $archivedir $args
diff --git a/ldap/admin/src/scripts/db2bak.in b/ldap/admin/src/scripts/db2bak.in
index 1896c19..adbe30b 100755
--- a/ldap/admin/src/scripts/db2bak.in
+++ b/ldap/admin/src/scripts/db2bak.in
@@ -43,10 +43,10 @@ do
q) args=$args" -q";;
v) args=$args" -v";;
S) args=$args" -S";;
- D) args=$args" -D $OPTARG";;
- i) args=$args" -i $OPTARG";;
+ D) args=$args" -D \"$OPTARG\"";;
+ i) args=$args" -i \"$OPTARG\"";;
a) $bakdir=$OPTARG;;
- d) args=$args" -d $OPTARG";;
+ d) args=$args" -d \"$OPTARG\"";;
Z) servid=$OPTARG;;
?) usage
exit 1;;
@@ -72,4 +72,4 @@ then
fi
echo "Back up directory: $bak_dir"
-@sbindir@/ns-slapd db2archive -D $CONFIG_DIR -a $bak_dir $args
+eval @sbindir@/ns-slapd db2archive -D $CONFIG_DIR -a $bak_dir $args
diff --git a/ldap/admin/src/scripts/db2index.in b/ldap/admin/src/scripts/db2index.in
index 6a0785e..c8e9075 100755
--- a/ldap/admin/src/scripts/db2index.in
+++ b/ldap/admin/src/scripts/db2index.in
@@ -35,15 +35,15 @@ do
h) usage
exit 0;;
Z) servid=$OPTARG;;
- n) args=$args" -n $OPTARG"
+ n) args=$args" -n \"$OPTARG\""
benameopt="set";;
- s) args=$args" -s $OPTARG"
+ s) args=$args" -s \"$OPTARG\""
includeSuffix="set";;
t) args=$args" -t "\"$OPTARG\";;
T) args=$args" -T "\"$OPTARG\";;
- d) args=$args" -d $OPTARG";;
- a) args=$args" -a $OPTARG";;
- x) args=$args" -x $OPTARG";;
+ d) args=$args" -d \"$OPTARG\"";;
+ a) args=$args" -a \"$OPTARG\"";;
+ x) args=$args" -x \"$OPTARG\"";;
v) args=$args" -v";;
S) args=$args" -S";;
D) args=$args" -D $OPTARG";;
diff --git a/ldap/admin/src/scripts/db2ldif.in b/ldap/admin/src/scripts/db2ldif.in
index fcf73a0..e9f7f7e 100755
--- a/ldap/admin/src/scripts/db2ldif.in
+++ b/ldap/admin/src/scripts/db2ldif.in
@@ -106,12 +106,12 @@ do
Z) servid=$OPTARG;;
n) benameopt="-n $OPTARG"
required_param="yes";;
- s) includeSuffix="-s $OPTARG"
+ s) includeSuffix="-s \"$OPTARG\""
required_param="yes";;
- x) excludeSuffix="-x $OPTARG";;
- a) outputFile="-a $OPTARG";;
- d) args=$args" -d $OPTARG";;
- D) args=$args" -D $OPTARG";;
+ x) excludeSuffix="-x \"$OPTARG\"";;
+ a) outputFile="-a \"$OPTARG\"";;
+ d) args=$args" -d \"$OPTARG\"";;
+ D) args=$args" -D \"$OPTARG\"";;
N) args=$args" -N";;
E) args=$args" -E";;
S) args=$args" -S";;
@@ -154,7 +154,7 @@ rn=$?
echo "Exported ldif file: $ldif_file"
if [ $rn -eq 1 ]
then
- @sbindir@/ns-slapd db2ldif -D $CONFIG_DIR $benameopt $includeSuffix $excludeSuffix $outputFile $args
+ eval @sbindir@/ns-slapd db2ldif -D $CONFIG_DIR $benameopt $includeSuffix $excludeSuffix $outputFile $args
else
- @sbindir@/ns-slapd db2ldif -D $CONFIG_DIR $benameopt $includeSuffix $excludeSuffix $args -a $ldif_file
+ eval @sbindir@/ns-slapd db2ldif -D $CONFIG_DIR $benameopt $includeSuffix $excludeSuffix $args -a $ldif_file
fi
diff --git a/ldap/admin/src/scripts/dbverify.in b/ldap/admin/src/scripts/dbverify.in
index bbacc17..b98e9b2 100755
--- a/ldap/admin/src/scripts/dbverify.in
+++ b/ldap/admin/src/scripts/dbverify.in
@@ -33,14 +33,14 @@ do
h) usage
exit 0;;
Z) servid=$OPTARG;;
- n) args=$args" -n $OPTARG";;
- d) args=$args" -d $OPTARG";;
+ n) args=$args" -n \"$OPTARG\"";;
+ d) args=$args" -d \"$OPTARG\"";;
V) args=$args" -V";;
v) args=$args" -v"
display_version="yes";;
f) args=$args" -f";;
- D) args=$args" -D $OPTARG";;
- a) args=$args" -a $OPTARG";;
+ D) args=$args" -D \"$OPTARG\"";;
+ a) args=$args" -a \"$OPTARG\"";;
?) usage
exit 1;;
esac
@@ -57,7 +57,7 @@ fi
. $initfile
-@sbindir@/ns-slapd dbverify -D $CONFIG_DIR $args
+eval @sbindir@/ns-slapd dbverify -D $CONFIG_DIR $args
if [ $display_version = "yes" ]; then
exit 0
fi
diff --git a/ldap/admin/src/scripts/dn2rdn.in b/ldap/admin/src/scripts/dn2rdn.in
index 616969a..762e63a 100755
--- a/ldap/admin/src/scripts/dn2rdn.in
+++ b/ldap/admin/src/scripts/dn2rdn.in
@@ -27,12 +27,12 @@ do
h) usage
exit 0;;
Z) servid=$OPTARG;;
- d) arg=$arg" -d $OPTARG";;
- a) arg=$arg" -a $OPTARG"
+ d) arg=$arg" -d \"$OPTARG\"";;
+ a) arg=$arg" -a \"$OPTARG\""
archive="provided";;
v) arg=$arg" -v";;
f) arg=$arg" -f";;
- D) arg=$arg" -D $OPTARG";;
+ D) arg=$arg" -D \"$OPTARG\"";;
?) usage
exit 1;;
esac
@@ -55,4 +55,4 @@ if [ "$archive" != "provided" ]; then
args=$args"-a $bak_dir"
fi
-@sbindir@/ns-slapd upgradedb -D $CONFIG_DIR -r $args
+eval @sbindir@/ns-slapd upgradedb -D $CONFIG_DIR -r $args
diff --git a/ldap/admin/src/scripts/ldif2db.in b/ldap/admin/src/scripts/ldif2db.in
index a34241a..3aed469 100755
--- a/ldap/admin/src/scripts/ldif2db.in
+++ b/ldap/admin/src/scripts/ldif2db.in
@@ -59,16 +59,16 @@ do
h) usage
exit 0;;
Z) servid=$OPTARG;;
- n) args=$args" -n $OPTARG";;
- i) args=$args" -i $OPTARG";;
- s) args=$args" -s $OPTARG";;
- x) args=$args" -x $OPTARG";;
- c) args=$args" -c $OPTARG";;
- d) args=$args" -d $OPTARG";;
- g) args=$args" -g $OPTARG";;
- G) args=$args" -G $OPTARG";;
- t) args=$args" -t $OPTARG";;
- D) args=$args" -D $OPTARG";;
+ n) args=$args" -n \"$OPTARG\"";;
+ i) args=$args" -i \"$OPTARG\"";;
+ s) args=$args" -s \"$OPTARG\"";;
+ x) args=$args" -x \"$OPTARG\"";;
+ c) args=$args" -c \"$OPTARG\"";;
+ d) args=$args" -d \"$OPTARG\"";;
+ g) args=$args" -g \"$OPTARG\"";;
+ G) args=$args" -G \"$OPTARG\"";;
+ t) args=$args" -t \"$OPTARG\"";;
+ D) args=$args" -D \"$OPTARG\"";;
E) args=$args" -E";;
v) args=$args" -v";;
N) args=$args" -N";;
@@ -104,6 +104,6 @@ if [ $quiet -eq 0 ]; then
echo importing data ...
fi
-@sbindir@/ns-slapd ldif2db -D $CONFIG_DIR $args 2>&1
+eval @sbindir@/ns-slapd ldif2db -D $CONFIG_DIR $args 2>&1
exit $?
diff --git a/ldap/admin/src/scripts/monitor.in b/ldap/admin/src/scripts/monitor.in
index 36a2fc9..e9265a1 100755
--- a/ldap/admin/src/scripts/monitor.in
+++ b/ldap/admin/src/scripts/monitor.in
@@ -73,8 +73,8 @@ fi
rm $file
if [ -n "$passwd" ]; then
- dn="-D $rootdn"
- passwd="-w$passwd"
+ dn="-D \"$rootdn\""
+ passwd="-w \"$passwd\""
fi
if [ -n "$ldapiURL" ]
then
@@ -109,9 +109,9 @@ if [ "$security" = "on" ]; then
echo "Using the next most secure protocol(STARTTLS)"
fi
if [ "$openldap" = "yes" ]; then
- ldapsearch -x -LLL -ZZ -h $host -p $port -b "$MDN" -s base $dn $passwd "objectClass=*"
+ eval ldapsearch -x -LLL -ZZ -h $host -p $port -b "$MDN" -s base $dn $passwd "objectClass=*"
else
- ldapsearch -ZZZ -P $certdir -h $host -p $port -b "$MDN" -s base $dn $passwd "objectClass=*"
+ eval ldapsearch -ZZZ -P $certdir -h $host -p $port -b "$MDN" -s base $dn $passwd "objectClass=*"
fi
exit $?
fi
diff --git a/ldap/admin/src/scripts/suffix2instance.in b/ldap/admin/src/scripts/suffix2instance.in
index 7774148..d7c6661 100755
--- a/ldap/admin/src/scripts/suffix2instance.in
+++ b/ldap/admin/src/scripts/suffix2instance.in
@@ -24,7 +24,7 @@ while getopts "Z:s:h" flag
do
case $flag in
Z) servid=$OPTARG;;
- s) args=$args" -s $OPTARG";;
+ s) args=$args" -s \"$OPTARG\"";;
h) usage
exit 0;;
?) usage
@@ -55,4 +55,4 @@ then
exit 1
fi
-@sbindir@/ns-slapd suffix2instance -D $CONFIG_DIR $args 2>&1
+eval @sbindir@/ns-slapd suffix2instance -D $CONFIG_DIR $args 2>&1
diff --git a/ldap/admin/src/scripts/upgradedb.in b/ldap/admin/src/scripts/upgradedb.in
index bf600dd..2b7c79d 100755
--- a/ldap/admin/src/scripts/upgradedb.in
+++ b/ldap/admin/src/scripts/upgradedb.in
@@ -29,10 +29,10 @@ do
v) args=$args" -v";;
f) args=$args" -f";;
r) args=$args" -r";;
- d) args=$args" -d $OPTARG";;
- a) args=$args" -a $OPTARG"
+ d) args=$args" -d \"$OPTARG\"";;
+ a) args=$args" -a \"$OPTARG\""
archive_provided="yes";;
- D) args=$args" -D $OPTARG";;
+ D) args=$args" -D \"$OPTARG\"";;
h) usage
exit 0;;
esac
@@ -56,4 +56,4 @@ then
fi
echo upgrade index files ...
-@sbindir@/ns-slapd upgradedb -D $CONFIG_DIR $args
+eval @sbindir@/ns-slapd upgradedb -D $CONFIG_DIR $args
diff --git a/ldap/admin/src/scripts/upgradednformat.in b/ldap/admin/src/scripts/upgradednformat.in
index 51585ae..9de60ea 100755
--- a/ldap/admin/src/scripts/upgradednformat.in
+++ b/ldap/admin/src/scripts/upgradednformat.in
@@ -36,14 +36,14 @@ do
Z) servid=$OPTARG;;
v) args=$args" -v";;
N) args=$args" -N";;
- d) args=$args" -d $OPTARG";;
- a) args=$args" -a $OPTARG"
+ d) args=$args" -d \"$OPTARG\"";;
+ a) args=$args" -a \"$OPTARG\""
dir="set";;
- n) args=$args" -n $OPTARG"
+ n) args=$args" -n \"$OPTARG\""
be="set";;
h) usage
exit 0;;
- D) args=$args" -D $OPTARG";;
+ D) args=$args" -D \"$OPTARG\"";;
?) usage
exit 1;;
esac
@@ -65,7 +65,7 @@ fi
. $initfile
-@sbindir@/ns-slapd upgradednformat -D $CONFIG_DIR $args
+eval @sbindir@/ns-slapd upgradednformat -D $CONFIG_DIR $args
rc=$?
exit $rc
diff --git a/ldap/admin/src/scripts/vlvindex.in b/ldap/admin/src/scripts/vlvindex.in
index 365e32f..a1696bc 100755
--- a/ldap/admin/src/scripts/vlvindex.in
+++ b/ldap/admin/src/scripts/vlvindex.in
@@ -29,14 +29,14 @@ do
case $flag in
Z) servid=$OPTARG;;
v) args=$args" -v";;
- s) args=$args" -s $OPTARG";;
- d) args=$args" -d $OPTARG";;
- a) args=$args" -a $OPTARG";;
- T) args=$args" -T $OPTARG";;
+ s) args=$args" -s \"$OPTARG\"";;
+ d) args=$args" -d \"$OPTARG\"";;
+ a) args=$args" -a \"$OPTARG\"";;
+ T) args=$args" -T \"$OPTARG\"";;
S) args=$args" -S";;
- n) args=$args" -n $OPTARG";;
- x) args=$args" -x $OPTARG";;
- D) args=$args" -D $OPTARG";;
+ n) args=$args" -n \"$OPTARG\"";;
+ x) args=$args" -x \"$OPTARG\"";;
+ D) args=$args" -D \"$OPTARG\"";;
h) usage
exit 0;;
?) usage
@@ -61,4 +61,4 @@ then
exit 1
fi
-@sbindir@/ns-slapd db2index -D $CONFIG_DIR $args
+eval @sbindir@/ns-slapd db2index -D $CONFIG_DIR $args
--
389 commits mailing list
389-commits@%(host_name)s
http://lists.fedoraproject.org/postorius/389-commits@lists.fedoraproject.org
8 years, 7 months
ldap/admin
by Noriko Hosoi
ldap/admin/src/scripts/bak2db.in | 10 +++++-----
ldap/admin/src/scripts/db2bak.in | 8 ++++----
ldap/admin/src/scripts/db2index.in | 10 +++++-----
ldap/admin/src/scripts/db2ldif.in | 14 +++++++-------
ldap/admin/src/scripts/dbverify.in | 10 +++++-----
ldap/admin/src/scripts/dn2rdn.in | 8 ++++----
ldap/admin/src/scripts/ldif2db.in | 22 +++++++++++-----------
ldap/admin/src/scripts/monitor.in | 8 ++++----
ldap/admin/src/scripts/suffix2instance.in | 4 ++--
ldap/admin/src/scripts/upgradedb.in | 8 ++++----
ldap/admin/src/scripts/upgradednformat.in | 10 +++++-----
ldap/admin/src/scripts/vlvindex.in | 16 ++++++++--------
12 files changed, 64 insertions(+), 64 deletions(-)
New commits:
commit 5fe28921810a53dcd31525ba1f675582b6aba0f7
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Tue Aug 25 11:48:31 2015 -0700
Ticket #48254 - Shell CLI fails with usage errors if an argument containing white spaces is given
Description: In addition to the patch:
Ticket #48254 - CLI db2index fails with usage errors
commit 3507c46c9f1156df11b6cf05eba695d81088b416
applying the similar changes to all the shell CLI which could be given
arguments that include white spaces.
https://fedorahosted.org/389/ticket/48254
Reviewed by mreynolds(a)redhat.com (Thank you, Mark!!)
diff --git a/ldap/admin/src/scripts/bak2db.in b/ldap/admin/src/scripts/bak2db.in
index a2e54cc..ab7c6b3 100755
--- a/ldap/admin/src/scripts/bak2db.in
+++ b/ldap/admin/src/scripts/bak2db.in
@@ -44,12 +44,12 @@ do
h) usage
exit 0;;
Z) servid=$OPTARG;;
- n) args=$args" -n $OPTARG";;
+ n) args=$args" -n \"$OPTARG\"";;
q) args=$args" -q";;
- d) args=$args" -d $OPTARG";;
+ d) args=$args" -d \"$OPTARG\"";;
v) args=$args" -v";;
- D) args=$args" -D $OPTARG";;
- i) args=$args" -i $OPTARG";;
+ D) args=$args" -D \"$OPTARG\"";;
+ i) args=$args" -i \"$OPTARG\"";;
a) archivedir=$OPTARG;;
S) args=$args" -S";;
?) usage
@@ -76,4 +76,4 @@ else
archivedir=`pwd`/$archivedir
fi
-@sbindir@/ns-slapd archive2db -D $CONFIG_DIR -a $archivedir $args
+eval @sbindir@/ns-slapd archive2db -D $CONFIG_DIR -a $archivedir $args
diff --git a/ldap/admin/src/scripts/db2bak.in b/ldap/admin/src/scripts/db2bak.in
index 1896c19..adbe30b 100755
--- a/ldap/admin/src/scripts/db2bak.in
+++ b/ldap/admin/src/scripts/db2bak.in
@@ -43,10 +43,10 @@ do
q) args=$args" -q";;
v) args=$args" -v";;
S) args=$args" -S";;
- D) args=$args" -D $OPTARG";;
- i) args=$args" -i $OPTARG";;
+ D) args=$args" -D \"$OPTARG\"";;
+ i) args=$args" -i \"$OPTARG\"";;
a) $bakdir=$OPTARG;;
- d) args=$args" -d $OPTARG";;
+ d) args=$args" -d \"$OPTARG\"";;
Z) servid=$OPTARG;;
?) usage
exit 1;;
@@ -72,4 +72,4 @@ then
fi
echo "Back up directory: $bak_dir"
-@sbindir@/ns-slapd db2archive -D $CONFIG_DIR -a $bak_dir $args
+eval @sbindir@/ns-slapd db2archive -D $CONFIG_DIR -a $bak_dir $args
diff --git a/ldap/admin/src/scripts/db2index.in b/ldap/admin/src/scripts/db2index.in
index 6a0785e..c8e9075 100755
--- a/ldap/admin/src/scripts/db2index.in
+++ b/ldap/admin/src/scripts/db2index.in
@@ -35,15 +35,15 @@ do
h) usage
exit 0;;
Z) servid=$OPTARG;;
- n) args=$args" -n $OPTARG"
+ n) args=$args" -n \"$OPTARG\""
benameopt="set";;
- s) args=$args" -s $OPTARG"
+ s) args=$args" -s \"$OPTARG\""
includeSuffix="set";;
t) args=$args" -t "\"$OPTARG\";;
T) args=$args" -T "\"$OPTARG\";;
- d) args=$args" -d $OPTARG";;
- a) args=$args" -a $OPTARG";;
- x) args=$args" -x $OPTARG";;
+ d) args=$args" -d \"$OPTARG\"";;
+ a) args=$args" -a \"$OPTARG\"";;
+ x) args=$args" -x \"$OPTARG\"";;
v) args=$args" -v";;
S) args=$args" -S";;
D) args=$args" -D $OPTARG";;
diff --git a/ldap/admin/src/scripts/db2ldif.in b/ldap/admin/src/scripts/db2ldif.in
index fcf73a0..e9f7f7e 100755
--- a/ldap/admin/src/scripts/db2ldif.in
+++ b/ldap/admin/src/scripts/db2ldif.in
@@ -106,12 +106,12 @@ do
Z) servid=$OPTARG;;
n) benameopt="-n $OPTARG"
required_param="yes";;
- s) includeSuffix="-s $OPTARG"
+ s) includeSuffix="-s \"$OPTARG\""
required_param="yes";;
- x) excludeSuffix="-x $OPTARG";;
- a) outputFile="-a $OPTARG";;
- d) args=$args" -d $OPTARG";;
- D) args=$args" -D $OPTARG";;
+ x) excludeSuffix="-x \"$OPTARG\"";;
+ a) outputFile="-a \"$OPTARG\"";;
+ d) args=$args" -d \"$OPTARG\"";;
+ D) args=$args" -D \"$OPTARG\"";;
N) args=$args" -N";;
E) args=$args" -E";;
S) args=$args" -S";;
@@ -154,7 +154,7 @@ rn=$?
echo "Exported ldif file: $ldif_file"
if [ $rn -eq 1 ]
then
- @sbindir@/ns-slapd db2ldif -D $CONFIG_DIR $benameopt $includeSuffix $excludeSuffix $outputFile $args
+ eval @sbindir@/ns-slapd db2ldif -D $CONFIG_DIR $benameopt $includeSuffix $excludeSuffix $outputFile $args
else
- @sbindir@/ns-slapd db2ldif -D $CONFIG_DIR $benameopt $includeSuffix $excludeSuffix $args -a $ldif_file
+ eval @sbindir@/ns-slapd db2ldif -D $CONFIG_DIR $benameopt $includeSuffix $excludeSuffix $args -a $ldif_file
fi
diff --git a/ldap/admin/src/scripts/dbverify.in b/ldap/admin/src/scripts/dbverify.in
index bbacc17..b98e9b2 100755
--- a/ldap/admin/src/scripts/dbverify.in
+++ b/ldap/admin/src/scripts/dbverify.in
@@ -33,14 +33,14 @@ do
h) usage
exit 0;;
Z) servid=$OPTARG;;
- n) args=$args" -n $OPTARG";;
- d) args=$args" -d $OPTARG";;
+ n) args=$args" -n \"$OPTARG\"";;
+ d) args=$args" -d \"$OPTARG\"";;
V) args=$args" -V";;
v) args=$args" -v"
display_version="yes";;
f) args=$args" -f";;
- D) args=$args" -D $OPTARG";;
- a) args=$args" -a $OPTARG";;
+ D) args=$args" -D \"$OPTARG\"";;
+ a) args=$args" -a \"$OPTARG\"";;
?) usage
exit 1;;
esac
@@ -57,7 +57,7 @@ fi
. $initfile
-@sbindir@/ns-slapd dbverify -D $CONFIG_DIR $args
+eval @sbindir@/ns-slapd dbverify -D $CONFIG_DIR $args
if [ $display_version = "yes" ]; then
exit 0
fi
diff --git a/ldap/admin/src/scripts/dn2rdn.in b/ldap/admin/src/scripts/dn2rdn.in
index 616969a..762e63a 100755
--- a/ldap/admin/src/scripts/dn2rdn.in
+++ b/ldap/admin/src/scripts/dn2rdn.in
@@ -27,12 +27,12 @@ do
h) usage
exit 0;;
Z) servid=$OPTARG;;
- d) arg=$arg" -d $OPTARG";;
- a) arg=$arg" -a $OPTARG"
+ d) arg=$arg" -d \"$OPTARG\"";;
+ a) arg=$arg" -a \"$OPTARG\""
archive="provided";;
v) arg=$arg" -v";;
f) arg=$arg" -f";;
- D) arg=$arg" -D $OPTARG";;
+ D) arg=$arg" -D \"$OPTARG\"";;
?) usage
exit 1;;
esac
@@ -55,4 +55,4 @@ if [ "$archive" != "provided" ]; then
args=$args"-a $bak_dir"
fi
-@sbindir@/ns-slapd upgradedb -D $CONFIG_DIR -r $args
+eval @sbindir@/ns-slapd upgradedb -D $CONFIG_DIR -r $args
diff --git a/ldap/admin/src/scripts/ldif2db.in b/ldap/admin/src/scripts/ldif2db.in
index a34241a..3aed469 100755
--- a/ldap/admin/src/scripts/ldif2db.in
+++ b/ldap/admin/src/scripts/ldif2db.in
@@ -59,16 +59,16 @@ do
h) usage
exit 0;;
Z) servid=$OPTARG;;
- n) args=$args" -n $OPTARG";;
- i) args=$args" -i $OPTARG";;
- s) args=$args" -s $OPTARG";;
- x) args=$args" -x $OPTARG";;
- c) args=$args" -c $OPTARG";;
- d) args=$args" -d $OPTARG";;
- g) args=$args" -g $OPTARG";;
- G) args=$args" -G $OPTARG";;
- t) args=$args" -t $OPTARG";;
- D) args=$args" -D $OPTARG";;
+ n) args=$args" -n \"$OPTARG\"";;
+ i) args=$args" -i \"$OPTARG\"";;
+ s) args=$args" -s \"$OPTARG\"";;
+ x) args=$args" -x \"$OPTARG\"";;
+ c) args=$args" -c \"$OPTARG\"";;
+ d) args=$args" -d \"$OPTARG\"";;
+ g) args=$args" -g \"$OPTARG\"";;
+ G) args=$args" -G \"$OPTARG\"";;
+ t) args=$args" -t \"$OPTARG\"";;
+ D) args=$args" -D \"$OPTARG\"";;
E) args=$args" -E";;
v) args=$args" -v";;
N) args=$args" -N";;
@@ -104,6 +104,6 @@ if [ $quiet -eq 0 ]; then
echo importing data ...
fi
-@sbindir@/ns-slapd ldif2db -D $CONFIG_DIR $args 2>&1
+eval @sbindir@/ns-slapd ldif2db -D $CONFIG_DIR $args 2>&1
exit $?
diff --git a/ldap/admin/src/scripts/monitor.in b/ldap/admin/src/scripts/monitor.in
index 36a2fc9..e9265a1 100755
--- a/ldap/admin/src/scripts/monitor.in
+++ b/ldap/admin/src/scripts/monitor.in
@@ -73,8 +73,8 @@ fi
rm $file
if [ -n "$passwd" ]; then
- dn="-D $rootdn"
- passwd="-w$passwd"
+ dn="-D \"$rootdn\""
+ passwd="-w \"$passwd\""
fi
if [ -n "$ldapiURL" ]
then
@@ -109,9 +109,9 @@ if [ "$security" = "on" ]; then
echo "Using the next most secure protocol(STARTTLS)"
fi
if [ "$openldap" = "yes" ]; then
- ldapsearch -x -LLL -ZZ -h $host -p $port -b "$MDN" -s base $dn $passwd "objectClass=*"
+ eval ldapsearch -x -LLL -ZZ -h $host -p $port -b "$MDN" -s base $dn $passwd "objectClass=*"
else
- ldapsearch -ZZZ -P $certdir -h $host -p $port -b "$MDN" -s base $dn $passwd "objectClass=*"
+ eval ldapsearch -ZZZ -P $certdir -h $host -p $port -b "$MDN" -s base $dn $passwd "objectClass=*"
fi
exit $?
fi
diff --git a/ldap/admin/src/scripts/suffix2instance.in b/ldap/admin/src/scripts/suffix2instance.in
index 7774148..d7c6661 100755
--- a/ldap/admin/src/scripts/suffix2instance.in
+++ b/ldap/admin/src/scripts/suffix2instance.in
@@ -24,7 +24,7 @@ while getopts "Z:s:h" flag
do
case $flag in
Z) servid=$OPTARG;;
- s) args=$args" -s $OPTARG";;
+ s) args=$args" -s \"$OPTARG\"";;
h) usage
exit 0;;
?) usage
@@ -55,4 +55,4 @@ then
exit 1
fi
-@sbindir@/ns-slapd suffix2instance -D $CONFIG_DIR $args 2>&1
+eval @sbindir@/ns-slapd suffix2instance -D $CONFIG_DIR $args 2>&1
diff --git a/ldap/admin/src/scripts/upgradedb.in b/ldap/admin/src/scripts/upgradedb.in
index bf600dd..2b7c79d 100755
--- a/ldap/admin/src/scripts/upgradedb.in
+++ b/ldap/admin/src/scripts/upgradedb.in
@@ -29,10 +29,10 @@ do
v) args=$args" -v";;
f) args=$args" -f";;
r) args=$args" -r";;
- d) args=$args" -d $OPTARG";;
- a) args=$args" -a $OPTARG"
+ d) args=$args" -d \"$OPTARG\"";;
+ a) args=$args" -a \"$OPTARG\""
archive_provided="yes";;
- D) args=$args" -D $OPTARG";;
+ D) args=$args" -D \"$OPTARG\"";;
h) usage
exit 0;;
esac
@@ -56,4 +56,4 @@ then
fi
echo upgrade index files ...
-@sbindir@/ns-slapd upgradedb -D $CONFIG_DIR $args
+eval @sbindir@/ns-slapd upgradedb -D $CONFIG_DIR $args
diff --git a/ldap/admin/src/scripts/upgradednformat.in b/ldap/admin/src/scripts/upgradednformat.in
index 51585ae..9de60ea 100755
--- a/ldap/admin/src/scripts/upgradednformat.in
+++ b/ldap/admin/src/scripts/upgradednformat.in
@@ -36,14 +36,14 @@ do
Z) servid=$OPTARG;;
v) args=$args" -v";;
N) args=$args" -N";;
- d) args=$args" -d $OPTARG";;
- a) args=$args" -a $OPTARG"
+ d) args=$args" -d \"$OPTARG\"";;
+ a) args=$args" -a \"$OPTARG\""
dir="set";;
- n) args=$args" -n $OPTARG"
+ n) args=$args" -n \"$OPTARG\""
be="set";;
h) usage
exit 0;;
- D) args=$args" -D $OPTARG";;
+ D) args=$args" -D \"$OPTARG\"";;
?) usage
exit 1;;
esac
@@ -65,7 +65,7 @@ fi
. $initfile
-@sbindir@/ns-slapd upgradednformat -D $CONFIG_DIR $args
+eval @sbindir@/ns-slapd upgradednformat -D $CONFIG_DIR $args
rc=$?
exit $rc
diff --git a/ldap/admin/src/scripts/vlvindex.in b/ldap/admin/src/scripts/vlvindex.in
index 365e32f..a1696bc 100755
--- a/ldap/admin/src/scripts/vlvindex.in
+++ b/ldap/admin/src/scripts/vlvindex.in
@@ -29,14 +29,14 @@ do
case $flag in
Z) servid=$OPTARG;;
v) args=$args" -v";;
- s) args=$args" -s $OPTARG";;
- d) args=$args" -d $OPTARG";;
- a) args=$args" -a $OPTARG";;
- T) args=$args" -T $OPTARG";;
+ s) args=$args" -s \"$OPTARG\"";;
+ d) args=$args" -d \"$OPTARG\"";;
+ a) args=$args" -a \"$OPTARG\"";;
+ T) args=$args" -T \"$OPTARG\"";;
S) args=$args" -S";;
- n) args=$args" -n $OPTARG";;
- x) args=$args" -x $OPTARG";;
- D) args=$args" -D $OPTARG";;
+ n) args=$args" -n \"$OPTARG\"";;
+ x) args=$args" -x \"$OPTARG\"";;
+ D) args=$args" -D \"$OPTARG\"";;
h) usage
exit 0;;
?) usage
@@ -61,4 +61,4 @@ then
exit 1
fi
-@sbindir@/ns-slapd db2index -D $CONFIG_DIR $args
+eval @sbindir@/ns-slapd db2index -D $CONFIG_DIR $args
--
389 commits mailing list
389-commits@%(host_name)s
http://lists.fedoraproject.org/postorius/389-commits@lists.fedoraproject.org
8 years, 7 months
Branch '389-ds-base-1.3.3' - ldap/admin
by Noriko Hosoi
ldap/admin/src/scripts/db2index.in | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
New commits:
commit 7f63b581fd035b0c13e068f5c0b8d78a5f1ad69d
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Thu Aug 20 17:01:28 2015 -0700
Ticket #48254 - CLI db2index fails with usage errors
Bug Description:
1) CLI db2index had an issue in option handling, which accidentally
added '=' at the end of the previous option.
2) if a value of an option includes a white space, e.g., -T "by MCC
ou=People dc=example dc=com", the value was not passed to the program
as a string.
Fix Description:
1) Removed unnecessary '='.
2) Quote $OPTARG which could include a white space, and call ns-slapd
command line vai eval.
https://fedorahosted.org/389/ticket/48254
Reviewed by rmeggins(a)redhat.com (Thank you, Rich!!)
(cherry picked from commit 3507c46c9f1156df11b6cf05eba695d81088b416)
(cherry picked from commit a6d7e3bd29eb63def170f73dc21e967df230f20a)
diff --git a/ldap/admin/src/scripts/db2index.in b/ldap/admin/src/scripts/db2index.in
index a1321ea..9af8fc8 100755
--- a/ldap/admin/src/scripts/db2index.in
+++ b/ldap/admin/src/scripts/db2index.in
@@ -39,13 +39,13 @@ do
benameopt="set";;
s) args=$args" -s $OPTARG"
includeSuffix="set";;
- t) args=$args" -t $OPTARG";;
- T) args=$args=" -T $OPTARG";;
- d) args=$args=" -d $OPTARG";;
- a) args=$args=" -a $OPTARG";;
- x) args=$args=" -x $OPTARG";;
- v) args=$args=" -v";;
- S) args=$args=" -S";;
+ t) args=$args" -t "\"$OPTARG\";;
+ T) args=$args" -T "\"$OPTARG\";;
+ d) args=$args" -d $OPTARG";;
+ a) args=$args" -a $OPTARG";;
+ x) args=$args" -x $OPTARG";;
+ v) args=$args" -v";;
+ S) args=$args" -S";;
D) args=$args" -D $OPTARG";;
?) usage
exit 1;;
@@ -79,5 +79,5 @@ then
usage
exit 1
else
- @sbindir@/ns-slapd db2index -D $CONFIG_DIR $args
+ eval @sbindir@/ns-slapd db2index -D $CONFIG_DIR $args
fi
8 years, 8 months
Branch '389-ds-base-1.3.4' - ldap/admin
by Noriko Hosoi
ldap/admin/src/scripts/db2index.in | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
New commits:
commit a6d7e3bd29eb63def170f73dc21e967df230f20a
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Thu Aug 20 17:01:28 2015 -0700
Ticket #48254 - CLI db2index fails with usage errors
Bug Description:
1) CLI db2index had an issue in option handling, which accidentally
added '=' at the end of the previous option.
2) if a value of an option includes a white space, e.g., -T "by MCC
ou=People dc=example dc=com", the value was not passed to the program
as a string.
Fix Description:
1) Removed unnecessary '='.
2) Quote $OPTARG which could include a white space, and call ns-slapd
command line vai eval.
https://fedorahosted.org/389/ticket/48254
Reviewed by rmeggins(a)redhat.com (Thank you, Rich!!)
(cherry picked from commit 3507c46c9f1156df11b6cf05eba695d81088b416)
diff --git a/ldap/admin/src/scripts/db2index.in b/ldap/admin/src/scripts/db2index.in
index 2b76cd1..6a0785e 100755
--- a/ldap/admin/src/scripts/db2index.in
+++ b/ldap/admin/src/scripts/db2index.in
@@ -39,13 +39,13 @@ do
benameopt="set";;
s) args=$args" -s $OPTARG"
includeSuffix="set";;
- t) args=$args" -t $OPTARG";;
- T) args=$args=" -T $OPTARG";;
- d) args=$args=" -d $OPTARG";;
- a) args=$args=" -a $OPTARG";;
- x) args=$args=" -x $OPTARG";;
- v) args=$args=" -v";;
- S) args=$args=" -S";;
+ t) args=$args" -t "\"$OPTARG\";;
+ T) args=$args" -T "\"$OPTARG\";;
+ d) args=$args" -d $OPTARG";;
+ a) args=$args" -a $OPTARG";;
+ x) args=$args" -x $OPTARG";;
+ v) args=$args" -v";;
+ S) args=$args" -S";;
D) args=$args" -D $OPTARG";;
?) usage
exit 1;;
@@ -79,5 +79,5 @@ then
usage
exit 1
else
- @sbindir@/ns-slapd db2index -D $CONFIG_DIR $args
+ eval @sbindir@/ns-slapd db2index -D $CONFIG_DIR $args
fi
8 years, 8 months
ldap/admin
by Noriko Hosoi
ldap/admin/src/scripts/db2index.in | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
New commits:
commit 3507c46c9f1156df11b6cf05eba695d81088b416
Author: Noriko Hosoi <nhosoi(a)redhat.com>
Date: Thu Aug 20 17:01:28 2015 -0700
Ticket #48254 - CLI db2index fails with usage errors
Bug Description:
1) CLI db2index had an issue in option handling, which accidentally
added '=' at the end of the previous option.
2) if a value of an option includes a white space, e.g., -T "by MCC
ou=People dc=example dc=com", the value was not passed to the program
as a string.
Fix Description:
1) Removed unnecessary '='.
2) Quote $OPTARG which could include a white space, and call ns-slapd
command line vai eval.
https://fedorahosted.org/389/ticket/48254
Reviewed by rmeggins(a)redhat.com (Thank you, Rich!!)
diff --git a/ldap/admin/src/scripts/db2index.in b/ldap/admin/src/scripts/db2index.in
index 2b76cd1..6a0785e 100755
--- a/ldap/admin/src/scripts/db2index.in
+++ b/ldap/admin/src/scripts/db2index.in
@@ -39,13 +39,13 @@ do
benameopt="set";;
s) args=$args" -s $OPTARG"
includeSuffix="set";;
- t) args=$args" -t $OPTARG";;
- T) args=$args=" -T $OPTARG";;
- d) args=$args=" -d $OPTARG";;
- a) args=$args=" -a $OPTARG";;
- x) args=$args=" -x $OPTARG";;
- v) args=$args=" -v";;
- S) args=$args=" -S";;
+ t) args=$args" -t "\"$OPTARG\";;
+ T) args=$args" -T "\"$OPTARG\";;
+ d) args=$args" -d $OPTARG";;
+ a) args=$args" -a $OPTARG";;
+ x) args=$args" -x $OPTARG";;
+ v) args=$args" -v";;
+ S) args=$args" -S";;
D) args=$args" -D $OPTARG";;
?) usage
exit 1;;
@@ -79,5 +79,5 @@ then
usage
exit 1
else
- @sbindir@/ns-slapd db2index -D $CONFIG_DIR $args
+ eval @sbindir@/ns-slapd db2index -D $CONFIG_DIR $args
fi
8 years, 8 months
Branch '389-ds-base-1.3.3' - ldap/servers
by Mark Reynolds
ldap/servers/plugins/retrocl/retrocl_po.c | 3 ---
1 file changed, 3 deletions(-)
New commits:
commit 5c48f28d2d6c46aa3cd2883207c18002d01e4994
Author: Mark Reynolds <mreynolds(a)redhat.com>
Date: Wed Aug 19 10:03:50 2015 -0400
Ticket 47831 - remove debug logging from retro cl
Description: Instrumented debug logging was accidentally left in the source.
This logging is being removed.
https://fedorahosted.org/389/ticket/47931
Reviewed by: mreynolds
(cherry picked from commit db7153f89bf3dda935e6ef4f175697bda32fe720)
diff --git a/ldap/servers/plugins/retrocl/retrocl_po.c b/ldap/servers/plugins/retrocl/retrocl_po.c
index a60becc..23c6402 100644
--- a/ldap/servers/plugins/retrocl/retrocl_po.c
+++ b/ldap/servers/plugins/retrocl/retrocl_po.c
@@ -186,14 +186,11 @@ write_replog_db(
int err = 0;
int ret = LDAP_SUCCESS;
int i;
- int mark = 0;
if (!dn) {
slapi_log_error( SLAPI_LOG_PLUGIN, RETROCL_PLUGIN_NAME, "write_replog_db: NULL dn\n");
return ret;
}
- mark = (post_entry && retrocl_entry_in_scope(post_entry));
- slapi_log_error( SLAPI_LOG_FATAL, RETROCL_PLUGIN_NAME, "post in scope (%d)\n",mark);
if (post_entry){
if(!retrocl_entry_in_scope(log_e) && !retrocl_entry_in_scope(post_entry)){
8 years, 8 months