commit_id
string | repo
string | commit_message
string | diff
string | label
int64 |
---|---|---|---|---|
69586c4c25b975ac8fcbfb52b6362e3be119564e
|
389ds/389-ds-base
|
Resolves: bug 339041
Bug Description: migration : encryption key entries missing when source is 6.21
Reviewed by: nhosoi (Thanks!)
Fix Description: I found out why it wasn't always adding the attribute encryption entries. If the cn=monitor entry existed for the database, it would not add the other container entries. I don't know why it did that. I changed it to always add those entries, and just skip the ones that already exist. This should ensure that the attribute encryption entries always exist.
Platforms tested: RHEL5 x86_64
Flag Day: no
Doc impact: no
QA impact: should be covered by regular nightly and manual testing
New Tests integrated into TET: none
|
commit 69586c4c25b975ac8fcbfb52b6362e3be119564e
Author: Rich Megginson <[email protected]>
Date: Wed Nov 14 15:04:51 2007 +0000
Resolves: bug 339041
Bug Description: migration : encryption key entries missing when source is 6.21
Reviewed by: nhosoi (Thanks!)
Fix Description: I found out why it wasn't always adding the attribute encryption entries. If the cn=monitor entry existed for the database, it would not add the other container entries. I don't know why it did that. I changed it to always add those entries, and just skip the ones that already exist. This should ensure that the attribute encryption entries always exist.
Platforms tested: RHEL5 x86_64
Flag Day: no
Doc impact: no
QA impact: should be covered by regular nightly and manual testing
New Tests integrated into TET: none
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_config.c b/ldap/servers/slapd/back-ldbm/ldbm_config.c
index 624d343d7..dbecdb2c0 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_config.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_config.c
@@ -82,8 +82,10 @@ int ldbm_config_add_dse_entries(struct ldbminfo *li, char **entries, char *strin
Slapi_Entry *e;
Slapi_PBlock *util_pb = NULL;
int rc;
+ int result;
char entry_string[512];
int dont_write_file = 0;
+ char ebuf[BUFSIZ];
if (flags & LDBM_INSTANCE_CONFIG_DONT_WRITE) {
dont_write_file = 1;
@@ -93,11 +95,21 @@ int ldbm_config_add_dse_entries(struct ldbminfo *li, char **entries, char *strin
util_pb = slapi_pblock_new();
PR_snprintf(entry_string, 512, entries[x], string1, string2, string3);
e = slapi_str2entry(entry_string, 0);
+ PR_snprintf(ebuf, sizeof(ebuf), slapi_entry_get_dn_const(e)); /* for logging */
slapi_add_entry_internal_set_pb(util_pb, e, NULL, li->li_identity, 0);
slapi_pblock_set(util_pb, SLAPI_DSE_DONT_WRITE_WHEN_ADDING,
&dont_write_file);
- if ((rc = slapi_add_internal_pb(util_pb)) != LDAP_SUCCESS) {
- LDAPDebug(LDAP_DEBUG_ANY, "Unable to add config entries to the DSE: %d\n", rc, 0, 0);
+ rc = slapi_add_internal_pb(util_pb);
+ slapi_pblock_get(util_pb, SLAPI_PLUGIN_INTOP_RESULT, &result);
+ if (!rc && (result == LDAP_SUCCESS)) {
+ LDAPDebug(LDAP_DEBUG_CONFIG, "Added database config entry [%s]\n",
+ ebuf, 0, 0);
+ } else if (result == LDAP_ALREADY_EXISTS) {
+ LDAPDebug(LDAP_DEBUG_TRACE, "Database config entry [%s] already exists - skipping\n",
+ ebuf, 0, 0);
+ } else {
+ LDAPDebug(LDAP_DEBUG_ANY, "Unable to add config entry [%s] to the DSE: %d %d\n",
+ ebuf, result, rc);
}
slapi_pblock_destroy(util_pb);
}
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_instance_config.c b/ldap/servers/slapd/back-ldbm/ldbm_instance_config.c
index 94f1f80e3..abe2299a5 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_instance_config.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_instance_config.c
@@ -490,27 +490,11 @@ ldbm_instance_config_load_dse_info(ldbm_instance *inst)
slapi_pblock_destroy(search_pb);
}
- /* now check for cn=monitor -- if not present, add default child entries */
- search_pb = slapi_pblock_new();
- PR_snprintf(dn, BUFSIZ, "cn=monitor, cn=%s, cn=%s, cn=plugins, cn=config",
- inst->inst_name, li->li_plugin->plg_name);
- slapi_search_internal_set_pb(search_pb, dn, LDAP_SCOPE_BASE,
- "objectclass=*", NULL, 0, NULL, NULL,
- li->li_identity, 0);
- slapi_search_internal_pb(search_pb);
- slapi_pblock_get(search_pb, SLAPI_PLUGIN_INTOP_RESULT, &res);
-
- if (res == LDAP_NO_SUCH_OBJECT) {
- /* Add skeleton dse entries for this instance */
- ldbm_config_add_dse_entries(li, ldbm_instance_skeleton_entries,
- inst->inst_name, li->li_plugin->plg_name,
- inst->inst_name, 0);
- }
-
- if (search_pb) {
- slapi_free_search_results_internal(search_pb);
- slapi_pblock_destroy(search_pb);
- }
+ /* Add skeleton dse entries for this instance */
+ /* IF they already exist, that's ok */
+ ldbm_config_add_dse_entries(li, ldbm_instance_skeleton_entries,
+ inst->inst_name, li->li_plugin->plg_name,
+ inst->inst_name, 0);
/* setup the dse callback functions for the ldbm instance config entry */
PR_snprintf(dn, BUFSIZ, "cn=%s, cn=%s, cn=plugins, cn=config",
| 0 |
ca855b89ab8f6b49191ffdf70b320dedab7235c5
|
389ds/389-ds-base
|
Ticket 49431 - Add CI test case
Description: Add a test case to suites/replication/regression_test.py
Test that replicated MODRDN does not break replication
https://fedorahosted.org/389/ticket/49431
Reviewed by: spichugi, lkrispen, wibrown (thanks!)
Signed-off-by: Simon Pichugin <[email protected]>
|
commit ca855b89ab8f6b49191ffdf70b320dedab7235c5
Author: Amita Sharma <[email protected]>
Date: Mon Dec 11 19:29:37 2017 +0530
Ticket 49431 - Add CI test case
Description: Add a test case to suites/replication/regression_test.py
Test that replicated MODRDN does not break replication
https://fedorahosted.org/389/ticket/49431
Reviewed by: spichugi, lkrispen, wibrown (thanks!)
Signed-off-by: Simon Pichugin <[email protected]>
diff --git a/dirsrvtests/tests/suites/replication/regression_test.py b/dirsrvtests/tests/suites/replication/regression_test.py
index 3cb20930e..a9dfbed3f 100644
--- a/dirsrvtests/tests/suites/replication/regression_test.py
+++ b/dirsrvtests/tests/suites/replication/regression_test.py
@@ -9,9 +9,11 @@
import pytest
from lib389.idm.user import TEST_USER_PROPERTIES, UserAccounts
from lib389.utils import *
-from lib389.topologies import topology_m2 as topo_m2
+from lib389.topologies import topology_m2 as topo_m2, TopologyMain
from lib389._constants import *
from . import get_repl_entries
+from lib389.idm.organisationalunit import OrganisationalUnits
+from lib389.replica import Replicas
NEW_SUFFIX_NAME = 'test_repl'
NEW_SUFFIX = 'o={}'.format(NEW_SUFFIX_NAME)
@@ -75,6 +77,89 @@ def test_double_delete(topo_m2, test_entry):
assert not entries, "Entry deletion {} wasn't replicated successfully".format(test_entry.dn)
[email protected]
+def test_repl_modrdn(topo_m2):
+ """Test that replicated MODRDN does not break replication
+
+ :id: a3e17698-9eb4-41e0-b537-8724b9915fa6
+ :setup: Two masters replication setup
+ :steps:
+ 1. Add 3 test OrganisationalUnits A, B and C
+ 2. Add 1 test user under OU=A
+ 3. Add same test user under OU=B
+ 4. Stop Replication
+ 5. Apply modrdn to M1 - move test user from OU A -> C
+ 6. Apply modrdn on M2 - move test user from OU B -> C
+ 7. Start Replication
+ 8. Check that there should be only one test entry under ou=C on both masters
+ 9. Check that the replication is working fine both ways M1 <-> M2
+ :expectedresults:
+ 1. This should pass
+ 2. This should pass
+ 3. This should pass
+ 4. This should pass
+ 5. This should pass
+ 6. This should pass
+ 7. This should pass
+ 8. This should pass
+ 9. This should pass
+ """
+
+ master1 = topo_m2.ms["master1"]
+ master2 = topo_m2.ms["master2"]
+
+ log.info("Add test entries - Add 3 OUs and 2 same users under 2 different OUs")
+ OUs = OrganisationalUnits(master1, DEFAULT_SUFFIX)
+ OU_A = OUs.create(properties={
+ 'ou': 'A',
+ 'description': 'A',
+ })
+ OU_B = OUs.create(properties={
+ 'ou': 'B',
+ 'description': 'B',
+ })
+ OU_C = OUs.create(properties={
+ 'ou': 'C',
+ 'description': 'C',
+ })
+
+ users = UserAccounts(master1, DEFAULT_SUFFIX, rdn='ou={}'.format(OU_A.rdn))
+ tuser_A = users.create(properties=TEST_USER_PROPERTIES)
+
+ users = UserAccounts(master1, DEFAULT_SUFFIX, rdn='ou={}'.format(OU_B.rdn))
+ tuser_B = users.create(properties=TEST_USER_PROPERTIES)
+
+ time.sleep(10)
+
+ log.info("Stop Replication")
+ topo_m2.pause_all_replicas()
+
+ log.info("Apply modrdn to M1 - move test user from OU A -> C")
+ master1.rename_s(tuser_A.dn,'uid=testuser1',newsuperior=OU_C.dn,delold=1)
+
+ log.info("Apply modrdn on M2 - move test user from OU B -> C")
+ master2.rename_s(tuser_B.dn,'uid=testuser1',newsuperior=OU_C.dn,delold=1)
+
+ log.info("Start Replication")
+ topo_m2.resume_all_replicas()
+
+ log.info("Wait for sometime for repl to resume")
+ time.sleep(10)
+
+ log.info("Check that there should be only one test entry under ou=C on both masters")
+ users = UserAccounts(master1, DEFAULT_SUFFIX, rdn='ou={}'.format(OU_C.rdn))
+ assert len(users.list()) == 1
+
+ users = UserAccounts(master2, DEFAULT_SUFFIX, rdn='ou={}'.format(OU_C.rdn))
+ assert len(users.list()) == 1
+
+ log.info("Check that the replication is working fine both ways, M1 <-> M2")
+ replicas_m1 = Replicas(master1)
+ replicas_m2 = Replicas(master2)
+ replicas_m1.test(DEFAULT_SUFFIX, master2)
+ replicas_m2.test(DEFAULT_SUFFIX, master1)
+
+
def test_password_repl_error(topo_m2, test_entry):
"""Check that error about userpassword replication is properly logged
@@ -172,3 +257,4 @@ if __name__ == '__main__':
# -s for DEBUG mode
CURRENT_FILE = os.path.realpath(__file__)
pytest.main("-s %s" % CURRENT_FILE)
+
| 0 |
005850477362e6304fa06448309d7c588e9601ce
|
389ds/389-ds-base
|
Ticket 48855 - Add basic pwdPolicy tests
Bug Description: There were no password policy tests in the features section.
Fix Description: Add the initial test that checks for password syntax enforcment
https://fedorahosted.org/389/ticket/48855
Author: wibrown
Review by: mreynolds (Thanks!)
|
commit 005850477362e6304fa06448309d7c588e9601ce
Author: William Brown <[email protected]>
Date: Mon May 30 13:33:41 2016 +1000
Ticket 48855 - Add basic pwdPolicy tests
Bug Description: There were no password policy tests in the features section.
Fix Description: Add the initial test that checks for password syntax enforcment
https://fedorahosted.org/389/ticket/48855
Author: wibrown
Review by: mreynolds (Thanks!)
diff --git a/dirsrvtests/tests/suites/password/pwdPolicy_test.py b/dirsrvtests/tests/suites/password/pwdPolicy_test.py
index 9ceb62c6d..653d033dc 100644
--- a/dirsrvtests/tests/suites/password/pwdPolicy_test.py
+++ b/dirsrvtests/tests/suites/password/pwdPolicy_test.py
@@ -21,23 +21,38 @@ from lib389.tasks import *
logging.getLogger(__name__).setLevel(logging.DEBUG)
log = logging.getLogger(__name__)
-installation1_prefix = None
+from lib389.config import RSA, Encryption, Config
+
+DEBUGGING = False
+
+USER_DN = 'uid=user,ou=People,%s' % DEFAULT_SUFFIX
+
+if DEBUGGING:
+ logging.getLogger(__name__).setLevel(logging.DEBUG)
+else:
+ logging.getLogger(__name__).setLevel(logging.INFO)
+
+
+log = logging.getLogger(__name__)
class TopologyStandalone(object):
+ """The DS Topology Class"""
def __init__(self, standalone):
+ """Init"""
standalone.open()
self.standalone = standalone
@pytest.fixture(scope="module")
def topology(request):
- global installation1_prefix
- if installation1_prefix:
- args_instance[SER_DEPLOYED_DIR] = installation1_prefix
+ """Create DS Deployment"""
# Creating standalone instance ...
- standalone = DirSrv(verbose=False)
+ if DEBUGGING:
+ standalone = DirSrv(verbose=True)
+ else:
+ standalone = DirSrv(verbose=False)
args_instance[SER_HOST] = HOST_STANDALONE
args_instance[SER_PORT] = PORT_STANDALONE
args_instance[SER_SERVERID_PROP] = SERVERID_STANDALONE
@@ -50,33 +65,87 @@ def topology(request):
standalone.create()
standalone.open()
+ # Deploy certs
+ # This is a trick. The nss db that ships with DS is broken
+ for f in ('key3.db', 'cert8.db', 'key4.db', 'cert9.db', 'secmod.db', 'pkcs11.txt'):
+ try:
+ os.remove("%s/%s" % (topology.standalone.confdir, f ))
+ except:
+ pass
+
+ assert(standalone.nss_ssl.reinit() is True)
+ assert(standalone.nss_ssl.create_rsa_ca() is True)
+ assert(standalone.nss_ssl.create_rsa_key_and_cert() is True)
+
+ # Say that we accept the cert
+ # Connect again!
+
+ # Enable the SSL options
+ standalone.rsa.create()
+ standalone.rsa.set('nsSSLPersonalitySSL', 'Server-Cert')
+ standalone.rsa.set('nsSSLToken', 'internal (software)')
+ standalone.rsa.set('nsSSLActivation', 'on')
+
+ standalone.config.set('nsslapd-secureport', PORT_STANDALONE2)
+ standalone.config.set('nsslapd-security', 'on')
+
+ standalone.restart()
+
+
+ def fin():
+ """If we are debugging just stop the instances, otherwise remove
+ them
+ """
+ if DEBUGGING:
+ standalone.stop()
+ else:
+ standalone.delete()
+
+ request.addfinalizer(fin)
+
# Clear out the tmp dir
standalone.clearTmpDir(__file__)
return TopologyStandalone(standalone)
+def _create_user(inst):
+ inst.add_s(Entry((
+ USER_DN, {
+ 'objectClass': 'top account simplesecurityobject'.split(),
+ 'uid': 'user',
+ 'userpassword': 'password'
+ })))
+
-def test_pwdPolicy_init(topology):
+def test_pwdPolicy_constraint(topology):
'''
- Init the test suite (if necessary)
+ Password policy test: Ensure that on a password change, the policy is
+ enforced correctly.
'''
- return
-
-def test_pwdPolicy_final(topology):
- topology.standalone.delete()
- log.info('Password Policy test suite PASSED')
-
-
-def run_isolated():
- global installation1_prefix
- installation1_prefix = None
-
- topo = topology(True)
- test_pwdPolicy_init(topo)
- test_pwdPolicy_final(topo)
+ # Create a user
+ _create_user(topology.standalone)
+ # Set the password policy globally
+ topology.standalone.config.set('passwordMinLength', '10')
+ topology.standalone.config.set('passwordMinDigits', '2')
+ topology.standalone.config.set('passwordCheckSyntax', 'on')
+ topology.standalone.config.set('nsslapd-pwpolicy-local', 'off')
+ # Now open a new ldap connection with TLS
+ userconn = ldap.initialize("ldap://%s:%s" % (HOST_STANDALONE, PORT_STANDALONE))
+ userconn.set_option(ldap.OPT_X_TLS_REQUIRE_CERT, ldap. OPT_X_TLS_NEVER )
+ userconn.start_tls_s()
+ userconn.simple_bind_s(USER_DN, 'password')
+ # This should have an exception!
+ try:
+ userconn.passwd_s(USER_DN, 'password', 'password1')
+ assert(False)
+ except ldap.CONSTRAINT_VIOLATION:
+ assert(True)
+ # Change the password to something invalid!
if __name__ == '__main__':
- run_isolated()
-
+ # Run isolated
+ # -s for DEBUG mode
+ CURRENT_FILE = os.path.realpath(__file__)
+ pytest.main("-s %s" % CURRENT_FILE)
| 0 |
bc7df12bbdeade5ba5115e5ea900d16ddd23c046
|
389ds/389-ds-base
|
DN normalizer should check the invalid type
File: ldap/servers/slapd/dn.c
Description: slapi_dn_normalize_ext failed to check a typical
invald DN (e.g., "bogus,dc=example,dc=com"), in which RDN does
not have the type=value format. The problem is fixed.
|
commit bc7df12bbdeade5ba5115e5ea900d16ddd23c046
Author: Noriko Hosoi <[email protected]>
Date: Tue Aug 31 13:57:04 2010 -0700
DN normalizer should check the invalid type
File: ldap/servers/slapd/dn.c
Description: slapi_dn_normalize_ext failed to check a typical
invald DN (e.g., "bogus,dc=example,dc=com"), in which RDN does
not have the type=value format. The problem is fixed.
diff --git a/ldap/servers/slapd/dn.c b/ldap/servers/slapd/dn.c
index a163fb357..54ddac101 100644
--- a/ldap/servers/slapd/dn.c
+++ b/ldap/servers/slapd/dn.c
@@ -564,6 +564,10 @@ slapi_dn_normalize_ext(char *src, size_t src_len, char **dest, size_t *dest_len)
*d++ = *s++;
} else if (ISSPACE(*s)) {
state = B4EQUAL; /* skip a trailing space */
+ } else if (ISQUOTE(*s) || SEPARATOR(*s)) {
+ /* type includes quote / separator; not a valid dn */
+ rc = -1;
+ goto bail;
} else {
*d++ = *s++;
}
| 0 |
ea4fa549e6daeba648ce11c8c2ce4e7688ffab7b
|
389ds/389-ds-base
|
Issue 50909 - nsDS5ReplicaId cant be set to the old value it had before
Bug Description: We were not handling the process of changing the replica
type and id correctly. For one, we were not correctly
handling a change to a hub/consumer, but it just happened
to work by accident in most cases. In other caes you
could not change the rid more than once.
Fix Description: Changed the value checking to allow ID changes to 65535
which allowed the type/id pointers to be set correctly.
Then the checking of the type & ID change combination had
to be revised.
Also, removed the option to get just set the RID or type
from dsconf. Only replication promotion/demotion should
be touching these values.
relates: https://pagure.io/389-ds-base/issue/50909
Reviewed by: firstyear & tbordaz(Thanks!!)
|
commit ea4fa549e6daeba648ce11c8c2ce4e7688ffab7b
Author: Mark Reynolds <[email protected]>
Date: Mon Feb 24 15:32:03 2020 -0500
Issue 50909 - nsDS5ReplicaId cant be set to the old value it had before
Bug Description: We were not handling the process of changing the replica
type and id correctly. For one, we were not correctly
handling a change to a hub/consumer, but it just happened
to work by accident in most cases. In other caes you
could not change the rid more than once.
Fix Description: Changed the value checking to allow ID changes to 65535
which allowed the type/id pointers to be set correctly.
Then the checking of the type & ID change combination had
to be revised.
Also, removed the option to get just set the RID or type
from dsconf. Only replication promotion/demotion should
be touching these values.
relates: https://pagure.io/389-ds-base/issue/50909
Reviewed by: firstyear & tbordaz(Thanks!!)
diff --git a/dirsrvtests/tests/suites/replication/replica_config_test.py b/dirsrvtests/tests/suites/replication/replica_config_test.py
index 185514380..c2140a2ac 100644
--- a/dirsrvtests/tests/suites/replication/replica_config_test.py
+++ b/dirsrvtests/tests/suites/replication/replica_config_test.py
@@ -43,7 +43,7 @@ agmt_dict = {'cn': 'test_agreement',
repl_add_attrs = [('nsDS5ReplicaType', '-1', '4', overflow, notnum, '1'),
('nsDS5Flags', '-1', '2', overflow, notnum, '1'),
- ('nsDS5ReplicaId', '0', '65535', overflow, notnum, '1'),
+ ('nsDS5ReplicaId', '0', '65536', overflow, notnum, '1'),
('nsds5ReplicaPurgeDelay', '-2', too_big, overflow, notnum, '1'),
('nsDS5ReplicaBindDnGroupCheckInterval', '-2', too_big, overflow, notnum, '1'),
('nsds5ReplicaTombstonePurgeInterval', '-2', too_big, overflow, notnum, '1'),
diff --git a/ldap/servers/plugins/replication/repl5_replica_config.c b/ldap/servers/plugins/replication/repl5_replica_config.c
index 02b36f6ad..d64d4bf45 100644
--- a/ldap/servers/plugins/replication/repl5_replica_config.c
+++ b/ldap/servers/plugins/replication/repl5_replica_config.c
@@ -461,7 +461,7 @@ replica_config_modify(Slapi_PBlock *pb,
}
} else if (strcasecmp(config_attr, attr_replicaId) == 0) {
int64_t rid = 0;
- if (repl_config_valid_num(config_attr, config_attr_value, 1, 65534, returncode, errortext, &rid) == 0) {
+ if (repl_config_valid_num(config_attr, config_attr_value, 1, MAX_REPLICA_ID, returncode, errortext, &rid) == 0) {
slapi_ch_free_string(&new_repl_id);
new_repl_id = slapi_ch_strdup(config_attr_value);
} else {
@@ -890,7 +890,7 @@ replica_config_search(Slapi_PBlock *pb,
static int
replica_config_change_type_and_id(Replica *r, const char *new_type, const char *new_id, char *returntext, int apply_mods)
{
- int type;
+ int type = REPLICA_TYPE_READONLY; /* by default - replica is read-only */
ReplicaType oldtype;
ReplicaId rid;
ReplicaId oldrid;
@@ -899,21 +899,21 @@ replica_config_change_type_and_id(Replica *r, const char *new_type, const char *
oldtype = replica_get_type(r);
oldrid = replica_get_rid(r);
- if (new_type == NULL) /* by default - replica is read-only */
- {
- type = REPLICA_TYPE_READONLY;
+ if (new_type == NULL) {
+ if (oldtype) {
+ type = oldtype;
+ }
} else {
type = atoi(new_type);
if (type <= REPLICA_TYPE_UNKNOWN || type >= REPLICA_TYPE_END) {
PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE, "invalid replica type %d", type);
return LDAP_OPERATIONS_ERROR;
}
- }
-
- /* disallow changing type to itself just to permit a replica ID change */
- if (oldtype == type) {
- PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE, "replica type is already %d - not changing", type);
- return LDAP_OPERATIONS_ERROR;
+ /* disallow changing type to itself just to permit a replica ID change */
+ if (oldtype == type) {
+ PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE, "replica type is already %d - not changing", type);
+ return LDAP_OPERATIONS_ERROR;
+ }
}
if (type == REPLICA_TYPE_READONLY) {
diff --git a/src/lib389/lib389/cli_conf/replication.py b/src/lib389/lib389/cli_conf/replication.py
index 7acbb33c3..1c0c9253d 100644
--- a/src/lib389/lib389/cli_conf/replication.py
+++ b/src/lib389/lib389/cli_conf/replication.py
@@ -1189,9 +1189,6 @@ def create_parser(subparsers):
repl_set_parser = repl_subcommands.add_parser('set', help='Set an attribute in the replication configuration')
repl_set_parser.set_defaults(func=set_repl_config)
repl_set_parser.add_argument('--suffix', required=True, help='The DN of the replication suffix')
- repl_set_parser.add_argument('--replica-id', help="The Replication Identifier number")
- repl_set_parser.add_argument('--replica-role', help="The Replication role: master, hub, or consumer")
-
repl_set_parser.add_argument('--repl-add-bind-dn', help="Add a bind (supplier) DN")
repl_set_parser.add_argument('--repl-del-bind-dn', help="Remove a bind (supplier) DN")
repl_set_parser.add_argument('--repl-add-ref', help="Add a replication referral (for consumers only)")
| 0 |
39fe2ae448b0a434333868b0676da60bfd3709d2
|
389ds/389-ds-base
|
Ticket 20 - Use the DN_DM constant instead of hard coding its value
Bug Description: We have defined the DN_DM string constant but we hard code
its value in a few places instead of using it.
Fix Description: Replace the hard coded occurrences with the DN_DM constant.
https://pagure.io/lib389/issue/20
Author: Ilias95
Review by: wibrown (Thanks for your patch!)
|
commit 39fe2ae448b0a434333868b0676da60bfd3709d2
Author: Ilias Stamatis <[email protected]>
Date: Mon Apr 10 04:09:33 2017 +0300
Ticket 20 - Use the DN_DM constant instead of hard coding its value
Bug Description: We have defined the DN_DM string constant but we hard code
its value in a few places instead of using it.
Fix Description: Replace the hard coded occurrences with the DN_DM constant.
https://pagure.io/lib389/issue/20
Author: Ilias95
Review by: wibrown (Thanks for your patch!)
diff --git a/src/lib389/cli/dsconf b/src/lib389/cli/dsconf
index 36834fa6b..7b60a1099 100755
--- a/src/lib389/cli/dsconf
+++ b/src/lib389/cli/dsconf
@@ -17,7 +17,7 @@ import sys
logging.basicConfig(format='%(message)s')
from lib389 import DirSrv
-from lib389._constants import DN_CONFIG
+from lib389._constants import DN_CONFIG, DN_DM
from lib389.cli_conf import backend as cli_backend
from lib389.cli_conf import plugin as cli_plugin
from lib389.cli_conf import schema as cli_schema
@@ -44,7 +44,7 @@ if __name__ == '__main__':
)
parser.add_argument('-D', '--binddn',
help="The account to bind as for executing operations",
- default='cn=Directory Manager',
+ default=DN_DM,
)
parser.add_argument('-Z', '--starttls',
help="Connect with StartTLS",
diff --git a/src/lib389/cli/dsidm b/src/lib389/cli/dsidm
index c615415e5..e253b4d6a 100755
--- a/src/lib389/cli/dsidm
+++ b/src/lib389/cli/dsidm
@@ -16,6 +16,7 @@ import logging
# This has to happen before we import DirSrv else it tramples our config ... :(
logging.basicConfig(format='%(message)s')
+from lib389._constants import DN_DM
from lib389.cli_idm import initialise as cli_init
from lib389.cli_idm import organisationalunit as cli_ou
from lib389.cli_idm import group as cli_group
@@ -46,7 +47,7 @@ if __name__ == '__main__':
)
parser.add_argument('-D', '--binddn',
help="The account to bind as for executing operations",
- default='cn=Directory Manager',
+ default=DN_DM,
)
parser.add_argument('-Z', '--starttls',
help="Connect with StartTLS",
| 0 |
b45cd0825069c69c30e4cfef21d90b59f15fa370
|
389ds/389-ds-base
|
Issue 5142 - CLI - dsctl dbgen is broken
Description:
Changes to dsctl broke dbgen which requires instance.userid to
set the permissions of the ldif file. It occurred when we added:
local_simple_allocate(). The fix is add userid in this allocate
function.
relates: https://github.com/389ds/389-ds-base/issues/5142
Reviewed by: progier(Thanks!)
|
commit b45cd0825069c69c30e4cfef21d90b59f15fa370
Author: Mark Reynolds <[email protected]>
Date: Thu Feb 3 16:06:07 2022 -0500
Issue 5142 - CLI - dsctl dbgen is broken
Description:
Changes to dsctl broke dbgen which requires instance.userid to
set the permissions of the ldif file. It occurred when we added:
local_simple_allocate(). The fix is add userid in this allocate
function.
relates: https://github.com/389ds/389-ds-base/issues/5142
Reviewed by: progier(Thanks!)
diff --git a/src/lib389/lib389/__init__.py b/src/lib389/lib389/__init__.py
index f781cab7b..52638bfb6 100644
--- a/src/lib389/lib389/__init__.py
+++ b/src/lib389/lib389/__init__.py
@@ -444,6 +444,7 @@ class DirSrv(SimpleLDAPObject, object):
self.isLocal = True
self.ds_paths = Paths(serverid, instance=self, local=self.isLocal)
self.serverid = serverid
+ self.userid = self.ds_paths.user
# Do we have ldapi settings?
self.ldapi_enabled = None
@@ -545,7 +546,7 @@ class DirSrv(SimpleLDAPObject, object):
self.host = ldapuri_parsed.hostname
try:
self.port = ldapuri_parsed.port
- except ValueError as e:
+ except ValueError:
self.port = DEFAULT_PORT
else:
self.host = args.get(SER_HOST, socket.gethostname())
@@ -3029,7 +3030,6 @@ class DirSrv(SimpleLDAPObject, object):
else:
return False
-
def is_dbi(self, dbipattern):
try:
cmd = ["%s/dbscan" % self.get_bin_dir(),
@@ -3045,7 +3045,6 @@ class DirSrv(SimpleLDAPObject, object):
self.log.debug("is_dbi output is: " + output)
return dbipattern.lower() in output.lower()
-
def dbscan(self, bename=None, index=None, key=None, width=None, isRaw=False):
"""Wrapper around dbscan tool that analyzes and extracts information
| 0 |
ac772cd4cb7dc71710fd433e9e89a593bec61db4
|
389ds/389-ds-base
|
Resolves: bug 301431
Description: Show-Stopper - Migration path rhel21_ds621_TO_rhel4_32bit
Fix Description: not actually a fix, but with -dd this will print out the entries that were ignored during migration, which should be the presence plugin config entries and possibly others
|
commit ac772cd4cb7dc71710fd433e9e89a593bec61db4
Author: Rich Megginson <[email protected]>
Date: Sat Sep 22 03:34:06 2007 +0000
Resolves: bug 301431
Description: Show-Stopper - Migration path rhel21_ds621_TO_rhel4_32bit
Fix Description: not actually a fix, but with -dd this will print out the entries that were ignored during migration, which should be the presence plugin config entries and possibly others
diff --git a/ldap/admin/src/scripts/DSMigration.pm.in b/ldap/admin/src/scripts/DSMigration.pm.in
index 6f5294d33..b6d5a7f5d 100644
--- a/ldap/admin/src/scripts/DSMigration.pm.in
+++ b/ldap/admin/src/scripts/DSMigration.pm.in
@@ -625,6 +625,8 @@ sub mergeConfigEntries {
fixAttrsInEntry($oldent, $mig, $inst);
$rc = $dest->add($oldent);
$op = "add";
+ } else {
+ debug(2, "Ignoring entry $dn - configuration not supported\n");
}
} elsif (!$oldent && $newent) {
if ($dn =~ /o=deleteAfterMigration/i) {
| 0 |
9545e36805201ac0e3172b762373c6df741c2721
|
389ds/389-ds-base
|
Make the build/pull work like the adminserver does with respect to console. Otherwise, dsbuild with recent code no longer works.
|
commit 9545e36805201ac0e3172b762373c6df741c2721
Author: Rich Megginson <[email protected]>
Date: Sat Apr 8 19:29:35 2006 +0000
Make the build/pull work like the adminserver does with respect to console. Otherwise, dsbuild with recent code no longer works.
diff --git a/buildpaths.mk b/buildpaths.mk
index 7b24e51c8..4b77c69fc 100644
--- a/buildpaths.mk
+++ b/buildpaths.mk
@@ -139,7 +139,7 @@ SETUPUTIL_SOURCE_ROOT = $(BUILD_ROOT)/../setuputil
ADMINSERVER_SOURCE_ROOT = $(BUILD_ROOT)/../adminserver
-LDAPCONSOLE_SOURCE_ROOT = $(BUILD_ROOT)/../directoryconsole
+LDAPCONSOLE_SOURCE_ROOT = $(BUILD_ROOT)/..
# these are the files needed to build the java components - xmltools and dsmlgw -
# and where to get them
diff --git a/components.mk b/components.mk
index 8951de801..32fc01fed 100644
--- a/components.mk
+++ b/components.mk
@@ -569,7 +569,7 @@ ADMINSERVER_PKG:=admserv.tar.gz
ADMINSERVER_SUBCOMPS:=admin base
ifdef LDAPCONSOLE_SOURCE_ROOT
- LDAPCONSOLE_DIR = $(ABS_ROOT)/../built/package
+ LDAPCONSOLE_DIR = $(LDAPCONSOLE_SOURCE_ROOT)/built/package
else
LDAPCONSOLE_DIR = $(CLASS_DEST)
endif
| 0 |
575d9e293ea92ba1079163f4cb3c6dca933bd3fa
|
389ds/389-ds-base
|
Ticket 49413 - Changelog trimming ignores disabled replica-agreement
Bug: if a replication agreement is disabled it is not taken into account when
changelog trimming determines where to stop.
If the agreement is reenabled later replication can fail
Fix: do not ignore disabled agreements in changelog trimming
Reviewed by: Thierry, thanks
|
commit 575d9e293ea92ba1079163f4cb3c6dca933bd3fa
Author: Ludwig Krispenz <[email protected]>
Date: Tue Nov 14 11:25:18 2017 +0100
Ticket 49413 - Changelog trimming ignores disabled replica-agreement
Bug: if a replication agreement is disabled it is not taken into account when
changelog trimming determines where to stop.
If the agreement is reenabled later replication can fail
Fix: do not ignore disabled agreements in changelog trimming
Reviewed by: Thierry, thanks
diff --git a/ldap/servers/plugins/replication/cl5_api.c b/ldap/servers/plugins/replication/cl5_api.c
index 721013abf..dc2857910 100644
--- a/ldap/servers/plugins/replication/cl5_api.c
+++ b/ldap/servers/plugins/replication/cl5_api.c
@@ -4283,12 +4283,10 @@ _cl5GetRUV2Purge2(Object *fileObj, RUV **ruv)
while (agmtObj) {
agmt = (Repl_Agmt *)object_get_data(agmtObj);
PR_ASSERT(agmt);
-
- if (!agmt_is_enabled(agmt)) {
- agmtObj = agmtlist_get_next_agreement_for_replica(r, agmtObj);
- continue;
- }
-
+ /* we need to handle all agreements, also if they are not enabled
+ * if they will be later enabled and changes are trimmed
+ * replication can fail
+ */
consRUVObj = agmt_get_consumer_ruv(agmt);
if (consRUVObj) {
consRUV = (RUV *)object_get_data(consRUVObj);
| 0 |
88134974278ca267e67e8f05aa487b487e9d607c
|
389ds/389-ds-base
|
Add check for the new "stress" directory for "getDir()", and added a new function to open a new connection to the server
|
commit 88134974278ca267e67e8f05aa487b487e9d607c
Author: Mark Reynolds <[email protected]>
Date: Mon Mar 16 11:46:55 2015 -0400
Add check for the new "stress" directory for "getDir()", and added a new function to open a new connection to the server
diff --git a/src/lib389/lib389/__init__.py b/src/lib389/lib389/__init__.py
index e10990916..42df56625 100644
--- a/src/lib389/lib389/__init__.py
+++ b/src/lib389/lib389/__init__.py
@@ -448,6 +448,18 @@ class DirSrv(SimpleLDAPObject):
self.host,
self.sslport or self.port))
+ def openConnection(self):
+ # Open a new connection to our LDAP server
+ server = DirSrv(verbose=False)
+ args_instance[SER_HOST] = self.host
+ args_instance[SER_PORT] = self.port
+ args_instance[SER_SERVERID_PROP] = self.serverid
+ args_standalone = args_instance.copy()
+ server.allocate(args_standalone)
+ server.open()
+
+ return server
+
def list(self, all=False):
"""
Returns a list dictionary. For a created instance that is on the local file system
@@ -1997,6 +2009,8 @@ class DirSrv(SimpleLDAPObject):
idx = filename.find('/suites/')
elif '/tickets/' in filename:
idx = filename.find('/tickets/')
+ elif '/stress/' in filename:
+ idx = filename.find('/stress/')
else:
# Unknown script location
return None
| 0 |
eb5fde9fec8aae02dc585d0fec24ba9140025bc7
|
389ds/389-ds-base
|
Ticket 47710 - Missing warning for invalid replica backoff configuration
Bug Description: If you manaully edit the dse.ldif and set the minimum or
maximum backoff time to zero, a warning/error is not given.
At server startup the server thinks zero means the attribute
is not set, and then sets it to the default value without
logging a message.
Fix Description: Properly check if the attribute is present, and log an error
accordingly.
https://fedorahosted.org/389/ticket/47710
Jenkins: passed
Reviewed by: nhosoi(Thanks!)
|
commit eb5fde9fec8aae02dc585d0fec24ba9140025bc7
Author: Mark Reynolds <[email protected]>
Date: Tue Jul 15 12:34:02 2014 -0400
Ticket 47710 - Missing warning for invalid replica backoff configuration
Bug Description: If you manaully edit the dse.ldif and set the minimum or
maximum backoff time to zero, a warning/error is not given.
At server startup the server thinks zero means the attribute
is not set, and then sets it to the default value without
logging a message.
Fix Description: Properly check if the attribute is present, and log an error
accordingly.
https://fedorahosted.org/389/ticket/47710
Jenkins: passed
Reviewed by: nhosoi(Thanks!)
diff --git a/ldap/servers/plugins/replication/repl5_replica.c b/ldap/servers/plugins/replication/repl5_replica.c
index b6e7be050..dab1c4eb0 100644
--- a/ldap/servers/plugins/replication/repl5_replica.c
+++ b/ldap/servers/plugins/replication/repl5_replica.c
@@ -1839,23 +1839,28 @@ _replica_init_from_config (Replica *r, Slapi_Entry *e, char *errortext)
}
/* grab and validate the backoff retry settings */
- backoff_min = slapi_entry_attr_get_int(e, type_replicaBackoffMin);
- if(backoff_min <= 0){
- if (backoff_min != 0){
+ if(slapi_entry_attr_exists(e, type_replicaBackoffMin)){
+ backoff_min = slapi_entry_attr_get_int(e, type_replicaBackoffMin);
+ if(backoff_min <= 0){
slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "Invalid value for %s: %d Using default value (%d)\n",
- type_replicaBackoffMin, backoff_min, PROTOCOL_BACKOFF_MINIMUM );
+ type_replicaBackoffMin, backoff_min, PROTOCOL_BACKOFF_MINIMUM );
+ backoff_min = PROTOCOL_BACKOFF_MINIMUM;
}
+ } else {
backoff_min = PROTOCOL_BACKOFF_MINIMUM;
}
- backoff_max = slapi_entry_attr_get_int(e, type_replicaBackoffMax);
- if(backoff_max <= 0){
- if(backoff_max != 0) {
+ if(slapi_entry_attr_exists(e, type_replicaBackoffMax)){
+ backoff_max = slapi_entry_attr_get_int(e, type_replicaBackoffMax);
+ if(backoff_max <= 0){
slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "Invalid value for %s: %d Using default value (%d)\n",
- type_replicaBackoffMax, backoff_max, PROTOCOL_BACKOFF_MAXIMUM );
+ type_replicaBackoffMax, backoff_max, PROTOCOL_BACKOFF_MAXIMUM );
+ backoff_max = PROTOCOL_BACKOFF_MAXIMUM;
}
+ } else {
backoff_max = PROTOCOL_BACKOFF_MAXIMUM;
}
+
if(backoff_min > backoff_max){
/* Ok these values are invalid, reset back the defaults */
slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "Backoff minimum (%d) can not be greater than "
diff --git a/ldap/servers/slapd/entry.c b/ldap/servers/slapd/entry.c
index 25549a794..718d78ad7 100644
--- a/ldap/servers/slapd/entry.c
+++ b/ldap/servers/slapd/entry.c
@@ -3123,11 +3123,21 @@ slapi_entry_attr_set_ulong( Slapi_Entry* e, const char *type, unsigned long l)
slapi_entry_attr_replace( e, type, bvals );
}
+int
+slapi_entry_attr_exists(Slapi_Entry *e, const char *type)
+{
+ Slapi_Attr *attr;
+
+ if(slapi_entry_attr_find(e, type, &attr) == 0){
+ return 1;
+ }
+ return 0;
+}
+
/* JCM: The strcasecmp below should really be a bervalcmp
* deprecatred in favour of slapi_entry_attr_has_syntax_value
* which does respect the syntax of the attribute type.
*/
-
SLAPI_DEPRECATED int
slapi_entry_attr_hasvalue(const Slapi_Entry *e, const char *type, const char *value) /* JCM - (const char *) => (struct berval *) */
{
diff --git a/ldap/servers/slapd/slapi-plugin.h b/ldap/servers/slapd/slapi-plugin.h
index cd179079e..b803f910c 100644
--- a/ldap/servers/slapd/slapi-plugin.h
+++ b/ldap/servers/slapd/slapi-plugin.h
@@ -1982,6 +1982,16 @@ void slapi_entry_attr_set_longlong( Slapi_Entry* e, const char *type, long long
*/
void slapi_entry_attr_set_ulong(Slapi_Entry* e, const char *type, unsigned long l);
+/**
+ * Check if an attribute is set in the entry
+ *
+ * \param e Entry that you want to check.
+ * \param type Attribute type that you want to test for the value specified.
+ * \return 1 if attribute is present in the entry
+ * \return 0 if the attribute is not present in the entry.
+ */
+int slapi_entry_attr_exists(Slapi_Entry *e, const char *type);
+
/**
* Determines if an attribute in an entry contains a specified value.
*
| 0 |
51bf2d258d097264d1d8c0d344ee40cbca09cc9d
|
389ds/389-ds-base
|
Bug 690584 - #10654 #10653 str2entry_dupcheck - fix coverity resource leak issues
https://bugzilla.redhat.com/show_bug.cgi?id=690584
Resolves: bug 690584
Bug Description: #10654 #10653 str2entry_dupcheck - fix coverity resource leak issues
Reviewed by: nkinder (Thanks!)
Branch: master
Fix Description: make sure to free maxcsn and attributedeletioncsn before they go
out of scope
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
|
commit 51bf2d258d097264d1d8c0d344ee40cbca09cc9d
Author: Rich Megginson <[email protected]>
Date: Fri Mar 25 09:58:33 2011 -0600
Bug 690584 - #10654 #10653 str2entry_dupcheck - fix coverity resource leak issues
https://bugzilla.redhat.com/show_bug.cgi?id=690584
Resolves: bug 690584
Bug Description: #10654 #10653 str2entry_dupcheck - fix coverity resource leak issues
Reviewed by: nkinder (Thanks!)
Branch: master
Fix Description: make sure to free maxcsn and attributedeletioncsn before they go
out of scope
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
diff --git a/ldap/servers/slapd/entry.c b/ldap/servers/slapd/entry.c
index a30bab187..a4a67a6fd 100644
--- a/ldap/servers/slapd/entry.c
+++ b/ldap/servers/slapd/entry.c
@@ -809,6 +809,7 @@ str2entry_dupcheck( const char *rawdn, char *s, int flags, int read_stateinfo )
slapi_entry_free( e );
if (freeval) slapi_ch_free_string(&bvvalue.bv_val);
csn_free(&attributedeletioncsn);
+ csn_free(&maxcsn);
return NULL;
}
/* normdn is consumed in e */
@@ -826,6 +827,7 @@ str2entry_dupcheck( const char *rawdn, char *s, int flags, int read_stateinfo )
slapi_entry_free( e );
if (freeval) slapi_ch_free_string(&bvvalue.bv_val);
csn_free(&attributedeletioncsn);
+ csn_free(&maxcsn);
return NULL;
}
/* normdn is just referred in slapi_entry_set_rdn. */
@@ -879,6 +881,7 @@ str2entry_dupcheck( const char *rawdn, char *s, int flags, int read_stateinfo )
if ( (flags & SLAPI_STR2ENTRY_NO_ENTRYDN) &&
strcasecmp( type, "entrydn" ) == 0 ) {
if (freeval) slapi_ch_free_string(&bvvalue.bv_val);
+ csn_free(&attributedeletioncsn);
continue;
}
@@ -939,6 +942,7 @@ str2entry_dupcheck( const char *rawdn, char *s, int flags, int read_stateinfo )
/* Something very bad happened */
if (freeval) slapi_ch_free_string(&bvvalue.bv_val);
csn_free(&attributedeletioncsn);
+ csn_free(&maxcsn);
return NULL;
}
for ( i = 0; i < nattrs; i++ )
| 0 |
8c524b4700238edba8a307a213ba81cb56a2b913
|
389ds/389-ds-base
|
Bug 630092 - Coverity #15481: Resource leaks issues
https://bugzilla.redhat.com/show_bug.cgi?id=630092
Description:
The acquire_replica() has been modified to release current_csn before
it returns.
|
commit 8c524b4700238edba8a307a213ba81cb56a2b913
Author: Endi Sukma Dewata <[email protected]>
Date: Tue Sep 14 22:54:03 2010 -0400
Bug 630092 - Coverity #15481: Resource leaks issues
https://bugzilla.redhat.com/show_bug.cgi?id=630092
Description:
The acquire_replica() has been modified to release current_csn before
it returns.
diff --git a/ldap/servers/plugins/replication/repl5_protocol_util.c b/ldap/servers/plugins/replication/repl5_protocol_util.c
index 02b16b505..16032b27a 100644
--- a/ldap/servers/plugins/replication/repl5_protocol_util.c
+++ b/ldap/servers/plugins/replication/repl5_protocol_util.c
@@ -121,6 +121,7 @@ acquire_replica(Private_Repl_Protocol *prp, char *prot_oid, RUV **ruv)
char *retoid = NULL;
Slapi_DN *replarea_sdn = NULL;
struct berval **ruv_bervals = NULL;
+ CSN *current_csn = NULL;
PR_ASSERT(prp && prot_oid);
@@ -176,8 +177,6 @@ acquire_replica(Private_Repl_Protocol *prp, char *prot_oid, RUV **ruv)
}
else
{
- CSN *current_csn = NULL;
-
/* we don't want the timer to go off in the middle of an operation */
conn_cancel_linger(conn);
@@ -276,8 +275,6 @@ acquire_replica(Private_Repl_Protocol *prp, char *prot_oid, RUV **ruv)
}
/* JCMREPL - Need to extract the referrals from the RUV */
- csn_free(¤t_csn);
- current_csn = NULL;
crc = conn_send_extended_operation(conn,
prp->repl90consumer ? REPL_START_NSDS90_REPLICATION_REQUEST_OID :
REPL_START_NSDS50_REPLICATION_REQUEST_OID, payload,
@@ -522,6 +519,7 @@ acquire_replica(Private_Repl_Protocol *prp, char *prot_oid, RUV **ruv)
}
error:
+ csn_free(¤t_csn);
if (NULL != ruv_bervals)
ber_bvecfree(ruv_bervals);
if (NULL != replarea_sdn)
| 0 |
6cb43822edfdb5260ce63c5d056f1b00112aa546
|
389ds/389-ds-base
|
Bug 610119 - fix coverify Defect Type: Null pointer dereferences issues 12167 - 12199
https://bugzilla.redhat.com/show_bug.cgi?id=610119
Resolves: bug 610119
Bug description: Fix coverify Defect Type: Null pointer dereferences issues 12167 - 12199
Fix description: Catch possible NULL pointer in check_entry_for_referral().
|
commit 6cb43822edfdb5260ce63c5d056f1b00112aa546
Author: Endi S. Dewata <[email protected]>
Date: Thu Jul 1 23:20:14 2010 -0500
Bug 610119 - fix coverify Defect Type: Null pointer dereferences issues 12167 - 12199
https://bugzilla.redhat.com/show_bug.cgi?id=610119
Resolves: bug 610119
Bug description: Fix coverify Defect Type: Null pointer dereferences issues 12167 - 12199
Fix description: Catch possible NULL pointer in check_entry_for_referral().
diff --git a/ldap/servers/slapd/back-ldbm/findentry.c b/ldap/servers/slapd/back-ldbm/findentry.c
index b3dfa0a7f..9c076f80b 100644
--- a/ldap/servers/slapd/back-ldbm/findentry.c
+++ b/ldap/servers/slapd/back-ldbm/findentry.c
@@ -49,37 +49,53 @@ check_entry_for_referral(Slapi_PBlock *pb, Slapi_Entry *entry, char *matched, co
{
int rc=0, i=0, numValues=0;
Slapi_Attr *attr;
+ Slapi_Value *val=NULL;
+ struct berval **refscopy=NULL;
+ struct berval **url=NULL;
/* if the entry is a referral send the referral */
- if ( slapi_entry_attr_find( entry, "ref", &attr ) == 0 )
+ if ( slapi_entry_attr_find( entry, "ref", &attr ) )
{
- Slapi_Value *val=NULL;
- struct berval **refscopy=NULL;
- struct berval **url=NULL;
- slapi_attr_get_numvalues(attr, &numValues );
- if(numValues > 0) {
- url=(struct berval **) slapi_ch_malloc((numValues + 1) * sizeof(struct berval*));
- }
- for (i = slapi_attr_first_value(attr, &val); i != -1;
- i = slapi_attr_next_value(attr, i, &val)) {
- url[i]=(struct berval*)slapi_value_get_berval(val);
- }
- url[numValues]=NULL;
- refscopy = ref_adjust( pb, url, slapi_entry_get_sdn(entry), 0 ); /* JCM - What's this PBlock* for? */
- slapi_send_ldap_result( pb, LDAP_REFERRAL, matched, NULL, 0, refscopy );
- LDAPDebug( LDAP_DEBUG_TRACE,
- "<= %s sent referral to (%s) for (%s)\n",
- callingfn,
- refscopy ? refscopy[0]->bv_val : "",
- slapi_entry_get_dn(entry));
- if ( refscopy != NULL )
- {
- ber_bvecfree( refscopy );
- }
- if( url != NULL) {
- slapi_ch_free( (void **)&url );
- }
- rc= 1;
+ // ref attribute not found
+ goto out;
+ }
+
+ slapi_attr_get_numvalues(attr, &numValues );
+ if(numValues == 0) {
+ // ref attribute is empty
+ goto out;
+ }
+
+ url=(struct berval **) slapi_ch_malloc((numValues + 1) * sizeof(struct berval*));
+ if (!url) {
+ LDAPDebug( LDAP_DEBUG_ANY,
+ "check_entry_for_referral: Out of memory\n",
+ 0, 0, 0);
+ goto out;
+ }
+
+ for (i = slapi_attr_first_value(attr, &val); i != -1;
+ i = slapi_attr_next_value(attr, i, &val)) {
+ url[i]=(struct berval*)slapi_value_get_berval(val);
+ }
+ url[numValues]=NULL;
+
+ refscopy = ref_adjust( pb, url, slapi_entry_get_sdn(entry), 0 ); /* JCM - What's this PBlock* for? */
+ slapi_send_ldap_result( pb, LDAP_REFERRAL, matched, NULL, 0, refscopy );
+ rc= 1;
+
+ LDAPDebug( LDAP_DEBUG_TRACE,
+ "<= %s sent referral to (%s) for (%s)\n",
+ callingfn,
+ refscopy ? refscopy[0]->bv_val : "",
+ slapi_entry_get_dn(entry));
+out:
+ if ( refscopy != NULL )
+ {
+ ber_bvecfree( refscopy );
+ }
+ if( url != NULL) {
+ slapi_ch_free( (void **)&url );
}
return rc;
}
| 0 |
916eb0da143eeb1745e9f67532255477eefbd3d7
|
389ds/389-ds-base
|
Coverity Fixes (Part 3)
11692 - Explicit null dereferenced (libavl/avl.c)
11695 - Explicit null dereferenced (cb_conn_stateless.c)
11696 - Explicit null dereferenced (memberof_config.c)
11697 - Explicit null dereferenced (memberof.c)
11698 - Explicit null dereferenced (memberof.c)
11699 - Explicit null dereferenced (memberof.c)
11700 - Explicit null dereferenced (memberof.c)
11701 - Explicit null dereferenced (cl5_api.c)
11702 - Explicit null dereferenced (cl5_api.c)
11703 - Dereference after null check (cl5_clcache.c)
11704 - Dereference after null check (repl5_replica_config.c)
11705 - Explicit null dereferenced (syntaxes/string.c)
11706 - Dereference after null check (plugin.c)
11707 - Dereference after null check (plugin.c)
11711 - Dereference after null check (ldif2ldbm.c)
11713 - Dereference after null check (dn.c)
11726 - Dereference after null check (valueset.c)
11729 - Explicit null dereferenced (libaccess/oneeval.cpp)
11744 - Explicit null dereferenced (dbverify.c)
11745 - Out-of-bounds read (linked_attrs.c)
11745 - Out-of-bounds read (memberof.c)
https://bugzilla.redhat.com/show_bug.cgi?id=970221
Reviewed by: richm(Thanks!)
|
commit 916eb0da143eeb1745e9f67532255477eefbd3d7
Author: Mark Reynolds <[email protected]>
Date: Wed Jun 5 12:15:05 2013 -0400
Coverity Fixes (Part 3)
11692 - Explicit null dereferenced (libavl/avl.c)
11695 - Explicit null dereferenced (cb_conn_stateless.c)
11696 - Explicit null dereferenced (memberof_config.c)
11697 - Explicit null dereferenced (memberof.c)
11698 - Explicit null dereferenced (memberof.c)
11699 - Explicit null dereferenced (memberof.c)
11700 - Explicit null dereferenced (memberof.c)
11701 - Explicit null dereferenced (cl5_api.c)
11702 - Explicit null dereferenced (cl5_api.c)
11703 - Dereference after null check (cl5_clcache.c)
11704 - Dereference after null check (repl5_replica_config.c)
11705 - Explicit null dereferenced (syntaxes/string.c)
11706 - Dereference after null check (plugin.c)
11707 - Dereference after null check (plugin.c)
11711 - Dereference after null check (ldif2ldbm.c)
11713 - Dereference after null check (dn.c)
11726 - Dereference after null check (valueset.c)
11729 - Explicit null dereferenced (libaccess/oneeval.cpp)
11744 - Explicit null dereferenced (dbverify.c)
11745 - Out-of-bounds read (linked_attrs.c)
11745 - Out-of-bounds read (memberof.c)
https://bugzilla.redhat.com/show_bug.cgi?id=970221
Reviewed by: richm(Thanks!)
diff --git a/ldap/libraries/libavl/avl.c b/ldap/libraries/libavl/avl.c
index 757789166..18c43e085 100644
--- a/ldap/libraries/libavl/avl.c
+++ b/ldap/libraries/libavl/avl.c
@@ -780,8 +780,11 @@ avl_getfirst( Avlnode *root )
return( 0 );
(void) avl_apply( root, avl_buildlist, (caddr_t) 0, -1, AVL_INORDER );
-
- return( avl_list[ avl_nextlist++ ] );
+ if(avl_list && avl_list[avl_nextlist++]){
+ return avl_list[avl_nextlist];
+ } else {
+ return( NULL );
+ }
}
caddr_t
diff --git a/ldap/servers/plugins/chainingdb/cb_conn_stateless.c b/ldap/servers/plugins/chainingdb/cb_conn_stateless.c
index a9abc3191..a85b39286 100644
--- a/ldap/servers/plugins/chainingdb/cb_conn_stateless.c
+++ b/ldap/servers/plugins/chainingdb/cb_conn_stateless.c
@@ -856,7 +856,7 @@ void cb_stale_all_connections( cb_backend_instance * cb)
else {
if (conn==pools[i]->conn.conn_list) {
pools[i]->conn.conn_list=next_conn;
- } else {
+ } else if(prev_conn){
prev_conn->next=next_conn;
}
cb_close_and_dispose_connection(conn);
diff --git a/ldap/servers/plugins/linkedattrs/linked_attrs.c b/ldap/servers/plugins/linkedattrs/linked_attrs.c
index ff3dc3a67..4bea10f17 100644
--- a/ldap/servers/plugins/linkedattrs/linked_attrs.c
+++ b/ldap/servers/plugins/linkedattrs/linked_attrs.c
@@ -1231,10 +1231,21 @@ linked_attrs_load_array(Slapi_Value **array, Slapi_Attr *attr)
int
linked_attrs_compare(const void *a, const void *b)
{
+ Slapi_Value *val1;
+ Slapi_Value *val2;
+ Slapi_Attr *linkattr;
int rc = 0;
- Slapi_Value *val1 = *((Slapi_Value **)a);
- Slapi_Value *val2 = *((Slapi_Value **)b);
- Slapi_Attr *linkattr = slapi_attr_new();
+
+ if(a == NULL && b != NULL){
+ return 1;
+ } else if(a != NULL && b == NULL){
+ return -1;
+ } else if(a == NULL && b == NULL){
+ return 0;
+ }
+ val1 = *((Slapi_Value **)a);
+ val2 = *((Slapi_Value **)b);
+ linkattr = slapi_attr_new();
slapi_attr_init(linkattr, "distinguishedName");
diff --git a/ldap/servers/plugins/memberof/memberof.c b/ldap/servers/plugins/memberof/memberof.c
index 1c50b6784..e362cab63 100644
--- a/ldap/servers/plugins/memberof/memberof.c
+++ b/ldap/servers/plugins/memberof/memberof.c
@@ -460,7 +460,7 @@ memberof_del_dn_from_groups(Slapi_PBlock *pb, MemberOfConfig *config, Slapi_DN *
/* Loop through each grouping attribute to find groups that have
* dn as a member. For any matches, delete the dn value from the
* same grouping attribute. */
- for (i = 0; config->groupattrs[i]; i++)
+ for (i = 0; config->groupattrs && config->groupattrs[i]; i++)
{
memberof_del_dn_data data = {(char *)slapi_sdn_get_dn(sdn),
config->groupattrs[i]};
@@ -724,7 +724,7 @@ memberof_replace_dn_from_groups(Slapi_PBlock *pb, MemberOfConfig *config,
/* Loop through each grouping attribute to find groups that have
* pre_dn as a member. For any matches, replace pre_dn with post_dn
* using the same grouping attribute. */
- for (i = 0; config->groupattrs[i]; i++)
+ for (i = 0; config->groupattrs && config->groupattrs[i]; i++)
{
replace_dn_data data = {(char *)slapi_sdn_get_ndn(pre_sdn),
(char *)slapi_sdn_get_ndn(post_sdn),
@@ -2218,8 +2218,18 @@ void memberof_load_array(Slapi_Value **array, Slapi_Attr *attr)
*/
int memberof_compare(MemberOfConfig *config, const void *a, const void *b)
{
- Slapi_Value *val1 = *((Slapi_Value **)a);
- Slapi_Value *val2 = *((Slapi_Value **)b);
+ Slapi_Value *val1;
+ Slapi_Value *val2;
+
+ if(a == NULL && b != NULL){
+ return 1;
+ } else if(a != NULL && b == NULL){
+ return -1;
+ } else if(a == NULL && b == NULL){
+ return 0;
+ }
+ val1 = *((Slapi_Value **)a);
+ val2 = *((Slapi_Value **)b);
/* We only need to provide a Slapi_Attr here for it's syntax. We
* already validated all grouping attributes to use the Distinguished
diff --git a/ldap/servers/plugins/memberof/memberof_config.c b/ldap/servers/plugins/memberof/memberof_config.c
index b4d557ab6..3fd63a95e 100644
--- a/ldap/servers/plugins/memberof/memberof_config.c
+++ b/ldap/servers/plugins/memberof/memberof_config.c
@@ -486,7 +486,7 @@ memberof_free_config(MemberOfConfig *config)
slapi_ch_array_free(config->groupattrs);
slapi_filter_free(config->group_filter, 1);
- for (i = 0; config->group_slapiattrs[i]; i++)
+ for (i = 0; config->group_slapiattrs && config->group_slapiattrs[i]; i++)
{
slapi_attr_free(&config->group_slapiattrs[i]);
}
diff --git a/ldap/servers/plugins/replication/cl5_api.c b/ldap/servers/plugins/replication/cl5_api.c
index 885e3a18a..63b2b9905 100644
--- a/ldap/servers/plugins/replication/cl5_api.c
+++ b/ldap/servers/plugins/replication/cl5_api.c
@@ -3547,6 +3547,13 @@ static void _cl5TrimFile (Object *obj, long *numToTrim, ReplicaId cleaned_rid)
* This change can be trimmed if it exceeds purge
* parameters and has been seen by all consumers.
*/
+ if(op.csn == NULL){
+ slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name_cl, "_cl5TrimFile: "
+ "Operation missing csn, moving on to next entry.\n");
+ cl5_operation_parameters_done (&op);
+ finished =_cl5GetNextEntry (&entry, it);
+ continue;
+ }
csn_rid = csn_get_replicaid (op.csn);
if ( (*numToTrim > 0 || _cl5CanTrim (entry.time, numToTrim)) &&
ruv_covers_csn_strict (ruv, op.csn) )
@@ -3876,7 +3883,15 @@ static int _cl5ConstructRUV (const char *replGen, Object *obj, PRBool purge)
rc = _cl5GetFirstEntry (obj, &entry, &iterator, NULL);
while (rc == CL5_SUCCESS)
{
- rid = csn_get_replicaid (op.csn);
+ if(op.csn){
+ rid = csn_get_replicaid (op.csn);
+ } else {
+ slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name_cl, "_cl5ConstructRUV: "
+ "Operation missing csn, moving on to next entry.\n");
+ cl5_operation_parameters_done (&op);
+ rc = _cl5GetNextEntry (&entry, iterator);
+ continue;
+ }
if(is_cleaned_rid(rid)){
/* skip this entry as the rid is invalid */
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name_cl, "_cl5ConstructRUV: "
diff --git a/ldap/servers/plugins/replication/cl5_clcache.c b/ldap/servers/plugins/replication/cl5_clcache.c
index 202cb64e1..738e4cb97 100644
--- a/ldap/servers/plugins/replication/cl5_clcache.c
+++ b/ldap/servers/plugins/replication/cl5_clcache.c
@@ -732,9 +732,14 @@ clcache_skip_change ( CLC_Buffer *buf )
*/
if ( csn_time_difference(buf->buf_current_csn, cscb->local_maxcsn) == 0 &&
(csn_get_seqnum(buf->buf_current_csn) ==
- csn_get_seqnum(cscb->local_maxcsn) + 1) ) {
- csn_init_by_csn ( cscb->local_maxcsn, buf->buf_current_csn );
- csn_init_by_csn ( cscb->consumer_maxcsn, buf->buf_current_csn );
+ csn_get_seqnum(cscb->local_maxcsn) + 1) )
+ {
+ if(cscb->local_maxcsn){
+ csn_init_by_csn ( cscb->local_maxcsn, buf->buf_current_csn );
+ }
+ if(cscb->consumer_maxcsn){
+ csn_init_by_csn ( cscb->consumer_maxcsn, buf->buf_current_csn );
+ }
skip = 0;
break;
}
diff --git a/ldap/servers/plugins/replication/repl5_replica_config.c b/ldap/servers/plugins/replication/repl5_replica_config.c
index 58285f900..cc0a93f1f 100644
--- a/ldap/servers/plugins/replication/repl5_replica_config.c
+++ b/ldap/servers/plugins/replication/repl5_replica_config.c
@@ -2468,6 +2468,11 @@ delete_cleaned_rid_config(cleanruv_data *clean_data)
int found = 0, i;
int rc, ret, rid;
+ if(clean_data == NULL){
+ slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "delete_cleaned_rid_config: cleanruv data is NULL, "
+ "failed to clean the config.\n");
+ return;
+ }
/*
* If there is no maxcsn, set the proper csnstr
*/
diff --git a/ldap/servers/plugins/syntaxes/string.c b/ldap/servers/plugins/syntaxes/string.c
index 54cd7c853..6c0da946f 100644
--- a/ldap/servers/plugins/syntaxes/string.c
+++ b/ldap/servers/plugins/syntaxes/string.c
@@ -84,7 +84,11 @@ string_filter_ava( struct berval *bvfilter, Slapi_Value **bvals, int syntax,
bvfilter_norm.bv_val = alt;
alt = NULL;
}
- bvfilter_norm.bv_len = strlen(bvfilter_norm.bv_val);
+ if(bvfilter_norm.bv_val){
+ bvfilter_norm.bv_len = strlen(bvfilter_norm.bv_val);
+ } else {
+ bvfilter_norm.bv_len = 0;
+ }
}
for ( i = 0; (bvals != NULL) && (bvals[i] != NULL); i++ ) {
@@ -103,7 +107,7 @@ string_filter_ava( struct berval *bvfilter, Slapi_Value **bvals, int syntax,
if(retVal) {
*retVal = bvals[i];
}
- slapi_ch_free ((void**)&bvfilter_norm.bv_val);
+ slapi_ch_free_string(&bvfilter_norm.bv_val);
return( 0 );
}
break;
@@ -112,7 +116,7 @@ string_filter_ava( struct berval *bvfilter, Slapi_Value **bvals, int syntax,
if(retVal) {
*retVal = bvals[i];
}
- slapi_ch_free ((void**)&bvfilter_norm.bv_val);
+ slapi_ch_free_string(&bvfilter_norm.bv_val);
return( 0 );
}
break;
@@ -121,14 +125,14 @@ string_filter_ava( struct berval *bvfilter, Slapi_Value **bvals, int syntax,
if(retVal) {
*retVal = bvals[i];
}
- slapi_ch_free ((void**)&bvfilter_norm.bv_val);
+ slapi_ch_free_string(&bvfilter_norm.bv_val);
return( 0 );
}
break;
}
}
- slapi_ch_free ((void**)&bvfilter_norm.bv_val);
+ slapi_ch_free_string(&bvfilter_norm.bv_val);
return( -1 );
}
diff --git a/ldap/servers/slapd/back-ldbm/dbverify.c b/ldap/servers/slapd/back-ldbm/dbverify.c
index 43fc9d500..ffd59007f 100644
--- a/ldap/servers/slapd/back-ldbm/dbverify.c
+++ b/ldap/servers/slapd/back-ldbm/dbverify.c
@@ -119,9 +119,11 @@ dbverify_ext( ldbm_instance *inst, int verbose )
char *p = NULL;
p = strstr(filep, LDBM_FILENAME_SUFFIX); /* since already checked,
it must have it */
- *p = '\0';
+ if(p)
+ *p = '\0';
ainfo_get( inst->inst_be, filep+1, &ai );
- *p = '.';
+ if(p)
+ *p = '.';
if (ai->ai_key_cmp_fn) {
dbp->app_private = (void *)ai->ai_key_cmp_fn;
dbp->set_bt_compare(dbp, dblayer_bt_compare);
diff --git a/ldap/servers/slapd/back-ldbm/ldif2ldbm.c b/ldap/servers/slapd/back-ldbm/ldif2ldbm.c
index 85ad12d48..bbc652f92 100644
--- a/ldap/servers/slapd/back-ldbm/ldif2ldbm.c
+++ b/ldap/servers/slapd/back-ldbm/ldif2ldbm.c
@@ -2248,15 +2248,23 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb)
* Update the Virtual List View indexes
*/
for ( vlvidx = 0; 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 (!run_from_cmdline) {
rc = dblayer_txn_begin(be, NULL, &txn);
if (0 != rc) {
+
LDAPDebug(LDAP_DEBUG_ANY,
"%s: ERROR: failed to begin txn for update index '%s'\n",
- inst->inst_name, indexAttrs[vlvidx], 0);
+ inst->inst_name, ai, 0);
LDAPDebug(LDAP_DEBUG_ANY,
"%s: Error %d: %s\n", inst->inst_name, rc,
dblayer_strerror(rc));
@@ -2264,7 +2272,7 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb)
slapi_task_log_notice(task,
"%s: ERROR: failed to begin txn for update index '%s' "
"(err %d: %s)", inst->inst_name,
- indexAttrs[vlvidx], rc, dblayer_strerror(rc));
+ ai, rc, dblayer_strerror(rc));
}
return_value = -2;
goto err_out;
@@ -2283,7 +2291,7 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb)
if (0 != rc) {
LDAPDebug(LDAP_DEBUG_ANY,
"%s: ERROR: failed to commit txn for update index '%s'\n",
- inst->inst_name, indexAttrs[vlvidx], 0);
+ inst->inst_name, ai, 0);
LDAPDebug(LDAP_DEBUG_ANY,
"%s: Error %d: %s\n", inst->inst_name, rc,
dblayer_strerror(rc));
@@ -2291,7 +2299,7 @@ ldbm_back_ldbm2index(Slapi_PBlock *pb)
slapi_task_log_notice(task,
"%s: ERROR: failed to commit txn for update index '%s' "
"(err %d: %s)", inst->inst_name,
- indexAttrs[vlvidx], rc, dblayer_strerror(rc));
+ ai, rc, dblayer_strerror(rc));
}
return_value = -2;
goto err_out;
diff --git a/ldap/servers/slapd/dn.c b/ldap/servers/slapd/dn.c
index 9261bd879..44459e1b8 100644
--- a/ldap/servers/slapd/dn.c
+++ b/ldap/servers/slapd/dn.c
@@ -2891,7 +2891,8 @@ ndn_cache_add(char *dn, size_t dn_len, char *ndn, size_t ndn_len)
new_node->next = NULL;
} else {
new_node->next = ndn_cache->head;
- ndn_cache->head->prev = new_node;
+ if(ndn_cache->head)
+ ndn_cache->head->prev = new_node;
}
ndn_cache->head = new_node;
PR_Unlock(lru_lock);
diff --git a/ldap/servers/slapd/plugin.c b/ldap/servers/slapd/plugin.c
index f90bd0dac..d19faa586 100644
--- a/ldap/servers/slapd/plugin.c
+++ b/ldap/servers/slapd/plugin.c
@@ -1493,15 +1493,24 @@ int
slapi_berval_cmp (const struct berval* L, const struct berval* R) /* JCM - This does not belong here. But, where should it go? */
{
int result = 0;
+
+ if(L == NULL && R != NULL){
+ return 1;
+ } else if(L != NULL && R == NULL){
+ return -1;
+ } else if(L == NULL && R == NULL){
+ return 0;
+ }
if (L->bv_len < R->bv_len) {
- result = memcmp (L->bv_val, R->bv_val, L->bv_len);
- if (result == 0)
- result = -1;
+ result = memcmp (L->bv_val, R->bv_val, L->bv_len);
+ if (result == 0)
+ result = -1;
} else {
- result = memcmp (L->bv_val, R->bv_val, R->bv_len);
- if (result == 0 && (L->bv_len > R->bv_len))
- result = 1;
+ result = memcmp (L->bv_val, R->bv_val, R->bv_len);
+ if (result == 0 && (L->bv_len > R->bv_len))
+ result = 1;
}
+
return result;
}
diff --git a/ldap/servers/slapd/valueset.c b/ldap/servers/slapd/valueset.c
index afde14bf5..c4e3d5df8 100644
--- a/ldap/servers/slapd/valueset.c
+++ b/ldap/servers/slapd/valueset.c
@@ -190,20 +190,23 @@ valuearray_add_valuearray(Slapi_Value ***vals, Slapi_Value **addvals, PRUint32 f
{
int valslen;
int addvalslen;
- int maxvals;
+ int maxvals;
- addvalslen= valuearray_count(addvals);
+ if(vals == NULL){
+ return;
+ }
+ addvalslen= valuearray_count(addvals);
if(*vals == NULL)
{
- valslen= 0;
- maxvals= 0;
+ valslen= 0;
+ maxvals= 0;
}
else
{
- valslen= valuearray_count(*vals);
- maxvals= valslen+1;
+ valslen= valuearray_count(*vals);
+ maxvals= valslen+1;
}
- valuearray_add_valuearray_fast(vals,addvals,valslen,addvalslen,&maxvals,1/*Exact*/,flags & SLAPI_VALUE_FLAG_PASSIN);
+ valuearray_add_valuearray_fast(vals,addvals,valslen,addvalslen,&maxvals,1/*Exact*/,flags & SLAPI_VALUE_FLAG_PASSIN);
}
int
diff --git a/lib/libaccess/oneeval.cpp b/lib/libaccess/oneeval.cpp
index eff4e10c0..a6d3bbd1d 100644
--- a/lib/libaccess/oneeval.cpp
+++ b/lib/libaccess/oneeval.cpp
@@ -381,20 +381,19 @@ ACLEvalBuildContext(
/* Loop through all the ACLs in the list */
while (wrapper)
{
- acl = wrapper->acl;
+ acl = wrapper->acl;
ace = acl->expr_list_head;
while (ace) /* Loop through all the ACEs in this ACL */
{
-
/* allocate a new ace list entry and link it in to the ordered
* list.
*/
new_ace = (ACLAceEntry_t *)PERM_CALLOC(sizeof(ACLAceEntry_t));
if (new_ace == (ACLAceEntry_t *)NULL) {
- nserrGenerate(errp, ACLERRNOMEM, ACLERR4020, ACL_Program, 1,
- XP_GetAdminStr(DBT_EvalBuildContextUnableToAllocAceEntry));
- goto error;
+ nserrGenerate(errp, ACLERRNOMEM, ACLERR4020, ACL_Program, 1,
+ XP_GetAdminStr(DBT_EvalBuildContextUnableToAllocAceEntry));
+ goto error;
}
new_ace->acep = ace;
ace_cnt++;
@@ -402,7 +401,8 @@ ACLEvalBuildContext(
if (cache->acelist == NULL)
cache->acelist = acelast = new_ace;
else {
- acelast->next = new_ace;
+ if(acelast)
+ acelast->next = new_ace;
acelast = new_ace;
new_ace->acep = ace;
}
| 0 |
e36fcec6d950634ab65d22199f1ea4cc5bed8dea
|
389ds/389-ds-base
|
Bug: 181465 - Handle spacing issues in objectClass SUP list.
Our schema parser requires a space after the opening paran
when multiple SUP objectclasses are listed in the definition
of an objectclass. The RFCs show that a space is not required.
This patch simply removes the requirement that a space be
present after the opening paran.
|
commit e36fcec6d950634ab65d22199f1ea4cc5bed8dea
Author: Nathan Kinder <[email protected]>
Date: Fri May 29 14:11:41 2009 -0700
Bug: 181465 - Handle spacing issues in objectClass SUP list.
Our schema parser requires a space after the opening paran
when multiple SUP objectclasses are listed in the definition
of an objectclass. The RFCs show that a space is not required.
This patch simply removes the requirement that a space be
present after the opening paran.
diff --git a/ldap/servers/slapd/schema.c b/ldap/servers/slapd/schema.c
index e331a946e..c2600f41b 100644
--- a/ldap/servers/slapd/schema.c
+++ b/ldap/servers/slapd/schema.c
@@ -2896,7 +2896,7 @@ read_oc_ldif ( const char *input, struct objclass **oc, char *errorbuf,
* XXXmcs: Since we do not yet support multiple superior objectclasses, we
* just grab the first OID in a parenthesized list.
*/
- if ( NULL == ( pOcSup = get_tagged_oid( " SUP ( ", &nextinput,
+ if ( NULL == ( pOcSup = get_tagged_oid( " SUP (", &nextinput,
keyword_strstr_fn ))) {
pOcSup = get_tagged_oid( " SUP ", &nextinput, keyword_strstr_fn );
}
@@ -4332,10 +4332,15 @@ get_flag_keyword( const char *keyword, int flag_value, const char **inputp,
* The `strstr_fn' function pointer is used to search for `tag', e.g., it
* could be PL_strcasestr().
*
- * The string passed in `tag' MUST include a trailing space, e.g.,
+ * The string passed in `tag' SHOULD generally include a trailing space, e.g.,
*
* pSuperior = get_tagged_oid( "SUP ", &input, PL_strcasestr );
*
+ * The exception to this is when the tag contains '(' as a trailing character.
+ * This is used to process lists of oids, such as the following:
+ *
+ * SUP (inetOrgPerson $ testUser)
+ *
* A malloc'd string is returned if `tag; is found and NULL if not.
*/
static char *
@@ -4350,7 +4355,7 @@ get_tagged_oid( const char *tag, const char **inputp,
PR_ASSERT( NULL != tag );
PR_ASSERT( '\0' != tag[ 0 ] );
if('(' !=tag[0])
- PR_ASSERT( ' ' == tag[ strlen( tag ) - 1 ] );
+ PR_ASSERT((' ' == tag[ strlen( tag ) - 1 ]) || ('(' == tag[ strlen( tag ) - 1 ]));
if ( NULL == strstr_fn ) {
strstr_fn = PL_strcasestr;
| 0 |
7a736adc6876832f9722656925618b6d0af50cd0
|
389ds/389-ds-base
|
Ticket 528 - RFE - get rid of instance specific scripts (part 2)
Bug Description: There was a lot of rundant code in the scripts, and
hardcoded paths.
Fix Description: Create new functions in DSUtil.pm(for perl scripts), and
create a new shared lib file for the shell scripts. Redundant
code was turned into functions and placed in these files. Also
replaced hardcoded paths with the proper macro values.
https://fedorahosted.org/389/ticket/528
Reviewed by: richm(Thanks!)
|
commit 7a736adc6876832f9722656925618b6d0af50cd0
Author: Mark Reynolds <[email protected]>
Date: Thu Feb 21 10:28:23 2013 -0500
Ticket 528 - RFE - get rid of instance specific scripts (part 2)
Bug Description: There was a lot of rundant code in the scripts, and
hardcoded paths.
Fix Description: Create new functions in DSUtil.pm(for perl scripts), and
create a new shared lib file for the shell scripts. Redundant
code was turned into functions and placed in these files. Also
replaced hardcoded paths with the proper macro values.
https://fedorahosted.org/389/ticket/528
Reviewed by: richm(Thanks!)
diff --git a/Makefile.am b/Makefile.am
index 06a46920f..9f52f0bb5 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -117,7 +117,7 @@ CLEANFILES = dberrstrs.h ns-slapd.properties \
ldap/ldif/template-ldapi-autobind.ldif ldap/ldif/template-ldapi-default.ldif \
ldap/ldif/template-ldapi.ldif ldap/ldif/template-locality.ldif ldap/ldif/template-org.ldif \
ldap/ldif/template-orgunit.ldif ldap/ldif/template-pampta.ldif ldap/ldif/template-sasl.ldif \
- ldap/ldif/template-state.ldif ldap/ldif/template-suffix-db.ldif \
+ ldap/ldif/template-state.ldif ldap/ldif/template-suffix-db.ldif ldap/admin/src/scripts/DSSharedLib \
ldap/admin/src/scripts/bak2db ldap/admin/src/scripts/db2bak ldap/admin/src/scripts/upgradedb \
ldap/admin/src/scripts/db2index ldap/admin/src/scripts/db2ldif \
ldap/admin/src/scripts/dn2rdn ldap/admin/src/scripts/ldif2db \
@@ -370,6 +370,7 @@ sbin_SCRIPTS = ldap/admin/src/scripts/setup-ds.pl \
ldap/admin/src/scripts/verify-db.pl \
ldap/admin/src/scripts/dbverify \
ldap/admin/src/scripts/upgradedb \
+ ldap/admin/src/scripts/DSSharedLib \
wrappers/ldap-agent
bin_SCRIPTS = ldap/servers/slapd/tools/rsearch/scripts/dbgen.pl \
diff --git a/Makefile.in b/Makefile.in
index 06ae00f69..6a9021c6c 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1444,7 +1444,7 @@ CLEANFILES = dberrstrs.h ns-slapd.properties \
ldap/ldif/template-ldapi-autobind.ldif ldap/ldif/template-ldapi-default.ldif \
ldap/ldif/template-ldapi.ldif ldap/ldif/template-locality.ldif ldap/ldif/template-org.ldif \
ldap/ldif/template-orgunit.ldif ldap/ldif/template-pampta.ldif ldap/ldif/template-sasl.ldif \
- ldap/ldif/template-state.ldif ldap/ldif/template-suffix-db.ldif \
+ ldap/ldif/template-state.ldif ldap/ldif/template-suffix-db.ldif ldap/admin/src/scripts/DSSharedLib \
ldap/admin/src/scripts/bak2db ldap/admin/src/scripts/db2bak ldap/admin/src/scripts/upgradedb \
ldap/admin/src/scripts/db2index ldap/admin/src/scripts/db2ldif \
ldap/admin/src/scripts/dn2rdn ldap/admin/src/scripts/ldif2db \
@@ -1635,6 +1635,7 @@ sbin_SCRIPTS = ldap/admin/src/scripts/setup-ds.pl \
ldap/admin/src/scripts/verify-db.pl \
ldap/admin/src/scripts/dbverify \
ldap/admin/src/scripts/upgradedb \
+ ldap/admin/src/scripts/DSSharedLib \
wrappers/ldap-agent
bin_SCRIPTS = ldap/servers/slapd/tools/rsearch/scripts/dbgen.pl \
diff --git a/ldap/admin/src/scripts/DSSharedLib.in b/ldap/admin/src/scripts/DSSharedLib.in
new file mode 100644
index 000000000..7b1b35dab
--- /dev/null
+++ b/ldap/admin/src/scripts/DSSharedLib.in
@@ -0,0 +1,68 @@
+libpath_add()
+{
+ [ -z "$1" ] && return
+ LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$1
+}
+
+#
+# get_server_id()
+#
+# First grab all the server instances
+# Then check if a server id was provided, if not, set
+# the server id if there is only one instance.
+# If a servid was provided, make sure its a valid instance name.
+#
+get_server_id()
+{
+ dir=$1
+ servid=$2
+ first="yes"
+ inst_count=0
+ rc=0
+
+ for i in `ls $dir/dirsrv-* 2>/dev/null`
+ do
+ if [ $i != '$dir/dirsrv-admin' ]
+ then
+ inst_count=`expr $inst_count + 1`
+ id=$(expr "$i" : ".*dirsrv-\([^)]*\).*")
+ if [ $first == "yes" ]
+ then
+ instances=$id
+ first="no"
+ else
+ instances=$instances", $id"
+ fi
+ name=$id
+ fi
+ done
+
+ if [ -z $servid ]
+ then
+ # server id not provided, check if there is only one instance
+ if [ $inst_count -eq 1 ]
+ then
+ servid=$name
+ else
+ # multiple instances, can not set server id. Return list of instances
+ servid=$instances
+ rc=1
+ fi
+ elif [ $servid == slapd-* ]
+ then
+ servid=`echo "$servid" | sed -e 's/slapd-//'`
+ elif [ $servid == dirsrv-* ]
+ then
+ servid=`echo "$servid" | sed -e 's/dirsrv-//'`
+ fi
+
+ if ! [ -a $dir/dirsrv-$servid ]
+ then
+ # invalid instance name, return the "valid" instance names
+ servid=$instances
+ rc=1
+ fi
+
+ echo $servid
+ exit $rc
+}
diff --git a/ldap/admin/src/scripts/DSUtil.pm.in b/ldap/admin/src/scripts/DSUtil.pm.in
index b6b9b86d6..8f368c26b 100644
--- a/ldap/admin/src/scripts/DSUtil.pm.in
+++ b/ldap/admin/src/scripts/DSUtil.pm.in
@@ -1212,20 +1212,13 @@ sub get_prefix {
# Grab the host, port, and rootDN from the config file of the server instance
# if the values are missing
sub get_missing_info {
- my $prefix = shift;
+ my $dir = shift;
my $servID = shift;
- my $instances = shift;
my $host = shift;
my $port = shift;
my $rootdn = shift;
- unless ( -e "$prefix/etc/dirsrv/slapd-$servID/dse.ldif" ){
- print (STDERR "Invalid server identifer: $servID\n");
- print (STDERR "Available instances: $instances\n");
- exit (1);
- }
-
- open (DSE, "<$prefix/etc/dirsrv/slapd-$servID/dse.ldif") || die "Failed to open config file $prefix/etc/dirsrv/slapd-$servID/dse.ldif $!\n";
+ open (DSE, "<$dir/slapd-$servID/dse.ldif") || die "Failed to open config file $dir/slapd-$servID/dse.ldif $!\n";
while(<DSE>){
if ($host eq "" && $_ =~ /^nsslapd-localhost: (.*)/){
$host = $1;
@@ -1241,6 +1234,85 @@ sub get_missing_info {
return $host, $port, $rootdn;
}
+sub get_server_id {
+ my $servid = shift;
+ my $dir = shift;
+ my $first = "yes";
+ my $instance_count = 0;
+ my $instances = "";
+ my $name = "";
+ my $file;
+
+ opendir(DIR, "$dir");
+ my @files = readdir(DIR);
+ foreach $file (@files){
+ if($file =~ /^dirsrv-/ && $file ne "dirsrv-admin"){
+ $instance_count++;
+ if($file =~ /dirsrv-(.*)/){
+ if($first eq "yes"){
+ $instances=$1;
+ $first = "no";
+ } else {
+ $instances=$instances . ", $1";
+ }
+ $name = $1;
+ }
+ }
+ }
+ if($servid eq ""){
+ if ($instance_count == 1){
+ $servid = $name;
+ } else {
+ print "You must supply a valid server instance identifier. Use -Z to specify instance name\n";
+ print "Available instances: $instances\n";
+ exit (1);
+ }
+ } elsif ($servid =~ /^dirsrv-/){
+ # strip off "dirsrv-"
+ $servid =~ s/^dirsrv-//;
+ } elsif ($servid =~ /^slapd-/){
+ # strip off "slapd-"
+ $servid =~ s/^slapd-//;
+ }
+
+ unless ( -e "$dir/dirsrv-$servid" ){
+ print (STDERR "instance dir: $dir/dirsrv-$servid\n");
+ print (STDERR "Invalid server identifer: $servid\n");
+ print (STDERR "Available instances: $instances\n");
+ exit (1);
+ }
+
+ return $servid;
+}
+
+sub get_password_from_file {
+ my $passwd = shift;
+ my $passwdfile = shift;
+
+ if ($passwdfile ne ""){
+ # Open file and get the password
+ unless (open (RPASS, $passwdfile)) {
+ die "Error, cannot open password file $passwdfile\n";
+ }
+ $passwd = <RPASS>;
+ chomp($passwd);
+ close(RPASS);
+ } elsif ($passwd eq "-"){
+ # Read the password from terminal
+ print "Bind Password: ";
+ # Disable console echo
+ system("@sttyexec@ -echo") if -t STDIN;
+ # read the answer
+ $passwd = <STDIN>;
+ # Enable console echo
+ system("@sttyexec@ echo") if -t STDIN;
+ print "\n";
+ chop($passwd); # trim trailing newline
+ }
+
+ return $passwd;
+}
+
1;
# emacs settings
diff --git a/ldap/admin/src/scripts/bak2db.in b/ldap/admin/src/scripts/bak2db.in
index 0fe52406a..56e038f05 100755
--- a/ldap/admin/src/scripts/bak2db.in
+++ b/ldap/admin/src/scripts/bak2db.in
@@ -1,23 +1,8 @@
#!/bin/sh
-libpath_add() {
- [ -z "$1" ] && return
- LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$1
-}
-
-server_dir="@libdir@/dirsrv/"
-SCRIPT=$(readlink -f $0)
-SCRIPTPATH=$(dirname $SCRIPT)
-if [ $SCRIPTPATH == "/usr/sbin" ]
-then
- prefix=`echo "$SCRIPTPATH" | sed -e 's/\/usr\/sbin//'`
- server_sbin="/usr/sbin"
-else
- prefix=`echo "$SCRIPTPATH" | sed -e 's/\/sbin//'`
- server_sbin=$prefix"/sbin"
-fi
+source ./DSSharedLib
-libpath_add "$server_dir"
+libpath_add "@libdir@/dirsrv/"
libpath_add "@nss_libdir@"
libpath_add "@libdir@"
libpath_add "@pcre_libdir@"
@@ -26,25 +11,28 @@ export LD_LIBRARY_PATH
SHLIB_PATH=$LD_LIBRARY_PATH
export SHLIB_PATH
+usage()
+{
+ echo "Usage: bak2db archivedir [-Z serverID] [-n backendname] [-q] | [-h]"
+}
+
if [ $# -lt 1 ] || [ $# -gt 7 ]
then
- echo "Usage: bak2db archivedir [-Z serverID] [-n backendname] [-q] | [-h]"
+ usage
exit 1
elif [ "$1" == "-*" ]
then
- echo "Usage: bak2db archivedir [-Z serverID] [-n backendname] [-q] | [-h]"
+ usage
exit 1
else
archivedir=$1
shift
fi
-
-first="yes"
-args=""
+
while getopts "hn:Z:qd:vi:a:SD:" flag
do
case $flag in
- h) echo "Usage: bak2db archivedir [-Z serverID] [-n backendname] [-q] | [-h]"
+ h) usage
exit 0;;
Z) servid=$OPTARG;;
n) args=$args" -n $OPTARG";;
@@ -55,57 +43,22 @@ do
i) args=$args" -i $OPTARG";;
a) archivedir=$OPTARG;;
S) args=$args" -S";;
- ?) echo "Usage: bak2db archivedir [-Z serverID] [-n backendname] [-q] | [-h]"
+ ?) usage
exit 1;;
esac
done
-inst_count=0
-for i in `ls $prefix/etc/sysconfig/dirsrv-* 2>/dev/null`
-do
- if [ $i != '$prefix/etc/sysconfig/dirsrv-admin' ]
- then
- inst_count=`expr $inst_count + 1`
- id=$(expr "$i" : ".*dirsrv-\([^)]*\).*")
- if [ $first == "yes" ]
- then
- instances=$id
- first="no"
- else
- instances=$instances", $id"
- fi
- name=$id
- fi
-done
-
-if [ -z $servid ]
-then
- # server id not provided, check if there is only one instance
- if [ $inst_count -eq 1 ]
- then
- servid=$name
- else
- # error
- echo "Usage: bak2db archivedir [-Z serverID] [-n backendname] [-q] | [-h]"
- echo "You must supply a server instance identifier. Use -Z to specify instance name"
- echo "Available instances: $instances"
- exit 1
- fi
-elif [ $servid == slapd-* ]
+servid=$(get_server_id "@initconfigdir@" $servid)
+if [ $? == 1 ]
then
- servid=`echo "$servid" | sed -e 's/slapd-//'`
-elif [ $servid == dirsrv-* ]
-then
- servid=`echo "$servid" | sed -e 's/dirsrv-//'`
-fi
-configdir="$prefix/etc/dirsrv/slapd-$servid"
-if ! [ -a $configdir ]
-then
- echo "Invalid server identifier: $servid"
- echo "Available instances: $instances"
+ usage
+ echo "You must supply a valid server instance identifier. Use -Z to specify instance name"
+ echo "Available instances: $servid"
exit 1
fi
+configdir="@instconfigdir@/slapd-$servid"
+
if [ 1 = `expr $archivedir : "\/"` ]
then
archivedir=$archivedir
@@ -114,5 +67,4 @@ else
archivedir=`pwd`/$archivedir
fi
-cd $server_sbin
-./ns-slapd archive2db -D $configdir -a $archivedir $args
+@sbindir@/ns-slapd archive2db -D $configdir -a $archivedir $args
diff --git a/ldap/admin/src/scripts/bak2db.pl.in b/ldap/admin/src/scripts/bak2db.pl.in
index 0352ed1c4..a6cb72d83 100644
--- a/ldap/admin/src/scripts/bak2db.pl.in
+++ b/ldap/admin/src/scripts/bak2db.pl.in
@@ -67,7 +67,6 @@ $passwdfile = "";
$host = "";
$port = "";
$i = 0;
-$prefix = DSUtil::get_prefix();
while ($i <= $#ARGV) {
if ("$ARGV[$i]" eq "-a") { # backup directory
@@ -99,62 +98,10 @@ if ($archivedir eq ""){
exit(1);
}
-$first = "yes";
-opendir(DIR, "$prefix/etc/sysconfig");
-@files = readdir(DIR);
-foreach $file (@files){
- if($file =~ /^dirsrv-/ && $file ne "dirsrv-admin"){
- $instance_count++;
- if($file =~ /dirsrv-(.*)/){
- if($first eq "yes"){
- $instances=$1;
- $first = "no";
- } else {
- $instances=$instances . ", $1";
- }
- $name = $1;
- }
- }
-}
-
-if($servid eq ""){
- if ($instance_count == 1){
- $servid = $name;
- } else {
- &usage;
- print "You must supply a server instance identifier. Use -Z to specify instance name\n";
- print "Available instances: $instances\n";
- exit (1);
- }
-} elsif ($servid =~ /^dirsrv-/){
- # strip off "dirsrv-"
- $servid =~ s/^dirsrv-//;
-} elsif ($servid =~ /^slapd-/){
- # strip off "slapd-"
- $servid =~ s/^slapd-//;
-}
-@info = DSUtil::get_missing_info($prefix, $servid, $instances, $host, $port, $rootdn);
+$servid = DSUtil::get_server_id($servid, "@initconfigdir@");
+@info = DSUtil::get_missing_info("@instconfigdir@", $servid, $host, $port, $rootdn);
+$passwd = DSUtil::get_password_from_file($passwd, $passwdfile);
-if ($passwdfile ne ""){
-# Open file and get the password
- unless (open (RPASS, $passwdfile)) {
- die "Error, cannot open password file $passwdfile\n";
- }
- $passwd = <RPASS>;
- chomp($passwd);
- close(RPASS);
-} elsif ($passwd eq "-"){
-# Read the password from terminal
- print "Bind Password: ";
- # Disable console echo
- system("@sttyexec@ -echo") if -t STDIN;
- # read the answer
- $passwd = <STDIN>;
- # Enable console echo
- system("@sttyexec@ echo") if -t STDIN;
- print "\n";
- chop($passwd); # trim trailing newline
-}
if ( $rootdn eq "" || $passwd eq "") { &usage; exit(1); }
($s, $m, $h, $dy, $mn, $yr, $wdy, $ydy, $r) = localtime(time);
$mn++; $yr += 1900;
@@ -168,7 +115,7 @@ if (!$isabs) {
$archivedir = File::Spec->rel2abs( $archivedir );
}
$dn = "dn: cn=$taskname, cn=restore, cn=tasks, cn=config\n";
-$misc = "changetype: add\nobjectclass: top\nobjectclass: extensibleObject\n";
+$misc = "objectclass: top\nobjectclass: extensibleObject\n";
$cn = "cn: $taskname\n";
if ($instance ne "") {
$nsinstance = "nsInstance: ${instance}\n";
@@ -178,12 +125,11 @@ $nsdbtype = "nsDatabaseType: $dbtype\n";
$entry = "${dn}${misc}${cn}${nsinstance}${nsarchivedir}${nsdbtype}";
$vstr = "";
if ($verbose != 0) { $vstr = "-v"; }
-$ENV{'PATH'} = "$prefix@ldaptool_bindir@:$prefix/usr/bin:@ldaptool_bindir@:/usr/bin";
+$ENV{'PATH'} = "@ldaptool_bindir@:/usr/bin:@ldaptool_bindir@:/usr/bin";
-DSUtil::libpath_add("$prefix@nss_libdir@");
-DSUtil::libpath_add("$prefix/usr/lib");
DSUtil::libpath_add("@nss_libdir@");
DSUtil::libpath_add("/usr/lib");
+DSUtil::libpath_add("/usr/lib64");
$ENV{'SHLIB_PATH'} = "$ENV{'LD_LIBRARY_PATH'}";
open(FOO, "| ldapmodify @ldaptool_opts@ $vstr -h $info[0] -p $info[1] -D $info[2] -w \"$passwd\" -a" );
diff --git a/ldap/admin/src/scripts/cleanallruv.pl.in b/ldap/admin/src/scripts/cleanallruv.pl.in
index 7cdfb2de9..267305d6a 100644
--- a/ldap/admin/src/scripts/cleanallruv.pl.in
+++ b/ldap/admin/src/scripts/cleanallruv.pl.in
@@ -64,15 +64,12 @@ $abort = "";
$verbose = 0;
$host = "";
$port = "";
-$first = "yes";
-$prefix = DSUtil::get_prefix();
-$ENV{'PATH'} = "$prefix@ldaptool_bindir@:$prefix/usr/bin:@ldaptool_bindir@:/usr/bin";
+$ENV{'PATH'} = "@ldaptool_bindir@:/usr/bin:@ldaptool_bindir@:/usr/bin";
-DSUtil::libpath_add("$prefix@nss_libdir@");
-DSUtil::libpath_add("$prefix/usr/lib");
DSUtil::libpath_add("@nss_libdir@");
DSUtil::libpath_add("/usr/lib");
+DSUtil::libpath_add("/usr/lib64");
$ENV{'SHLIB_PATH'} = "$ENV{'LD_LIBRARY_PATH'}";
@@ -131,61 +128,9 @@ while ($i <= $#ARGV)
$i++;
}
-opendir(DIR, "$prefix/etc/sysconfig");
-@files = readdir(DIR);
-foreach $file (@files){
- if($file =~ /^dirsrv-/ && $file ne "dirsrv-admin"){
- $instance_count++;
- if($file =~ /dirsrv-(.*)/){
- if($first eq "yes"){
- $instances=$1;
- $first = "no";
- } else {
- $instances=$instances . ", $1";
- }
- $name = $1;
- }
- }
-}
-
-if($servid eq ""){
- if ($instance_count == 1){
- $servid = $name;
- } else {
- &usage;
- print "You must supply a server instance identifier. Use -Z to specify instance name\n";
- print "Available instances: $instances\n";
- exit (1);
- }
-} elsif ($servid =~ /^dirsrv-/){
- # strip off "dirsrv-"
- $servid =~ s/^dirsrv-//;
-} elsif ($servid =~ /^slapd-/){
- # strip off "slapd-"
- $servid =~ s/^slapd-//;
-}
-@info = DSUtil::get_missing_info($prefix, $servid, $instances, $host, $port, $rootdn);
-
-if ($passwdfile ne ""){
-# Open file and get the password
- unless (open (RPASS, $passwdfile)) {
- die "Error, cannot open password file $passwdfile\n";
- }
- $passwd = <RPASS>;
- chomp($passwd);
- close(RPASS);
-} elsif ($passwd eq "-"){
-# Read the password from terminal
- print "Bind Password: ";
- # Disable console echo
- system("@sttyexec@ -echo") if -t STDIN;
- # read the answer
- $passwd = <STDIN>;
- # Enable console echo
- system("@sttyexec@ echo") if -t STDIN;
- print "\n";
- chop($passwd); # trim trailing newline
-}
+$servid = DSUtil::get_server_id($servid, "@initconfigdir@");
+@info = DSUtil::get_missing_info("@instconfigdir@", $servid, $host, $port, $rootdn);
+$passwd = DSUtil::get_password_from_file($passwd, $passwdfile);
if ( $info[2] eq "" || $passwd eq "" || $basedn eq "" || $rid eq "")
{
diff --git a/ldap/admin/src/scripts/db2bak.in b/ldap/admin/src/scripts/db2bak.in
index 8e53722a7..b4dd456dd 100755
--- a/ldap/admin/src/scripts/db2bak.in
+++ b/ldap/admin/src/scripts/db2bak.in
@@ -1,41 +1,27 @@
#!/bin/sh
-libpath_add() {
- [ -z "$1" ] && return
- LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$1
-}
-
-server_dir="@libdir@/dirsrv/"
-SCRIPT=$(readlink -f $0)
-SCRIPTPATH=$(dirname $SCRIPT)
-if [ $SCRIPTPATH == "/usr/sbin" ]
-then
- prefix=`echo "$SCRIPTPATH" | sed -e 's/\/usr\/sbin//'`
- server_sbin="/usr/sbin"
-else
- prefix=`echo "$SCRIPTPATH" | sed -e 's/\/sbin//'`
- server_sbin=$prefix"/sbin"
-fi
+source ./DSSharedLib
-libpath_add "$server_dir"
-libpath_add "$prefix@nss_libdir@"
-libpath_add "$prefix@libdir@"
-libpath_add "$prefix@pcre_libdir@"
+libpath_add "@libdir@/dirsrv/"
+libpath_add "@nss_libdir@"
+libpath_add "@libdir@"
+libpath_add "@pcre_libdir@"
export LD_LIBRARY_PATH
SHLIB_PATH=$LD_LIBRARY_PATH
export SHLIB_PATH
+usage()
+{
+ echo "Usage: db2bak [archivedir] [-Z serverID] [-q] [-h]"
+}
+
if [ $# -gt 4 ]
then
- echo "Usage: db2bak [archivedir] [-Z serverID] [-q] [-h]"
+ usage
exit 1
fi
-first="yes"
-bak_dir=""
-args=""
-cd $server_sbin
if [ "$#" -gt 0 ]
then
if ["$1" != "-*" ]
@@ -47,7 +33,7 @@ then
while getopts "hqd:Z:vi:a:SD" flag
do
case $flag in
- h) echo "Usage: db2bak [archivedir] [-Z serverID] [-q] [-h]"
+ h) usage
exit 0;;
q) args=$args" -g";;
v) args=$args" -v";;
@@ -57,62 +43,27 @@ then
a) $bakdir=$OPTARG;;
d) args=$args" -d $OPTARG";;
Z) servid=$OPTARG;;
- ?) echo "Usage: db2bak [archivedir] [-Z serverID] [-q] [-h]"
+ ?) usage
exit 1;;
esac
done
fi
-# server id not provided, check if there is only one instance
-inst_count=0
-for i in `ls $prefix/etc/sysconfig/dirsrv-* 2>/dev/null`
-do
- if [ $i != '$prefix/etc/sysconfig/dirsrv-admin' ]
- then
- inst_count=`expr $inst_count + 1`
- id=$(expr "$i" : ".*dirsrv-\([^)]*\).*")
- if [ $first == "yes" ]
- then
- instances=$id
- first="no"
- else
- instances=$instances", $id"
- fi
- name=$id
- fi
-done
-
-if [ -z $servid ]
-then
- if [ $inst_count -eq 1 ]
- then
- servid=$name
- else
- # error
- echo "Usage: db2bak [archivedir] [-Z serverID] [-q] [-h]"
- echo "You must supply a server instance identifier. Use -Z to specify instance name"
- echo "Available instances: $instances"
- exit 1
- fi
-elif [ $servid == slapd-* ]
-then
- servid=`echo "$servid" | sed -e 's/slapd-//'`
-elif [ $servid == dirsrv-* ]
+servid=$(get_server_id "@initconfigdir@" $servid)
+if [ $? == 1 ]
then
- servid=`echo "$servid" | sed -e 's/dirsrv-//'`
-fi
-configdir="$prefix/etc/dirsrv/slapd-$servid"
-if ! [ -a $configdir ]
-then
- echo "Invalid server identifier: $servid"
- echo "Available instances: $instances"
+ usage
+ echo "You must supply a valid server instance identifier. Use -Z to specify instance name"
+ echo "Available instances: $servid"
exit 1
fi
+configdir="@instconfigdir@/slapd-$servid"
+
if [ -z $bak_dir ]
then
- bak_dir=$prefix/var/lib/dirsrv/slapd-$servid/bak/$servid-`date +%Y_%m_%d_%H_%M_%S`
+ bak_dir=@localstatedir@/lib/@PACKAGE_NAME@/slapd-$servid/bak/$servid-`date +%Y_%m_%d_%H_%M_%S`
fi
echo "Back up directory: $bak_dir"
-./ns-slapd db2archive -D $configdir -a $bak_dir $args
+@sbindir@/ns-slapd db2archive -D $configdir -a $bak_dir $args
diff --git a/ldap/admin/src/scripts/db2bak.pl.in b/ldap/admin/src/scripts/db2bak.pl.in
index f45a83495..d406a2c0f 100644
--- a/ldap/admin/src/scripts/db2bak.pl.in
+++ b/ldap/admin/src/scripts/db2bak.pl.in
@@ -64,8 +64,6 @@ $passwdfile = "";
$i = 0;
$host = "";
$port = "";
-$first = "yes";
-$prefix = DSUtil::get_prefix();
while ($i <= $#ARGV) {
if ("$ARGV[$i]" eq "-a") { # backup directory
@@ -90,63 +88,11 @@ while ($i <= $#ARGV) {
$i++;
}
-opendir(DIR, "$prefix/etc/sysconfig");
-@files = readdir(DIR);
-foreach $file (@files){
- if($file =~ /^dirsrv-/ && $file ne "dirsrv-admin"){
- $instance_count++;
- if($file =~ /dirsrv-(.*)/){
- if($first eq "yes"){
- $instances=$1;
- $first = "no";
- } else {
- $instances=$instances . ", $1";
- }
- $name = $1;
- }
- }
-}
-
-if($servid eq ""){
- if ($instance_count == 1){
- $servid = $name;
- } else {
- &usage;
- print "You must supply a server instance identifier. Use -Z to specify instance name\n";
- print "Available instances: $instances\n";
- exit (1);
- }
-} elsif ($servid =~ /^dirsrv-/){
- # strip off "dirsrv-"
- $servid =~ s/^dirsrv-//;
-} elsif ($servid =~ /^slapd-/){
- # strip off "slapd-"
- $servid =~ s/^slapd-//;
-}
-@info = DSUtil::get_missing_info($prefix, $servid, $instances, $host, $port, $rootdn);
+$servid = DSUtil::get_server_id($servid, "@initconfigdir@");
+@info = DSUtil::get_missing_info("@instconfigdir@", $servid, $host, $port, $rootdn);
+$mybakdir = "@localstatedir@/lib/@PACKAGE_NAME@/slapd-$servid/bak";
+$passwd = DSUtil::get_password_from_file($passwd, $passwdfile);
-$mybakdir = "$prefix/var/lib/dirsrv/slapd-$servid/bak";
-
-if ($passwdfile ne ""){
-# Open file and get the password
- unless (open (RPASS, $passwdfile)) {
- die "Error, cannot open password file $passwdfile\n";
- }
- $passwd = <RPASS>;
- chomp($passwd);
- close(RPASS);
-} elsif ($passwd eq "-"){
-# Read the password from terminal
- print "Bind Password: ";
- # Disable console echo
- system("@sttyexec@ -echo") if -t STDIN;
- # read the answer
- $passwd = <STDIN>;
- # Enable console echo
- system("@sttyexec@ echo") if -t STDIN;
- print "\n";
- chop($passwd); # trim trailing newline
-}
if ( $info[2] eq "" || $passwd eq "") { &usage; exit(1); }
($s, $m, $h, $dy, $mn, $yr, $wdy, $ydy, $r) = localtime(time);
$mn++; $yr += 1900;
@@ -155,19 +101,18 @@ if ($archivedir eq "") {
$archivedir = "${mybakdir}/$servid-${yr}_${mn}_${dy}_${h}_${m}_${s}";
}
$dn = "dn: cn=$taskname, cn=backup, cn=tasks, cn=config\n";
-$misc = "changetype: add\nobjectclass: top\nobjectclass: extensibleObject\n";
+$misc = "objectclass: top\nobjectclass: extensibleObject\n";
$cn = "cn: $taskname\n";
$nsarchivedir = "nsArchiveDir: $archivedir\n";
$nsdbtype = "nsDatabaseType: $dbtype\n";
$entry = "${dn}${misc}${cn}${nsarchivedir}${nsdbtype}";
$vstr = "";
if ($verbose != 0) { $vstr = "-v"; }
-$ENV{'PATH'} = "$prefix@ldaptool_bindir@:$prefix/usr/bin:@ldaptool_bindir@:/usr/bin";
+$ENV{'PATH'} = "@ldaptool_bindir@:/usr/bin:@ldaptool_bindir@:/usr/bin";
-DSUtil::libpath_add("$prefix@nss_libdir@");
-DSUtil::libpath_add("$prefix/usr/lib");
DSUtil::libpath_add("@nss_libdir@");
DSUtil::libpath_add("/usr/lib");
+DSUtil::libpath_add("/usr/lib64");
$ENV{'SHLIB_PATH'} = "$ENV{'LD_LIBRARY_PATH'}";
print("Back up directory: $archivedir host: $info[0] port: $info[1] binddn: $info[2]\n");
diff --git a/ldap/admin/src/scripts/db2index.in b/ldap/admin/src/scripts/db2index.in
index f735cfcc2..501f6370b 100755
--- a/ldap/admin/src/scripts/db2index.in
+++ b/ldap/admin/src/scripts/db2index.in
@@ -1,37 +1,25 @@
#!/bin/sh
-libpath_add() {
- [ -z "$1" ] && return
- LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$1
-}
-
-server_dir="@libdir@/dirsrv/"
-SCRIPT=$(readlink -f $0)
-SCRIPTPATH=$(dirname $SCRIPT)
-if [ $SCRIPTPATH == "/usr/sbin" ]
-then
- prefix=`echo "$SCRIPTPATH" | sed -e 's/\/usr\/sbin//'`
- server_sbin="/usr/sbin"
-else
- prefix=`echo "$SCRIPTPATH" | sed -e 's/\/sbin//'`
- server_sbin=$prefix"/sbin"
-fi
+source ./DSSharedLib
-libpath_add "$server_dir"
-libpath_add "$prefix@nss_libdir@"
-libpath_add "$prefix@libdir@"
-libpath_add "$prefix@pcre_libdir@"
+libpath_add "@libdir@/dirsrv/"
+libpath_add "@nss_libdir@"
+libpath_add "@libdir@"
+libpath_add "@pcre_libdir@"
export LD_LIBRARY_PATH
SHLIB_PATH=$LD_LIBRARY_PATH
export SHLIB_PATH
-first="yes"
-args=""
+usage ()
+{
+ echo "Usage: db2index [-Z serverID] [-n backend_instance | {-s includesuffix}* -t attribute[:indextypes[:matchingrules]] -T vlvattribute]"
+}
+
while getopts "hZ:n:s:t:T:vd:a:SD:x:" flag
do
case $flag in
- h) echo "Usage: db2index [-Z serverID] [-n backend_instance | {-s includesuffix}* -t attribute[:indextypes[:matchingrules]] -T vlvattribute]"
+ h) usage
exit 0;;
Z) servid=$OPTARG;;
n) args=$args" -n $OPTARG"
@@ -46,72 +34,36 @@ do
v) args=$args=" -v";;
S) args=$args=" -S";;
D) args=$args" -D $OPTARG";;
- ?) echo "Usage: db2index [-Z serverID] [-n backend_instance | {-s includesuffix}* -t attribute[:indextypes[:matchingrules]] -T vlvattribute]"
+ ?) usage
exit 1;;
esac
done
if [ -z $benameopt ] && [ -z $includeSuffix ]
then
- echo "Usage: db2index [-Z serverID] [-n backend_instance | {-s includesuffix}* -t attribute[:indextypes[:matchingrules]] -T vlvattribute]"
+ usage
exit 1;
fi
-# server id not provided, check if there is only one instance
-inst_count=0
-for i in `ls $prefix/etc/sysconfig/dirsrv-* 2>/dev/null`
-do
- if [ $i != '$prefix/etc/sysconfig/dirsrv-admin' ]
- then
- inst_count=`expr $inst_count + 1`
- id=$(expr "$i" : ".*dirsrv-\([^)]*\).*")
- if [ $first == "yes" ]
- then
- instances=$id
- first="no"
- else
- instances=$instances", $id"
- fi
- name=$id
- fi
-done
-
-if [ -z $servid ]
-then
- if [ $inst_count -eq 1 ]
- then
- servid=$name
- else
- # error
- echo "Usage: db2index [-Z serverID] [-n backend_instance | {-s includesuffix}* -t attribute[:indextypes[:matchingrules]] -T vlvattribute]"
- echo "You must supply a server instance identifier. Use -Z to specify instance name"
- echo "Available instances: $instances"
- exit 1
- fi
-elif [ $servid == slapd-* ]
-then
- servid=`echo "$servid" | sed -e 's/slapd-//'`
-elif [ $servid == dirsrv-* ]
+servid=$(get_server_id "@initconfigdir@" $servid)
+if [ $? == 1 ]
then
- servid=`echo "$servid" | sed -e 's/dirsrv-//'`
-fi
-configdir="$prefix/etc/dirsrv/slapd-$servid"
-if ! [ -a $configdir ]
-then
- echo "Invalid server identifier: $servid"
- echo "Available instances: $instances"
+ usage
+ echo "You must supply a valid server instance identifier. Use -Z to specify instance name"
+ echo "Available instances: $servid"
exit 1
fi
-cd $server_sbin
+configdir="@instconfigdir@/slapd-$servid"
+
if [ $# -eq 0 ]
then
- bak_dir=$prefix/var/lib/dirsrv/slapd-$servid/bak/reindex_`date +%Y_%m_%d_%H_%M_%S`
- ./ns-slapd upgradedb -D $configdir -a "$bak_dir"
+ bak_dir=@localstatedir@/lib/@PACKAGE_NAME@/slapd-$servid/bak/reindex_`date +%Y_%m_%d_%H_%M_%S`
+ @sbindir@/ns-slapd upgradedb -D $configdir -a "$bak_dir"
elif [ $# -lt 2 ]
then
- echo "Usage: db2index [-Z instance-name] [-n backend_instance | {-s includesuffix}* -t attribute[:indextypes[:matchingrules]] -T vlvattribute]"
+ usage
exit 1
else
- ./ns-slapd db2index -D $configdir $args
+ @sbindir@/ns-slapd db2index -D $configdir $args
fi
diff --git a/ldap/admin/src/scripts/db2index.pl.in b/ldap/admin/src/scripts/db2index.pl.in
index a9acce5ee..956e9750b 100644
--- a/ldap/admin/src/scripts/db2index.pl.in
+++ b/ldap/admin/src/scripts/db2index.pl.in
@@ -73,14 +73,12 @@ $vlvattribute_arg = "";
$verbose = 0;
$host = "";
$port = "";
-$first = "yes";
-$prefix = DSUtil::get_prefix();
-$ENV{'PATH'} = "$prefix@ldaptool_bindir@:$prefix/usr/bin:@ldaptool_bindir@:/usr/bin";
+$ENV{'PATH'} = "@ldaptool_bindir@:/usr/bin:@ldaptool_bindir@:/usr/bin";
-DSUtil::libpath_add("$prefix@nss_libdir@");
DSUtil::libpath_add("@nss_libdir@");
DSUtil::libpath_add("/usr/lib");
+DSUtil::libpath_add("/usr/lib64");
$ENV{'SHLIB_PATH'} = "$ENV{'LD_LIBRARY_PATH'}";
@@ -109,62 +107,11 @@ $attribute_arg = $opt_t;
$vlvattribute_arg = $opt_T;
$verbose = $opt_v;
$servid = $opt_Z;
+$passwdfile = $opt_j;
-opendir(DIR, "$prefix/etc/sysconfig");
-@files = readdir(DIR);
-foreach $file (@files){
- if($file =~ /^dirsrv-/ && $file ne "dirsrv-admin"){
- $instance_count++;
- if($file =~ /dirsrv-(.*)/){
- if($first eq "yes"){
- $instances=$1;
- $first = "no";
- } else {
- $instances=$instances . ", $1";
- }
- $name = $1;
- }
- }
-}
-
-if($servid eq ""){
- if ($instance_count == 1){
- $servid = $name;
- } else {
- &usage;
- print "You must supply a server instance identifier. Use -Z to specify instance name\n";
- print "Available instances: $instances\n";
- exit (1);
- }
-} elsif ($servid =~ /^dirsrv-/){
- # strip off "dirsrv-"
- $servid =~ s/^dirsrv-//;
-} elsif ($servid =~ /^slapd-/){
- # strip off "slapd-"
- $servid =~ s/^slapd-//;
-}
-@info = DSUtil::get_missing_info($prefix, $servid, $instances, $host, $port, $rootdn);
-
-if ($passwdfile ne ""){
-# Open file and get the password
- unless (open (RPASS, $passwdfile)) {
- die "Error, cannot open password file $passwdfile\n";
- }
- $passwd = <RPASS>;
- chomp($passwd);
- close(RPASS);
-} elsif ($passwd eq "-"){
-# Read the password from terminal
- print "Bind Password: ";
- # Disable console echo
- system("@sttyexec@ -echo") if -t STDIN;
- # read the answer
- $passwd = <STDIN>;
- # Enable console echo
- system("@sttyexec@ echo") if -t STDIN;
- print "\n";
- chop($passwd); # trim trailing newline
-}
+$servid = DSUtil::get_server_id($servid, "@initconfigdir@");
+@info = DSUtil::get_missing_info("@instconfigdir@", $servid, $host, $port, $rootdn);
+$passwd = DSUtil::get_password_from_file($passwd, $passwdfile);
if ( $info[2] eq "" || $passwd eq "" )
{
@@ -242,7 +189,7 @@ else
# Build the task entry to add
$dn = "dn: cn=$taskname, cn=index, cn=tasks, cn=config\n";
-$misc = "changetype: add\nobjectclass: top\nobjectclass: extensibleObject\n";
+$misc = "objectclass: top\nobjectclass: extensibleObject\n";
$cn = "cn: $taskname\n";
$nsinstance = "nsInstance: ${instance}\n";
diff --git a/ldap/admin/src/scripts/db2ldif.in b/ldap/admin/src/scripts/db2ldif.in
index 8df3e5123..f17e7a86a 100755
--- a/ldap/admin/src/scripts/db2ldif.in
+++ b/ldap/admin/src/scripts/db2ldif.in
@@ -1,31 +1,24 @@
#!/bin/sh
-libpath_add() {
- [ -z "$1" ] && return
- LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$1
-}
-
-server_dir="@libdir@/dirsrv/"
-SCRIPT=$(readlink -f $0)
-SCRIPTPATH=$(dirname $SCRIPT)
-if [ $SCRIPTPATH == "/usr/sbin" ]
-then
- prefix=`echo "$SCRIPTPATH" | sed -e 's/\/usr\/sbin//'`
- server_sbin="/usr/sbin"
-else
- prefix=`echo "$SCRIPTPATH" | sed -e 's/\/sbin//'`
- server_sbin=$prefix"/sbin"
-fi
+source ./DSSharedLib
-libpath_add "$server_dir"
-libpath_add "$prefix@nss_libdir@"
-libpath_add "$prefix@libdir@"
-libpath_add "$prefix@pcre_libdir@"
+libpath_add "@libdir@/dirsrv/"
+libpath_add "@nss_libdir@"
+libpath_add "@libdir@"
+libpath_add "@pcre_libdir@"
export LD_LIBRARY_PATH
SHLIB_PATH=$LD_LIBRARY_PATH
export SHLIB_PATH
+usage()
+{
+ echo "Usage: db2ldif [-Z serverID] {-n backend_instance}* | {-s includesuffix}*"
+ echo " [{-x excludesuffix}*] [-a outputfile]"
+ echo " [-N] [-r] [-C] [-u] [-U] [-m] [-M] [-1] [-q]"
+ echo "Note: either \"-n backend_instance\" or \"-s includesuffix\" is required."
+}
+
make_ldiffile()
{
be=""
@@ -64,33 +57,24 @@ make_ldiffile()
done
if [ "$be" = "" ]; then
- echo $prefix/var/lib/dirsrv/slapd-$servid/ldif/$servid-`date +%Y_%m_%d_%H%M%S`.ldif
+ echo @localstatedir@/lib/@PACKAGE_NAME@/slapd-$servid/ldif/$servid-`date +%Y_%m_%d_%H%M%S`.ldif
else
- echo $prefix/var/lib/dirsrv/slapd-$servid/ldif/$servid-${be}-`date +%Y_%m_%d_%H%M%S`.ldif
+ echo @localstatedir@/lib/@PACKAGE_NAME@/slapd-$servid/ldif/$servid-${be}-`date +%Y_%m_%d_%H%M%S`.ldif
fi
return 0
}
-cd $server_sbin
if [ "$#" -lt 2 ];
then
- echo "Usage: db2ldif [-Z serverID] {-n backend_instance}* | {-s includesuffix}*"
- echo " [{-x excludesuffix}*] [-a outputfile]"
- echo " [-N] [-r] [-C] [-u] [-U] [-m] [-M] [-1] [-q]"
- echo "Note: either \"-n backend_instance\" or \"-s includesuffix\" is required."
+ usage
exit 1
fi
-
-first="yes"
-args=""
+
while getopts "hZ:n:s:x:a:NrCuUmM1qvd:D:ESt:o" flag
do
case $flag in
- h) echo "Usage: db2ldif [-Z serverID] {-n backend_instance}* | {-s includesuffix}*"
- echo " [{-x excludesuffix}*] [-a outputfile]"
- echo " [-N] [-r] [-C] [-u] [-U] [-m] [-M] [-1] [-q]"
- echo "Note: either \"-n backend_instance\" or \"-s includesuffix\" is required."
- exit 0;;
+ h) usage
+ exit 0;;
Z) servid=$OPTARG;;
n) benameopt="-n $OPTARG"
required_param="yes";;
@@ -113,78 +97,35 @@ do
M) args=$args" -M";;
1) args=$args" -1";;
q) args=$args" -q";;
- ?) echo "Usage: db2ldif [-Z serverID] {-n backend_instance}* | {-s includesuffix}*"
- echo " [{-x excludesuffix}*] [-a outputfile]"
- echo " [-N] [-r] [-C] [-u] [-U] [-m] [-M] [-1] [-q]"
- echo "Note: either \"-n backend_instance\" or \"-s includesuffix\" is required."
- exit 1;;
+ ?) usage
+ exit 1;;
esac
done
if [ "$required_param" != "yes" ]
then
- echo "Usage: db2ldif [-Z serverID] {-n backend_instance}* | {-s includesuffix}*"
- echo " [{-x excludesuffix}*] [-a outputfile]"
- echo " [-N] [-r] [-C] [-u] [-U] [-m] [-M] [-1] [-q]"
- echo "Note: either \"-n backend_instance\" or \"-s includesuffix\" is required."
+ usage
exit 1
fi
-# server id not provided, check if there is only one instance
-inst_count=0
-for i in `ls $prefix/etc/sysconfig/dirsrv-* 2>/dev/null`
-do
- if [ $i != '$prefix/etc/sysconfig/dirsrv-admin' ]
- then
- inst_count=`expr $inst_count + 1`
- id=$(expr "$i" : ".*dirsrv-\([^)]*\).*")
- if [ $first == "yes" ]
- then
- instances=$id
- first="no"
- else
- instances=$instances", $id"
- fi
- name=$id
- fi
-done
-
-if [ -z $servid ]
-then
- if [ $inst_count -eq 1 ]
- then
- servid=$name
- else
- # error
- echo "Usage: db2ldif [-Z serverID] {-n backend_instance}* | {-s includesuffix}*"
- echo " [{-x excludesuffix}*] [-a outputfile]"
- echo " [-N] [-r] [-C] [-u] [-U] [-m] [-M] [-1] [-q]"
- echo "You must supply a server instance identifier. Use -Z to specify instance name"
- echo "Available instances: $instances"
- exit 1
- fi
-elif [ $servid == slapd-* ]
+servid=$(get_server_id "@initconfigdir@" $servid)
+if [ $? == 1 ]
then
- servid=`echo "$servid" | sed -e 's/slapd-//'`
-elif [ $servid == dirsrv-* ]
-then
- servid=`echo "$servid" | sed -e 's/dirsrv-//'`
-fi
-configdir="$prefix/etc/dirsrv/slapd-$servid"
-if ! [ -a $configdir ]
-then
- echo "Invalid server identifier: $servid"
- echo "Available instances: $instances"
+ usage
+ echo "You must supply a valid server instance identifier. Use -Z to specify instance name"
+ echo "Available instances: $servid"
exit 1
fi
+configdir="@instconfigdir@/slapd-$servid"
+
ldif_file=`make_ldiffile $@`
rn=$?
echo "Exported ldif file: $ldif_file"
if [ $rn -eq 1 ]
then
-./ns-slapd db2ldif -D $configdir $benameopt $includeSuffix $excludeSuffix $outputFile $args
+ @sbindir@/ns-slapd db2ldif -D $configdir $benameopt $includeSuffix $excludeSuffix $outputFile $args
else
-./ns-slapd db2ldif -D $configdir $benameopt $includeSuffix $excludeSuffix -a $ldif_file $args
+ @sbindir@/ns-slapd db2ldif -D $configdir $benameopt $includeSuffix $excludeSuffix -a $ldif_file $args
fi
diff --git a/ldap/admin/src/scripts/db2ldif.pl.in b/ldap/admin/src/scripts/db2ldif.pl.in
index 5b7e75c6b..14054d976 100644
--- a/ldap/admin/src/scripts/db2ldif.pl.in
+++ b/ldap/admin/src/scripts/db2ldif.pl.in
@@ -94,7 +94,6 @@ sub usage {
""
);
-$prefix = DSUtil::get_prefix();
$maxidx = 50;
$nowrap = 0;
$nobase64 = 0;
@@ -117,7 +116,6 @@ $excli = 0;
$decrypt_on_export = 0;
$host = "";
$port = "";
-$first = "yes";
while ($i <= $#ARGV) {
if ( "$ARGV[$i]" eq "-n" ) { # instances
@@ -181,68 +179,17 @@ while ($i <= $#ARGV) {
$i++;
}
-opendir(DIR, "$prefix/etc/sysconfig");
-@files = readdir(DIR);
-foreach $file (@files){
- if($file =~ /^dirsrv-/ && $file ne "dirsrv-admin"){
- $instance_count++;
- if($file =~ /dirsrv-(.*)/){
- if($first eq "yes"){
- $instances=$1;
- $first = "no";
- } else {
- $instances=$instances . ", $1";
- }
- $name = $1;
- }
- }
-}
-
-if($servid eq ""){
- if ($instance_count == 1){
- $servid = $name;
- } else {
- &usage;
- print "You must supply a server instance identifier. Use -Z to specify instance name\n";
- print "Available instances: $instances\n";
- exit (1);
- }
-} elsif ($servid =~ /^dirsrv-/){
- # strip off "dirsrv-"
- $servid =~ s/^dirsrv-//;
-} elsif ($servid =~ /^slapd-/){
- # strip off "slapd-"
- $servid =~ s/^slapd-//;
-}
-@info = DSUtil::get_missing_info($prefix, $servid, $instances, $host, $port, $rootdn);
-$ldifdir = "$prefix/var/lib/dirsrv/slapd-$servid/ldif";
+$servid = DSUtil::get_server_id($servid, "@initconfigdir@");
+@info = DSUtil::get_missing_info("@instconfigdir@", $servid, $host, $port, $rootdn);
+$ldifdir = "@localstatedir@/lib/@PACKAGE_NAME@/slapd-$servid/ldif";
+$passwd = DSUtil::get_password_from_file($passwd, $passwdfile);
-if ($passwdfile ne ""){
-# Open file and get the password
- unless (open (RPASS, $passwdfile)) {
- die "Error, cannot open password file $passwdfile\n";
- }
- $passwd = <RPASS>;
- chomp($passwd);
- close(RPASS);
-} elsif ($passwd eq "-"){
-# Read the password from terminal
- print "Bind Password: ";
- # Disable console echo
- system("@sttyexec@ -echo") if -t STDIN;
- # read the answer
- $passwd = <STDIN>;
- # Enable console echo
- system("@sttyexec@ echo") if -t STDIN;
- print "\n";
- chop($passwd); # trim trailing newline
-}
if (($instances[0] eq "" && $included[0] eq "") || $info[2] eq "" || $passwd eq "") { &usage; exit(1); }
($s, $m, $h, $dy, $mn, $yr, $wdy, $ydy, $r) = localtime(time);
$mn++; $yr += 1900;
$taskname = "export_${yr}_${mn}_${dy}_${h}_${m}_${s}";
$dn = "dn: cn=$taskname, cn=export, cn=tasks, cn=config\n";
-$misc = "changetype: add\nobjectclass: top\nobjectclass: extensibleObject\n";
+$misc = "objectclass: top\nobjectclass: extensibleObject\n";
$cn = "cn: $taskname\n";
$i = 0;
$be = "";
@@ -305,12 +252,11 @@ $nsldiffile = "nsFilename: ${ldiffile}\n";
$entry = "${dn}${misc}${cn}${nsinstance}${nsincluded}${nsexcluded}${nsreplica}${nsnobase64}${nsnowrap}${nsnoversion}${nsnouniqueid}${nsuseid2entry}${nsonefile}${nsexportdecrypt}${nsprintkey}${nsldiffile}";
$vstr = "";
if ($verbose != 0) { $vstr = "-v"; }
-$ENV{'PATH'} = "$prefix@ldaptool_bindir@:$prefix/usr/bin:@ldaptool_bindir@:/usr/bin";
+$ENV{'PATH'} = "@ldaptool_bindir@:/usr/bin:@ldaptool_bindir@:/usr/bin";
-DSUtil::libpath_add("$prefix@nss_libdir@");
-DSUtil::libpath_add("$prefix/usr/lib");
DSUtil::libpath_add("@nss_libdir@");
DSUtil::libpath_add("/usr/lib");
+DSUtil::libpath_add("/usr/lib64");
$ENV{'SHLIB_PATH'} = "$ENV{'LD_LIBRARY_PATH'}";
print("Exporting to ldif file: ${ldiffile}\n");
diff --git a/ldap/admin/src/scripts/dbverify.in b/ldap/admin/src/scripts/dbverify.in
index fb160862d..169e59173 100755
--- a/ldap/admin/src/scripts/dbverify.in
+++ b/ldap/admin/src/scripts/dbverify.in
@@ -1,42 +1,30 @@
#!/bin/sh
-libpath_add() {
- [ -z "$1" ] && return
- LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$1
-}
-
-PATH=$PATH:/bin
-server_dir="@libdir@/dirsrv/"
-SCRIPT=$(readlink -f $0)
-SCRIPTPATH=$(dirname $SCRIPT)
-if [ $SCRIPTPATH == "/usr/sbin" ]
-then
- prefix=`echo "$SCRIPTPATH" | sed -e 's/\/usr\/sbin//'`
- server_sbin="/usr/sbin"
-else
- prefix=`echo "$SCRIPTPATH" | sed -e 's/\/sbin//'`
- server_sbin=$prefix"/sbin"
-fi
+source ./DSSharedLib
-libpath_add "$server_dir"
-libpath_add "$prefix@nss_libdir@"
-libpath_add "$prefix@libdir@"
-libpath_add "$prefix@pcre_libdir@"
+libpath_add "@libdir@/dirsrv/"
+libpath_add "@nss_libdir@"
+libpath_add "@libdir@"
+libpath_add "@pcre_libdir@"
export LD_LIBRARY_PATH
SHLIB_PATH=$LD_LIBRARY_PATH
export SHLIB_PATH
+PATH=$PATH:/bin
+
+usage()
+{
+ echo "Usage: dbverify [-Z serverID] [-n backend_instance] [-V]"
+ echo "Note : if \"-n backend_instance\" is not passed, verify all DBs."
+ echo " -Z : Server instance identifier"
+ echo " -V : verbose"
+}
-first="yes"
-args=""
while getopts "Z:n:hVfd:n:D:" flag
do
case $flag in
- h) echo "Usage: dbverify [-Z serverID] [-n backend_instance] [-V]"
- echo "Note : if \"-n backend_instance\" is not passed, verify all DBs."
- echo " -Z : Server instance identifier"
- echo " -V : verbose"
- exit 0;;
+ h) usage
+ exit 0;;
Z) servid=$OPTARG;;
n) args=$args" -n $OPTARG";;
d) args=$args" -d $OPTARG";;
@@ -44,65 +32,23 @@ do
v) args=$args" -v";;
f) args=$args" -f";;
D) args=$args" -D $OPTARG";;
- ?) echo "Usage: dbverify [-Z serverID] [-n backend_instance] [-V]"
- echo "Note : if \"-n backend_instance\" is not passed, verify all DBs."
- echo " -Z : Server instance identifier"
- echo " -V : verbose"
+ ?) usage
exit 1;;
esac
done
-# server id not provided, check if there is only one instance
-inst_count=0
-for i in `ls $prefix/etc/sysconfig/dirsrv-* 2>/dev/null`
-do
- if [ $i != '$prefix/etc/sysconfig/dirsrv-admin' ]
- then
- inst_count=`expr $inst_count + 1`
- id=$(expr "$i" : ".*dirsrv-\([^)]*\).*")
- if [ $first == "yes" ]
- then
- instances=$id
- first="no"
- else
- instances=$instances", $id"
- fi
- name=$id
- fi
-done
-
-if [ -z $servid ]
-then
- if [ $inst_count -eq 1 ]
- then
- servid=$name
- else
- # error
- echo "Usage: dbverify [-Z serverID] [-n backend_instance] [-V]"
- echo "Note : if \"-n backend_instance\" is not passed, verify all DBs."
- echo " -Z : Server instance identifier"
- echo " -V : verbose"
- echo "You must supply a server instance identifier. Use -Z to specify instance name"
- echo "Available instances: $instances"
- exit 1
- fi
-elif [ $servid == slapd-* ]
+servid=$(get_server_id "@initconfigdir@" $servid)
+if [ $? == 1 ]
then
- servid=`echo "$servid" | sed -e 's/slapd-//'`
-elif [ $servid == dirsrv-* ]
-then
- servid=`echo "$servid" | sed -e 's/dirsrv-//'`
-fi
-configdir="$prefix/etc/dirsrv/slapd-$servid"
-if ! [ -a $configdir ]
-then
- echo "Invalid server identifier: $servid"
- echo "Available instances: $instances"
+ usage
+ echo "You must supply a valid server instance identifier. Use -Z to specify instance name"
+ echo "Available instances: $servid"
exit 1
fi
-cd $server_sbin
-./ns-slapd dbverify -D $configdir $args
+configdir="@instconfigdir@/slapd-$servid"
+
+@sbindir@/ns-slapd dbverify -D $configdir $args
if [ $? -eq 0 ]; then
echo "DB verify: Passed"
exit 0
diff --git a/ldap/admin/src/scripts/dn2rdn.in b/ldap/admin/src/scripts/dn2rdn.in
index bf078ef28..9e1a1025f 100755
--- a/ldap/admin/src/scripts/dn2rdn.in
+++ b/ldap/admin/src/scripts/dn2rdn.in
@@ -1,36 +1,24 @@
#!/bin/sh
-libpath_add() {
- [ -z "$1" ] && return
- LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$1
-}
-
-server_dir="@libdir@/dirsrv/"
-SCRIPT=$(readlink -f $0)
-SCRIPTPATH=$(dirname $SCRIPT)
-if [ $SCRIPTPATH == "/usr/sbin" ]
-then
- prefix=`echo "$SCRIPTPATH" | sed -e 's/\/usr\/sbin//'`
- server_sbin="/usr/sbin"
-else
- prefix=`echo "$SCRIPTPATH" | sed -e 's/\/sbin//'`
- server_sbin=$prefix"/sbin"
-fi
+source ./DSSharedLib
-libpath_add "$server_dir"
-libpath_add "$prefix@nss_libdir@"
-libpath_add "$prefix@libdir@"
+libpath_add "@libdir@/dirsrv/"
+libpath_add "@nss_libdir@"
+libpath_add "@libdir@"
export LD_LIBRARY_PATH
SHLIB_PATH=$LD_LIBRARY_PATH
export SHLIB_PATH
-first="yes"
-arg=""
+usage ()
+{
+ echo "Usage: db2rdn [-Z serverID]"
+}
+
while getopts "Z:d:ha:vfr:D:" flag
do
case $flag in
- h) echo "Usage: db2rdn [-Z serverID]"
+ h) usage
exit 0;;
Z) servid=$OPTARG;;
d) arg=$arg" -d $OPTARG";;
@@ -39,57 +27,21 @@ do
f) arg=$arg" -f";;
r) arg=$arg" -r";;
D) arg=$arg" -D $OPTARG";;
- ?) echo "Usage: db2rdn [-Z serverID]"
+ ?) usage
exit 1;;
esac
done
-# server id not provided, check if there is only one instance
-inst_count=0
-for i in `ls $prefix/etc/sysconfig/dirsrv-* 2>/dev/null`
-do
- if [ $i != '$prefix/etc/sysconfig/dirsrv-admin' ]
- then
- inst_count=`expr $inst_count + 1`
- id=$(expr "$i" : ".*dirsrv-\([^)]*\).*")
- if [ $first == "yes" ]
- then
- instances=$id
- first="no"
- else
- instances=$instances", $id"
- fi
- name=$id
- fi
-done
-
-if [ -z $servid ]
-then
- if [ $inst_count -eq 1 ]
- then
- servid=$name
- else
- # error
- echo "Usage: db2rdn [-Z serverID]"
- echo "You must supply a server instance identifier. Use -Z to specify instance name"
- echo "Available instances: $instances"
- exit 1
- fi
-elif [ $servid == slapd-* ]
-then
- servid=`echo "$servid" | sed -e 's/slapd-//'`
-elif [ $servid == dirsrv-* ]
+servid=$(get_server_id "@initconfigdir@" $servid)
+if [ $? == 1 ]
then
- servid=`echo "$servid" | sed -e 's/dirsrv-//'`
-fi
-configdir="$prefix/etc/dirsrv/slapd-$servid"
-if ! [ -a $configdir ]
-then
- echo "Invalid server identifier: $servid"
- echo "Available instances: $instances"
+ usage
+ echo "You must supply a valid server instance identifier. Use -Z to specify instance name"
+ echo "Available instances: $servid"
exit 1
fi
-cd $server_sbin
-bak_dir=$prefix/var/lib/dirsrv/slapd-$servid/bak/reindex_`date +%Y_%m_%d_%H_%M_%S`
-./ns-slapd upgradedb -D $configdir -r -a "$bak_dir" $arg
+configdir="@instconfigdir@/slapd-$servid"
+
+bak_dir=@localstatedir@/lib/@PACKAGE_NAME@/slapd-$servid/bak/reindex_`date +%Y_%m_%d_%H_%M_%S`
+@sbindir@/ns-slapd upgradedb -D $configdir -r -a "$bak_dir" $arg
diff --git a/ldap/admin/src/scripts/fixup-linkedattrs.pl.in b/ldap/admin/src/scripts/fixup-linkedattrs.pl.in
index 187e5880a..149973608 100644
--- a/ldap/admin/src/scripts/fixup-linkedattrs.pl.in
+++ b/ldap/admin/src/scripts/fixup-linkedattrs.pl.in
@@ -62,15 +62,12 @@ $linkdn_arg = "";
$verbose = 0;
$host = "";
$port = "";
-$first = "yes";
-$prefix = DSUtil::get_prefix();
-$ENV{'PATH'} = "$prefix@ldaptool_bindir@:$prefix/usr/bin:@ldaptool_bindir@:/usr/bin";
+$ENV{'PATH'} = "@ldaptool_bindir@:/usr/bin:@ldaptool_bindir@:/usr/bin";
-DSUtil::libpath_add("$prefix@nss_libdir@");
-DSUtil::libpath_add("$prefix/usr/lib");
DSUtil::libpath_add("@nss_libdir@");
DSUtil::libpath_add("/usr/lib");
+DSUtil::libpath_add("/usr/lib64");
$ENV{'SHLIB_PATH'} = "$ENV{'LD_LIBRARY_PATH'}";
@@ -118,62 +115,9 @@ while ($i <= $#ARGV)
}
$i++;
}
-
-opendir(DIR, "$prefix/etc/sysconfig");
-@files = readdir(DIR);
-foreach $file (@files){
- if($file =~ /^dirsrv-/ && $file ne "dirsrv-admin"){
- $instance_count++;
- if($file =~ /dirsrv-(.*)/){
- if($first eq "yes"){
- $instances=$1;
- $first = "no";
- } else {
- $instances=$instances . ", $1";
- }
- $name = $1;
- }
- }
-}
-
-if($servid eq ""){
- if ($instance_count == 1){
- $servid = $name;
- } else {
- &usage;
- print "You must supply a server instance identifier. Use -Z to specify instance name\n";
- print "Available instances: $instances\n";
- exit (1);
- }
-} elsif ($servid =~ /^dirsrv-/){
- # strip off "dirsrv-"
- $servid =~ s/^dirsrv-//;
-} elsif ($servid =~ /^slapd-/){
- # strip off "slapd-"
- $servid =~ s/^slapd-//;
-}
-@info = DSUtil::get_missing_info($prefix, $servid, $instances, $host, $port, $rootdn);
-
-if ($passwdfile ne ""){
-# Open file and get the password
- unless (open (RPASS, $passwdfile)) {
- die "Error, cannot open password file $passwdfile\n";
- }
- $passwd = <RPASS>;
- chomp($passwd);
- close(RPASS);
-} elsif ($passwd eq "-"){
-# Read the password from terminal
- print "Bind Password: ";
- # Disable console echo
- system("@sttyexec@ -echo") if -t STDIN;
- # read the answer
- $passwd = <STDIN>;
- # Enable console echo
- system("@sttyexec@ echo") if -t STDIN;
- print "\n";
- chop($passwd); # trim trailing newline
-}
+$servid = DSUtil::get_server_id($servid, "@initconfigdir@");
+@info = DSUtil::get_missing_info("@instconfigdir@", $servid, $host, $port, $rootdn);
+$passwd = DSUtil::get_password_from_file($passwd, $passwdfile);
if ( $info[2] eq "" || $passwd eq "" )
{
@@ -194,7 +138,7 @@ $taskname = "linked_attrs_fixup_${yr}_${mn}_${dy}_${h}_${m}_${s}";
# Build the task entry to add
$dn = "dn: cn=$taskname, cn=fixup linked attributes, cn=tasks, cn=config\n";
-$misc = "changetype: add\nobjectclass: top\nobjectclass: extensibleObject\n";
+$misc = "objectclass: top\nobjectclass: extensibleObject\n";
$cn = "cn: $taskname\n";
if ($linkdn_arg ne "")
{
diff --git a/ldap/admin/src/scripts/fixup-memberof.pl.in b/ldap/admin/src/scripts/fixup-memberof.pl.in
index 923d2ad7b..8afa24304 100644
--- a/ldap/admin/src/scripts/fixup-memberof.pl.in
+++ b/ldap/admin/src/scripts/fixup-memberof.pl.in
@@ -67,15 +67,12 @@ $filter = "";
$verbose = 0;
$host = "";
$port = "";
-$first = "yes";
-$prefix = DSUtil::get_prefix();
-$ENV{'PATH'} = "$prefix@ldaptool_bindir@:$prefix/usr/bin:@ldaptool_bindir@:/usr/bin";
+$ENV{'PATH'} = "@ldaptool_bindir@:/usr/bin:@ldaptool_bindir@:/usr/bin";
-DSUtil::libpath_add("$prefix@nss_libdir@");
-DSUtil::libpath_add("$prefix/usr/lib");
DSUtil::libpath_add("@nss_libdir@");
DSUtil::libpath_add("/usr/lib");
+DSUtil::libpath_add("/usr/lib64");
$ENV{'SHLIB_PATH'} = "$ENV{'LD_LIBRARY_PATH'}";
@@ -129,61 +126,9 @@ while ($i <= $#ARGV)
$i++;
}
-opendir(DIR, "$prefix/etc/sysconfig");
-@files = readdir(DIR);
-foreach $file (@files){
- if($file =~ /^dirsrv-/ && $file ne "dirsrv-admin"){
- $instance_count++;
- if($file =~ /dirsrv-(.*)/){
- if($first eq "yes"){
- $instances=$1;
- $first = "no";
- } else {
- $instances=$instances . ", $1";
- }
- $name = $1;
- }
- }
-}
-
-if($servid eq ""){
- if ($instance_count == 1){
- $servid = $name;
- } else {
- &usage;
- print "You must supply a server instance identifier. Use -Z to specify instance name\n";
- print "Available instances: $instances\n";
- exit (1);
- }
-} elsif ($servid =~ /^dirsrv-/){
- # strip off "dirsrv-"
- $servid =~ s/^dirsrv-//;
-} elsif ($servid =~ /^slapd-/){
- # strip off "slapd-"
- $servid =~ s/^slapd-//;
-}
-@info = DSUtil::get_missing_info($prefix, $servid, $instances, $host, $port, $rootdn);
-
-if ($passwdfile ne ""){
-# Open file and get the password
- unless (open (RPASS, $passwdfile)) {
- die "Error, cannot open password file $passwdfile\n";
- }
- $passwd = <RPASS>;
- chomp($passwd);
- close(RPASS);
-} elsif ($passwd eq "-"){
-# Read the password from terminal
- print "Bind Password: ";
- # Disable console echo
- system("@sttyexec@ -echo") if -t STDIN;
- # read the answer
- $passwd = <STDIN>;
- # Enable console echo
- system("@sttyexec@ echo") if -t STDIN;
- print "\n";
- chop($passwd); # trim trailing newline
-}
+$servid = DSUtil::get_server_id($servid, "@initconfigdir@");
+@info = DSUtil::get_missing_info("@instconfigdir@", $servid, $host, $port, $rootdn);
+$passwd = DSUtil::get_password_from_file($passwd, $passwdfile);
if ( $info[2] eq "" || $passwd eq "" || $basedn_arg eq "" )
{
@@ -204,7 +149,7 @@ $taskname = "memberOf_fixup_${yr}_${mn}_${dy}_${h}_${m}_${s}";
# Build the task entry to add
$dn = "dn: cn=$taskname, cn=memberOf task, cn=tasks, cn=config\n";
-$misc = "changetype: add\nobjectclass: top\nobjectclass: extensibleObject\n";
+$misc = "objectclass: top\nobjectclass: extensibleObject\n";
$cn = "cn: $taskname\n";
$basedn = "basedn: $basedn_arg\n";
diff --git a/ldap/admin/src/scripts/ldif2db.in b/ldap/admin/src/scripts/ldif2db.in
index fdf92309a..d62ed660a 100755
--- a/ldap/admin/src/scripts/ldif2db.in
+++ b/ldap/admin/src/scripts/ldif2db.in
@@ -1,26 +1,11 @@
#!/bin/sh
-libpath_add() {
- [ -z "$1" ] && return
- LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$1
-}
-
-server_dir="@libdir@/dirsrv/"
-SCRIPT=$(readlink -f $0)
-SCRIPTPATH=$(dirname $SCRIPT)
-if [ $SCRIPTPATH == "/usr/sbin" ]
-then
- prefix=`echo "$SCRIPTPATH" | sed -e 's/\/usr\/sbin//'`
- server_sbin="/usr/sbin"
-else
- prefix=`echo "$SCRIPTPATH" | sed -e 's/\/sbin//'`
- server_sbin=$prefix"/sbin"
-fi
+source ./DSSharedLib
-libpath_add "$server_dir"
-libpath_add "$prefix@nss_libdir@"
-libpath_add "$prefix@libdir@"
-libpath_add "$prefix@pcre_libdir@"
+libpath_add "@libdir@/dirsrv/"
+libpath_add "@nss_libdir@"
+libpath_add "@libdir@"
+libpath_add "@pcre_libdir@"
export LD_LIBRARY_PATH
SHLIB_PATH=$LD_LIBRARY_PATH
@@ -51,8 +36,6 @@ handleopts()
return 0
}
-first="yes"
-args=""
while getopts "Z:vd:i:g:G:n:s:x:NOCc:St:D:Eq" flag
do
case $flag in
@@ -81,53 +64,17 @@ do
esac
done
-# server id not provided, check if there is only one instance
-inst_count=0
-for i in `ls $prefix/etc/sysconfig/dirsrv-* 2>/dev/null`
-do
- if [ $i != '$prefix/etc/sysconfig/dirsrv-admin' ]
- then
- inst_count=`expr $inst_count + 1`
- id=$(expr "$i" : ".*dirsrv-\([^)]*\).*")
- if [ $first == "yes" ]
- then
- instances=$id
- first="no"
- else
- instances=$instances", $id"
- fi
- name=$id
- fi
-done
-
-if [ -z $servid ]
-then
- if [ $inst_count -eq 1 ]
- then
- servid=$name
- else
- # error
- usage
- echo "You must supply a server instance identifier. Use -Z to specify instance name"
- echo "Available instances: $instances"
- exit 1
- fi
-elif [ $servid == slapd-* ]
+servid=$(get_server_id "@initconfigdir@" $servid)
+if [ $? == 1 ]
then
- servid=`echo "$servid" | sed -e 's/slapd-//'`
-elif [ $servid == dirsrv-* ]
-then
- servid=`echo "$servid" | sed -e 's/dirsrv-//'`
-fi
-configdir="$prefix/etc/dirsrv/slapd-$servid"
-if ! [ -a $configdir ]
-then
- echo "Invalid server identifier: $servid"
- echo "Available instances: $instances"
+ usage
+ echo "You must supply a valid server instance identifier. Use -Z to specify instance name"
+ echo "Available instances: $servid"
exit 1
fi
-cd $server_sbin
+configdir="@instconfigdir@/slapd-$servid"
+
if [ $# -lt 5 ]
then
usage
@@ -136,9 +83,10 @@ fi
handleopts $@
quiet=$?
-
if [ $quiet -eq 0 ]; then
echo importing data ...
fi
-./ns-slapd ldif2db -D $configdir $args 2>&1
+
+@sbindir@/ns-slapd ldif2db -D $configdir $args 2>&1
+
exit $?
diff --git a/ldap/admin/src/scripts/ldif2db.pl.in b/ldap/admin/src/scripts/ldif2db.pl.in
index 379a264a7..5aff2bb4d 100644
--- a/ldap/admin/src/scripts/ldif2db.pl.in
+++ b/ldap/admin/src/scripts/ldif2db.pl.in
@@ -108,8 +108,6 @@ $excli = 0;
$encrypt_on_import = 0;
$host = "";
$port = "";
-$first = "yes";
-$prefix = DSUtil::get_prefix();
while ($i <= $#ARGV) {
if ( "$ARGV[$i]" eq "-i" ) { # ldiffiles
@@ -169,68 +167,16 @@ while ($i <= $#ARGV) {
}
$i++;
}
+$servid = DSUtil::get_server_id($servid, "@initconfigdir@");
+@info = DSUtil::get_missing_info("@instconfigdir@", $servid, $host, $port, $rootdn);
+$passwd = DSUtil::get_password_from_file($passwd, $passwdfile);
-opendir(DIR, "$prefix/etc/sysconfig");
-@files = readdir(DIR);
-foreach $file (@files){
- if($file =~ /^dirsrv-/ && $file ne "dirsrv-admin"){
- $instance_count++;
- if($file =~ /dirsrv-(.*)/){
- if($first eq "yes"){
- $instances=$1;
- $first = "no";
- } else {
- $instances=$instances . ", $1";
- }
- $name = $1;
- }
- }
-}
-
-if($servid eq ""){
- if ($instance_count == 1){
- $servid = $name;
- } else {
- &usage;
- print (STDERR "You must supply a server instance identifier. Use -Z to specify instance name\n");
- print "Available instances: $instances\n";
- exit (1);
- }
-} elsif ($servid =~ /^dirsrv-/){
- # strip off "dirsrv-"
- $servid =~ s/^dirsrv-//;
-} elsif ($servid =~ /^slapd-/){
- # strip off "slapd-"
- $servid =~ s/^slapd-//;
-}
-@info = DSUtil::get_missing_info($prefix, $servid, $instances, $host, $port, $rootdn);
-
-if ($passwdfile ne ""){
-# Open file and get the password
- unless (open (RPASS, $passwdfile)) {
- die "Error, cannot open password file $passwdfile\n";
- }
- $passwd = <RPASS>;
- chomp($passwd);
- close(RPASS);
-} elsif ($passwd eq "-"){
-# Read the password from terminal
- print "Bind Password: ";
- # Disable console echo
- system("@sttyexec@ -echo") if -t STDIN;
- # read the answer
- $passwd = <STDIN>;
- # Enable console echo
- system("@sttyexec@ echo") if -t STDIN;
- print "\n";
- chop($passwd); # trim trailing newline
-}
if (($instance eq "" && $included[0] eq "") || $ldiffiles[0] eq "" || $info[2] eq "" || $passwd eq "") { &usage; exit(1); }
($s, $m, $h, $dy, $mn, $yr, $wdy, $ydy, $r) = localtime(time);
$mn++; $yr += 1900;
$taskname = "import_${yr}_${mn}_${dy}_${h}_${m}_${s}";
$dn = "dn: cn=$taskname, cn=import, cn=tasks, cn=config\n";
-$misc = "changetype: add\nobjectclass: top\nobjectclass: extensibleObject\n";
+$misc = "objectclass: top\nobjectclass: extensibleObject\n";
$cn = "cn: $taskname\n";
if ($instance ne "") {
$nsinstance = "nsInstance: ${instance}\n";
@@ -264,12 +210,11 @@ if ($uniqidname ne "") { $nsuniqidname = "nsUniqueIdGeneratorNamespace: ${uniqid
$entry = "${dn}${misc}${cn}${nsinstance}${nsincluded}${nsexcluded}${nsldiffiles}${nsnoattrindexes}${nsimportencrypt}${nsmergechunksiz}${nsgenuniqid}${nsuniqidname}";
$vstr = "";
if ($verbose != 0) { $vstr = "-v"; }
-$ENV{'PATH'} = "$prefix@ldaptool_bindir@:$prefix/usr/bin:@ldaptool_bindir@:/usr/bin";
+$ENV{'PATH'} = "@ldaptool_bindir@:/usr/bin:@ldaptool_bindir@:/usr/bin";
-DSUtil::libpath_add("$prefix@nss_libdir@");
-DSUtil::libpath_add("$prefix/usr/lib");
DSUtil::libpath_add("@nss_libdir@");
DSUtil::libpath_add("/usr/lib");
+DSUtil::libpath_add("/usr/lib64");
$ENV{'SHLIB_PATH'} = "$ENV{'LD_LIBRARY_PATH'}";
open(FOO, "| ldapmodify @ldaptool_opts@ $vstr -h $info[0] -p $info[1] -D \"$info[2]\" -w \"$passwd\" -a" );
diff --git a/ldap/admin/src/scripts/ldif2ldap.in b/ldap/admin/src/scripts/ldif2ldap.in
index abfb5f42d..069470cfb 100755
--- a/ldap/admin/src/scripts/ldif2ldap.in
+++ b/ldap/admin/src/scripts/ldif2ldap.in
@@ -1,37 +1,22 @@
#!/bin/sh
-libpath_add() {
- [ -z "$1" ] && return
- LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$1
-}
+source ./DSSharedLib
-server_dir="@libdir@/dirsrv/"
-SCRIPT=$(readlink -f $0)
-SCRIPTPATH=$(dirname $SCRIPT)
-if [ $SCRIPTPATH == "/usr/sbin" ]
-then
- prefix=`echo "$SCRIPTPATH" | sed -e 's/\/usr\/sbin//'`
- server_sbin="/usr/sbin"
-else
- prefix=`echo "$SCRIPTPATH" | sed -e 's/\/sbin//'`
- server_sbin=$prefix"/sbin"
-fi
-
-libpath_add "$prefix@ldapsdk_libdir@"
libpath_add "@ldapsdk_libdir@"
-libpath_add "$prefix@nss_libdir@"
-libpath_add "$prefix@libdir@"
+libpath_add "@libdir@"
libpath_add "@nss_libdir@"
-libpath_add "$server_dir"
+libpath_add "@libdir@/dirsrv/"
export LD_LIBRARY_PATH
SHLIB_PATH=$LD_LIBRARY_PATH
export SHLIB_PATH
+PATH=$PATH:@ldaptool_bindir@:@ldaptool_bindir@
-PATH=$PATH:$prefix@ldaptool_bindir@:@ldaptool_bindir@
+usage ()
+{
+ echo "Usage: ldif2ldap [-Z serverID] -D <bind dn> -w <password> -f <file>"
+}
-first="yes"
-args=""
while getopts "Z:D:w:f:h" flag
do
case $flag in
@@ -42,65 +27,29 @@ do
passwd=$OPTARG;;
f) args=$args" -f $OPTARG"
input_file=$OPTARG;;
- h) echo "Usage: ldif2ldap [-Z serverID] -D <bind dn> -w <password> -f <file>"
+ h) usage
exit 0;;
- ?) echo "Usage: ldif2ldap [-Z serverID] -D <bind dn> -w <password> -f <file>"
+ ?) usage
exit 1;;
esac
done
if [ "$binddn" == "" ] || [ "$passwd" == "" ] || [ "$input_file" == "" ]
then
- echo "Usage: ldif2ldap -D <bind dn> -w <password> -f <file>"
+ usage
exit 1
fi
-# server id not provided, check if there is only one instance
-inst_count=0
-for i in `ls $prefix/etc/sysconfig/dirsrv-* 2>/dev/null`
-do
- if [ $i != '$prefix/etc/sysconfig/dirsrv-admin' ]
- then
- inst_count=`expr $inst_count + 1`
- id=$(expr "$i" : ".*dirsrv-\([^)]*\).*")
- if [ $first == "yes" ]
- then
- instances=$id
- first="no"
- else
- instances=$instances", $id"
- fi
- name=$id
- fi
-done
-
-if [ -z $servid ]
-then
- if [ $inst_count -eq 1 ]
- then
- servid=$name
- else
- # error
- echo "Usage: ldif2ldap [-Z serverID] -D <bind dn> -w <password> -f <file>"
- echo "You must supply a server instance identifier. Use -Z to specify instance name"
- echo "Available instances: $instances"
- exit 1
- fi
-elif [ $servid == slapd-* ]
-then
- servid=`echo "$servid" | sed -e 's/slapd-//'`
-elif [ $servid == dirsrv-* ]
-then
- servid=`echo "$servid" | sed -e 's/dirsrv-//'`
-fi
-if ! [ -a "$prefix/etc/dirsrv/slapd-$servid/dse.ldif" ]
+servid=$(get_server_id "@initconfigdir@" $servid)
+if [ $? == 1 ]
then
- echo "Invalid server identifier: $servid"
- echo "Available instances: $instances"
+ usage
+ echo "You must supply a valid server instance identifier. Use -Z to specify instance name"
+ echo "Available instances: $servid"
exit 1
fi
-port=$(grep 'nsslapd-port' $prefix/etc/dirsrv/slapd-$servid/dse.ldif | awk '{print $2}' )
-host=$(grep 'nsslapd-localhost' $prefix/etc/dirsrv/slapd-$servid/dse.ldif | awk '{print $2}' )
+port=$(grep 'nsslapd-port' @instconfigdir@/slapd-$servid/dse.ldif | awk '{print $2}' )
+host=$(grep 'nsslapd-localhost' @instconfigdir@/slapd-$servid/dse.ldif | awk '{print $2}' )
ldapmodify @ldaptool_opts@ -a -p $port -h $host $args
diff --git a/ldap/admin/src/scripts/monitor.in b/ldap/admin/src/scripts/monitor.in
index 643833126..fc3723b28 100755
--- a/ldap/admin/src/scripts/monitor.in
+++ b/ldap/admin/src/scripts/monitor.in
@@ -1,94 +1,45 @@
#!/bin/sh
-libpath_add() {
- [ -z "$1" ] && return
- LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$1
-}
-
-server_dir="@libdir@/dirsrv/"
-SCRIPT=$(readlink -f $0)
-SCRIPTPATH=$(dirname $SCRIPT)
-if [ $SCRIPTPATH == "/usr/sbin" ]
-then
- prefix=`echo "$SCRIPTPATH" | sed -e 's/\/usr\/sbin//'`
-else
- prefix=`echo "$SCRIPTPATH" | sed -e 's/\/sbin//'`
-fi
+source ./DSSharedLib
-libpath_add "$server_dir"
-libpath_add "$prefix@ldapsdk_libdir@"
+libpath_add "@libdir@/dirsrv/"
libpath_add "@ldapsdk_libdir@"
-libpath_add "$prefix@nss_libdir@"
-libpath_add "$prefix@libdir@"
+libpath_add "@libdir@"
libpath_add "@nss_libdir@"
export LD_LIBRARY_PATH
SHLIB_PATH=$LD_LIBRARY_PATH
export SHLIB_PATH
+PATH=$PATH:@ldaptool_bindir@:@ldaptool_bindir@
-PATH=$PATH:$prefix@ldaptool_bindir@:@ldaptool_bindir@
+usage ()
+{
+ echo "Usage: monitor [ -Z serverID ] [ -b basedn ]"
+}
while getopts "Z:b:h" flag
do
case $flag in
Z) servid=$OPTARG;;
b) MDN=$OPTARG;;
- h) echo "Usage: monitor [ -Z serverID ] [ -b basedn ]"
+ h) usage
exit 0;;
- ?) echo "Usage: monitor [ -Z serverID ] [ -b basedn ]"
+ ?) usage
exit 1;;
esac
done
-first="yes"
-
-# server id not provided, check if there is only one instance
-inst_count=0
-for i in `ls $prefix/etc/sysconfig/dirsrv-* 2>/dev/null`
-do
- if [ $i != '$prefix/etc/sysconfig/dirsrv-admin' ]
- then
- inst_count=`expr $inst_count + 1`
- id=$(expr "$i" : ".*dirsrv-\([^)]*\).*")
- if [ $first == "yes" ]
- then
- instances=$id
- first="no"
- else
- instances=$instances", $id"
- fi
- name=$id
- fi
-done
-
-if [ -z $servid ]
-then
- if [ $inst_count -eq 1 ]
- then
- servid=$name
- else
- # error
- echo "Usage: monitor [ -Z serverID ] [ -b basedn ]"
- echo "You must supply a server instance identifier. Use -Z to specify instance name"
- echo "Available instances: $instances"
- exit 1
- fi
-elif [ $servid == slapd-* ]
-then
- servid=`echo "$servid" | sed -e 's/slapd-//'`
-elif [ $servid == dirsrv-* ]
-then
- servid=`echo "$servid" | sed -e 's/dirsrv-//'`
-fi
-if ! [ -a "$prefix/etc/dirsrv/slapd-$servid/dse.ldif" ]
+servid=$(get_server_id "@initconfigdir@" $servid)
+if [ $? == 1 ]
then
- echo "Invalid server identifier: $servid"
- echo "Available instances: $instances"
+ usage
+ echo "You must supply a valid server instance identifier. Use -Z to specify instance name"
+ echo "Available instances: $servid"
exit 1
fi
-port=$(grep 'nsslapd-port' $prefix/etc/dirsrv/slapd-$servid/dse.ldif | awk '{print $2}' )
-host=$(grep 'nsslapd-localhost' $prefix/etc/dirsrv/slapd-$servid/dse.ldif | awk '{print $2}' )
+port=$(grep 'nsslapd-port' @instconfigdir@/slapd-$servid/dse.ldif | awk '{print $2}' )
+host=$(grep 'nsslapd-localhost' @instconfigdir@/slapd-$servid/dse.ldif | awk '{print $2}' )
if [ -z $MDN ]
then
diff --git a/ldap/admin/src/scripts/ns-accountstatus.pl.in b/ldap/admin/src/scripts/ns-accountstatus.pl.in
index eac94733b..ee569147e 100644
--- a/ldap/admin/src/scripts/ns-accountstatus.pl.in
+++ b/ldap/admin/src/scripts/ns-accountstatus.pl.in
@@ -42,8 +42,6 @@
use lib qw(@perlpath@);
use DSUtil;
-$prefix = DSUtil::get_prefix();
-
###############################
# SUB-ROUTINES
###############################
@@ -391,9 +389,9 @@ else
}
debug("Running ** $cmd ** $operation\n");
-$ENV{'PATH'} = "$prefix@ldaptool_bindir@:$prefix/usr/bin:@ldaptool_bindir@:/usr/bin";
-DSUtil::libpath_add("$prefix@nss_libdir@");
-DSUtil::libpath_add("$prefix/usr/lib");
+$ENV{'PATH'} = "@ldaptool_bindir@:/usr/bin:@ldaptool_bindir@:/usr/bin";
+DSUtil::libpath_add("@nss_libdir@");
+DSUtil::libpath_add("/usr/lib");
DSUtil::libpath_add("@nss_libdir@");
DSUtil::libpath_add("/usr/lib");
@@ -411,7 +409,6 @@ $pwfile = "";
$entry = "";
$single = 0;
$role = 0;
-$first = "yes";
# Process the command line arguments
while( $arg = shift)
@@ -457,61 +454,9 @@ while( $arg = shift)
}
}
-opendir(DIR, "$prefix/etc/sysconfig");
-@files = readdir(DIR);
-foreach $file (@files){
- if($file =~ /^dirsrv-/ && $file ne "dirsrv-admin"){
- $instance_count++;
- if($file =~ /dirsrv-(.*)/){
- if($first eq "yes"){
- $instances=$1;
- $first = "no";
- } else {
- $instances=$instances . ", $1";
- }
- $name = $1;
- }
- }
-}
-
-if($servid eq ""){
- if ($instance_count == 1){
- $servid = $name;
- } else {
- &usage;
- print "You must supply a server instance identifier. Use -Z to specify instance name\n";
- print "Available instances: $instances\n";
- exit (1);
- }
-} elsif ($servid =~ /^dirsrv-/){
- # strip off "dirsrv-"
- $servid =~ s/^dirsrv-//;
-} elsif ($servid =~ /^slapd-/){
- # strip off "slapd-"
- $servid =~ s/^slapd-//;
-}
-@info = DSUtil::get_missing_info($prefix, $servid, $instances, $host, $port, $rootdn);
-
-if ($pwfile ne ""){
-# Open file and get the password
- unless (open (RPASS, $pwfile)) {
- die "Error, cannot open password file $passwdfile\n";
- }
- $rootpw = <RPASS>;
- chomp($rootpw);
- close(RPASS);
-} elsif ($rootpw eq "-"){
-# Read the password from terminal
- print "Bind Password: ";
- # Disable console echo
- system("@sttyexec@ -echo") if -t STDIN;
- # read the answer
- $rootpw = <STDIN>;
- # Enable console echo
- system("@sttyexec@ echo") if -t STDIN;
- print "\n";
- chop($rootpw); # trim trailing newline
-}
+$servid = DSUtil::get_server_id($servid, "@initconfigdir@");
+@info = DSUtil::get_missing_info("@instconfigdir@", $servid, $host, $port, $rootdn);
+$rootpw = DSUtil::get_password_from_file($rootpw, $pwfile);
if( $rootpw eq "" || $entry eq "")
{
diff --git a/ldap/admin/src/scripts/ns-activate.pl.in b/ldap/admin/src/scripts/ns-activate.pl.in
index 3660aa425..f7254e00f 100644
--- a/ldap/admin/src/scripts/ns-activate.pl.in
+++ b/ldap/admin/src/scripts/ns-activate.pl.in
@@ -359,7 +359,6 @@ sub checkScope
###############################
# Generated variable
-$prefix = DSUtil::get_prefix();
# Determine which command we are running
if ( $0 =~ /ns-inactivate(.pl)?$/ )
@@ -395,10 +394,10 @@ else
debug("Running ** $cmd ** $operation\n");
-$ENV{'PATH'} = "$prefix@ldaptool_bindir@:$prefix/usr/bin:@ldaptool_bindir@:/usr/bin";
+$ENV{'PATH'} = "@ldaptool_bindir@:/usr/bin:@ldaptool_bindir@:/usr/bin";
-DSUtil::libpath_add("$prefix@nss_libdir@");
-DSUtil::libpath_add("$prefix/usr/lib");
+DSUtil::libpath_add("@nss_libdir@");
+DSUtil::libpath_add("/usr/lib");
DSUtil::libpath_add("@nss_libdir@");
DSUtil::libpath_add("/usr/lib");
@@ -414,7 +413,6 @@ $host = "";
$rootpw = "";
$pwfile = "";
$entry = "";
-$first = "yes";
$single = 0;
$role = 0;
@@ -462,61 +460,9 @@ while( $arg = shift)
}
}
-opendir(DIR, "$prefix/etc/sysconfig");
-@files = readdir(DIR);
-foreach $file (@files){
- if($file =~ /^dirsrv-/ && $file ne "dirsrv-admin"){
- $instance_count++;
- if($file =~ /dirsrv-(.*)/){
- if($first eq "yes"){
- $instances=$1;
- $first = "no";
- } else {
- $instances=$instances . ", $1";
- }
- $name = $1;
- }
- }
-}
-
-if($servid eq ""){
- if ($instance_count == 1){
- $servid = $name;
- } else {
- &usage;
- print "You must supply a server instance identifier. Use -Z to specify instance name\n";
- print "Available instances: $instances\n";
- exit (1);
- }
-} elsif ($servid =~ /^dirsrv-/){
- # strip off "dirsrv-"
- $servid =~ s/^dirsrv-//;
-} elsif ($servid =~ /^slapd-/){
- # strip off "slapd-"
- $servid =~ s/^slapd-//;
-}
-@info = DSUtil::get_missing_info($prefix, $servid, $instances, $host, $port, $rootdn);
-
-if ($pwfile ne ""){
-# Open file and get the password
- unless (open (RPASS, $pwfile)) {
- die "Error, cannot open password file $passwdfile\n";
- }
- $rootpw = <RPASS>;
- chomp($rootpw);
- close(RPASS);
-} elsif ($rootpw eq "-"){
-# Read the password from terminal
- print "Bind Password: ";
- # Disable console echo
- system("@sttyexec@ -echo") if -t STDIN;
- # read the answer
- $rootpw = <STDIN>;
- # Enable console echo
- system("@sttyexec@ echo") if -t STDIN;
- print "\n";
- chop($rootpw); # trim trailing newline
-}
+$servid = DSUtil::get_server_id($servid, "@initconfigdir@");
+@info = DSUtil::get_missing_info("@instconfigdir@", $servid, $host, $port, $rootdn);
+$rootpw = DSUtil::get_password_from_file($rootpw, $pwfile);
if( $rootpw eq "" || $entry eq "")
{
diff --git a/ldap/admin/src/scripts/ns-inactivate.pl.in b/ldap/admin/src/scripts/ns-inactivate.pl.in
index 9aa17e121..cf82eea4d 100644
--- a/ldap/admin/src/scripts/ns-inactivate.pl.in
+++ b/ldap/admin/src/scripts/ns-inactivate.pl.in
@@ -359,7 +359,6 @@ sub checkScope
###############################
# Generated variable
-$prefix = DSUtil::get_prefix();
# Determine which command we are running
if ( $0 =~ /ns-inactivate(.pl)?$/ )
@@ -395,10 +394,10 @@ else
debug("Running ** $cmd ** $operation\n");
-$ENV{'PATH'} = "$prefix@ldaptool_bindir@:$prefix/usr/bin:@ldaptool_bindir@:/usr/bin";
+$ENV{'PATH'} = "@ldaptool_bindir@:/usr/bin:@ldaptool_bindir@:/usr/bin";
-DSUtil::libpath_add("$prefix@nss_libdir@");
-DSUtil::libpath_add("$prefix/usr/lib");
+DSUtil::libpath_add("@nss_libdir@");
+DSUtil::libpath_add("/usr/lib");
DSUtil::libpath_add("@nss_libdir@");
DSUtil::libpath_add("/usr/lib");
@@ -414,7 +413,6 @@ $pwfile = "";
$host = "";
$port = "";
$entry = "";
-$first = "yes";
$single = 0;
$role = 0;
@@ -461,62 +459,9 @@ while( $arg = shift)
exit(1);
}
}
-
-opendir(DIR, "$prefix/etc/sysconfig");
-@files = readdir(DIR);
-foreach $file (@files){
- if($file =~ /^dirsrv-/ && $file ne "dirsrv-admin"){
- $instance_count++;
- if($file =~ /dirsrv-(.*)/){
- if($first eq "yes"){
- $instances=$1;
- $first = "no";
- } else {
- $instances=$instances . ", $1";
- }
- $name = $1;
- }
- }
-}
-
-if($servid eq ""){
- if ($instance_count == 1){
- $servid = $name;
- } else {
- &usage;
- print "You must supply a server instance identifier. Use -Z to specify instance name\n";
- print "Available instances: $instances\n";
- exit (1);
- }
-} elsif ($servid =~ /^dirsrv-/){
- # strip off "dirsrv-"
- $servid =~ s/^dirsrv-//;
-} elsif ($servid =~ /^slapd-/){
- # strip off "slapd-"
- $servid =~ s/^slapd-//;
-}
-@info = DSUtil::get_missing_info($prefix, $servid, $instances, $host, $port, $rootdn);
-
-if ($pwfile ne ""){
-# Open file and get the password
- unless (open (RPASS, $pwfile)) {
- die "Error, cannot open password file $passwdfile\n";
- }
- $rootpw = <RPASS>;
- chomp($rootpw);
- close(RPASS);
-} elsif ($rootpw eq "-"){
-# Read the password from terminal
- print "Bind Password: ";
- # Disable console echo
- system("@sttyexec@ -echo") if -t STDIN;
- # read the answer
- $rootpw = <STDIN>;
- # Enable console echo
- system("@sttyexec@ echo") if -t STDIN;
- print "\n";
- chop($rootpw); # trim trailing newline
-}
+$servid = DSUtil::get_server_id($servid, "@initconfigdir@");
+@info = DSUtil::get_missing_info("@instconfigdir@", $servid, $host, $port, $rootdn);
+$rootpw = DSUtil::get_password_from_file($rootpw, $pwfile);
if( $rootpw eq "" || $entry eq "")
{
diff --git a/ldap/admin/src/scripts/ns-newpwpolicy.pl.in b/ldap/admin/src/scripts/ns-newpwpolicy.pl.in
index 4486ad19d..d785147b7 100755
--- a/ldap/admin/src/scripts/ns-newpwpolicy.pl.in
+++ b/ldap/admin/src/scripts/ns-newpwpolicy.pl.in
@@ -45,13 +45,12 @@ use DSUtil;
# enable the use of our bundled perldap with our bundled ldapsdk libraries
# all of this nonsense can be omitted if the mozldapsdk and perldap are
# installed in the operating system locations (e.g. /usr/lib /usr/lib/perl5)
-$prefix = DSUtil::get_prefix();
-$ENV{'PATH'} = "$prefix@ldaptool_bindir@:$prefix/usr/bin:@ldaptool_bindir@:/usr/bin";
-DSUtil::libpath_add("$prefix@nss_libdir@");
-DSUtil::libpath_add("$prefix/usr/lib");
+$ENV{'PATH'} = "@ldaptool_bindir@:/usr/bin:@ldaptool_bindir@:/usr/bin";
+
DSUtil::libpath_add("@nss_libdir@");
DSUtil::libpath_add("/usr/lib");
+DSUtil::libpath_add("/usr/lib64");
$ENV{'SHLIB_PATH'} = "$ENV{'LD_LIBRARY_PATH'}";
# Add new password policy specific entries
@@ -102,41 +101,8 @@ sub usage {
{
usage() if (!getopts('vD:w:j:p:h:U:S:Z:'));
- $first = "yes";
-
- opendir(DIR, "$prefix/etc/sysconfig");
- @files = readdir(DIR);
- foreach $file (@files){
- if($file =~ /^dirsrv-/ && $file ne "dirsrv-admin"){
- $instance_count++;
- if($file =~ /dirsrv-(.*)/){
- if($first eq "yes"){
- $instances=$1;
- $first = "no";
- } else {
- $instances=$instances . ", $1";
- }
- $name = $1;
- }
- }
- }
-
- if($opt_Z eq ""){
- if ($instance_count == 1){
- $opt_Z = $name;
- } else {
- print (STDERR "You must supply a server instance identifier. Use -Z to specify instance name\n");
- print "Available instances: $instances\n";
- exit (1);
- }
- } elsif ($opt_Z =~ /^dirsrv-/){
- # strip off "dirsrv-"
- $opt_Z =~ s/^dirsrv-//;
- } elsif ($opt_Z =~ /^slapd-/){
- # strip off "slapd-"
- $opt_Z =~ s/^slapd-//;
- }
- @info = DSUtil::get_missing_info($prefix, $opt_Z, $instances, $opt_h, $opt_p, $opt_D);
+ $opt_Z = DSUtil::get_server_id($opt_Z, "@initconfigdir@");
+ @info = DSUtil::get_missing_info("@instconfigdir@", $opt_Z, $opt_h, $opt_p, $opt_D);
if ($opt_j ne ""){
die "Error, cannot open password file $opt_j\n" unless (open (RPASS, $opt_j));
diff --git a/ldap/admin/src/scripts/restart-slapd.in b/ldap/admin/src/scripts/restart-slapd.in
index 800c51255..87120826e 100644
--- a/ldap/admin/src/scripts/restart-slapd.in
+++ b/ldap/admin/src/scripts/restart-slapd.in
@@ -1,5 +1,7 @@
#!/bin/sh
+source ./DSSharedLib
+
# Script that restarts the ns-slapd server.
# Exit status can be:
# 0: Server restarted successfully
@@ -7,8 +9,11 @@
# 2: Server started successfully (was not running)
# 3: Server could not be stopped
-first="yes"
-args=""
+usage ()
+{
+ echo "Usage: restart-slapd [-Z serverID]"
+}
+
while getopts "Z:SvVhi:d:w:" flag
do
case $flag in
@@ -19,70 +24,23 @@ do
i) args=$args" -i $OPTARG";;
w) args=$args" -w $OPTARG";;
S) args=$args" -S";;
- h) echo "Usage: restart-slapd [-Z serverID]"
+ h) usage
exit 0;;
- ?) echo "Usage: restart-slapd [-Z serverID]"
+ ?) usage
exit 1;;
esac
done
-SCRIPT=$(readlink -f $0)
-SCRIPTPATH=$(dirname $SCRIPT)
-if [ $SCRIPTPATH == "/usr/sbin" ]
-then
- prefix=`echo "$SCRIPTPATH" | sed -e 's/\/usr\/sbin//'`
-else
- prefix=`echo "$SCRIPTPATH" | sed -e 's/\/sbin//'`
-fi
-
-# server id not provided, check if there is only one instance
-inst_count=0
-for i in `ls $prefix/etc/sysconfig/dirsrv-* 2>/dev/null`
-do
- if [ $i != '$prefix/etc/sysconfig/dirsrv-admin' ]
- then
- inst_count=`expr $inst_count + 1`
- id=$(expr "$i" : ".*dirsrv-\([^)]*\).*")
- if [ $first == "yes" ]
- then
- instances=$id
- first="no"
- else
- instances=$instances", $id"
- fi
- name=$id
- fi
-done
-
-if [ -z $servid ]
-then
- if [ $inst_count -eq 1 ]
- then
- servid=$name
- else
- # error
- echo "Usage: restart-slapd [-Z serverID]"
- echo "You must supply a server instance identifier. Use -Z to specify instance name"
- echo "Available instances: $instances"
- exit 1
- fi
-elif [ $servid == slapd-* ]
-then
- servid=`echo "$servid" | sed -e 's/slapd-//'`
-elif [ $servid == dirsrv-* ]
-then
- servid=`echo "$servid" | sed -e 's/dirsrv-//'`
-fi
-
-
-if ! [ -a "$prefix/etc/dirsrv/slapd-$servid/dse.ldif" ]
+servid=$(get_server_id "@initconfigdir@" $servid)
+if [ $? == 1 ]
then
- echo "Invalid server identifier: $servid"
- echo "Available instances: $instances"
+ usage
+ echo "You must supply a valid server instance identifier. Use -Z to specify instance name"
+ echo "Available instances: $servid"
exit 1
fi
-@sbindir@/restart-dirsrv -d $prefix/etc/sysconfig $servid $args
+@sbindir@/restart-dirsrv -d @initconfigdir@ $servid $args
if [ $? == 0 ]
then
echo Sucessfully restarted instance $servid
diff --git a/ldap/admin/src/scripts/restoreconfig.in b/ldap/admin/src/scripts/restoreconfig.in
index 1f5ea8e42..c8f68bd47 100755
--- a/ldap/admin/src/scripts/restoreconfig.in
+++ b/ldap/admin/src/scripts/restoreconfig.in
@@ -1,101 +1,47 @@
#!/bin/sh
-libpath_add() {
- [ -z "$1" ] && return
- LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$1
-}
-
-server_dir="@libdir@/dirsrv/"
-SCRIPT=$(readlink -f $0)
-SCRIPTPATH=$(dirname $SCRIPT)
-if [ $SCRIPTPATH == "/usr/sbin" ]
-then
- prefix=`echo "$SCRIPTPATH" | sed -e 's/\/usr\/sbin//'`
- server_sbin="/usr/sbin"
-else
- prefix=`echo "$SCRIPTPATH" | sed -e 's/\/sbin//'`
- server_sbin=$prefix"/sbin"
-fi
+source ./DSSharedLib
-libpath_add "$server_dir"
-libpath_add "$prefix@nss_libdir@"
-libpath_add "$prefix@libdir@"
-libpath_add "@libdir@"
+libpath_add "@libdir@/dirsrv/"
libpath_add "@nss_libdir@"
-libpath_add "$prefix@pcre_libdir@"
+libpath_add "@libdir@"
+libpath_add "@pcre_libdir@"
export LD_LIBRARY_PATH
SHLIB_PATH=$LD_LIBRARY_PATH
export SHLIB_PATH
+usage ()
+{
+ echo "Usage: restoreconfig [-Z serverID]"
+ echo " -Z - Server instance identifier"
+}
+
while getopts "Z:h" flag
do
case $flag in
Z) servid=$OPTARG;;
- h) echo "Usage: restoreconfig [-Z serverID]"
- echo " -Z - Server instance identifier"
+ h) usage
exit 0;;
- ?) echo "Usage: restoreconfig [-Z serverID]"
- echo " -Z - Server instance identifier"
+ ?) usage
exit 1;;
-
esac
done
-first="yes"
-
-# server id not provided, check if there is only one instance
-inst_count=0
-for i in `ls $prefix/etc/sysconfig/dirsrv-* 2>/dev/null`
-do
- if [ $i != '$prefix/etc/sysconfig/dirsrv-admin' ]
- then
- inst_count=`expr $inst_count + 1`
- id=$(expr "$i" : ".*dirsrv-\([^)]*\).*")
- if [ $first == "yes" ]
- then
- instances=$id
- first="no"
- else
- instances=$instances", $id"
- fi
- name=$id
- fi
-done
-
-if [ -z $servid ]
-then
- if [ $inst_count -eq 1 ]
- then
- servid=$name
- else
- # error
- echo "Usage: restoreconfig [-Z serverID]"
- echo "You must supply a server instance identifier. Use -Z to specify instance name"
- echo "Available instances: $instances"
- exit 1
- fi
-elif [ $servid == slapd-* ]
-then
- servid=`echo "$servid" | sed -e 's/slapd-//'`
-elif [ $servid == dirsrv-* ]
-then
- servid=`echo "$servid" | sed -e 's/dirsrv-//'`
-fi
-configdir="$prefix/etc/dirsrv/slapd-$servid"
-if ! [ -a $configdir ]
+servid=$(get_server_id "@initconfigdir@" $servid)
+if [ $? == 1 ]
then
- echo "Invalid server identifier: $servid"
- echo "Available instances: $instances"
+ usage
+ echo "You must supply a valid server instance identifier. Use -Z to specify instance name"
+ echo "Available instances: $servid"
exit 1
fi
-cd $server_sbin
-conf_ldif=`ls -1t $prefix/var/lib/dirsrv/slapd-$servid/bak/$servid-*.ldif 2>/dev/null | head -1 `
+conf_ldif=`ls -1t @localstatedir@/lib/@PACKAGE_NAME@/slapd-$servid/bak/$servid-*.ldif 2>/dev/null | head -1 `
if [ -z "$conf_ldif" ]
then
- echo No configuration to restore in $prefix/var/lib/dirsrv/slapd-$servid/bak/ ; exit 1
+ echo No configuration to restore in @localstatedir@/lib/@PACKAGE_NAME@/slapd-$servid/bak/ ; exit 1
fi
echo Restoring $conf_ldif...
-./ns-slapd ldif2db -D $configdir -i $conf_ldif -n NetscapeRoot 2>&1
+@sbindir@/ns-slapd ldif2db -D $configdir -i $conf_ldif -n NetscapeRoot 2>&1
exit $?
diff --git a/ldap/admin/src/scripts/saveconfig.in b/ldap/admin/src/scripts/saveconfig.in
index 62aa1601b..f388a829a 100755
--- a/ldap/admin/src/scripts/saveconfig.in
+++ b/ldap/admin/src/scripts/saveconfig.in
@@ -1,98 +1,47 @@
#!/bin/sh
-libpath_add() {
- [ -z "$1" ] && return
- LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$1
-}
-
-server_dir="@libdir@/dirsrv/"
-SCRIPT=$(readlink -f $0)
-SCRIPTPATH=$(dirname $SCRIPT)
-if [ $SCRIPTPATH == "/usr/sbin" ]
-then
- prefix=`echo "$SCRIPTPATH" | sed -e 's/\/usr\/sbin//'`
- server_sbin="/usr/sbin"
-else
- prefix=`echo "$SCRIPTPATH" | sed -e 's/\/sbin//'`
- server_sbin=$prefix"/sbin"
-fi
+source ./DSSharedLib
-libpath_add "$server_dir"
-libpath_add "$prefix@nss_libdir@"
-libpath_add "$prefix@libdir@"
+libpath_add "@libdir@/dirsrv/"
libpath_add "@libdir@"
libpath_add "@nss_libdir@"
-libpath_add "$prefix@pcre_libdir@"
+libpath_add "@pcre_libdir@"
export LD_LIBRARY_PATH
SHLIB_PATH=$LD_LIBRARY_PATH
export SHLIB_PATH
+usage ()
+{
+ echo "Usage: saveconfig [-Z serverID]"
+ echo " -Z - Server instance identifier"
+}
+
while getopts "Z:h" flag
do
case $flag in
Z) servid=$OPTARG;;
- h) echo "Usage: saveconfig [-Z serverID]"
- echo " -Z - Server instance identifier"
+ h) usage
exit 0;;
- ?) echo "Usage: saveconfig [-Z serverID]"
- echo " -Z - Server instance identifier"
+ ?) usage
exit 1;;
esac
done
-first="yes"
-
-# server id not provided, check if there is only one instance
-inst_count=0
-for i in `ls $prefix/etc/sysconfig/dirsrv-* 2>/dev/null`
-do
- if [ $i != '$prefix/etc/sysconfig/dirsrv-admin' ]
- then
- inst_count=`expr $inst_count + 1`
- id=$(expr "$i" : ".*dirsrv-\([^)]*\).*")
- if [ $first == "yes" ]
- then
- instances=$id
- first="no"
- else
- instances=$instances", $id"
- fi
- name=$id
- fi
-done
-
-if [ -z $servid ]
-then
- if [ $inst_count -eq 1 ]
- then
- servid=$name
- else
- # error
- echo "Usage: saveconfig [-Z serverID]"
- echo "You must supply a server instance identifier. Use -Z to specify instance name"
- echo "Available instances: $instances"
- exit 1
- fi
-elif [ $servid == slapd-* ]
-then
- servid=`echo "$servid" | sed -e 's/slapd-//'`
-elif [ $servid == dirsrv-* ]
+servid=$(get_server_id "@initconfigdir@" $servid)
+if [ $? == 1 ]
then
- servid=`echo "$servid" | sed -e 's/dirsrv-//'`
-fi
-configdir="$prefix/etc/dirsrv/slapd-$servid"
-if ! [ -a $configdir ]
-then
- echo "Invalid server identifier: $servid"
- echo "Available instances: $instances"
+ usage
+ echo "You must supply a valid server instance identifier. Use -Z to specify instance name"
+ echo "Available instances: $servid"
exit 1
fi
-cd $server_sbin
+configdir="@instconfigdir@/slapd-$servid"
+
echo saving configuration...
-conf_ldif=$prefix/var/lib/dirsrv/slapd-$servid/bak/$servid-`date +%Y_%m_%d_%H%M%S`.ldif
-./ns-slapd db2ldif -N -D $configdir -s "o=NetscapeRoot" -a $conf_ldif -n NetscapeRoot 2>&1
+conf_ldif=@localstatedir@/lib/@PACKAGE_NAME@/slapd-$servid/bak/$servid-`date +%Y_%m_%d_%H%M%S`.ldif
+@sbindir@/ns-slapd db2ldif -N -D $configdir -s "o=NetscapeRoot" -a $conf_ldif -n NetscapeRoot 2>&1
if [ "$?" -ge 1 ]
then
echo Error occurred while saving configuration
diff --git a/ldap/admin/src/scripts/schema-reload.pl.in b/ldap/admin/src/scripts/schema-reload.pl.in
index 8d235a6df..3e8cc0803 100644
--- a/ldap/admin/src/scripts/schema-reload.pl.in
+++ b/ldap/admin/src/scripts/schema-reload.pl.in
@@ -61,16 +61,13 @@ $schemadir = "";
$verbose = 0;
$host = "";
$port = "";
-$first = "yes";
-$prefix = DSUtil::get_prefix();
$ENV{'SHLIB_PATH'} = "$ENV{'LD_LIBRARY_PATH'}";
-$ENV{'PATH'} = "$prefix@ldaptool_bindir@:$prefix/usr/bin:@ldaptool_bindir@:/usr/bin";
+$ENV{'PATH'} = "@ldaptool_bindir@:/usr/bin:@ldaptool_bindir@:/usr/bin";
-DSUtil::libpath_add("$prefix@nss_libdir@");
-DSUtil::libpath_add("$prefix/usr/lib");
DSUtil::libpath_add("@nss_libdir@");
DSUtil::libpath_add("/usr/lib");
+DSUtil::libpath_add("/usr/lib64");
$i = 0;
while ($i <= $#ARGV)
@@ -116,63 +113,9 @@ while ($i <= $#ARGV)
}
$i++;
}
-
-
-opendir(DIR, "$prefix/etc/sysconfig");
-@files = readdir(DIR);
-foreach $file (@files){
- if($file =~ /^dirsrv-/ && $file ne "dirsrv-admin"){
- $instance_count++;
- if($file =~ /dirsrv-(.*)/){
- if($first eq "yes"){
- $instances=$1;
- $first = "no";
- } else {
- $instances=$instances . ", $1";
- }
- $name = $1;
- }
- }
-}
-
-if($servid eq ""){
- if ($instance_count == 1){
- $servid = $name;
- } else {
- &usage;
- print "You must supply a server instance identifier. Use -Z to specify instance name\n";
- print "Available instances: $instances\n";
- exit (1);
- }
-} elsif ($servid =~ /^dirsrv-/){
- # strip off "dirsrv-"
- $servid =~ s/^dirsrv-//;
-} elsif ($servid =~ /^slapd-/){
- # strip off "slapd-"
- $servid =~ s/^slapd-//;
-}
-@info = DSUtil::get_missing_info($prefix, $servid, $instances, $host, $port, $rootdn);
-
-if ($passwdfile ne ""){
-# Open file and get the password
- unless (open (RPASS, $passwdfile)) {
- die "Error, cannot open password file $passwdfile\n";
- }
- $passwd = <RPASS>;
- chomp($passwd);
- close(RPASS);
-} elsif ($passwd eq "-"){
-# Read the password from terminal
- print "Bind Password: ";
- # Disable console echo
- system("@sttyexec@ -echo") if -t STDIN;
- # read the answer
- $passwd = <STDIN>;
- # Enable console echo
- system("@sttyexec@ echo") if -t STDIN;
- print "\n";
- chop($passwd); # trim trailing newline
-}
+$servid = DSUtil::get_server_id($servid, "@initconfigdir@");
+@info = DSUtil::get_missing_info("@instconfigdir@", $servid, $host, $port, $rootdn);
+$passwd = DSUtil::get_password_from_file($passwd, $passwdfile);
if ( $info[2] eq "" || $passwd eq "" )
{
diff --git a/ldap/admin/src/scripts/start-slapd.in b/ldap/admin/src/scripts/start-slapd.in
index 6f1f6a58e..d31ffcf68 100755
--- a/ldap/admin/src/scripts/start-slapd.in
+++ b/ldap/admin/src/scripts/start-slapd.in
@@ -1,12 +1,18 @@
#!/bin/sh
+source ./DSSharedLib
+
# Script that starts the ns-slapd server.
# Exit status can be:
# 0: Server started successfully
# 1: Server could not be started
# 2: Server already running
-args=""
+usage ()
+{
+ echo "Usage: start-slapd [-Z serverID]"
+}
+
while getopts "Z:SvVhi:d:w:" flag
do
case $flag in
@@ -17,66 +23,28 @@ do
i) args=$args" -i $OPTARG";;
w) args=$args" -w $OPTARG";;
S) args=$args" -S";;
- h) echo "Usage: start-slapd [-Z serverID]"
+ h) usage
exit 0;;
- ?) echo "Usage: start-slapd [-Z serverID]"
+ ?) usage
exit 1;;
esac
done
-SCRIPT=$(readlink -f $0)
-SCRIPTPATH=$(dirname $SCRIPT)
-if [ $SCRIPTPATH == "/usr/sbin" ]
+servid=$(get_server_id "@initconfigdir@" $servid)
+if [ $? == 1 ]
then
- prefix=`echo "$SCRIPTPATH" | sed -e 's/\/usr\/sbin//'`
-else
- prefix=`echo "$SCRIPTPATH" | sed -e 's/\/sbin//'`
+ usage
+ echo "You must supply a valid server instance identifier. Use -Z to specify instance name"
+ echo "Available instances: $servid"
+ exit 1
fi
-first="yes"
-if [ -z $servid ]
-then
- # server id not provided, check if there is only one instance
- inst_count=0
- for i in `ls $prefix/etc/sysconfig/dirsrv-* 2>/dev/null`
- do
- if [ $i != '$prefix/etc/sysconfig/dirsrv-admin' ]
- then
- inst_count=`expr $inst_count + 1`
- id=$(expr "$i" : ".*dirsrv-\([^)]*\).*")
- if [ $first == "yes" ]
- then
- instances=$id
- first="no"
- else
- instances=$instances", $id"
- fi
- name=$id
- fi
- done
- if [ $inst_count -eq 1 ]
- then
- servid=$name
- else
- # error
- echo "Usage: start-slapd [-Z serverID]"
- echo "You must supply a server instance identifier. Use -Z to specify instance name"
- echo "Available instances: $instances"
- exit 1
- fi
-elif [ $servid == slapd-* ]
-then
- servid=`echo "$servid" | sed -e 's/slapd-//'`
-elif [ $servid == dirsrv-* ]
-then
- servid=`echo "$servid" | sed -e 's/dirsrv-//'`
-fi
-
-@sbindir@/start-dirsrv -d $prefix/etc/sysconfig $servid $args
+@sbindir@/start-dirsrv -d @initconfigdir@ $servid $args
if [ $? == 0 ]
then
echo Sucessfully started instance $servid
else
echo Failed to start instance $servid
fi
+
exit $?
diff --git a/ldap/admin/src/scripts/stop-slapd.in b/ldap/admin/src/scripts/stop-slapd.in
index 7661b1791..c8b9f425a 100755
--- a/ldap/admin/src/scripts/stop-slapd.in
+++ b/ldap/admin/src/scripts/stop-slapd.in
@@ -1,11 +1,18 @@
#!/bin/sh
+source ./DSSharedLib
+
# Script that stops the ns-slapd server.
# Exit status can be:
# 0: Server stopped successfully
# 1: Server could not be stopped
# 2: Server was not running
+usage ()
+{
+ echo "Usage: stop-slapd [-Z serverID]"
+}
+
while getopts "Z:SvVhi:d:w:" flag
do
case $flag in
@@ -16,63 +23,23 @@ do
i) args=$args" -i $OPTARG";;
w) args=$args" -w $OPTARG";;
S) args=$args" -S";;
- h) echo "Usage: stop-slapd [-Z serverID]"
+ h) usage
exit 0;;
- ?) echo "Usage: stop-slapd [-Z serverID]"
+ ?) usage
exit 1;;
esac
done
-SCRIPT=$(readlink -f $0)
-SCRIPTPATH=$(dirname $SCRIPT)
-if [ $SCRIPTPATH == "/usr/sbin" ]
+servid=$(get_server_id "@initconfigdir@" $servid)
+if [ $? == 1 ]
then
- prefix=`echo "$SCRIPTPATH" | sed -e 's/\/usr\/sbin//'`
-else
- prefix=`echo "$SCRIPTPATH" | sed -e 's/\/sbin//'`
+ usage
+ echo "You must supply a valid server instance identifier. Use -Z to specify instance name"
+ echo "Available instances: $servid"
+ exit 1
fi
-first="yes"
-if [ -z $servid ]
-then
- # server id not provided, check if there is only one instance
- inst_count=0
- for i in `ls $prefix/etc/sysconfig/dirsrv-* 2>/dev/null`
- do
- if [ $i != '$prefix/etc/sysconfig/dirsrv-admin' ]
- then
- inst_count=`expr $inst_count + 1`
- id=$(expr "$i" : ".*dirsrv-\([^)]*\).*")
- if [ $first == "yes" ]
- then
- instances=$id
- first="no"
- else
- instances=$instances", $id"
- fi
- name=$id
- fi
- done
- if [ $inst_count -eq 1 ]
- then
- servid=$name
- else
- # error
- echo "Usage: stop-slapd [-Z serverID]"
- echo "You must supply a server instance identifier. Use -Z to specify instance name"
- echo "Available instances: $instances"
- exit 1
- fi
-elif [ $servid == slapd-* ]
-then
- servid=`echo "$servid" | sed -e 's/slapd-//'`
-elif [ $servid == dirsrv-* ]
-then
- servid=`echo "$servid" | sed -e 's/dirsrv-//'`
-fi
-
-
-@sbindir@/stop-dirsrv -d $prefix/etc/sysconfig $servid $args
+@sbindir@/stop-dirsrv -d @initconfigdir@ $servid $args
if [ $? == 0 ]
then
echo Sucessfully stopped instance $servid
diff --git a/ldap/admin/src/scripts/suffix2instance.in b/ldap/admin/src/scripts/suffix2instance.in
index 0c31fc6f9..86b89054e 100755
--- a/ldap/admin/src/scripts/suffix2instance.in
+++ b/ldap/admin/src/scripts/suffix2instance.in
@@ -1,104 +1,54 @@
#!/bin/sh
-libpath_add() {
- [ -z "$1" ] && return
- LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$1
-}
-
-server_dir="@libdir@/dirsrv/"
-SCRIPT=$(readlink -f $0)
-SCRIPTPATH=$(dirname $SCRIPT)
-if [ $SCRIPTPATH == "/usr/sbin" ]
-then
- prefix=`echo "$SCRIPTPATH" | sed -e 's/\/usr\/sbin//'`
- server_sbin="/usr/sbin"
-else
- prefix=`echo "$SCRIPTPATH" | sed -e 's/\/sbin//'`
- server_sbin=$prefix"/sbin"
-fi
+source ./DSSharedLib
-libpath_add "$server_dir"
-libpath_add "$prefix@nss_libdir@"
-libpath_add "$prefix@libdir@"
+libpath_add "@libdir@/dirsrv/"
libpath_add "@libdir@"
libpath_add "@nss_libdir@"
-libpath_add "$prefix@pcre_libdir@"
+libpath_add "@pcre_libdir@"
export LD_LIBRARY_PATH
SHLIB_PATH=$LD_LIBRARY_PATH
export SHLIB_PATH
-first="yes"
-args=""
+usage ()
+{
+ echo "Usage: suffix2index [-Z serverID] -s <suffix>"
+}
+
while getopts "Z:s:h" flag
do
case $flag in
Z) servid=$OPTARG;;
s) args=$args" -s $OPTARG";;
- h) echo "Usage: suffix2index [-Z serverID] -s <suffix>"
+ h) usage
exit 0;;
- ?) echo "Usage: suffix2index [-Z serverID] -s <suffix>"
+ ?) usage
exit 1;;
esac
done
if [ "$args" == "" ]
then
- echo "Usage: suffix2index [-Z serverID] -s <suffix>"
+ usage
exit 1
fi
-# server id not provided, check if there is only one instance
-inst_count=0
-for i in `ls $prefix/etc/sysconfig/dirsrv-* 2>/dev/null`
-do
- if [ $i != '$prefix/etc/sysconfig/dirsrv-admin' ]
- then
- inst_count=`expr $inst_count + 1`
- id=$(expr "$i" : ".*dirsrv-\([^)]*\).*")
- if [ $first == "yes" ]
- then
- instances=$id
- first="no"
- else
- instances=$instances", $id"
- fi
- name=$id
- fi
-done
-
-if [ -z $servid ]
-then
- if [ $inst_count -eq 1 ]
- then
- servid=$name
- else
- # error
- echo "Usage: suffix2index [-Z serverID] -s <suffix>"
- echo "You must supply a server instance identifier. Use -Z to specify instance name"
- echo "Available instances: $instances"
- exit 1
- fi
-elif [ $servid == slapd-* ]
-then
- servid=`echo "$servid" | sed -e 's/slapd-//'`
-elif [ $servid == dirsrv-* ]
+servid=$(get_server_id "@initconfigdir@" $servid)
+if [ $? == 1 ]
then
- servid=`echo "$servid" | sed -e 's/dirsrv-//'`
-fi
-configdir="$prefix/etc/dirsrv/slapd-$servid"
-if ! [ -a $configdir ]
-then
- echo "Invalid server identifier: $servid"
- echo "Available instances: $instances"
+ usage
+ echo "You must supply a valid server instance identifier. Use -Z to specify instance name"
+ echo "Available instances: $servid"
exit 1
fi
-cd $server_sbin
+configdir="@instconfigdir@/slapd-$servid"
+
if [ $# -lt 2 ]
then
echo Usage: suffix2instance [-Z serverID] {-s includesuffix}*
exit 1
fi
-./ns-slapd suffix2instance -D $configdir $args 2>&1
+@sbindir@/ns-slapd suffix2instance -D $configdir $args 2>&1
diff --git a/ldap/admin/src/scripts/syntax-validate.pl.in b/ldap/admin/src/scripts/syntax-validate.pl.in
index 2d6c98b9f..18bddba65 100644
--- a/ldap/admin/src/scripts/syntax-validate.pl.in
+++ b/ldap/admin/src/scripts/syntax-validate.pl.in
@@ -64,17 +64,14 @@ $passwdfile = "";
$basedn_arg = "";
$filter_arg = "";
$filter = "";
-$first = "yes";
$verbose = 0;
-$prefix = DSUtil::get_prefix();
$ENV{'SHLIB_PATH'} = "$ENV{'LD_LIBRARY_PATH'}";
-$ENV{'PATH'} = "$prefix@ldaptool_bindir@:$prefix/usr/bin:@ldaptool_bindir@:/usr/bin";
+$ENV{'PATH'} = "@ldaptool_bindir@:/usr/bin:@ldaptool_bindir@:/usr/bin";
-DSUtil::libpath_add("$prefix@nss_libdir@");
-DSUtil::libpath_add("$prefix/usr/lib");
DSUtil::libpath_add("@nss_libdir@");
DSUtil::libpath_add("/usr/lib");
+DSUtil::libpath_add("/usr/lib64");
$i = 0;
while ($i <= $#ARGV)
@@ -126,61 +123,9 @@ while ($i <= $#ARGV)
$i++;
}
-opendir(DIR, "$prefix/etc/sysconfig");
-@files = readdir(DIR);
-foreach $file (@files){
- if($file =~ /^dirsrv-/ && $file ne "dirsrv-admin"){
- $instance_count++;
- if($file =~ /dirsrv-(.*)/){
- if($first eq "yes"){
- $instances=$1;
- $first = "no";
- } else {
- $instances=$instances . ", $1";
- }
- $name = $1;
- }
- }
-}
-
-if($servid eq ""){
- if ($instance_count == 1){
- $servid = $name;
- } else {
- &usage;
- print "You must supply a server instance identifier. Use -Z to specify instance name\n";
- print "Available instances: $instances\n";
- exit (1);
- }
-} elsif ($servid =~ /^dirsrv-/){
- # strip off "dirsrv-"
- $servid =~ s/^dirsrv-//;
-} elsif ($servid =~ /^slapd-/){
- # strip off "slapd-"
- $servid =~ s/^slapd-//;
-}
-@info = DSUtil::get_missing_info($prefix, $servid, $instances, $host, $port, $rootdn);
-
-if ($passwdfile ne ""){
-# Open file and get the password
- unless (open (RPASS, $passwdfile)) {
- die "Error, cannot open password file $passwdfile\n";
- }
- $passwd = <RPASS>;
- chomp($passwd);
- close(RPASS);
-} elsif ($passwd eq "-"){
-# Read the password from terminal
- print "Bind Password: ";
- # Disable console echo
- system("@sttyexec@ -echo") if -t STDIN;
- # read the answer
- $passwd = <STDIN>;
- # Enable console echo
- system("@sttyexec@ echo") if -t STDIN;
- print "\n";
- chop($passwd); # trim trailing newline
-}
+$servid = DSUtil::get_server_id($servid, "@initconfigdir@");
+@info = DSUtil::get_missing_info("@instconfigdir@", $servid, $host, $port, $rootdn);
+$passwd = DSUtil::get_password_from_file($passwd, $passwdfile);
if ( $info[2] eq "" || $passwd eq "" || $basedn_arg eq "" )
{
@@ -201,7 +146,7 @@ $taskname = "syntax_validate_${yr}_${mn}_${dy}_${h}_${m}_${s}";
# Build the task entry to add
$dn = "dn: cn=$taskname, cn=syntax validate, cn=tasks, cn=config\n";
-$misc = "changetype: add\nobjectclass: top\nobjectclass: extensibleObject\n";
+$misc = "objectclass: top\nobjectclass: extensibleObject\n";
$cn = "cn: $taskname\n";
$basedn = "basedn: $basedn_arg\n";
diff --git a/ldap/admin/src/scripts/upgradedb.in b/ldap/admin/src/scripts/upgradedb.in
index e250cc92a..0f9056777 100755
--- a/ldap/admin/src/scripts/upgradedb.in
+++ b/ldap/admin/src/scripts/upgradedb.in
@@ -1,35 +1,16 @@
#!/bin/sh
-libpath_add() {
- [ -z "$1" ] && return
- LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$1
-}
+source ./DSSharedLib
-server_dir="@libdir@/dirsrv/"
-SCRIPT=$(readlink -f $0)
-SCRIPTPATH=$(dirname $SCRIPT)
-if [ $SCRIPTPATH == "/usr/sbin" ]
-then
- prefix=`echo "$SCRIPTPATH" | sed -e 's/\/usr\/sbin//'`
- server_sbin="/usr/sbin"
-else
- prefix=`echo "$SCRIPTPATH" | sed -e 's/\/sbin//'`
- server_sbin=$prefix"/sbin"
-fi
-
-libpath_add "$server_dir"
-libpath_add "$prefix@nss_libdir@"
-libpath_add "$prefix@libdir@"
+libpath_add "@libdir@/dirsrv/"
libpath_add "@libdir@"
libpath_add "@nss_libdir@"
-libpath_add "$prefix@pcre_libdir@"
+libpath_add "@pcre_libdir@"
export LD_LIBRARY_PATH
SHLIB_PATH=$LD_LIBRARY_PATH
export SHLIB_PATH
-first="yes"
-args=""
while getopts "Z:vfrd:" flag
do
case $flag in
@@ -43,58 +24,22 @@ do
esac
done
-# server id not provided, check if there is only one instance
-inst_count=0
-for i in `ls $prefix/etc/sysconfig/dirsrv-* 2>/dev/null`
-do
- if [ $i != '$prefix/etc/sysconfig/dirsrv-admin' ]
- then
- inst_count=`expr $inst_count + 1`
- id=$(expr "$i" : ".*dirsrv-\([^)]*\).*")
- if [ $first == "yes" ]
- then
- instances=$id
- first="no"
- else
- instances=$instances", $id"
- fi
- name=$id
- fi
-done
-
-if [ -z $servid ]
+servid=$(get_server_id "@initconfigdir@" $servid)
+if [ $? == 1 ]
then
- if [ $inst_count -eq 1 ]
- then
- servid=$name
- else
- # error
- echo "You must supply a server instance identifier. Use -Z to specify instance name"
- echo "Available instances: $instances"
- exit 1
- fi
-elif [ $servid == slapd-* ]
-then
- servid=`echo "$servid" | sed -e 's/slapd-//'`
-elif [ $servid == dirsrv-* ]
-then
- servid=`echo "$servid" | sed -e 's/dirsrv-//'`
-fi
-configdir="$prefix/etc/dirsrv/slapd-$servid"
-if ! [ -a $configdir ]
-then
- echo "Invalid server identifier: $servid"
- echo "Available instances: $instances"
+ echo "You must supply a valid server instance identifier. Use -Z to specify instance name"
+ echo "Available instances: $servid"
exit 1
fi
-cd $server_sbin
+configdir="@instconfigdir@/slapd-$servid"
+
if [ "$#" -eq 1 ]
then
bak_dir=$1
else
- bak_dir=$prefix/var/lib/dirsrv/slapd-$servid/bak/upgradedb_`date +%Y_%m_%d_%H_%M_%S`
+ bak_dir=@localstatedir@/lib/@PACKAGE_NAME@/slapd-$servid/bak/upgradedb_`date +%Y_%m_%d_%H_%M_%S`
fi
echo upgrade index files ...
-./ns-slapd upgradedb -D $configdir -a $bak_dir $args
+@sbindir@/ns-slapd upgradedb -D $configdir -a $bak_dir $args
diff --git a/ldap/admin/src/scripts/upgradednformat.in b/ldap/admin/src/scripts/upgradednformat.in
index 6f6ded84c..0e7304f26 100755
--- a/ldap/admin/src/scripts/upgradednformat.in
+++ b/ldap/admin/src/scripts/upgradednformat.in
@@ -1,5 +1,7 @@
#!/bin/sh
+source ./DSSharedLib
+
# upgradednformat -- upgrade DN format to the new style (RFC 4514)
# Usgae: upgradednformat [-N] -n backend_instance -a db_instance_directory
# -N: dryrun
@@ -8,42 +10,20 @@
# -a db_instance_directory -- full path to the db instance dir
# e.g., /var/lib/dirsrv/slapd-ID/db/userRoot
-libpath_add() {
- [ -z "$1" ] && return
- LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$1
-}
-
-server_dir="@libdir@/dirsrv/"
-SCRIPT=$(readlink -f $0)
-SCRIPTPATH=$(dirname $SCRIPT)
-if [ $SCRIPTPATH == "/usr/sbin" ]
-then
- prefix=`echo "$SCRIPTPATH" | sed -e 's/\/usr\/sbin//'`
- server_sbin="/usr/sbin"
-else
- prefix=`echo "$SCRIPTPATH" | sed -e 's/\/sbin//'`
- server_sbin=$prefix"/sbin"
-fi
-
-libpath_add "$server_dir"
-libpath_add "$prefix@nss_libdir@"
-libpath_add "$prefix@libdir@"
+libpath_add "@libdir@/dirsrv/"
+libpath_add "@nss_libdir@"
libpath_add "@libdir@"
-libpath_add "$prefix@pcre_libdir@"
+libpath_add "@pcre_libdir@"
export LD_LIBRARY_PATH
SHLIB_PATH=$LD_LIBRARY_PATH
export SHLIB_PATH
-cd $server_sbin
-
-dir=""
-be=""
-servid=""
-dryrun=0
-
-first="yes"
-args=""
+usage ()
+{
+ echo "Usage: $0 [-N] [-Z serverID] -n backend_instance -a db_instance_directory"
+}
+
while getopts "vhd:a:n:D:N" flag
do
case $flag in
@@ -55,67 +35,31 @@ do
dir="set";;
n) args=$args" -n $OPTARG"
be="set";;
- h) echo "Usage: $0 [-N] [-Z serverID] -n backend_instance -a db_instance_directory"
+ h) usage
exit 0;;
D) args=$args" -D $OPTARG";;
- ?) echo "Usage: $0 [-N] [-Z serverID] -n backend_instance -a db_instance_directory"
+ ?) usage
exit 1;;
esac
done
if [ "$be" = "" ] || [ "$dir" = "" ]; then
- echo "Usage: $0 [-N] [-Z serverID] -n backend_instance -a db_instance_directory"
+ usage
exit 1
fi
-
- # server id not provided, check if there is only one instance
- inst_count=0
- for i in `ls $prefix/etc/sysconfig/dirsrv-* 2>/dev/null`
- do
- if [ $i != '$prefix/etc/sysconfig/dirsrv-admin' ]
- then
- inst_count=`expr $inst_count + 1`
- id=$(expr "$i" : ".*dirsrv-\([^)]*\).*")
- if [ $first == "yes" ]
- then
- instances=$id
- first="no"
- else
- instances=$instances", $id"
- fi
- name=$id
- fi
- done
-
-if [ -z $servid ]
-then
- if [ $inst_count -eq 1 ]
- then
- servid=$name
- else
- # error
- echo "Usage: $0 [-N] [-Z serverID] -n backend_instance -a db_instance_directory"
- echo "You must supply a server instance identifier. Use -Z to specify instance name"
- echo "Available instances: $instances"
- exit 1
- fi
-elif [ $servid == slapd-* ]
+servid=$(get_server_id "@initconfigdir@" $servid)
+if [ $? == 1 ]
then
- servid=`echo "$servid" | sed -e 's/slapd-//'`
-elif [ $servid == dirsrv-* ]
-then
- servid=`echo "$servid" | sed -e 's/dirsrv-//'`
-fi
-configdir="$prefix/etc/dirsrv/slapd-$servid"
-if ! [ -a $configdir ]
-then
- echo "Invalid server identifier: $servid"
- echo "Available instances: $instances"
+ usage
+ echo "You must supply a valid server instance identifier. Use -Z to specify instance name"
+ echo "Available instances: $servid"
exit 1
fi
-./ns-slapd upgradednformat -D $configdir $args
+configdir="@instconfigdir@/slapd-$servid"
+@sbindir@/ns-slapd upgradednformat -D $configdir $args
rc=$?
+
exit $rc
diff --git a/ldap/admin/src/scripts/usn-tombstone-cleanup.pl.in b/ldap/admin/src/scripts/usn-tombstone-cleanup.pl.in
index f03a53f33..de4db8b98 100644
--- a/ldap/admin/src/scripts/usn-tombstone-cleanup.pl.in
+++ b/ldap/admin/src/scripts/usn-tombstone-cleanup.pl.in
@@ -66,15 +66,12 @@ $maxusn_arg = "";
$verbose = 0;
$host = "";
$port = "";
-$first = "yes";
-$prefix = DSUtil::get_prefix();
-$ENV{'PATH'} = "$prefix@ldaptool_bindir@:$prefix/usr/bin:@ldaptool_bindir@:/usr/bin";
+$ENV{'PATH'} = "@ldaptool_bindir@:/usr/bin:@ldaptool_bindir@:/usr/bin";
-DSUtil::libpath_add("$prefix@nss_libdir@");
-DSUtil::libpath_add("$prefix/usr/lib");
DSUtil::libpath_add("@nss_libdir@");
DSUtil::libpath_add("/usr/lib");
+DSUtil::libpath_add("/usr/lib64");
$ENV{'SHLIB_PATH'} = "$ENV{'LD_LIBRARY_PATH'}";
@@ -133,62 +130,9 @@ while ($i <= $#ARGV)
$i++;
}
-
-opendir(DIR, "$prefix/etc/sysconfig");
-@files = readdir(DIR);
-foreach $file (@files){
- if($file =~ /^dirsrv-/ && $file ne "dirsrv-admin"){
- $instance_count++;
- if($file =~ /dirsrv-(.*)/){
- if($first eq "yes"){
- $instances=$1;
- $first = "no";
- } else {
- $instances=$instances . ", $1";
- }
- $name = $1;
- }
- }
-}
-
-if($servid eq ""){
- if ($instance_count == 1){
- $servid = $name;
- } else {
- &usage;
- print "You must supply a server instance identifier. Use -Z to specify instance name\n";
- print "Available instances: $instances\n";
- exit (1);
- }
-} elsif ($servid =~ /^dirsrv-/){
- # strip off "dirsrv-"
- $servid =~ s/^dirsrv-//;
-} elsif ($servid =~ /^slapd-/){
- # strip off "slapd-"
- $servid =~ s/^slapd-//;
-}
-@info = DSUtil::get_missing_info($prefix, $servid, $instances, $host, $port, $rootdn);
-
-if ($passwdfile ne ""){
-# Open file and get the password
- unless (open (RPASS, $passwdfile)) {
- die "Error, cannot open password file $passwdfile\n";
- }
- $passwd = <RPASS>;
- chomp($passwd);
- close(RPASS);
-} elsif ($passwd eq "-"){
-# Read the password from terminal
- print "Bind Password: ";
- # Disable console echo
- system("@sttyexec@ -echo") if -t STDIN;
- # read the answer
- $passwd = <STDIN>;
- # Enable console echo
- system("@sttyexec@ echo") if -t STDIN;
- print "\n";
- chop($passwd); # trim trailing newline
-}
+$servid = DSUtil::get_server_id($servid, "@initconfigdir@");
+@info = DSUtil::get_missing_info("@instconfigdir@", $servid, $host, $port, $rootdn);
+$passwd = DSUtil::get_password_from_file($passwd, $passwdfile);
if ( $info[2] eq "" || $passwd eq "" )
{
diff --git a/ldap/admin/src/scripts/verify-db.pl.in b/ldap/admin/src/scripts/verify-db.pl.in
index bff8a2e15..364136c27 100644
--- a/ldap/admin/src/scripts/verify-db.pl.in
+++ b/ldap/admin/src/scripts/verify-db.pl.in
@@ -149,7 +149,6 @@ if ($isWin) {
my $i = 0;
$startpoint = "";
-$prefix = DSUtil::get_prefix();
while ($i <= $#ARGV) {
if ( "$ARGV[$i]" eq "-a" ) { # path to search the db files
@@ -164,39 +163,7 @@ while ($i <= $#ARGV) {
$i++;
}
-$first = "yes";
-if($servid eq ""){
- opendir(DIR, "$prefix/etc/sysconfig");
- @files = readdir(DIR);
- foreach $file (@files){
- if($file =~ /^dirsrv-/ && $file ne "dirsrv-admin"){
- $instance_count++;
- if($file =~ /dirsrv-(.*)/){
- if($first eq "yes"){
- $instances=$1;
- $first = "no";
- } else {
- $instances=$instances . ", $1";
- }
- $name = $1;
- }
- }
- }
- if ($instance_count == 1){
- $servid = $name;
- } else {
- &usage;
- print "You must supply a server instance identifier. Use -Z to specify instance name\n";
- print "Available instances: $instances\n";
- exit (1);
- }
-} elsif ($servid =~ /^dirsrv-/){
- # strip off "dirsrv-"
- $servid =~ s/^dirsrv-//;
-} elsif ($servid =~ /^slapd-/){
- # strip off "slapd-"
- $servid =~ s/^slapd-//;
-}
+$servid = DSUtil::get_server_id($servid, "@initconfigdir@");
print("*****************************************************************\n");
print("verify-db: This tool should only be run if recovery start fails\n" .
@@ -206,12 +173,12 @@ print("verify-db: This tool should only be run if recovery start fails\n" .
print("*****************************************************************\n");
if ( "$startpoint" eq "" ) {
- $startpoint = "$prefix/var/lib/dirsrv/slapd-$servid/db";
+ $startpoint = "@localstatedir@/lib/@PACKAGE_NAME@/slapd-$servid/db";
}
# get dirs having DBVERSION
my $dbdirs = getDbDir($startpoint);
-$ENV{'PATH'} = "@libdir@/dirsrv/slapd-$servid:$prefix@db_bindir@:$prefix/usr/bin:@db_bindir@:/usr/bin";
+$ENV{'PATH'} = "@libdir@/dirsrv/slapd-$servid:@db_bindir@:/usr/bin:@db_bindir@:/usr/bin";
DSUtil::libpath_add("@db_libdir@");
DSUtil::libpath_add("@libdir@");
diff --git a/ldap/admin/src/scripts/vlvindex.in b/ldap/admin/src/scripts/vlvindex.in
index 4f0c69365..4854b00d3 100755
--- a/ldap/admin/src/scripts/vlvindex.in
+++ b/ldap/admin/src/scripts/vlvindex.in
@@ -1,35 +1,22 @@
#!/bin/sh
-libpath_add() {
- [ -z "$1" ] && return
- LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$1
-}
-
-server_dir="@libdir@/dirsrv/"
-SCRIPT=$(readlink -f $0)
-SCRIPTPATH=$(dirname $SCRIPT)
-if [ $SCRIPTPATH == "/usr/sbin" ]
-then
- prefix=`echo "$SCRIPTPATH" | sed -e 's/\/usr\/sbin//'`
- server_sbin="/usr/sbin"
-else
- prefix=`echo "$SCRIPTPATH" | sed -e 's/\/sbin//'`
- server_sbin=$prefix"/sbin"
-fi
+source ./DSSharedLib
-libpath_add "$server_dir"
-libpath_add "$prefix@nss_libdir@"
-libpath_add "$prefix@libdir@"
+libpath_add "@libdir@/dirsrv/"
libpath_add "@libdir@"
libpath_add "@nss_libdir@"
-libpath_add "$prefix@pcre_libdir@"
+libpath_add "@pcre_libdir@"
export LD_LIBRARY_PATH
SHLIB_PATH=$LD_LIBRARY_PATH
export SHLIB_PATH
-first="yes"
-args=""
+usage ()
+{
+ echo "Usage: vlvindex [-Z serverID] -n backend_instance | {-s includesuffix}* -T attribute"
+ echo Note: either \"-n backend_instance\" or \"-s includesuffix\" are required.
+}
+
while getopts "Z:vd:a:t:T:Sn:s:x:hD:" flag
do
case $flag in
@@ -44,67 +31,28 @@ do
n) args=$args" -n $OPTARG";;
x) args=$args" -x $OPTARG";;
D) args=$args" -D $OPTARG";;
- h) echo "Usage: vlvindex [-Z serverID] -n backend_instance | {-s includesuffix}* -T attribute"
- echo Note: either \"-n backend_instance\" or \"-s includesuffix\" are required.
+ h) usage
exit 0;;
- ?) echo "Usage: vlvindex [-Z serverID] -n backend_instance | {-s includesuffix}* -T attribute"
- echo Note: either \"-n backend_instance\" or \"-s includesuffix\" are required.
+ ?) usage
exit 1;;
esac
done
-# server id not provided, check if there is only one instance
-inst_count=0
-for i in `ls $prefix/etc/sysconfig/dirsrv-* 2>/dev/null`
-do
- if [ $i != '$prefix/etc/sysconfig/dirsrv-admin' ]
- then
- inst_count=`expr $inst_count + 1`
- id=$(expr "$i" : ".*dirsrv-\([^)]*\).*")
- if [ $first == "yes" ]
- then
- instances=$id
- first="no"
- else
- instances=$instances", $id"
- fi
- name=$id
- fi
-done
-
-if [ -z $servid ]
-then
- if [ $inst_count -eq 1 ]
- then
- servid=$name
- else
- # error
- echo "Usage: vlvindex [-Z serverID] -n backend_instance | {-s includesuffix}* -T attribute"
- echo "You must supply a server instance identifier. Use -Z to specify instance name"
- echo "Available instances: $instances"
- exit 1
- fi
-elif [ $servid == slapd-* ]
-then
- servid=`echo "$servid" | sed -e 's/slapd-//'`
-elif [ $servid == dirsrv-* ]
+servid=$(get_server_id "@initconfigdir@" $servid)
+if [ $? == 1 ]
then
- servid=`echo "$servid" | sed -e 's/dirsrv-//'`
-fi
-configdir="$prefix/etc/dirsrv/slapd-$servid"
-if ! [ -a $configdir ]
-then
- echo "Invalid server identifier: $servid"
- echo "Available instances: $instances"
+ usage
+ echo "You must supply a valid server instance identifier. Use -Z to specify instance name"
+ echo "Available instances: $servid"
exit 1
fi
-cd $server_sbin
+configdir="@instconfigdir@/slapd-$servid"
+
if [ $# -lt 4 ]
then
- echo "Usage: vlvindex [-Z serverID] -n backend_instance | {-s includesuffix}* -T attribute"
- echo Note: either \"-n backend_instance\" or \"-s includesuffix\" are required.
+ usage
exit 1
fi
-./ns-slapd db2index -D $configdir $args
+@sbindir@/ns-slapd db2index -D $configdir $args
| 0 |
f31abde7da3a941147b3dfea032bbbc60305b87f
|
389ds/389-ds-base
|
Issue 50640 - Database links: get_monitor() takes 1 positional argument but 2 were given
Bug Description:
Cannot call dsconf ... chaining monitor due to invalid call to get_monitor.
FTR: The other issue reported within, for the ... link-delete has already been
fixed in commit c403a39.
Fix Description:
Use _get_link to get the named link, the same way some other functions in the
file do.
Also, merge and move _format_status to cli_base.
Fixes https://pagure.io/389-ds-base/issue/50640
Author: Matus Honek <[email protected]>
Review by: Mark (thanks!)
|
commit f31abde7da3a941147b3dfea032bbbc60305b87f
Author: Matus Honek <[email protected]>
Date: Fri Mar 27 04:36:09 2020 +0000
Issue 50640 - Database links: get_monitor() takes 1 positional argument but 2 were given
Bug Description:
Cannot call dsconf ... chaining monitor due to invalid call to get_monitor.
FTR: The other issue reported within, for the ... link-delete has already been
fixed in commit c403a39.
Fix Description:
Use _get_link to get the named link, the same way some other functions in the
file do.
Also, merge and move _format_status to cli_base.
Fixes https://pagure.io/389-ds-base/issue/50640
Author: Matus Honek <[email protected]>
Review by: Mark (thanks!)
diff --git a/src/lib389/lib389/cli_base/__init__.py b/src/lib389/lib389/cli_base/__init__.py
index 92b564039..9a3706fb6 100644
--- a/src/lib389/lib389/cli_base/__init__.py
+++ b/src/lib389/lib389/cli_base/__init__.py
@@ -165,6 +165,18 @@ def populate_attr_arguments(parser, attributes):
parser.add_argument('--%s' % attr, nargs='?', help="Value of %s" % attr)
+def _format_status(log, mtype, json=False):
+ if json:
+ print(mtype.get_status_json())
+ else:
+ status_dict = mtype.get_status()
+ log.info('dn: ' + mtype._dn)
+ for k, v in list(status_dict.items()):
+ # For each value in the multivalue attr
+ for vi in v:
+ log.info('{}: {}'.format(k, vi))
+
+
def _generic_list(inst, basedn, log, manager_class, args=None):
mc = manager_class(inst, basedn)
ol = mc.list()
diff --git a/src/lib389/lib389/cli_conf/backend.py b/src/lib389/lib389/cli_conf/backend.py
index 75dfc5fdd..39f4e92f4 100644
--- a/src/lib389/lib389/cli_conf/backend.py
+++ b/src/lib389/lib389/cli_conf/backend.py
@@ -21,6 +21,7 @@ from lib389.replica import Replicas
from lib389.utils import ensure_str, is_a_dn, is_dn_parent
from lib389._constants import *
from lib389.cli_base import (
+ _format_status,
_generic_get,
_generic_get_dn,
_get_arg,
@@ -507,18 +508,6 @@ def db_config_set(inst, basedn, log, args):
log.info("Successfully updated database configuration")
-def _format_status(log, mtype, json=False):
- if json:
- log.info(mtype.get_status_json())
- else:
- status_dict = mtype.get_status()
- log.info('dn: ' + mtype._dn)
- for k, v in list(status_dict.items()):
- # For each value in the multivalue attr
- for vi in v:
- log.info('{}: {}'.format(k, vi))
-
-
def get_monitor(inst, basedn, log, args):
if args.suffix is not None:
# Get a suffix/backend monitor entry
diff --git a/src/lib389/lib389/cli_conf/chaining.py b/src/lib389/lib389/cli_conf/chaining.py
index 7c93eb3d0..512589834 100644
--- a/src/lib389/lib389/cli_conf/chaining.py
+++ b/src/lib389/lib389/cli_conf/chaining.py
@@ -14,6 +14,7 @@ from lib389.cli_base import (
_generic_get,
_get_arg,
)
+from lib389.cli_conf.monitor import _format_status
arg_to_attr = {
'conn_bind_limit': 'nsbindconnectionslimit',
@@ -197,10 +198,10 @@ def delete_link(inst, basedn, log, args, warn=True):
def monitor_link(inst, basedn, log, args):
- chain_link = ChainingLink(inst)
- monitor = chain_link.get_monitor(args.CHAIN_NAME[0])
+ chain_link = _get_link(inst, args.CHAIN_NAME[0])
+ monitor = chain_link.get_monitor()
if monitor is not None:
- monitor.get_status(use_json=args.json)
+ _format_status(log, monitor, args.json)
else:
raise ValueError("There was no monitor found for link '{}'".format(args.CHAIN_NAME[0]))
diff --git a/src/lib389/lib389/cli_conf/monitor.py b/src/lib389/lib389/cli_conf/monitor.py
index 19806e536..38490c6ad 100644
--- a/src/lib389/lib389/cli_conf/monitor.py
+++ b/src/lib389/lib389/cli_conf/monitor.py
@@ -12,18 +12,7 @@ from lib389.monitor import (Monitor, MonitorLDBM, MonitorSNMP, MonitorDiskSpace)
from lib389.chaining import (ChainingLinks)
from lib389.backend import Backends
from lib389.utils import convert_bytes
-
-
-def _format_status(log, mtype, json=False):
- if json:
- print(mtype.get_status_json())
- else:
- status_dict = mtype.get_status()
- log.info('dn: ' + mtype._dn)
- for k, v in list(status_dict.items()):
- # For each value in the multivalue attr
- for vi in v:
- log.info('{}: {}'.format(k, vi))
+from lib389.cli_base import _format_status
def monitor(inst, basedn, log, args):
| 0 |
ba433f5a1be4c7b85cb399f242fd0a2d8909ff56
|
389ds/389-ds-base
|
fix mozldap build issues
ldap_start_tls_s needs ldap_ssl.h
mozldap does not define LDAP_MAXINT
Reviewed by: nkinder (Thanks!)
|
commit ba433f5a1be4c7b85cb399f242fd0a2d8909ff56
Author: Rich Megginson <[email protected]>
Date: Fri Jan 20 20:01:17 2012 -0700
fix mozldap build issues
ldap_start_tls_s needs ldap_ssl.h
mozldap does not define LDAP_MAXINT
Reviewed by: nkinder (Thanks!)
diff --git a/ldap/servers/plugins/chainingdb/cb_conn_stateless.c b/ldap/servers/plugins/chainingdb/cb_conn_stateless.c
index ac109600e..a9abc3191 100644
--- a/ldap/servers/plugins/chainingdb/cb_conn_stateless.c
+++ b/ldap/servers/plugins/chainingdb/cb_conn_stateless.c
@@ -42,6 +42,10 @@
#include "cb.h"
+#ifndef USE_OPENLDAP
+#include "ldap_ssl.h" /* for start_tls */
+#endif
+
/*
* Most of the complicated connection-related code lives in this file. Some
* general notes about how we manage our connections to "remote" LDAP servers:
diff --git a/ldap/servers/slapd/slapi-plugin.h b/ldap/servers/slapd/slapi-plugin.h
index 2296351df..e684fe09a 100644
--- a/ldap/servers/slapd/slapi-plugin.h
+++ b/ldap/servers/slapd/slapi-plugin.h
@@ -342,6 +342,11 @@ NSPR_API(PRUint32) PR_fprintf(struct PRFileDesc* fd, const char *fmt, ...)
#define LBER_OVERFLOW ((ber_tag_t) -3) /* 0xfffffffdU */
#endif
+#ifndef LDAP_MAXINT
+/* RFC 4511: maxInt INTEGER ::= 2147483647 -- (2^^31 - 1) -- */
+#define LDAP_MAXINT (2147483647)
+#endif
+
/*
* Sequential access types
*/
| 0 |
4f9128fd0a5c76b4bed83a194cadd68ba47ed9e6
|
389ds/389-ds-base
|
Resolves: 197997
Summary: Fixed PTA config parsing to use a comma delimiter instread of a space.
|
commit 4f9128fd0a5c76b4bed83a194cadd68ba47ed9e6
Author: Nathan Kinder <[email protected]>
Date: Fri Sep 28 22:46:50 2007 +0000
Resolves: 197997
Summary: Fixed PTA config parsing to use a comma delimiter instread of a space.
diff --git a/ldap/servers/plugins/passthru/ptconfig.c b/ldap/servers/plugins/passthru/ptconfig.c
index d25f363d8..272e653bc 100644
--- a/ldap/servers/plugins/passthru/ptconfig.c
+++ b/ldap/servers/plugins/passthru/ptconfig.c
@@ -134,7 +134,7 @@ passthru_config( int argc, char **argv )
srvr = (PassThruServer *)slapi_ch_calloc( 1, sizeof( PassThruServer ));
srvr->ptsrvr_url = slapi_ch_strdup( argv[i] );
- if (( p = strchr( srvr->ptsrvr_url, ' ' )) == NULL ) {
+ if (( p = strchr( srvr->ptsrvr_url, ',' )) == NULL ) {
/*
* use defaults for maxconnections, maxconcurrency, timeout,
* LDAP version, and connlifetime.
| 0 |
f90c3a6e1933b9cc19a51b17a038f26652c4b2bc
|
389ds/389-ds-base
|
Ticket #48299 - pagedresults - when timed out, search results could have been already freed.
Description: When a search results object is freed, there is a window
until the information is set to the pagedresults handle. If the paged-
results handle is released due to a timeout in the window, double free
occurs.
This patch sets NULL just before the search results object is freed
in the backend as well as in dse.
Plus, fixed a minor memory leak in pagedresults_parse_control_value.
https://fedorahosted.org/389/ticket/48299
Reviewed and a bug found by [email protected] (Thank you, Thierry!!)
|
commit f90c3a6e1933b9cc19a51b17a038f26652c4b2bc
Author: Noriko Hosoi <[email protected]>
Date: Wed Sep 30 13:32:05 2015 -0700
Ticket #48299 - pagedresults - when timed out, search results could have been already freed.
Description: When a search results object is freed, there is a window
until the information is set to the pagedresults handle. If the paged-
results handle is released due to a timeout in the window, double free
occurs.
This patch sets NULL just before the search results object is freed
in the backend as well as in dse.
Plus, fixed a minor memory leak in pagedresults_parse_control_value.
https://fedorahosted.org/389/ticket/48299
Reviewed and a bug found by [email protected] (Thank you, Thierry!!)
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_search.c b/ldap/servers/slapd/back-ldbm/ldbm_search.c
index 73c54d33c..8ed6b4d38 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_search.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_search.c
@@ -1890,6 +1890,7 @@ delete_search_result_set( Slapi_PBlock *pb, back_search_result_set **sr )
/* If the op is pagedresults, let the module clean up sr. */
return;
}
+ pagedresults_set_search_result_pb(pb, NULL, 0);
slapi_pblock_set(pb, SLAPI_SEARCH_RESULT_SET, NULL);
}
if ( NULL != (*sr)->sr_candidates )
diff --git a/ldap/servers/slapd/dse.c b/ldap/servers/slapd/dse.c
index e8e393b7e..68ce75120 100644
--- a/ldap/servers/slapd/dse.c
+++ b/ldap/servers/slapd/dse.c
@@ -2830,6 +2830,7 @@ dse_next_search_entry (Slapi_PBlock *pb)
/* we reached the end of the list */
if (e == NULL)
{
+ pagedresults_set_search_result_pb(pb, NULL, 0);
dse_search_set_delete (ss);
slapi_pblock_set(pb, SLAPI_SEARCH_RESULT_SET, NULL);
}
diff --git a/ldap/servers/slapd/pagedresults.c b/ldap/servers/slapd/pagedresults.c
index d0c93cd5a..6dd643225 100644
--- a/ldap/servers/slapd/pagedresults.c
+++ b/ldap/servers/slapd/pagedresults.c
@@ -172,7 +172,6 @@ pagedresults_parse_control_value( Slapi_PBlock *pb,
}
/* reset sizelimit */
op->o_pagedresults_sizelimit = -1;
- slapi_ch_free((void **)&cookie.bv_val);
if ((*index > -1) && (*index < conn->c_pagedresults.prl_maxlen)) {
if (conn->c_pagedresults.prl_list[*index].pr_flags & CONN_FLAG_PAGEDRESULTS_ABANDONED) {
@@ -189,6 +188,7 @@ pagedresults_parse_control_value( Slapi_PBlock *pb,
LDAPDebug1Arg(LDAP_DEBUG_ANY, "pagedresults_parse_control_value: invalid cookie: %d\n", *index);
}
bail:
+ slapi_ch_free((void **)&cookie.bv_val);
/* cleaning up the rest of the timedout or abandoned if any */
prp = conn->c_pagedresults.prl_list;
for (i = 0; i < conn->c_pagedresults.prl_maxlen; i++, prp++) {
@@ -1010,3 +1010,34 @@ pagedresults_is_abandoned_or_notavailable( Connection *conn, int index )
PR_Unlock(conn->c_mutex);
return prp->pr_flags & CONN_FLAG_PAGEDRESULTS_ABANDONED;
}
+
+int
+pagedresults_set_search_result_pb(Slapi_PBlock *pb, void *sr, int locked)
+{
+ int rc = -1;
+ Connection *conn = NULL;
+ Operation *op = NULL;
+ int index = -1;
+ if (!pb) {
+ return 0;
+ }
+ slapi_pblock_get(pb, SLAPI_OPERATION, &op);
+ if (!op_is_pagedresults(op)) {
+ return 0; /* noop */
+ }
+ slapi_pblock_get(pb, SLAPI_CONNECTION, &conn);
+ slapi_pblock_get(pb, SLAPI_PAGED_RESULTS_INDEX, &index);
+ LDAPDebug2Args(LDAP_DEBUG_TRACE,
+ "--> pagedresults_set_search_result_pb: idx=%d, sr=%p\n", index, sr);
+ if (conn && (index > -1)) {
+ if (!locked) PR_Lock(conn->c_mutex);
+ if (index < conn->c_pagedresults.prl_maxlen) {
+ conn->c_pagedresults.prl_list[index].pr_search_result_set = sr;
+ rc = 0;
+ }
+ if (!locked) PR_Unlock(conn->c_mutex);
+ }
+ LDAPDebug1Arg(LDAP_DEBUG_TRACE,
+ "<-- pagedresults_set_search_result_pb: %d\n", rc);
+ return rc;
+}
diff --git a/ldap/servers/slapd/proto-slap.h b/ldap/servers/slapd/proto-slap.h
index e8673e160..b10c1ebad 100644
--- a/ldap/servers/slapd/proto-slap.h
+++ b/ldap/servers/slapd/proto-slap.h
@@ -1488,6 +1488,7 @@ void op_set_pagedresults(Operation *op);
void pagedresults_lock(Connection *conn, int index);
void pagedresults_unlock(Connection *conn, int index);
int pagedresults_is_abandoned_or_notavailable(Connection *conn, int index);
+int pagedresults_set_search_result_pb(Slapi_PBlock *pb, void *sr, int locked);
/*
* sort.c
| 0 |
131b7fe13af04a0dc13bb63591dc589adb5d3230
|
389ds/389-ds-base
|
Bug(s) fixed: 183903
Bug Description: Memory leak in ldbm_config.c:replace_ldbm_config_value
Reviewed by: nhosoi (Thanks!)
Fix Description: Just needed to call slapi_mods_done(&smods) after the call to slapi_modify_internal_pb(). This is the same as in the other places in the server that perform an internal modify operation.
Platforms tested: RHEL4
Flag Day: no
Doc impact: no
|
commit 131b7fe13af04a0dc13bb63591dc589adb5d3230
Author: Rich Megginson <[email protected]>
Date: Thu Oct 12 21:21:10 2006 +0000
Bug(s) fixed: 183903
Bug Description: Memory leak in ldbm_config.c:replace_ldbm_config_value
Reviewed by: nhosoi (Thanks!)
Fix Description: Just needed to call slapi_mods_done(&smods) after the call to slapi_modify_internal_pb(). This is the same as in the other places in the server that perform an internal modify operation.
Platforms tested: RHEL4
Flag Day: no
Doc impact: no
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_config.c b/ldap/servers/slapd/back-ldbm/ldbm_config.c
index 169d8e29c..9021dd7fb 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_config.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_config.c
@@ -1760,5 +1760,6 @@ void replace_ldbm_config_value(char *conftype, char *val, struct ldbminfo *li)
slapi_mods_get_ldapmods_byref(&smods),
NULL, NULL, li->li_identity, 0);
slapi_modify_internal_pb(&pb);
+ slapi_mods_done(&smods);
pblock_done(&pb);
}
| 0 |
7f92c01ce39974e2d2c7351fd23b695f0d5a7c52
|
389ds/389-ds-base
|
Issue 6248 - fix fanalyzer warnings (#6253)
* Issue 6248 - fix fanalyzer warnings
* Issue 6248 - fix fanalyzer warnings - clang warning
* Issue 6248 - fix fanalyzer warnings - fix non debug warning
This change remove all gcc -fanalyzer warnings.
Number of them are not that interesting (False/positive due to some limts of the analyzer and some possible crashes when running out of memory.
But some of these warnings where real concerns.
Issue #6248
Reviewed by: @droideck (Thanks!)
|
commit 7f92c01ce39974e2d2c7351fd23b695f0d5a7c52
Author: progier389 <[email protected]>
Date: Wed Jul 17 15:52:37 2024 +0200
Issue 6248 - fix fanalyzer warnings (#6253)
* Issue 6248 - fix fanalyzer warnings
* Issue 6248 - fix fanalyzer warnings - clang warning
* Issue 6248 - fix fanalyzer warnings - fix non debug warning
This change remove all gcc -fanalyzer warnings.
Number of them are not that interesting (False/positive due to some limts of the analyzer and some possible crashes when running out of memory.
But some of these warnings where real concerns.
Issue #6248
Reviewed by: @droideck (Thanks!)
diff --git a/ldap/libraries/libavl/avl.c b/ldap/libraries/libavl/avl.c
index 517e08098..759fbf68f 100644
--- a/ldap/libraries/libavl/avl.c
+++ b/ldap/libraries/libavl/avl.c
@@ -709,8 +709,16 @@ avl_buildlist(caddr_t data, int arg __attribute__((unused)))
avl_maxlist = 0;
} else if (avl_maxlist == slots) {
slots += AVL_GRABSIZE;
- avl_list = (caddr_t *)realloc((char *)avl_list,
- (unsigned)slots * sizeof(caddr_t));
+ caddr_t *new_avl_list = realloc((char *)avl_list,
+ (unsigned)slots * sizeof(caddr_t));
+ if (!new_avl_list) {
+ free(avl_list);
+ }
+ avl_list = new_avl_list;
+ }
+
+ if (avl_list == NULL) {
+ return (-1);
}
avl_list[avl_maxlist++] = data;
@@ -744,8 +752,8 @@ avl_getfirst(Avlnode *root)
return (0);
(void)avl_apply(root, avl_buildlist, (caddr_t)0, -1, AVL_INORDER);
- if (avl_list && avl_list[avl_nextlist++]) {
- return avl_list[avl_nextlist];
+ if (avl_list && avl_list[avl_nextlist]) {
+ return avl_list[avl_nextlist++];
} else {
return (NULL);
}
diff --git a/ldap/servers/plugins/acl/acl_ext.c b/ldap/servers/plugins/acl/acl_ext.c
index f9478ce4b..2d199d4aa 100644
--- a/ldap/servers/plugins/acl/acl_ext.c
+++ b/ldap/servers/plugins/acl/acl_ext.c
@@ -428,6 +428,12 @@ acl_create_aclpb_pool()
first_aclpb = NULL;
for (i = 0; i < maxThreads; i++) {
aclpb = acl__malloc_aclpb();
+ if (aclpb == NULL) {
+ /* ERROR */
+ aclQueue->aclq_free = first_aclpb;
+ aclQueue->aclq_nfree = i;
+ return 1;
+ }
if (0 == i)
first_aclpb = aclpb;
@@ -512,12 +518,14 @@ acl__get_aclpb_from_pool(void)
/* Now move it to the FRONT of busy list */
- t_aclpb = aclQueue->aclq_busy;
- aclpb->aclpb_next = t_aclpb;
- if (t_aclpb)
- t_aclpb->aclpb_prev = aclpb;
- aclQueue->aclq_busy = aclpb;
- aclQueue->aclq_nbusy++;
+ if (aclpb != NULL) {
+ t_aclpb = aclQueue->aclq_busy;
+ aclpb->aclpb_next = t_aclpb;
+ if (t_aclpb)
+ t_aclpb->aclpb_prev = aclpb;
+ aclQueue->aclq_busy = aclpb;
+ aclQueue->aclq_nbusy++;
+ }
PR_Unlock(aclQueue->aclq_lock);
diff --git a/ldap/servers/plugins/acl/acllas.c b/ldap/servers/plugins/acl/acllas.c
index 59eaf7036..ef50f315c 100644
--- a/ldap/servers/plugins/acl/acllas.c
+++ b/ldap/servers/plugins/acl/acllas.c
@@ -4065,6 +4065,9 @@ aclutil_evaluate_macro(char *rule, lasInfo *lasinfo, acl_eval_types evalType)
*/
candidate_list = acllas_replace_dn_macro(rule, matched_val, lasinfo);
+ if (candidate_list == NULL) {
+ return matched;
+ }
sptr = candidate_list;
while (*sptr != NULL && !matched) {
diff --git a/ldap/servers/plugins/cos/cos_cache.c b/ldap/servers/plugins/cos/cos_cache.c
index d404ff901..32f023f47 100644
--- a/ldap/servers/plugins/cos/cos_cache.c
+++ b/ldap/servers/plugins/cos/cos_cache.c
@@ -1677,16 +1677,22 @@ cos_cache_release(cos_cache *ptheCache)
slapi_unlock_mutex(cache_lock);
- if (destroy) {
+ if (destroy && (pOldCache != NULL)) {
cosDefinitions *pDef = pOldCache->pDefs;
/* now is the first time it is
* safe to assess whether
* vattr caching can be turned on
*/
+ /* Work around gcc -fanalyzer bug: it complain about pOldCache
+ * but that is pCache that is tested ...
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wanalyzer-deref-before-check"
if (pCache && pCache->vattr_cacheable) {
slapi_vattrcache_cache_all();
}
+#pragma GCC diagnostic pop
/* destroy the cache here - no locking required, no references outstanding */
diff --git a/ldap/servers/plugins/memberof/memberof.c b/ldap/servers/plugins/memberof/memberof.c
index a14617044..a8195a501 100644
--- a/ldap/servers/plugins/memberof/memberof.c
+++ b/ldap/servers/plugins/memberof/memberof.c
@@ -1918,6 +1918,11 @@ memberof_mod_attr_list_r(Slapi_PBlock *pb, MemberOfConfig *config, int mod, Slap
op_this_val = slapi_value_new_string(slapi_sdn_get_ndn(op_this_sdn));
slapi_value_set_flags(op_this_val, SLAPI_ATTR_FLAG_NORMALIZED_CIS);
+ /* For gcc -analyser: ignore false positive about dn_str
+ * (last_str cannot be NULL if last_size > bv->bv_len)
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wanalyzer-null-argument"
while (val && rc == 0) {
char *dn_str = 0;
@@ -1967,6 +1972,7 @@ memberof_mod_attr_list_r(Slapi_PBlock *pb, MemberOfConfig *config, int mod, Slap
if (last_str)
slapi_ch_free_string(&last_str);
+#pragma GCC diagnostic pop
return rc;
}
@@ -2712,9 +2718,13 @@ memberof_replace_list(Slapi_PBlock *pb, MemberOfConfig *config, Slapi_DN *group_
post_index++;
} else if (post_index == post_total) {
+ /* For gcc -fanalyzer: pre_index cannot be null when pre_index < pre_total */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wanalyzer-null-dereference"
/* delete the rest of pre */
slapi_sdn_set_normdn_byref(sdn,
slapi_value_get_string(pre_array[pre_index]));
+#pragma GCC diagnostic pop
rc = memberof_del_one(pb, config, group_sdn, sdn);
pre_index++;
diff --git a/ldap/servers/plugins/replication/cl5_api.c b/ldap/servers/plugins/replication/cl5_api.c
index 83004e880..2be06574f 100644
--- a/ldap/servers/plugins/replication/cl5_api.c
+++ b/ldap/servers/plugins/replication/cl5_api.c
@@ -3399,6 +3399,9 @@ _cl5Operation2LDIF(const slapi_operation_parameters *op, const char *replGen, ch
PR_ASSERT(op && replGen && ldifEntry && IsValidOperation(op));
strType = _cl5OperationType2Str(op->operation_type);
+ if ((NULL == strType) || (NULL == op->target_address.uniqueid)) {
+ return CL5_BAD_FORMAT;
+ }
csn_as_string(op->csn, PR_FALSE, strCSN);
/* find length of the buffer */
@@ -3440,6 +3443,11 @@ _cl5Operation2LDIF(const slapi_operation_parameters *op, const char *replGen, ch
"_cl5Operation2LDIF - MODRDN - mods are NULL\n");
return CL5_BAD_FORMAT;
}
+ if (NULL == op->p.p_modrdn.modrdn_newrdn) {
+ slapi_log_err(SLAPI_LOG_ERR, repl_plugin_name_cl,
+ "_cl5Operation2LDIF - MODRDN - mods are NULL\n");
+ return CL5_BAD_FORMAT;
+ }
len += LDIF_SIZE_NEEDED(strlen(T_DNSTR), REPL_GET_DN_LEN(&op->target_address));
len += LDIF_SIZE_NEEDED(strlen(T_NEWRDNSTR), strlen(op->p.p_modrdn.modrdn_newrdn));
strDeleteOldRDN = (op->p.p_modrdn.modrdn_deloldrdn ? "true" : "false");
@@ -3486,6 +3494,14 @@ _cl5Operation2LDIF(const slapi_operation_parameters *op, const char *replGen, ch
slapi_ldif_put_type_and_value_with_options(&buff, T_UNIQUEIDSTR, op->target_address.uniqueid,
strlen(op->target_address.uniqueid), 0);
+ /*
+ * Disable two false positives with gcc -fanalyser (about rawDN and l)
+ * because the analyzer does not select the same branch in consecutive
+ * similar switches
+ */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wanalyzer-null-dereference"
+#pragma GCC diagnostic ignored "-Wanalyzer-null-argument"
switch (op->operation_type) {
case SLAPI_OPERATION_ADD:
if (op->p.p_add.parentuniqueid)
@@ -3525,6 +3541,7 @@ _cl5Operation2LDIF(const slapi_operation_parameters *op, const char *replGen, ch
REPL_GET_DN_LEN(&op->target_address), 0);
break;
}
+#pragma GCC diagnostic pop
*buff = '\n';
buff++;
diff --git a/ldap/servers/plugins/replication/repl5_inc_protocol.c b/ldap/servers/plugins/replication/repl5_inc_protocol.c
index 68d93e1b0..7263d0655 100644
--- a/ldap/servers/plugins/replication/repl5_inc_protocol.c
+++ b/ldap/servers/plugins/replication/repl5_inc_protocol.c
@@ -384,8 +384,7 @@ repl5_inc_rd_new(Private_Repl_Protocol *prp)
res->prp = prp;
res->lock = PR_NewLock();
if (NULL == res->lock) {
- slapi_ch_free((void **)&res);
- res = NULL;
+ slapi_ch_oom("PR_NewLock");
}
}
return res;
diff --git a/ldap/servers/plugins/replication/repl5_replica_config.c b/ldap/servers/plugins/replication/repl5_replica_config.c
index 60c4148fd..7c4be7313 100644
--- a/ldap/servers/plugins/replication/repl5_replica_config.c
+++ b/ldap/servers/plugins/replication/repl5_replica_config.c
@@ -282,7 +282,13 @@ replica_config_modify(Slapi_PBlock *pb,
PR_Lock(s_configLock);
mtnode_ext = _replica_config_get_mtnode_ext(e);
- PR_ASSERT(mtnode_ext);
+ if (NULL == mtnode_ext) {
+ PR_Unlock(s_configLock);
+ PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE,
+ "Unable to get the replica mapping tree");
+ *returncode = LDAP_OPERATIONS_ERROR;
+ return SLAPI_DSE_CALLBACK_ERROR;
+ }
if (mtnode_ext->replica == NULL) {
PR_snprintf(errortext, SLAPI_DSE_RETURNTEXT_SIZE, "Replica does not exist for %s", replica_root);
@@ -614,7 +620,13 @@ replica_config_post_modify(Slapi_PBlock *pb,
PR_Lock(s_configLock);
mtnode_ext = _replica_config_get_mtnode_ext(e);
- PR_ASSERT(mtnode_ext);
+ if (NULL == mtnode_ext) {
+ PR_Unlock(s_configLock);
+ PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE,
+ "Unable to get the replica mapping tree");
+ *returncode = LDAP_OPERATIONS_ERROR;
+ return SLAPI_DSE_CALLBACK_ERROR;
+ }
if (mtnode_ext->replica == NULL) {
PR_snprintf(errortext, SLAPI_DSE_RETURNTEXT_SIZE,
@@ -708,7 +720,13 @@ replica_config_delete(Slapi_PBlock *pb __attribute__((unused)),
PR_Lock(s_configLock);
mtnode_ext = _replica_config_get_mtnode_ext(e);
- PR_ASSERT(mtnode_ext);
+ if (NULL == mtnode_ext) {
+ PR_Unlock(s_configLock);
+ PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE,
+ "Unable to get the replica mapping tree");
+ *returncode = LDAP_OPERATIONS_ERROR;
+ return SLAPI_DSE_CALLBACK_ERROR;
+ }
if (mtnode_ext->replica) {
/* remove object from the hash */
@@ -840,7 +858,13 @@ replica_config_search(Slapi_PBlock *pb,
PR_Lock(s_configLock);
mtnode_ext = _replica_config_get_mtnode_ext(e);
- PR_ASSERT(mtnode_ext);
+ if (NULL == mtnode_ext) {
+ PR_Unlock(s_configLock);
+ PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE,
+ "Unable to get the replica mapping tree");
+ *returncode = LDAP_OPERATIONS_ERROR;
+ return SLAPI_DSE_CALLBACK_ERROR;
+ }
if (mtnode_ext->replica) {
Replica *replica = (Replica *)object_get_data(mtnode_ext->replica);
diff --git a/ldap/servers/plugins/replication/repl_shared.h b/ldap/servers/plugins/replication/repl_shared.h
index d59449e51..f62c9c674 100644
--- a/ldap/servers/plugins/replication/repl_shared.h
+++ b/ldap/servers/plugins/replication/repl_shared.h
@@ -104,7 +104,7 @@ int copyfile(char *source, char *destination, int overwrite, int mode);
time_t age_str2time(const char *age);
const char *changeType2Str(int type);
int str2ChangeType(const char *str);
-lenstr *make_changes_string(LDAPMod **ldm, char **includeattrs);
+lenstr *make_changes_string(LDAPMod **ldm, char **includeattrs) __ATTRIBUTE__((returns_nonnull));
Slapi_Mods *parse_changes_string(char *str);
PRBool IsValidOperation(const slapi_operation_parameters *op);
const char *map_repl_root_to_dbid(Slapi_DN *repl_root);
diff --git a/ldap/servers/plugins/rootdn_access/rootdn_access.c b/ldap/servers/plugins/rootdn_access/rootdn_access.c
index deae76592..3e20981d8 100644
--- a/ldap/servers/plugins/rootdn_access/rootdn_access.c
+++ b/ldap/servers/plugins/rootdn_access/rootdn_access.c
@@ -56,7 +56,7 @@ static int32_t rootdn_check_access(Slapi_PBlock *pb);
static int32_t rootdn_check_host_wildcard(char *host, char *client_host);
static int rootdn_check_ip_wildcard(char *ip, char *client_ip);
static int32_t rootdn_preop_bind_init(Slapi_PBlock *pb);
-char *strToLower(char *str);
+void strToLower(char *str);
/*
* Plug-in globals
@@ -238,7 +238,7 @@ rootdn_load_config(Slapi_PBlock *pb)
* Validate out settings
*/
if (daysAllowed_tmp) {
- daysAllowed_tmp = strToLower(daysAllowed_tmp);
+ strToLower(daysAllowed_tmp);
end = strspn(daysAllowed_tmp, "abcdefghijklmnopqrstuvwxyz ,");
if (!end || daysAllowed_tmp[end] != '\0') {
slapi_log_err(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_load_config - "
@@ -499,13 +499,12 @@ rootdn_check_access(Slapi_PBlock *pb)
*/
if (daysAllowed) {
char *timestr;
- char day[4] = {0};
- char *today = day;
+ char today[4] = {0};
timestr = asctime(timeinfo); // DDD MMM dd hh:mm:ss YYYY
- memmove(day, timestr, 3); // we only want the day
- today = strToLower(today);
- daysAllowed = strToLower(daysAllowed);
+ memmove(today, timestr, 3); // we only want the day
+ strToLower(today);
+ strToLower(daysAllowed);
if (!strstr(daysAllowed, today)) {
slapi_log_err(SLAPI_LOG_ERR, ROOTDN_PLUGIN_SUBSYSTEM, "rootdn_check_access - "
@@ -758,11 +757,15 @@ rootdn_check_ip_wildcard(char *ip, char *client_ip)
return 0;
}
-char *
+void
strToLower(char *str)
{
- for (size_t i = 0; str && i < strlen(str); i++) {
- str[i] = tolower(str[i]);
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wanalyzer-out-of-bounds"
+ if (NULL != str) {
+ for (char *pt = str; *pt != '\0'; pt++) {
+ *pt = tolower(*pt);
+ }
}
- return str;
+#pragma GCC diagnostic pop
}
diff --git a/ldap/servers/plugins/sync/sync_util.c b/ldap/servers/plugins/sync/sync_util.c
index dc0ec70e1..1b731cb10 100644
--- a/ldap/servers/plugins/sync/sync_util.c
+++ b/ldap/servers/plugins/sync/sync_util.c
@@ -333,7 +333,7 @@ sync_result_msg(Slapi_PBlock *pb, Sync_Cookie *cookie)
LDAPControl **ctrl = (LDAPControl **)slapi_ch_calloc(2, sizeof(LDAPControl *));
- if (cookie->openldap_compat) {
+ if (cookie && cookie->openldap_compat) {
sync_create_sync_done_control(&ctrl[0], 1, cookiestr);
} else {
sync_create_sync_done_control(&ctrl[0], 0, cookiestr);
diff --git a/ldap/servers/plugins/views/views.c b/ldap/servers/plugins/views/views.c
index 007a9d6f5..1014fc619 100644
--- a/ldap/servers/plugins/views/views.c
+++ b/ldap/servers/plugins/views/views.c
@@ -1352,7 +1352,7 @@ views_update_views_cache(Slapi_Entry *e, char *dn __attribute__((unused)), int m
* update all child filters
* re-index
*/
- if (modtype == LDAP_CHANGETYPE_DELETE) {
+ if ((modtype == LDAP_CHANGETYPE_DELETE) && (theView != NULL)) {
if (theCache.view_count - 1) {
/* detach view */
diff --git a/ldap/servers/slapd/back-ldbm/archive.c b/ldap/servers/slapd/back-ldbm/archive.c
index 6658cc80a..8f07beaa3 100644
--- a/ldap/servers/slapd/back-ldbm/archive.c
+++ b/ldap/servers/slapd/back-ldbm/archive.c
@@ -490,7 +490,7 @@ out:
#define CPRETRY 4
/* Copy a file to the backup */
static int32_t
-archive_copyfile(char *source, char *destination, char *filename, mode_t mode, Slapi_Task *task)
+archive_copyfile(char *source, char *destination, const char *filename, mode_t mode, Slapi_Task *task)
{
PRFileDesc *source_fd = NULL;
PRFileDesc *dest_fd = NULL;
@@ -626,10 +626,10 @@ error:
return return_value;
}
-static char *cert_files_600[] = {
+static const char *cert_files_600[] = {
"key4.db", "cert9.db", "pin.txt", "pwdfile.txt", NULL
};
-static char *config_files_440[] = {"certmap.conf", "slapd-collations.conf", NULL};
+static const char *config_files_440[] = {"certmap.conf", "slapd-collations.conf", NULL};
/* Archive nss files, 99user.ldif, and config files */
int32_t
diff --git a/ldap/servers/slapd/back-ldbm/cache.c b/ldap/servers/slapd/back-ldbm/cache.c
index 0dd53d72b..642eee71d 100644
--- a/ldap/servers/slapd/back-ldbm/cache.c
+++ b/ldap/servers/slapd/back-ldbm/cache.c
@@ -533,7 +533,11 @@ dbgec_test_if_entry_pointer_is_valid(void *e, void *prev, int slot, int line)
*/
slapi_log_err(SLAPI_LOG_FATAL, "dbgec_test_if_entry_pointer_is_valid", "cache.c[%d]: Wrong entry address: %p Previous entry address is: %p hash table slot is %d\n", line, e, prev, slot);
slapi_log_backtrace(SLAPI_LOG_FATAL);
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Warray-bounds="
+#pragma GCC diagnostic ignored "-Wstringop-overflow="
*(char*)23 = 1; /* abort() somehow corrupt gdb stack backtrace so lets generate a SIGSEGV */
+#pragma GCC diagnostic pop
abort();
}
}
diff --git a/ldap/servers/slapd/back-ldbm/db-bdb/bdb_import.c b/ldap/servers/slapd/back-ldbm/db-bdb/bdb_import.c
index 8e6a8bd11..f664b2a54 100644
--- a/ldap/servers/slapd/back-ldbm/db-bdb/bdb_import.c
+++ b/ldap/servers/slapd/back-ldbm/db-bdb/bdb_import.c
@@ -3141,6 +3141,7 @@ static int
bdb_import_merge_one_file(ImportWorkerInfo *worker, int passes, int *key_count)
{
ldbm_instance *inst = worker->job->inst;
+ PR_ASSERT(NULL != inst);
backend *be = inst->inst_be;
DB *output_file = NULL;
int ret = 0;
@@ -3150,8 +3151,6 @@ bdb_import_merge_one_file(ImportWorkerInfo *worker, int passes, int *key_count)
DB **input_files = NULL;
DBC **input_cursors = NULL;
- PR_ASSERT(NULL != inst);
-
/* Try to open all the input files.
If we can't open file a file, we assume that is
because there was no data in it. */
diff --git a/ldap/servers/slapd/back-ldbm/db-bdb/bdb_import_threads.c b/ldap/servers/slapd/back-ldbm/db-bdb/bdb_import_threads.c
index 8c715dc44..b228e268a 100644
--- a/ldap/servers/slapd/back-ldbm/db-bdb/bdb_import_threads.c
+++ b/ldap/servers/slapd/back-ldbm/db-bdb/bdb_import_threads.c
@@ -1717,6 +1717,11 @@ bdb_upgradedn_producer(void *param)
the temp work file */
/* open "path" once, and set FILE* to upgradefd */
if (NULL == job->upgradefd) {
+ /* Disable gcc -fanalyzer false positive about job->upgradefd */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wanalyzer-malloc-leak"
+#pragma GCC diagnostic ignored "-Wanalyzer-file-leak"
+
char *ldifdir = config_get_ldifdir();
if (ldifdir) {
path = slapi_ch_smprintf("%s/%s_dn_norm_sp.txt",
@@ -1753,6 +1758,7 @@ bdb_upgradedn_producer(void *param)
goto error;
}
}
+#pragma GCC diagnostic pop
}
slapi_ch_free_string(&path);
if (is_dryrun) {
diff --git a/ldap/servers/slapd/back-ldbm/db-bdb/bdb_layer.c b/ldap/servers/slapd/back-ldbm/db-bdb/bdb_layer.c
index 1a64e814c..defb29c31 100644
--- a/ldap/servers/slapd/back-ldbm/db-bdb/bdb_layer.c
+++ b/ldap/servers/slapd/back-ldbm/db-bdb/bdb_layer.c
@@ -5713,14 +5713,14 @@ bdb_restore(struct ldbminfo *li, char *src_dir, Slapi_Task *task)
slapi_log_err(SLAPI_LOG_ERR,
"bdb_restore", "%s is on, while the instance %s is in the DN format. "
"Please run dn2rdn to convert the database format.\n",
- CONFIG_ENTRYRDN_SWITCH, inst->inst_name);
+ CONFIG_ENTRYRDN_SWITCH, (inst != NULL) ? inst->inst_name : "<Null>");
return_value = -1;
goto error_out;
} else if (action & DBVERSION_NEED_RDN2DN) {
slapi_log_err(SLAPI_LOG_ERR,
"bdb_restore", "%s is off, while the instance %s is in the RDN format. "
"Please change the value to on in dse.ldif.\n",
- CONFIG_ENTRYRDN_SWITCH, inst->inst_name);
+ CONFIG_ENTRYRDN_SWITCH, (inst != NULL) ? inst->inst_name : "<Null>");
return_value = -1;
goto error_out;
} else {
diff --git a/ldap/servers/slapd/back-ldbm/db-mdb/mdb_instance.c b/ldap/servers/slapd/back-ldbm/db-mdb/mdb_instance.c
index 1a26ce576..184af1ba0 100644
--- a/ldap/servers/slapd/back-ldbm/db-mdb/mdb_instance.c
+++ b/ldap/servers/slapd/back-ldbm/db-mdb/mdb_instance.c
@@ -396,7 +396,7 @@ dbmdb_open_all_files(dbmdb_ctx_t *ctx, backend *be)
}
}
ctxflags = ctx->readonly ? MDB_RDONLY: MDB_CREATE;
- if (does_vlv_need_init(inst)) {
+ if (be != NULL && does_vlv_need_init(inst)) {
/* Vlv initialization is quite tricky as it require that
* [1] dbis_lock is not held
* [2] inst->inst_id2entry is set
@@ -414,8 +414,13 @@ dbmdb_open_all_files(dbmdb_ctx_t *ctx, backend *be)
/* Note: ctx->dbis_lock mutex must always be hold after getting the txn
* because txn is held very early (within backend code) in add operation
* and inverting the order may lead to deadlock
+ * BTW TST macro cannot be used here because mutex is not held and valid_slot is NULL
*/
- TST(START_TXN(&txn, NULL, TXNFL_DBI));
+ rc = START_TXN(&txn, NULL, TXNFL_DBI);
+ if (rc != 0) {
+ slapi_log_err(SLAPI_LOG_ERR, "dbmdb_open_all_files", "failed to begin a new transaction rc=%d: %s.\n", rc, mdb_strerror(rc));
+ return dbmdb_map_error(__FUNCTION__, rc);
+ }
pthread_mutex_lock(&ctx->dbis_lock);
if (!ctx->dbi_slots) {
@@ -1384,16 +1389,13 @@ int dbmdb_recno_cache_get_mode(dbmdb_recno_cache_ctx_t *rcctx)
/* Now lets search for the associated recno cache dbi */
rcctx->rcdbi = dbi_get_by_name(ctx, rcctx->cursor->be, rcdbname);
- if (rcctx->rcdbi)
- rcctx->mode = RCMODE_USE_CURSOR_TXN;
-
- if (rcctx->mode == RCMODE_USE_CURSOR_TXN) {
+ if (rcctx->rcdbi) {
/* DBI cache was found, Let check that it is usuable */
rcctx->key.mv_data = "OK";
rcctx->key.mv_size = 2;
rc = MDB_GET(txn, rcctx->rcdbi->dbi, &rcctx->key, &rcctx->data);
- if (rc) {
- rcctx->mode = RCMODE_UNKNOWN;
+ if (rc == MDB_SUCCESS) {
+ rcctx->mode = RCMODE_USE_CURSOR_TXN;
}
if (rc != MDB_NOTFOUND) {
/* There was an error or cache is valid.
diff --git a/ldap/servers/slapd/bind.c b/ldap/servers/slapd/bind.c
index 5365ab8c0..cf0b14e30 100644
--- a/ldap/servers/slapd/bind.c
+++ b/ldap/servers/slapd/bind.c
@@ -248,7 +248,7 @@ do_bind(Slapi_PBlock *pb)
/* You are "bound" when the SSL connection is made,
but the client still passes a BIND SASL/EXTERNAL request.
*/
- if ((LDAP_AUTH_SASL == method) &&
+ if ((LDAP_AUTH_SASL == method) && (saslmech != NULL) &&
(0 == strcasecmp(saslmech, LDAP_SASL_EXTERNAL)) &&
(0 == dn || 0 == dn[0]) && pb_conn->c_unix_local) {
slapd_bind_local_user(pb_conn);
diff --git a/ldap/servers/slapd/ch_malloc.c b/ldap/servers/slapd/ch_malloc.c
index 9b9bac29d..cbab1d170 100644
--- a/ldap/servers/slapd/ch_malloc.c
+++ b/ldap/servers/slapd/ch_malloc.c
@@ -244,6 +244,10 @@ struct berval **
slapi_ch_bvecdup(struct berval **v)
{
struct berval **newberval = NULL;
+ /* Disable fanalyzer false positive */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wanalyzer-out-of-bounds"
+
if (v != NULL) {
size_t i = 0;
while (v[i] != NULL)
@@ -254,6 +258,7 @@ slapi_ch_bvecdup(struct berval **v)
newberval[i] = slapi_ch_bvdup(v[i]);
}
}
+#pragma GCC diagnostic pop
return newberval;
}
@@ -365,3 +370,15 @@ slapi_ct_memcmp(const void *p1, const void *p2, size_t n)
}
return result;
}
+
+/* Log out of memory error message and exit process */
+void
+slapi_ch_oom(const char *funcname)
+{
+ int oserr = errno;
+ oom_occurred();
+ slapi_log_err(SLAPI_LOG_ERR, SLAPD_MODULE,
+ "Run out of memory while calling %s(); OS error %d (%s)%s\n",
+ funcname, oserr, slapd_system_strerror(oserr), oom_advice);
+ exit(1);
+}
diff --git a/ldap/servers/slapd/counters.c b/ldap/servers/slapd/counters.c
index 5fe7e850b..c7457e8f3 100644
--- a/ldap/servers/slapd/counters.c
+++ b/ldap/servers/slapd/counters.c
@@ -123,7 +123,7 @@ counters_as_entry(Slapi_Entry *e)
fetch_counters();
for (i = 0; i < num_counters; i++) {
char value[40];
- char *type = (char *)malloc(counter_size(&counters[i]) + 4);
+ char *type = (char *)slapi_ch_malloc(counter_size(&counters[i]) + 4);
counter_dump(type, value, i);
slapi_entry_attr_set_charptr(e, type, value);
free(type);
@@ -141,7 +141,7 @@ counters_to_errors_log(const char *text)
slapi_log_err(SLAPI_LOG_DEBUG, "counters_to_errors_log", "Counter Dump - %s\n", text);
for (i = 0; i < num_counters; i++) {
char value[40];
- char *type = (char *)malloc(counter_size(&counters[i]) + 4);
+ char *type = (char *)slapi_ch_malloc(counter_size(&counters[i]) + 4);
counter_dump(type, value, i);
slapi_log_err(SLAPI_LOG_DEBUG, "counters_to_errors_log", "%s %s\n", type, value);
free(type);
diff --git a/ldap/servers/slapd/csngen.c b/ldap/servers/slapd/csngen.c
index d75e510a8..6239dca6a 100644
--- a/ldap/servers/slapd/csngen.c
+++ b/ldap/servers/slapd/csngen.c
@@ -858,6 +858,10 @@ void csngen_multi_suppliers_test(void)
if (gen[i]) {
gen[i]->gettime = _csngen_tester_gettime;
gen[i]->state.sampled_time = now.tv_sec;
+ } else {
+ slapi_log_err(SLAPI_LOG_ERR, "csngen_multi_suppliers_test",
+ "Failed to initialize the CSNs\n");
+ return;
}
}
diff --git a/ldap/servers/slapd/dn.c b/ldap/servers/slapd/dn.c
index 093019e28..42f475831 100644
--- a/ldap/servers/slapd/dn.c
+++ b/ldap/servers/slapd/dn.c
@@ -3051,6 +3051,9 @@ slapi_sdn_common_ancestor(Slapi_DN *dn1, Slapi_DN *dn2)
}
dn1str = slapi_sdn_get_ndn(dn1);
dn2str = slapi_sdn_get_ndn(dn2);
+ if ((NULL == dn1str) || (NULL == dn2str)) {
+ return NULL;
+ }
if (0 == strcmp(dn1str, dn2str)) {
/* identical */
return slapi_sdn_dup(dn1);
diff --git a/ldap/servers/slapd/libglobs.c b/ldap/servers/slapd/libglobs.c
index 72e935a9f..12aa4af40 100644
--- a/ldap/servers/slapd/libglobs.c
+++ b/ldap/servers/slapd/libglobs.c
@@ -9136,13 +9136,16 @@ static void
config_set_value(
Slapi_Entry *e,
struct config_get_and_set *cgas,
- void **value)
+ void *value)
{
struct berval **values = 0;
char *sval = 0;
int ival = 0;
uintptr_t pval;
+ /* gcc -fanalyzer false postive with switch and type lenght */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wanalyzer-out-of-bounds"
switch (cgas->config_var_type) {
case CONFIG_ON_OFF: /* convert 0,1 to "off","on" */
slapi_entry_attr_set_charptr(e, cgas->attr_name,
@@ -9195,7 +9198,7 @@ config_set_value(
case CONFIG_SPECIAL_REFERRALLIST:
/* referral list is already an array of berval* */
if (value)
- slapi_entry_attr_replace(e, cgas->attr_name, (struct berval **)*value);
+ slapi_entry_attr_replace(e, cgas->attr_name, *(struct berval ***)value);
else
slapi_entry_attr_set_charptr(e, cgas->attr_name, "");
break;
@@ -9203,7 +9206,7 @@ config_set_value(
case CONFIG_SPECIAL_TRUSTED_IP_LIST:
/* trusted IP list is already an array of berval* */
if (value)
- slapi_entry_attr_replace(e, cgas->attr_name, (struct berval **)*value);
+ slapi_entry_attr_replace(e, cgas->attr_name, *(struct berval ***)value);
else
slapi_entry_attr_set_charptr(e, cgas->attr_name, "");
break;
@@ -9362,6 +9365,7 @@ config_set_value(
PR_ASSERT(0); /* something went horribly wrong . . . */
break;
}
+#pragma GCC diagnostic pop
return;
}
@@ -9390,7 +9394,7 @@ config_set_entry(Slapi_Entry *e)
CFG_LOCK_READ(slapdFrontendConfig);
for (ii = 0; ii < tablesize; ++ii) {
struct config_get_and_set *cgas = &ConfigList[ii];
- void **value = 0;
+ void *value = 0;
PR_ASSERT(cgas);
value = cgas->config_var_addr;
@@ -9413,7 +9417,7 @@ config_set_entry(Slapi_Entry *e)
struct config_get_and_set *cgas = &ConfigList[ii];
int ival = 0;
long lval = 0;
- void **value = NULL;
+ void *value = NULL;
void *alloc_val = NULL;
int needs_free = 0;
@@ -9430,10 +9434,10 @@ config_set_entry(Slapi_Entry *e)
/* otherwise endianness problems will ensue */
if (isInt(cgas->config_var_type)) {
ival = (int)(intptr_t)(cgas->getfunc)();
- value = (void **)&ival; /* value must be address of int */
+ value = &ival; /* value must be address of int */
} else if (cgas->config_var_type == CONFIG_LONG) {
lval = (long)(intptr_t)(cgas->getfunc)();
- value = (void **)&lval; /* value must be address of long */
+ value = &lval; /* value must be address of long */
} else {
alloc_val = (cgas->getfunc)();
value = &alloc_val; /* value must be address of pointer */
@@ -9445,9 +9449,9 @@ config_set_entry(Slapi_Entry *e)
if (needs_free && value) { /* assumes memory allocated by slapi_ch_Xalloc */
if (CONFIG_CHARRAY == cgas->config_var_type) {
- charray_free((char **)*value);
+ charray_free(*(char ***)value);
} else if (CONFIG_SPECIAL_REFERRALLIST == cgas->config_var_type) {
- ber_bvecfree((struct berval **)*value);
+ ber_bvecfree(*(struct berval ***)value);
} else if ((CONFIG_CONSTANT_INT != cgas->config_var_type) && /* do not free constants */
(CONFIG_CONSTANT_STRING != cgas->config_var_type)) {
slapi_ch_free(value);
diff --git a/ldap/servers/slapd/mapping_tree.c b/ldap/servers/slapd/mapping_tree.c
index dd7b1af37..159d3972c 100644
--- a/ldap/servers/slapd/mapping_tree.c
+++ b/ldap/servers/slapd/mapping_tree.c
@@ -2534,6 +2534,10 @@ mtn_get_be(mapping_tree_node *target_node, Slapi_PBlock *pb, Slapi_Backend **be,
/* shut down detected */
return LDAP_OPERATIONS_ERROR;
}
+ if (target_node == NULL) {
+ return LDAP_UNWILLING_TO_PERFORM;
+ }
+
/* Get usefull stuff like the type of operation, target dn */
slapi_pblock_get(pb, SLAPI_OPERATION, &op);
op_type = operation_get_type(op);
diff --git a/ldap/servers/slapd/opshared.c b/ldap/servers/slapd/opshared.c
index 540597f45..c592d8def 100644
--- a/ldap/servers/slapd/opshared.c
+++ b/ldap/servers/slapd/opshared.c
@@ -863,12 +863,17 @@ op_shared_search(Slapi_PBlock *pb, int send_result)
case -1: /* an error occurred */
/* PAGED RESULTS */
+ /* Explicit ctrlp test avoid gcc -fanalyzer warning */
if (op_is_pagedresults(operation)) {
+ /* Disable gcc -fanalyzer false positive about pagedresults_mutex == NULL */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wanalyzer-null-argument"
/* cleanup the slot */
pthread_mutex_lock(pagedresults_mutex);
pagedresults_set_search_result(pb_conn, operation, NULL, 1, pr_idx);
rc = pagedresults_set_current_be(pb_conn, NULL, pr_idx, 1);
pthread_mutex_unlock(pagedresults_mutex);
+#pragma GCC diagnostic pop
}
if (1 == flag_no_such_object) {
break;
diff --git a/ldap/servers/slapd/protect_db.c b/ldap/servers/slapd/protect_db.c
index c723b919f..eb61e0a23 100644
--- a/ldap/servers/slapd/protect_db.c
+++ b/ldap/servers/slapd/protect_db.c
@@ -99,6 +99,7 @@ grab_lockfile(void)
size_t nb_bytes = 0;
nb_bytes = read(fd, (void *)&owning_pid, sizeof(pid_t));
+ close(fd);
if ((nb_bytes != (size_t)(sizeof(pid_t))) || (owning_pid == 0) || (kill(owning_pid, 0) != 0 && errno == ESRCH)) {
/* The process that owns the lock is dead. Try to remove the old lockfile. */
if (unlink(lockfile) != 0) {
diff --git a/ldap/servers/slapd/pw.c b/ldap/servers/slapd/pw.c
index 33e73efde..9890ffad2 100644
--- a/ldap/servers/slapd/pw.c
+++ b/ldap/servers/slapd/pw.c
@@ -1135,10 +1135,13 @@ check_pw_syntax_ext(Slapi_PBlock *pb, const Slapi_DN *sdn, Slapi_Value **vals, c
}
attr = attrlist_find(e->e_attrs, SLAPI_USERPWD_ATTR);
if (attr && !valueset_isempty(&attr->a_present_values)) {
- if (old_pw && (va = valueset_get_valuearray(&attr->a_present_values))) {
- *old_pw = slapi_ch_strdup(slapi_value_get_string(va[0]));
- } else {
- *old_pw = NULL;
+ if (old_pw) {
+ va = valueset_get_valuearray(&attr->a_present_values);
+ if (va != NULL) {
+ *old_pw = slapi_ch_strdup(slapi_value_get_string(va[0]));
+ } else {
+ *old_pw = NULL;
+ }
}
}
slapi_entry_free(e);
diff --git a/ldap/servers/slapd/slapi-plugin.h b/ldap/servers/slapd/slapi-plugin.h
index 5d4af7c20..1d56a0920 100644
--- a/ldap/servers/slapd/slapi-plugin.h
+++ b/ldap/servers/slapd/slapi-plugin.h
@@ -5836,6 +5836,7 @@ char *slapi_ch_smprintf(const char *fmt, ...) __ATTRIBUTE__((format(printf, 1, 2
* \return 0 on match. 1 on non-match. 2 on presence of NULL pointer in p1 or p2.
*/
int slapi_ct_memcmp(const void *p1, const void *p2, size_t n);
+void slapi_ch_oom(const char *funcname) __ATTRIBUTE__((noreturn));
/*
* syntax plugin routines
diff --git a/ldap/servers/slapd/tools/dbscan.c b/ldap/servers/slapd/tools/dbscan.c
index abfd0113b..159096bd5 100644
--- a/ldap/servers/slapd/tools/dbscan.c
+++ b/ldap/servers/slapd/tools/dbscan.c
@@ -1127,7 +1127,6 @@ importdb(const char *dbimpl_name, const char *filename, const char *dump_name)
if (!dump) {
printf("Failed to open dump file %s. Error %d: %s\n", dump_name, errno, strerror(errno));
- fclose(dump);
return 1;
}
diff --git a/ldap/servers/slapd/tools/ldclt/data.c b/ldap/servers/slapd/tools/ldclt/data.c
index ae0c722c9..ac4b1c4c1 100644
--- a/ldap/servers/slapd/tools/ldclt/data.c
+++ b/ldap/servers/slapd/tools/ldclt/data.c
@@ -41,6 +41,7 @@
#include <sys/mman.h> /* mmap(), etc... */
#include "port.h" /* Portability definitions */ /*JLS 28-11-00*/
#include "ldclt.h" /* This tool's include file */
+#include "utils.h" /* Utilities functions */
/* ****************************************************************************
@@ -192,6 +193,7 @@ loadImages(
fprintf(stderr, "Cannot close(%s)\n", name);
fflush(stderr);
rc = -1;
+ fd = -1;
goto exit;
} else {
fd = -1;
@@ -324,7 +326,7 @@ loadDataListFile(
*/
for (dlf->strNb = 0; fgets(line, MAX_FILTER, ifile) != NULL; dlf->strNb++)
;
- dlf->str = (char **)malloc(dlf->strNb * sizeof(char *));
+ dlf->str = (char **)safe_malloc(dlf->strNb * sizeof(char *));
if (fseek(ifile, 0, SEEK_SET) != 0) {
perror(dlf->fname);
fprintf(stderr, "Error: cannot rewind file \"%s\"\n", dlf->fname);
diff --git a/ldap/servers/slapd/tools/ldclt/ldclt.c b/ldap/servers/slapd/tools/ldclt/ldclt.c
index b0e3bedae..343cc7b7b 100644
--- a/ldap/servers/slapd/tools/ldclt/ldclt.c
+++ b/ldap/servers/slapd/tools/ldclt/ldclt.c
@@ -134,7 +134,7 @@ copyVersAttribute(
dstattr->name = srcattr->name;
dstattr->src = srcattr->src;
- dstattr->field = (vers_field *)malloc(sizeof(vers_field));
+ dstattr->field = (vers_field *)safe_malloc(sizeof(vers_field));
/*
* Copy each field of the attribute
@@ -145,7 +145,7 @@ copyVersAttribute(
memcpy(dst, src, sizeof(vers_field));
dst->commonField = src; /*JLS 28-03-01*/
if ((src = src->next) != NULL) {
- dst->next = (vers_field *)malloc(sizeof(vers_field));
+ dst->next = (vers_field *)safe_malloc(sizeof(vers_field));
dst = dst->next;
}
}
@@ -156,7 +156,7 @@ copyVersAttribute(
if (srcattr->buf == NULL) /*JLS 28-03-01*/
dstattr->buf = NULL; /*JLS 28-03-01*/
else /*JLS 28-03-01*/
- dstattr->buf = (char *)malloc(MAX_FILTER);
+ dstattr->buf = (char *)safe_malloc(MAX_FILTER);
/*
* End of function
@@ -182,7 +182,7 @@ copyVersObject(
/*
* Copy the object and initiates the buffers...
*/
- newobj = (vers_object *)malloc(sizeof(vers_object));
+ newobj = (vers_object *)safe_malloc(sizeof(vers_object));
newobj->attribsNb = srcobj->attribsNb;
newobj->fname = srcobj->fname;
@@ -193,14 +193,14 @@ copyVersObject(
if (srcobj->var[i] == NULL)
newobj->var[i] = NULL;
else
- newobj->var[i] = (char *)malloc(MAX_FILTER);
+ newobj->var[i] = (char *)safe_malloc(MAX_FILTER);
/*
* Maybe copy the rdn ?
*/
if (srcobj->rdn != NULL) {
newobj->rdnName = strdup(srcobj->rdnName);
- newobj->rdn = (vers_attribute *)malloc(sizeof(vers_attribute));
+ newobj->rdn = (vers_attribute *)safe_malloc(sizeof(vers_attribute));
if (copyVersAttribute(srcobj->rdn, newobj->rdn) < 0)
return (NULL);
}
@@ -246,10 +246,11 @@ tttctxInit(
tttctx->status = FREE;
tttctx->thrdNum = num;
tttctx->totalReq = mctx.totalReq;
+ tttctx->bufBindDN = NULL;
sprintf(tttctx->thrdId, "T%03d", tttctx->thrdNum);
if (mctx.mod2 & M2_OBJECT) {
- tttctx->bufObject1 = (char *)malloc(MAX_FILTER);
+ tttctx->bufObject1 = (char *)safe_malloc(MAX_FILTER);
if ((tttctx->object = copyVersObject(&(mctx.object))) == NULL)
return (-1);
}
@@ -890,7 +891,7 @@ parseFilter(
for (i = 0; (i < strlen(src)) && (src[i] != 'X'); i++)
;
- *head = (char *)malloc(i + 1);
+ *head = (char *)safe_malloc(i + 1);
if (*head == NULL) {
printf("Error: cannot malloc(*head), error=%d (%s)\n",
errno, strerror(errno));
@@ -901,7 +902,7 @@ parseFilter(
for (j = i; (i < strlen(src)) && (src[j] == 'X'); j++)
;
- *tail = (char *)malloc(strlen(src) - j + 1);
+ *tail = (char *)safe_malloc(strlen(src) - j + 1);
if (*tail == NULL) {
printf("Error: cannot malloc(*tail), error=%d (%s)\n",
errno, strerror(errno));
@@ -1190,7 +1191,7 @@ basicInit(void)
/*
* Parse the attribute value
*/
- mctx.attrplFile = (char *)malloc(strlen(mctx.attrpl + i) + 2);
+ mctx.attrplFile = (char *)safe_malloc(strlen(mctx.attrpl + i) + 2);
if (mctx.attrplFile == NULL) {
printf("Error: unable to allocate memory for attreplfile\n");
return (-1);
@@ -1233,7 +1234,7 @@ basicInit(void)
}
/* start to read file content */
- mctx.attrplFileContent = (char *)malloc(mctx.attrplFileSize + 1);
+ mctx.attrplFileContent = (char *)safe_malloc(mctx.attrplFileSize + 1);
i = 0;
while ((ret = fread(buffer, BUFFERSIZE, 1, attrF))) {
memcpy(mctx.attrplFileContent + i, buffer, ret);
@@ -1310,7 +1311,7 @@ basicInit(void)
* We need to initiate this entry to dummy values because some opXyz()
* functions will access this entry careless.
*/
- mctx.opListTail = (oper *)malloc(sizeof(oper));
+ mctx.opListTail = (oper *)safe_malloc(sizeof(oper));
if (mctx.opListTail == NULL) /*JLS 06-03-00*/
{ /*JLS 06-03-00*/
printf("Error: cannot malloc(mctx.opListTail), error=%d (%s)\n",
@@ -1663,7 +1664,7 @@ addAttrToList(
for (end = start; (list[end] != '\0') && (list[end] != ':'); end++)
;
- mctx.attrlist[mctx.attrlistNb] = (char *)malloc(1 + end - start);
+ mctx.attrlist[mctx.attrlistNb] = (char *)safe_malloc(1 + end - start);
if (mctx.attrlist[mctx.attrlistNb] == NULL) {
fprintf(stderr, "Error : failed to allocate mctx.attrlist\n");
return (-1);
@@ -1698,7 +1699,7 @@ decodeRdnParam(
* simply lost this data...
* Anyway, there is not a lot of memory used here...
*/
- mctx.object.rdn = (vers_attribute *)malloc(sizeof(vers_attribute));
+ mctx.object.rdn = (vers_attribute *)safe_malloc(sizeof(vers_attribute));
if (mctx.object.rdn == NULL) {
fprintf(stderr, "Error : failed to allocate mctx.object.rdn\n");
return (-1);
@@ -1714,7 +1715,7 @@ decodeRdnParam(
fprintf(stderr, "Error: missing rdn attribute name\n");
return (-1);
}
- mctx.object.rdnName = (char *)malloc(i + 1);
+ mctx.object.rdnName = (char *)safe_malloc(i + 1);
if (mctx.object.rdnName == NULL) {
fprintf(stderr, "Error : failed to allocate mctx.object.rdnName\n");
return (-1);
@@ -2208,7 +2209,7 @@ buildArgListString(
if ((strchr(argv[i], ' ') != NULL) || (strchr(argv[i], '\t') != NULL))
lgth += 2;
}
- argvList = (char *)malloc(lgth);
+ argvList = (char *)safe_malloc(lgth);
if (argvList == NULL) {
return (argvList);
}
diff --git a/ldap/servers/slapd/tools/ldclt/parser.c b/ldap/servers/slapd/tools/ldclt/parser.c
index 133937a1a..74f146362 100644
--- a/ldap/servers/slapd/tools/ldclt/parser.c
+++ b/ldap/servers/slapd/tools/ldclt/parser.c
@@ -154,7 +154,7 @@ parseVariant(
* We need a variable !
*/
if (obj->var[field->var] == NULL)
- obj->var[field->var] = (char *)malloc(MAX_FILTER);
+ obj->var[field->var] = (char *)safe_malloc(MAX_FILTER);
}
/*
@@ -331,11 +331,11 @@ parseAttribValue(
* Allocate a new field
*/
if (field == NULL) {
- field = (vers_field *)malloc(sizeof(vers_field));
+ field = (vers_field *)safe_malloc(sizeof(vers_field));
field->next = NULL;
attrib->field = field;
} else {
- field->next = (vers_field *)malloc(sizeof(vers_field));
+ field->next = (vers_field *)safe_malloc(sizeof(vers_field));
field = field->next;
field->next = NULL;
}
@@ -364,7 +364,7 @@ parseAttribValue(
* We need to allocate a buffer in this attribute !
*/
if (attrib->buf == NULL) {
- attrib->buf = (char *)malloc(MAX_FILTER);
+ attrib->buf = (char *)safe_malloc(MAX_FILTER);
if (mctx.mode & VERY_VERBOSE)
printf("parseAttribValue: buffer allocated\n");
}
@@ -375,7 +375,7 @@ parseAttribValue(
for (start = end; (line[end] != '\0') && (line[end] != '['); end++)
;
field->how = HOW_CONSTANT;
- field->cst = (char *)malloc(1 + end - start);
+ field->cst = (char *)safe_malloc(1 + end - start);
strncpy(field->cst, line + start, end - start);
field->cst[end - start] = '\0';
}
@@ -437,7 +437,7 @@ parseLine(
*/
obj->attribs[obj->attribsNb].buf = NULL;
obj->attribs[obj->attribsNb].src = strdup(line);
- obj->attribs[obj->attribsNb].name = (char *)malloc(1 + end);
+ obj->attribs[obj->attribsNb].name = (char *)safe_malloc(1 + end);
strncpy(obj->attribs[obj->attribsNb].name, line, end);
obj->attribs[obj->attribsNb].name[end] = '\0';
for (end++; line[end] == ' '; end++)
diff --git a/ldap/servers/slapd/tools/ldclt/repcheck.c b/ldap/servers/slapd/tools/ldclt/repcheck.c
index 05ea65a8b..d65e404c2 100644
--- a/ldap/servers/slapd/tools/ldclt/repcheck.c
+++ b/ldap/servers/slapd/tools/ldclt/repcheck.c
@@ -71,7 +71,7 @@ send_op(char *s, int sfd)
if (pendops[i].op == tmp.op && pendops[i].conn == tmp.conn) {
t = strstr(s, "err=");
sz = strlen(pendops[i].dn);
- result = (repconfirm *)malloc(sizeof(repconfirm) + sz);
+ result = (repconfirm *)safe_malloc(sizeof(repconfirm) + sz);
for (t += 4, result->res = 0; isdigit(*t); t++)
result->res = result->res * 10 + *t - '0';
result->type = htonl(ldap_val[pendops[i].type]);
@@ -126,7 +126,7 @@ main(int argc, char **argv)
srvsaddr.sin_port = htons(port);
freeaddrinfo(info);
maxop = npend = 0;
- pendops = (Optype *)malloc(sizeof(Optype) * 20);
+ pendops = (Optype *)safe_malloc(sizeof(Optype) * 20);
sigset(SIGPIPE, SIG_IGN);
while (fgets(logline, sizeof(logline), stdin)) {
if ((p = strchr(logline, '\n'))) {
diff --git a/ldap/servers/slapd/tools/ldclt/repworker.c b/ldap/servers/slapd/tools/ldclt/repworker.c
index 45b0f6145..1caae7796 100644
--- a/ldap/servers/slapd/tools/ldclt/repworker.c
+++ b/ldap/servers/slapd/tools/ldclt/repworker.c
@@ -159,7 +159,7 @@ send_op(char *s)
*/
if (pendops[i].op == tmp.op && pendops[i].conn == tmp.conn) {
sz = strlen(pendops[i].dn);
- result = (repconfirm *)malloc(sizeof(repconfirm) + sz);
+ result = (repconfirm *)safe_malloc(sizeof(repconfirm) + sz);
t = strstr(s, "err=");
for (t += 4, result->res = 0; isdigit(*t); t++)
result->res = result->res * 10 + *t - '0';
@@ -287,7 +287,7 @@ main(int argc, char **argv)
printf("Unknown host %s\n", hn);
exit(1);
}
- srvlist = (Towho *)malloc(sizeof(Towho));
+ srvlist = (Towho *)safe_malloc(sizeof(Towho));
srvlist[nsrv].addr.sin_addr.s_addr = htonl(*((u_long *)(info->ai_addr)));
srvlist[nsrv].addr.sin_family = AF_INET;
srvlist[nsrv].addr.sin_port = htons(port);
@@ -298,7 +298,7 @@ main(int argc, char **argv)
freeaddrinfo(info);
}
maxop = npend = 0;
- pendops = (Optype *)malloc(sizeof(Optype) * 20);
+ pendops = (Optype *)safe_malloc(sizeof(Optype) * 20);
/*
* Ignore SIGPIPE during write()
*/
diff --git a/ldap/servers/slapd/tools/ldclt/scalab01.c b/ldap/servers/slapd/tools/ldclt/scalab01.c
index 6322366e5..8c67d1f35 100644
--- a/ldap/servers/slapd/tools/ldclt/scalab01.c
+++ b/ldap/servers/slapd/tools/ldclt/scalab01.c
@@ -336,7 +336,7 @@ scalab01_addLogin(
{
int ret; /* Return value */
isp_user *new; /* New entry */
- isp_user *cur; /* Current entry */
+ isp_user **ptcur; /* Current entry address */
int rc = 0;
/*
@@ -368,48 +368,24 @@ scalab01_addLogin(
goto error;
}
- /*
- * Maybe this is the first entry of the list ?
- */
- if (s1ctx.list == NULL)
- s1ctx.list = new;
- else {
- /*
- * Check with the list's head
+ /*
+ * Find insertion point
*/
- if (s1ctx.list->counter >= duration) {
- new->next = s1ctx.list;
- s1ctx.list = new;
- } else {
- cur = s1ctx.list;
-
- /* If cur is NULL, we should just bail and free new. */
- if (cur == NULL) {
- goto error;
- }
-
- while (cur != NULL) {
- if (cur->next == NULL) {
- cur->next = new;
- cur = NULL; /* Exit loop */
- } else if (cur->next->counter >= duration) {
- new->next = cur->next;
- cur->next = new;
- cur = NULL; /* Exit loop */
- } else {
- cur = cur->next;
- }
- }
- }
+ ptcur = &s1ctx.list;
+ while ((*ptcur != NULL) && ((*ptcur)->counter < duration)) {
+ ptcur = &(*ptcur)->next;
}
-
- goto done;
+ /*
+ * Insert new element
+ */
+ new->next = *ptcur;
+ *ptcur = new;
+ new = NULL;
error:
if (new)
free(new);
-done:
/*
* Free mutex
*/
diff --git a/ldap/servers/slapd/tools/ldclt/threadMain.c b/ldap/servers/slapd/tools/ldclt/threadMain.c
index 988f25eab..e6105589b 100644
--- a/ldap/servers/slapd/tools/ldclt/threadMain.c
+++ b/ldap/servers/slapd/tools/ldclt/threadMain.c
@@ -817,7 +817,7 @@ threadMain(
if ((mctx.mode & NEED_FILTER) || (mctx.mod2 & (M2_GENLDIF | M2_NEED_FILTER))) /*JLS 19-03-01*/
{
if (mctx.mod2 & M2_RDN_VALUE) /*JLS 23-03-01*/
- tttctx->bufFilter = (char *)malloc(MAX_FILTER); /*JLS 23-03-01*/
+ tttctx->bufFilter = (char *)safe_malloc(MAX_FILTER); /*JLS 23-03-01*/
else /*JLS 23-03-01*/
{ /*JLS 23-03-01*/
/*
@@ -921,6 +921,9 @@ threadMain(
*/
if (mctx.mod2 & M2_RNDBINDFILE) /*JLS 03-05-01*/
{ /*JLS 03-05-01*/
+ if (tttctx->bufBindDN != NULL) {
+ free(tttctx->bufBindDN);
+ }
tttctx->bufBindDN = (char *)malloc(MAX_DN_LENGTH); /*JLS 03-05-01*/
tttctx->bufPasswd = (char *)malloc(MAX_DN_LENGTH); /*JLS 03-05-01*/
mctx.passwd = "foo bar"; /* trick... */ /*JLS 03-05-01*/
diff --git a/ldap/servers/slapd/tools/ldclt/utils.c b/ldap/servers/slapd/tools/ldclt/utils.c
index 42329619b..56e398ea0 100644
--- a/ldap/servers/slapd/tools/ldclt/utils.c
+++ b/ldap/servers/slapd/tools/ldclt/utils.c
@@ -35,6 +35,7 @@
#include <stdlib.h> /* lrand48(), etc... */
#include <ctype.h> /* isascii(), etc... */ /*JLS 16-11-00*/
#include <string.h> /* strerror(), etc... */ /*JLS 14-11-00*/
+#include <errno.h> /* ENOMEM */
/*
@@ -202,3 +203,23 @@ incr_and_wrap(int val, int min, int max, int incr)
int range = max - min + 1;
return (((val + incr) - min) % range) + min;
}
+
+/* ****************************************************************************
+ FUNCTION : safe_malloc
+ PURPOSE : a malloc that never returns NULL
+ INPUT : datalen = lenght of the alloced buffer in bytes.
+ OUTPUT : None
+ RETURN : alloced buffer
+ DESCRIPTION :
+ *****************************************************************************/
+void *
+safe_malloc(size_t datalen)
+{
+ void *pt = malloc(datalen);
+ if (pt == NULL) {
+ fprintf(stderr, "ldclt: %s\n", strerror(ENOMEM));
+ fprintf(stderr, "ldclt: Error: Unable to alloc %zd bytes.\n", datalen);
+ exit(3);
+ }
+ return pt;
+}
diff --git a/ldap/servers/slapd/tools/ldclt/utils.h b/ldap/servers/slapd/tools/ldclt/utils.h
index 7e057ccd7..8cd572dc6 100644
--- a/ldap/servers/slapd/tools/ldclt/utils.h
+++ b/ldap/servers/slapd/tools/ldclt/utils.h
@@ -12,6 +12,7 @@
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
+#include <sys/types.h>
/*
@@ -46,6 +47,7 @@ extern int rndlim(int low, int high);
extern void rndstr(char *buf, int ndigits);
extern int utilsInit(void);
extern int incr_and_wrap(int val, int min, int max, int incr);
+void *safe_malloc(size_t datalen);
/* End of file */
diff --git a/ldap/servers/snmp/ldap-agent.c b/ldap/servers/snmp/ldap-agent.c
index 22c5cb5c6..b65692ce5 100644
--- a/ldap/servers/snmp/ldap-agent.c
+++ b/ldap/servers/snmp/ldap-agent.c
@@ -57,6 +57,8 @@ init_ldap_agent(void)
/* Check if this row already exists. */
if (stats_table_find_row(serv_p->port) == NULL) {
/* Create a new row */
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wanalyzer-malloc-leak"
if ((new_row = stats_table_create_row(serv_p->port)) != NULL) {
/* Set pointer for entity table */
new_row->entity_tbl = serv_p;
@@ -67,6 +69,8 @@ init_ldap_agent(void)
/* Insert new row into the table */
snmp_log(LOG_DEBUG, "Inserting row for server: %d\n", serv_p->port);
CONTAINER_INSERT(ops_cb.container, new_row);
+ new_row = NULL;
+#pragma GCC diagnostic pop
} else {
/* error during malloc of row */
snmp_log(LOG_ERR, "Error creating row for server: %d\n",
diff --git a/lib/ldaputil/cert.c b/lib/ldaputil/cert.c
index 6c351afea..bbbb88a54 100644
--- a/lib/ldaputil/cert.c
+++ b/lib/ldaputil/cert.c
@@ -136,6 +136,7 @@ ldapu_get_cert_ava_val(void *cert_in, int which_dn, const char *attr, char ***va
CERTAVA **avas;
CERTAVA *ava;
int attr_tag = certmap_name_to_secoid(attr);
+ int nbvals = 1; /* reserve 1 slot for final NULL */
char **val;
char **ptr;
int rv;
@@ -153,46 +154,55 @@ ldapu_get_cert_ava_val(void *cert_in, int which_dn, const char *attr, char ***va
else
return LDAPU_ERR_INVALID_ARGUMENT;
- val = (char **)malloc(32 * sizeof(char *));
+ rdns = cert_dn->rdns;
+ if (!rdns) {
+ return LDAPU_FAILED;
+ }
+
+ for (rdn = rdns; *rdn; rdn++) {
+ nbvals++;
+ }
+
+ val = (char **)malloc(nbvals*sizeof(char *));
if (!val)
return LDAPU_ERR_OUT_OF_MEMORY;
ptr = val;
- rdns = cert_dn->rdns;
- if (rdns) {
- for (rdn = rdns; *rdn; rdn++) {
- avas = (*rdn)->avas;
- while ((ava = *avas++) != NULL) {
- int tag = CERT_GetAVATag(ava);
-
- if (tag == attr_tag) {
- char buf[BIG_LINE];
- int lenLen;
- int vallen;
- /* Found it */
-
- /* Copied from ns/lib/libsec ...
- * XXX this code is incorrect in general
- * -- should use a DER template.
- */
- lenLen = 2;
- if (ava->value.len >= 128)
- lenLen = 3;
- vallen = ava->value.len - lenLen;
-
- rv = CERT_RFC1485_EscapeAndQuote(buf,
- BIG_LINE,
- (char *)ava->value.data + lenLen,
- vallen);
-
- if (rv == SECSuccess) {
- *ptr++ = strdup(buf);
+ for (rdn = rdns; *rdn; rdn++) {
+ avas = (*rdn)->avas;
+ while ((ava = *avas++) != NULL) {
+ int tag = CERT_GetAVATag(ava);
+
+ if (tag == attr_tag) {
+ char buf[BIG_LINE];
+ int lenLen;
+ int vallen;
+ /* Found it */
+
+ /* Copied from ns/lib/libsec ...
+ * XXX this code is incorrect in general
+ * -- should use a DER template.
+ */
+ lenLen = 2;
+ if (ava->value.len >= 128)
+ lenLen = 3;
+ vallen = ava->value.len - lenLen;
+
+ rv = CERT_RFC1485_EscapeAndQuote(buf,
+ BIG_LINE,
+ (char *)ava->value.data + lenLen,
+ vallen);
+
+ if (rv == SECSuccess) {
+ char *newbuf = strdup(buf);
+ if (newbuf != NULL) {
+ *ptr++ = newbuf;
}
- break;
}
+ break;
}
}
}
diff --git a/lib/ldaputil/certmap.c b/lib/ldaputil/certmap.c
index 7e91d777c..70b772e73 100644
--- a/lib/ldaputil/certmap.c
+++ b/lib/ldaputil/certmap.c
@@ -533,7 +533,7 @@ ldapu_cert_verifyfn_default(void *subject_cert, LDAP *ld, void *certmap_info __a
static int
parse_into_bitmask(const char *comps_in, long *bitmask_out, long default_val)
{
- long bitmask;
+ long bitmask = default_val;
char *comps = comps_in ? strdup(comps_in) : 0;
if (!comps) {
@@ -543,32 +543,12 @@ parse_into_bitmask(const char *comps_in, long *bitmask_out, long default_val)
/* present but empty */
bitmask = 0;
} else {
- char *ptr = comps;
- char *name = comps;
- long bit;
- int break_loop = 0;
-
- bitmask = 0;
-
- while (*name) {
- /* advance ptr to delimeter */
- while (*ptr && !isspace(*ptr) && *ptr != ',')
- ptr++;
-
- if (!*ptr)
- break_loop = 1;
- else
- *ptr++ = 0;
-
- bit = certmap_name_to_bit_pos(name);
+ char *delim = " \t\r\n,";
+ char *saveptr = NULL;
+ for (char *name = strtok_r(comps, delim, &saveptr);
+ name!=NULL; name = strtok_r(NULL, delim, &saveptr)) {
+ long bit = certmap_name_to_bit_pos(name);
bitmask |= bit;
-
- if (break_loop)
- break;
- /* skip delimeters */
- while (*ptr && (isspace(*ptr) || *ptr == ','))
- ptr++;
- name = ptr;
}
}
@@ -984,6 +964,7 @@ ldapu_issuer_certinfo(const CERTName *issuerDN, void **certmap_info)
if (NULL == info->issuerDN) {
/* no DN to compare to (probably the default certmap info) */
+ cur = cur->next;
continue;
}
diff --git a/lib/ldaputil/encode.c b/lib/ldaputil/encode.c
index ea7f5b005..4cb506934 100644
--- a/lib/ldaputil/encode.c
+++ b/lib/ldaputil/encode.c
@@ -71,9 +71,12 @@ Snip-n-shift, snip-n-shift, etc....
/* Always do 4-for-3, but if not round threesome, have to go
clean up the last extra bytes */
-
+
+#pragma GCC diagnostic push
+#pragma GCC diagnostic ignored "-Wanalyzer-out-of-bounds"
for (; i != srclen; i--)
*--p = '=';
+#pragma GCC diagnostic pop
return r;
}
@@ -107,6 +110,9 @@ _uudecode(const char *bufcoded)
nbytesdecoded = ((nprbytes + 3) / 4) * 3;
bufout = (unsigned char *)malloc(nbytesdecoded + 1);
+ if (bufout == NULL) {
+ return NULL;
+ }
bufplain = bufout;
bufin = bufcoded;
diff --git a/lib/ldaputil/ldapauth.c b/lib/ldaputil/ldapauth.c
index 34205199a..1ed8d0dd6 100644
--- a/lib/ldaputil/ldapauth.c
+++ b/lib/ldaputil/ldapauth.c
@@ -161,10 +161,10 @@ ldapu_find_entire_tree(LDAP *ld, int scope, const char *filter, const char **att
retval = LDAPU_FAILED;
return retval;
}
- for (i = num_namingcontexts; i < (num_namingcontexts + num_private_suffix); ++i) {
- suffix_list[i] = strdup(private_suffix_list[i - num_namingcontexts]);
+ for (i = 0; i < num_private_suffix; ++i) {
+ suffix_list[num_namingcontexts + i] = strdup(private_suffix_list[i]);
}
- suffix_list[i] = NULL;
+ suffix_list[num_namingcontexts + i] = NULL;
num_namingcontexts += num_private_suffix;
suffix = suffix_list;
}
diff --git a/lib/libsi18n/txtfile.c b/lib/libsi18n/txtfile.c
index 609245bc3..f859dd897 100644
--- a/lib/libsi18n/txtfile.c
+++ b/lib/libsi18n/txtfile.c
@@ -46,6 +46,10 @@ OpenTextFile(char *filename, int access)
return NULL;
txtfile = (TEXTFILE *)malloc(sizeof(TEXTFILE));
+ if (txtfile == NULL) {
+ (void) fclose(file);
+ return NULL;
+ }
memset(txtfile, 0, sizeof(TEXTFILE));
txtfile->file = file;
| 0 |
0f6a9215e01d903a3e35558119bb7e61392fb73c
|
389ds/389-ds-base
|
Issue 6238 - Fix test_audit_json_logging CI test regression (#6264)
CI test test_audit_json_logging report generation fails because some log file contains non UTF-8 characters.
The fix is to ignore invalid characters when generating the report.
(So that the logs get properly copied in the assets)
Issue #6238
Reviewed by: @mreynolds389 (Thanks!)
|
commit 0f6a9215e01d903a3e35558119bb7e61392fb73c
Author: progier389 <[email protected]>
Date: Wed Jul 17 10:18:48 2024 +0200
Issue 6238 - Fix test_audit_json_logging CI test regression (#6264)
CI test test_audit_json_logging report generation fails because some log file contains non UTF-8 characters.
The fix is to ignore invalid characters when generating the report.
(So that the logs get properly copied in the assets)
Issue #6238
Reviewed by: @mreynolds389 (Thanks!)
diff --git a/dirsrvtests/conftest.py b/dirsrvtests/conftest.py
index c9db07a58..c989729c1 100644
--- a/dirsrvtests/conftest.py
+++ b/dirsrvtests/conftest.py
@@ -133,7 +133,7 @@ def pytest_runtest_makereport(item, call):
instance_name = os.path.basename(os.path.dirname(f)).split("slapd-",1)[1]
extra.append(pytest_html.extras.text(text, name=f"{instance_name}-{log_name}"))
elif 'rotationinfo' not in f:
- with open(f) as dirsrv_log:
+ with open(f, errors='ignore') as dirsrv_log:
text = dirsrv_log.read()
log_name = os.path.basename(f)
instance_name = os.path.basename(os.path.dirname(f)).split("slapd-",1)[1]
| 0 |
f2c63bcdca0d0195b679852dcaa1a2322c975883
|
389ds/389-ds-base
|
Issue 50387 - enable_tls() should label ports with ldap_port_t
Bug Description:
In some tests we use enable_tls(), but the secure port doesn't get
labeled automatically with ldap_port_t.
Fix Description:
Fix enable_tls() to label secure port.
Additionally fix typo in pluginpath_validation_test.py
Fixes https://pagure.io/389-ds-base/issue/50387
Reviewed by: mreynolds, mhonek (Thanks!)
|
commit f2c63bcdca0d0195b679852dcaa1a2322c975883
Author: Viktor Ashirov <[email protected]>
Date: Fri May 17 15:44:51 2019 +0200
Issue 50387 - enable_tls() should label ports with ldap_port_t
Bug Description:
In some tests we use enable_tls(), but the secure port doesn't get
labeled automatically with ldap_port_t.
Fix Description:
Fix enable_tls() to label secure port.
Additionally fix typo in pluginpath_validation_test.py
Fixes https://pagure.io/389-ds-base/issue/50387
Reviewed by: mreynolds, mhonek (Thanks!)
diff --git a/dirsrvtests/tests/suites/plugins/pluginpath_validation_test.py b/dirsrvtests/tests/suites/plugins/pluginpath_validation_test.py
index 65a97be69..660ceac6b 100644
--- a/dirsrvtests/tests/suites/plugins/pluginpath_validation_test.py
+++ b/dirsrvtests/tests/suites/plugins/pluginpath_validation_test.py
@@ -67,7 +67,7 @@ def test_pluginpath_validation(topology_st):
# Try using new remote location
# If SELinux is enabled, plugin can't be loaded as it's not labeled properly
- if selinux_present:
+ if selinux_present():
import selinux
if selinux.is_selinux_enabled():
with pytest.raises(ldap.UNWILLING_TO_PERFORM):
diff --git a/src/lib389/lib389/__init__.py b/src/lib389/lib389/__init__.py
index df1add7e6..ed1c2594b 100644
--- a/src/lib389/lib389/__init__.py
+++ b/src/lib389/lib389/__init__.py
@@ -86,7 +86,9 @@ from lib389.utils import (
ensure_bytes,
ensure_str,
ensure_list_str,
- format_cmd_list)
+ format_cmd_list,
+ selinux_present,
+ selinux_label_port)
from lib389.paths import Paths
from lib389.nss_ssl import NssSsl
from lib389.tasks import BackupTask, RestoreTask
@@ -1591,6 +1593,9 @@ class DirSrv(SimpleLDAPObject, object):
self.config.set('nsslapd-security', 'on')
self.use_ldaps_uri()
+ if selinux_present():
+ selinux_label_port(self.sslport)
+
if self.ds_paths.perl_enabled:
# We don't setup sslport correctly in perl installer ....
self.config.set('nsslapd-secureport', '%s' % self.sslport)
| 0 |
02600dad033e7910b566c9698491ef2a2cef4538
|
389ds/389-ds-base
|
Ticket 47827 - online import crashes server if using verbose error logging
Bug Description: When using verbose logging and running an import task, the
server will crash at the end of the import. The verbose
logging changes the internal timing and exposes a race condition
where the task queue frees the import job before the import
finishes.
Fix Description: Wait for the backend instance to be set as "not busy" before
freeing the import task.
https://fedorahosted.org/389/ticket/47827
Reviewed by: nhosoi(Thanks!)
|
commit 02600dad033e7910b566c9698491ef2a2cef4538
Author: Mark Reynolds <[email protected]>
Date: Tue Jun 24 17:48:14 2014 -0400
Ticket 47827 - online import crashes server if using verbose error logging
Bug Description: When using verbose logging and running an import task, the
server will crash at the end of the import. The verbose
logging changes the internal timing and exposes a race condition
where the task queue frees the import job before the import
finishes.
Fix Description: Wait for the backend instance to be set as "not busy" before
freeing the import task.
https://fedorahosted.org/389/ticket/47827
Reviewed by: nhosoi(Thanks!)
diff --git a/ldap/servers/slapd/back-ldbm/import.c b/ldap/servers/slapd/back-ldbm/import.c
index 7149ef0be..3c195e221 100644
--- a/ldap/servers/slapd/back-ldbm/import.c
+++ b/ldap/servers/slapd/back-ldbm/import.c
@@ -217,6 +217,10 @@ static void import_task_destroy(Slapi_Task *task)
{
ImportJob *job = (ImportJob *)slapi_task_get_data(task);
+ while(is_instance_busy(job->inst)){
+ /* wait for the job to finish before freeing it */
+ DS_Sleep(PR_SecondsToInterval(1));
+ }
if (job && job->task_status) {
slapi_ch_free((void **)&job->task_status);
job->task_status = NULL;
| 0 |
cc5f43f62095657678be3aff390a11a1025a8c98
|
389ds/389-ds-base
|
Bug 613056 - fix coverify Defect Type: Null pointer dereferences issues 11892 - 11939
https://bugzilla.redhat.com/show_bug.cgi?id=613056
Resolves: bug 613056
Bug description: Fix coverify Defect Type: Null pointer dereferences issues 11892 - 11939
description: Catch possible NULL pointer in ldbm_instance_attrcrypt_config_delete_callback().
|
commit cc5f43f62095657678be3aff390a11a1025a8c98
Author: Endi S. Dewata <[email protected]>
Date: Fri Jul 9 20:42:31 2010 -0500
Bug 613056 - fix coverify Defect Type: Null pointer dereferences issues 11892 - 11939
https://bugzilla.redhat.com/show_bug.cgi?id=613056
Resolves: bug 613056
Bug description: Fix coverify Defect Type: Null pointer dereferences issues 11892 - 11939
description: Catch possible NULL pointer in ldbm_instance_attrcrypt_config_delete_callback().
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_attrcrypt_config.c b/ldap/servers/slapd/back-ldbm/ldbm_attrcrypt_config.c
index 40155096f..0b7deaa45 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_attrcrypt_config.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_attrcrypt_config.c
@@ -243,7 +243,7 @@ ldbm_instance_attrcrypt_config_delete_callback(Slapi_PBlock *pb, Slapi_Entry* e,
struct attrinfo *ai = NULL;
ainfo_get(inst->inst_be, attribute_name, &ai);
- if (ai == NULL && (0 == strcmp(LDBM_PSEUDO_ATTR_DEFAULT, ai->ai_type)) ) {
+ if (ai == NULL || (0 == strcmp(LDBM_PSEUDO_ATTR_DEFAULT, ai->ai_type)) ) {
LDAPDebug(LDAP_DEBUG_ANY, "Warning: attempt to delete encryption for non-existant attribute: %s\n",
attribute_name, 0, 0);
} else {
| 0 |
6c4eac9ca642b99d7664d3a6b04067c3091f5694
|
389ds/389-ds-base
|
Bug 680555 - ns-slapd segfaults if I have more than 100 DBs
https://bugzilla.redhat.com/show_bug.cgi?id=680555
Resolves: bug 680555
Bug Description: ns-slapd segfaults if I have more than 100 DBs
Reviewed by: nhosoi, nkinder (Thanks!)
Branch: master
Fix Description: 1) slapi_mapping_tree_select_all() does
be_list[BE_LIST_SIZE] = NULL
so be_list must be of size BE_LIST_SIZE+1
2) loop counter should check be_index, not index, to see if the loop is
completed
3) if the search is going to hit more backends than we can process, just
return ADMINLIMIT_EXCEEDED with an explanatory error message
4) increase the BE_LIST_SIZE to 1000
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
|
commit 6c4eac9ca642b99d7664d3a6b04067c3091f5694
Author: Rich Megginson <[email protected]>
Date: Tue Mar 1 15:36:11 2011 -0700
Bug 680555 - ns-slapd segfaults if I have more than 100 DBs
https://bugzilla.redhat.com/show_bug.cgi?id=680555
Resolves: bug 680555
Bug Description: ns-slapd segfaults if I have more than 100 DBs
Reviewed by: nhosoi, nkinder (Thanks!)
Branch: master
Fix Description: 1) slapi_mapping_tree_select_all() does
be_list[BE_LIST_SIZE] = NULL
so be_list must be of size BE_LIST_SIZE+1
2) loop counter should check be_index, not index, to see if the loop is
completed
3) if the search is going to hit more backends than we can process, just
return ADMINLIMIT_EXCEEDED with an explanatory error message
4) increase the BE_LIST_SIZE to 1000
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
diff --git a/ldap/servers/slapd/mapping_tree.c b/ldap/servers/slapd/mapping_tree.c
index 0f6356094..898fe9308 100644
--- a/ldap/servers/slapd/mapping_tree.c
+++ b/ldap/servers/slapd/mapping_tree.c
@@ -2178,7 +2178,7 @@ int slapi_mapping_tree_select_all(Slapi_PBlock *pb, Slapi_Backend **be_list,
ret = slapi_mtn_get_first_be(node_list, &node, pb, &be, &index, &referral, errorbuf, scope);
- while ((node) &&(index < BE_LIST_SIZE))
+ while ((node) && (be_index <= BE_LIST_SIZE))
{
if (ret != LDAP_SUCCESS)
{
@@ -2204,7 +2204,15 @@ int slapi_mapping_tree_select_all(Slapi_PBlock *pb, Slapi_Backend **be_list,
{
if (be && !be_isdeleted(be))
{
+ if (be_index == BE_LIST_SIZE) { /* error - too many backends */
+ ret_code = LDAP_ADMINLIMIT_EXCEEDED;
+ PR_snprintf(errorbuf, BUFSIZ-1,
+ "Error: too many backends match search request - cannot proceed");
+ slapi_log_error(SLAPI_LOG_FATAL, NULL, "%s\n", errorbuf);
+ break;
+ } else {
be_list[be_index++]=be;
+ }
}
if (referral)
diff --git a/ldap/servers/slapd/opshared.c b/ldap/servers/slapd/opshared.c
index b3e2c4510..d398cd664 100644
--- a/ldap/servers/slapd/opshared.c
+++ b/ldap/servers/slapd/opshared.c
@@ -192,8 +192,8 @@ op_shared_search (Slapi_PBlock *pb, int send_result)
int scope;
Slapi_Backend *be = NULL;
Slapi_Backend *be_single = NULL;
- Slapi_Backend *be_list[BE_LIST_SIZE];
- Slapi_Entry *referral_list[BE_LIST_SIZE];
+ Slapi_Backend *be_list[BE_LIST_SIZE+1];
+ Slapi_Entry *referral_list[BE_LIST_SIZE+1];
char ebuf[ BUFSIZ ];
char attrlistbuf[ 1024 ], *attrliststr, **attrs = NULL;
int rc = 0;
diff --git a/ldap/servers/slapd/slap.h b/ldap/servers/slapd/slap.h
index ee02a26e7..a19e5c89f 100644
--- a/ldap/servers/slapd/slap.h
+++ b/ldap/servers/slapd/slap.h
@@ -299,7 +299,7 @@ typedef void (*VFP0)(void);
#define EGG_OBJECT_CLASS "directory-team-extensible-object"
#define EGG_FILTER "(objectclass=directory-team-extensible-object)"
-#define BE_LIST_SIZE 100 /* used by mapping tree code to hold be_list stuff */
+#define BE_LIST_SIZE 1000 /* used by mapping tree code to hold be_list stuff */
#define REPL_DBTYPE "ldbm"
#define REPL_DBTAG "repl"
| 0 |
b672e63e60d85629e161dbe8c167567dbc08fe22
|
389ds/389-ds-base
|
Ticket 49177 - rpm would not create valid pkgconfig files
Bug Description: pkgconfig from the rpm was not valid.
Fix Description: Add missing variables with directories
to dirsrv.pc. Otherwise pkgconfig cannot expand variables
${libdir}, ${includedir}
https://pagure.io/389-ds-base/issue/49177
Author: lslebodn
Review by: mreynolds
Signed-off-by: Mark Reynolds <[email protected]>
|
commit b672e63e60d85629e161dbe8c167567dbc08fe22
Author: Lukas Slebodnik <[email protected]>
Date: Wed Mar 22 16:29:50 2017 +0000
Ticket 49177 - rpm would not create valid pkgconfig files
Bug Description: pkgconfig from the rpm was not valid.
Fix Description: Add missing variables with directories
to dirsrv.pc. Otherwise pkgconfig cannot expand variables
${libdir}, ${includedir}
https://pagure.io/389-ds-base/issue/49177
Author: lslebodn
Review by: mreynolds
Signed-off-by: Mark Reynolds <[email protected]>
diff --git a/src/pkgconfig/dirsrv.pc.in b/src/pkgconfig/dirsrv.pc.in
index 414003121..df433cfa9 100644
--- a/src/pkgconfig/dirsrv.pc.in
+++ b/src/pkgconfig/dirsrv.pc.in
@@ -1,3 +1,7 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
ldaplib=@ldaplib@
Name: dirsrv
| 0 |
0b95451c7e50cb6b2d0cb310dddca18336e1b2ac
|
389ds/389-ds-base
|
570667 - MMR: simultaneous total updates on the masters cause
deadlock and data loss
https://bugzilla.redhat.com/show_bug.cgi?id=570667
Description: In the MMR topology, if a master receives a total
update request to initialize the other master and being initialized
by the other master at the same time, the 2 replication threads hang
and the replicated backend instance could be wiped out.
To prevent the server running the total update supplier and the
consumer at the same time, REPLICA_TOTAL_EXCL_SEND and _RECV bits
have been introduced. If the server is sending the total update
to other replicas, the server rejects the total update request
on the backend. But the server can send multiple total updates
to other replicas at the same time. If the total update from
other master is in progress on the server, the server rejects
another total update from yet another master as well as a request
to initialize other replicas.
|
commit 0b95451c7e50cb6b2d0cb310dddca18336e1b2ac
Author: Noriko Hosoi <[email protected]>
Date: Fri Mar 5 10:07:38 2010 -0800
570667 - MMR: simultaneous total updates on the masters cause
deadlock and data loss
https://bugzilla.redhat.com/show_bug.cgi?id=570667
Description: In the MMR topology, if a master receives a total
update request to initialize the other master and being initialized
by the other master at the same time, the 2 replication threads hang
and the replicated backend instance could be wiped out.
To prevent the server running the total update supplier and the
consumer at the same time, REPLICA_TOTAL_EXCL_SEND and _RECV bits
have been introduced. If the server is sending the total update
to other replicas, the server rejects the total update request
on the backend. But the server can send multiple total updates
to other replicas at the same time. If the total update from
other master is in progress on the server, the server rejects
another total update from yet another master as well as a request
to initialize other replicas.
diff --git a/ldap/servers/plugins/replication/repl5.h b/ldap/servers/plugins/replication/repl5.h
index 97ce55699..c6859ddb3 100644
--- a/ldap/servers/plugins/replication/repl5.h
+++ b/ldap/servers/plugins/replication/repl5.h
@@ -521,6 +521,12 @@ void replica_write_ruv (Replica *r);
#define REPLICA_INCREMENTAL_IN_PROGRESS 2 /* Set only between start and stop inc */
#define REPLICA_TOTAL_IN_PROGRESS 4 /* Set only between start and stop total */
#define REPLICA_AGREEMENTS_DISABLED 8 /* Replica is offline */
+#define REPLICA_TOTAL_EXCL_SEND 16 /* The server is either sending or receiving
+ the total update. Introducing it if SEND
+ is active, RECV should back off. And
+ vice versa. But SEND can coexist. */
+#define REPLICA_TOTAL_EXCL_RECV 32 /* ditto */
+
PRBool replica_is_state_flag_set(Replica *r, PRInt32 flag);
void replica_set_state_flag (Replica *r, PRUint32 flag, PRBool clear);
void replica_set_tombstone_reap_stop(Replica *r, PRBool val);
diff --git a/ldap/servers/plugins/replication/repl5_protocol.c b/ldap/servers/plugins/replication/repl5_protocol.c
index 927c450ac..efb327160 100644
--- a/ldap/servers/plugins/replication/repl5_protocol.c
+++ b/ldap/servers/plugins/replication/repl5_protocol.c
@@ -317,6 +317,28 @@ prot_thread_main(void *arg)
dev_debug("prot_thread_main(STATE_PERFORMING_INCREMENTAL_UPDATE): end");
break;
case STATE_PERFORMING_TOTAL_UPDATE:
+ {
+ Slapi_DN *dn = agmt_get_replarea(agmt);
+ Replica *replica = NULL;
+ Object *replica_obj = replica_get_replica_from_dn(dn);
+ if (replica_obj)
+ {
+ replica = (Replica*) object_get_data (replica_obj);
+ /* If total update against this replica is in progress,
+ * we should not initiate the total update to other replicas. */
+ if (replica_is_state_flag_set(replica, REPLICA_TOTAL_EXCL_RECV))
+ {
+ object_release(replica_obj);
+ slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name,
+ "%s: total update on the replica is in progress. Cannot initiate the total update.\n", agmt_get_long_name(rp->agmt));
+ break;
+ }
+ else
+ {
+ replica_set_state_flag (replica, REPLICA_TOTAL_EXCL_SEND, 0);
+ }
+ }
+
PR_Lock(rp->lock);
/* stop incremental protocol if running */
@@ -332,7 +354,13 @@ prot_thread_main(void *arg)
replica initialization is completed. */
agmt_replica_init_done (agmt);
+ if (replica_obj)
+ {
+ replica_set_state_flag (replica, REPLICA_TOTAL_EXCL_SEND, 1);
+ object_release(replica_obj);
+ }
break;
+ }
case STATE_FINISHED:
dev_debug("prot_thread_main(STATE_FINISHED): exiting prot_thread_main");
done = 1;
diff --git a/ldap/servers/plugins/replication/repl_extop.c b/ldap/servers/plugins/replication/repl_extop.c
index b65c6c8fd..c47ea93dc 100644
--- a/ldap/servers/plugins/replication/repl_extop.c
+++ b/ldap/servers/plugins/replication/repl_extop.c
@@ -678,6 +678,25 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb)
goto send_response;
}
+ if (REPL_PROTOCOL_50_TOTALUPDATE == connext->repl_protocol_version)
+ {
+ /* If total update has been initiated against other replicas or
+ * this replica is already being initialized, we should return
+ * an error immediately. */
+ if (replica_is_state_flag_set(replica,
+ REPLICA_TOTAL_EXCL_SEND|REPLICA_TOTAL_EXCL_RECV))
+ {
+ slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name,
+ "%s: total update on is initiated on the replica. Cannot execute the total update from other master.\n", repl_root);
+ response = NSDS50_REPL_REPLICA_BUSY;
+ goto send_response;
+ }
+ else
+ {
+ replica_set_state_flag (replica, REPLICA_TOTAL_EXCL_RECV, 0);
+ }
+ }
+
/* check that this replica is not a 4.0 consumer */
if (replica_is_legacy_consumer (replica))
{
@@ -861,6 +880,11 @@ multimaster_extop_StartNSDS50ReplicationRequest(Slapi_PBlock *pb)
slapi_pblock_get(pb, SLAPI_CONNECTION, &connext->connection);
send_response:
+ if (connext && replica &&
+ (REPL_PROTOCOL_50_TOTALUPDATE == connext->repl_protocol_version))
+ {
+ replica_set_state_flag (replica, REPLICA_TOTAL_EXCL_RECV, 1);
+ }
if (response != NSDS50_REPL_REPLICA_READY)
{
int resp_log_level = SLAPI_LOG_FATAL;
| 0 |
60316fc548f6bc6dd1c53f8133cdc302f2aecbd2
|
389ds/389-ds-base
|
Ticket 407 - dna memory leak
One line change to fix crash. Had a '&' where it wasn't needed.
https://fedorahosted.org/389/ticket/407
|
commit 60316fc548f6bc6dd1c53f8133cdc302f2aecbd2
Author: Mark Reynolds <[email protected]>
Date: Mon Aug 6 15:34:55 2012 -0400
Ticket 407 - dna memory leak
One line change to fix crash. Had a '&' where it wasn't needed.
https://fedorahosted.org/389/ticket/407
diff --git a/ldap/servers/plugins/dna/dna.c b/ldap/servers/plugins/dna/dna.c
index 70d9c6b42..34d67abe9 100644
--- a/ldap/servers/plugins/dna/dna.c
+++ b/ldap/servers/plugins/dna/dna.c
@@ -3260,7 +3260,7 @@ dna_pre_op(Slapi_PBlock * pb, int modtype)
goto bail;
}
smods = slapi_mods_new();
- slapi_mods_init_passin(&smods, mods);
+ slapi_mods_init_passin(smods, mods);
}
/* For a MOD, we need to check the resulting entry */
| 0 |
386ba57d421ee2d59a267d52d63bd88cbf20c435
|
389ds/389-ds-base
|
Clean up compiler warnings
This cleans up all of the compiler warnings produced with -Wall on RHEL/Fedora platforms.
The warnings about the %lld and %llu formats are still produced and cannot be helped.
Reviewed by: nkinder (Thanks!)
|
commit 386ba57d421ee2d59a267d52d63bd88cbf20c435
Author: Rich Megginson <[email protected]>
Date: Tue Jul 7 13:22:45 2009 -0600
Clean up compiler warnings
This cleans up all of the compiler warnings produced with -Wall on RHEL/Fedora platforms.
The warnings about the %lld and %llu formats are still produced and cannot be helped.
Reviewed by: nkinder (Thanks!)
diff --git a/ldap/servers/plugins/acl/acl.c b/ldap/servers/plugins/acl/acl.c
index b708cadaf..d62796fc4 100644
--- a/ldap/servers/plugins/acl/acl.c
+++ b/ldap/servers/plugins/acl/acl.c
@@ -3148,6 +3148,7 @@ acl_match_substring ( Slapi_Filter *f, char *str, int exact_match)
char *type, *initial, *final;
char **any;
Slapi_Regex *re = NULL;
+ const char *re_result = NULL;
if ( 0 != slapi_filter_get_subfilt ( f, &type, &initial, &any, &final ) ) {
return (ACL_FALSE);
@@ -3235,11 +3236,10 @@ acl_match_substring ( Slapi_Filter *f, char *str, int exact_match)
** Now we will compile the pattern and compare wth the string to
** see if the input string matches with the patteren or not.
*/
- p = NULL;
- re = slapi_re_comp( pat, &p );
+ re = slapi_re_comp( pat, &re_result );
if (NULL == re) {
slapi_log_error (SLAPI_LOG_ACL, plugin_name,
- "acl_match_substring:re_comp failed (%s)\n", p?p:"unknown");
+ "acl_match_substring:re_comp failed (%s)\n", re_result?re_result:"unknown");
return (ACL_ERR);
}
diff --git a/ldap/servers/plugins/acl/acllas.c b/ldap/servers/plugins/acl/acllas.c
index abde4fd7c..e16fbd275 100644
--- a/ldap/servers/plugins/acl/acllas.c
+++ b/ldap/servers/plugins/acl/acllas.c
@@ -2218,7 +2218,7 @@ acllas__handle_group_entry (Slapi_Entry* e, void *callback_data)
Slapi_Attr *currAttr, *nextAttr;
char *n_dn, *attrType;
int n;
- int i, j;
+ int i;
info = (struct eval_info *) callback_data;
info->result = ACL_FALSE;
@@ -2252,11 +2252,18 @@ acllas__handle_group_entry (Slapi_Entry* e, void *callback_data)
return 0;
}
if (!(n % ACLLAS_MAX_GRP_MEMBER)) {
- struct member_info *orig_memberInfo = info->memberInfo[0];
+ struct member_info **orig_memberInfo = info->memberInfo;
info->memberInfo = (struct member_info **)slapi_ch_realloc(
(char *)info->memberInfo,
(n + ACLLAS_MAX_GRP_MEMBER) *
sizeof(struct member_info *));
+ if (!info->memberInfo) {
+ slapi_log_error( SLAPI_LOG_FATAL, plugin_name,
+ "acllas__handle_group_entry: out of memory - could not allocate space for %d group members\n",
+ n + ACLLAS_MAX_GRP_MEMBER );
+ info->memberInfo = orig_memberInfo;
+ return 0;
+ }
}
/* allocate the space for the member and attch it to the list */
diff --git a/ldap/servers/plugins/replication/repl5_replica.c b/ldap/servers/plugins/replication/repl5_replica.c
index 5f280b1d6..a563835a6 100644
--- a/ldap/servers/plugins/replication/repl5_replica.c
+++ b/ldap/servers/plugins/replication/repl5_replica.c
@@ -1012,7 +1012,8 @@ replica_set_referrals(Replica *r,const Slapi_ValueSet *vs)
{
const char *ref = slapi_value_get_string(vv);
LDAPURLDesc *lud = NULL;
- int myrc = slapi_ldap_url_parse(ref, &lud, 0, NULL);
+
+ (void)slapi_ldap_url_parse(ref, &lud, 0, NULL);
/* see if the dn is already in the referral URL */
if (!lud || !lud->lud_dn) {
/* add the dn */
diff --git a/ldap/servers/plugins/replication/replutil.c b/ldap/servers/plugins/replication/replutil.c
index 8703c7c2d..aaa427bdd 100644
--- a/ldap/servers/plugins/replication/replutil.c
+++ b/ldap/servers/plugins/replication/replutil.c
@@ -740,7 +740,7 @@ repl_set_mtn_state_and_referrals(
/* next, add the repl root dn to each referral if not present */
for (ii = 0; referrals_to_set && referrals_to_set[ii]; ++ii) {
LDAPURLDesc *lud = NULL;
- int myrc = slapi_ldap_url_parse(referrals_to_set[ii], &lud, 0, NULL);
+ (void)slapi_ldap_url_parse(referrals_to_set[ii], &lud, 0, NULL);
/* see if the dn is already in the referral URL */
if (!lud || !lud->lud_dn) {
/* add the dn */
diff --git a/ldap/servers/plugins/syntaxes/string.c b/ldap/servers/plugins/syntaxes/string.c
index 218cc762d..c2f0fa605 100644
--- a/ldap/servers/plugins/syntaxes/string.c
+++ b/ldap/servers/plugins/syntaxes/string.c
@@ -210,6 +210,7 @@ string_filter_sub( Slapi_PBlock *pb, char *initial, char **any, char *final,
int timelimit = 0; /* search timelimit */
Operation *op = NULL;
Slapi_Regex *re = NULL;
+ const char *re_result = NULL;
LDAPDebug( LDAP_DEBUG_FILTER, "=> string_filter_sub\n",
0, 0, 0 );
@@ -286,10 +287,10 @@ string_filter_sub( Slapi_PBlock *pb, char *initial, char **any, char *final,
/* compile the regex */
p = (bigpat) ? bigpat : pat;
tmpbuf = NULL;
- re = slapi_re_comp( p, &tmpbuf );
+ re = slapi_re_comp( p, &re_result );
if (NULL == re) {
LDAPDebug( LDAP_DEBUG_ANY, "re_comp (%s) failed (%s): %s\n",
- pat, p, tmpbuf?tmpbuf:"unknown" );
+ pat, p, re_result?re_result:"unknown" );
rc = LDAP_OPERATIONS_ERROR;
goto bailout;
} else {
diff --git a/ldap/servers/slapd/backend.c b/ldap/servers/slapd/backend.c
index 1bded05e2..c4c399f9a 100644
--- a/ldap/servers/slapd/backend.c
+++ b/ldap/servers/slapd/backend.c
@@ -502,7 +502,7 @@ slapi_be_setentrypoint(Slapi_Backend *be, int entrypoint, void *ret_fnptr, Slapi
be->be_entry_release=(IFP) ret_fnptr;
break;
case SLAPI_PLUGIN_DB_SEARCH_RESULTS_RELEASE_FN:
- be->be_search_results_release=(IFP) ret_fnptr;
+ be->be_search_results_release=(VFPP) ret_fnptr;
break;
case SLAPI_PLUGIN_DB_SIZE_FN:
be->be_dbsize=(IFP) ret_fnptr;
diff --git a/ldap/servers/slapd/getfilelist.c b/ldap/servers/slapd/getfilelist.c
index ac79430f6..c8dd8f9e9 100644
--- a/ldap/servers/slapd/getfilelist.c
+++ b/ldap/servers/slapd/getfilelist.c
@@ -124,7 +124,7 @@ matches(const char *filename, const char *pattern)
{
Slapi_Regex *re = NULL;
int match = 0;
- char *error = NULL;
+ const char *error = NULL;
if (!pattern)
return 1; /* null pattern matches everything */
diff --git a/ldap/servers/slapd/pblock.c b/ldap/servers/slapd/pblock.c
index c89a64854..98984adaf 100644
--- a/ldap/servers/slapd/pblock.c
+++ b/ldap/servers/slapd/pblock.c
@@ -516,7 +516,7 @@ slapi_pblock_get( Slapi_PBlock *pblock, int arg, void *value )
if ( pblock->pb_plugin->plg_type != SLAPI_PLUGIN_DATABASE ) {
return( -1 );
}
- (*(IFP *)value) = pblock->pb_plugin->plg_search_results_release;
+ (*(VFPP *)value) = pblock->pb_plugin->plg_search_results_release;
break;
case SLAPI_PLUGIN_DB_COMPARE_FN:
if ( pblock->pb_plugin->plg_type != SLAPI_PLUGIN_DATABASE ) {
@@ -1814,7 +1814,7 @@ slapi_pblock_set( Slapi_PBlock *pblock, int arg, void *value )
if ( pblock->pb_plugin->plg_type != SLAPI_PLUGIN_DATABASE ) {
return( -1 );
}
- pblock->pb_plugin->plg_search_results_release = (IFP) value;
+ pblock->pb_plugin->plg_search_results_release = (VFPP) value;
break;
case SLAPI_PLUGIN_DB_COMPARE_FN:
if ( pblock->pb_plugin->plg_type != SLAPI_PLUGIN_DATABASE ) {
diff --git a/ldap/servers/slapd/sasl_map.c b/ldap/servers/slapd/sasl_map.c
index 637ea5dca..383f04559 100644
--- a/ldap/servers/slapd/sasl_map.c
+++ b/ldap/servers/slapd/sasl_map.c
@@ -469,7 +469,7 @@ sasl_map_check(sasl_map_data *dp, char *sasl_user_and_realm, char **ldap_search_
Slapi_Regex *re = NULL;
int ret = 0;
int matched = 0;
- char *recomp_result = NULL;
+ const char *recomp_result = NULL;
LDAPDebug( LDAP_DEBUG_TRACE, "-> sasl_map_check\n", 0, 0, 0 );
/* Compiles the regex */
diff --git a/ldap/servers/slapd/slap.h b/ldap/servers/slapd/slap.h
index 7fd676133..696d81037 100644
--- a/ldap/servers/slapd/slap.h
+++ b/ldap/servers/slapd/slap.h
@@ -211,7 +211,8 @@ typedef struct symbol_t {
#define SLAPD_SHORT_VERSION_STR PRODUCTTEXT
typedef void (*VFP)(void *);
-typedef void (*VFP0)();
+typedef void (*VFPP)(void **);
+typedef void (*VFP0)(void);
#define LDAPI_INTERNAL 1
#include "slapi-private.h"
#include "pw.h"
@@ -765,7 +766,7 @@ struct slapdplugin {
IFP plg_un_db_search; /* search */
IFP plg_un_db_next_search_entry; /* iterate */
IFP plg_un_db_next_search_entry_ext;
- IFP plg_un_db_search_results_release; /* PAGED RESULTS */
+ VFPP plg_un_db_search_results_release; /* PAGED RESULTS */
IFP plg_un_db_entry_release;
IFP plg_un_db_compare; /* compare */
IFP plg_un_db_modify; /* modify */
| 0 |
98ddd817e26f236adebd80270ec71d7ec372c20e
|
389ds/389-ds-base
|
Ticket #47642 - Windows Sync group issues
Bug Description: When an entry is moved on AD, and the entry is
a member of a group, the value of the member in the group is
automatically updated. But Windows Sync Control request only
returns the renamed entry; it does not return the group having
the member in it even though the value is updated. This is
because an AD group stores DNT (Distinguish Name Tag -- ID in
integer) instead of the dn itself. Since the rename operation
does not change DNT, the group entry on AD has no change, either.
On the DS side, the group entry stores the full DN which needs
to be adjusted to the renamed DN to complete the synchronization
with AD.
Fix Description: Once rename operation is received from AD,
windows_update_local_entry searches groups having a member value
matches the pre-renamed dn on DS, and replaces the old dn with the
renamed one.
Thanks to [email protected] for pointing out the possibility of
NULL dereference. The problem is fixed, as well.
Thanks to [email protected] for suggesting to escape the search
filter value. It was added.
https://fedorahosted.org/389/ticket/47642
|
commit 98ddd817e26f236adebd80270ec71d7ec372c20e
Author: Noriko Hosoi <[email protected]>
Date: Tue Feb 18 10:36:15 2014 -0800
Ticket #47642 - Windows Sync group issues
Bug Description: When an entry is moved on AD, and the entry is
a member of a group, the value of the member in the group is
automatically updated. But Windows Sync Control request only
returns the renamed entry; it does not return the group having
the member in it even though the value is updated. This is
because an AD group stores DNT (Distinguish Name Tag -- ID in
integer) instead of the dn itself. Since the rename operation
does not change DNT, the group entry on AD has no change, either.
On the DS side, the group entry stores the full DN which needs
to be adjusted to the renamed DN to complete the synchronization
with AD.
Fix Description: Once rename operation is received from AD,
windows_update_local_entry searches groups having a member value
matches the pre-renamed dn on DS, and replaces the old dn with the
renamed one.
Thanks to [email protected] for pointing out the possibility of
NULL dereference. The problem is fixed, as well.
Thanks to [email protected] for suggesting to escape the search
filter value. It was added.
https://fedorahosted.org/389/ticket/47642
diff --git a/ldap/servers/plugins/replication/windows_protocol_util.c b/ldap/servers/plugins/replication/windows_protocol_util.c
index 69ac3a399..caeb388f7 100644
--- a/ldap/servers/plugins/replication/windows_protocol_util.c
+++ b/ldap/servers/plugins/replication/windows_protocol_util.c
@@ -4264,6 +4264,7 @@ map_entry_dn_inbound_ext(Slapi_Entry *e, Slapi_DN **dn, const Repl_Agmt *ra, int
} else
{
/* Error, no username */
+ retval = ENTRY_NOTFOUND;
}
}
if (new_dn)
@@ -5214,7 +5215,7 @@ windows_update_remote_entry(Private_Repl_Protocol *prp,Slapi_Entry *remote_entry
static int
windows_update_local_entry(Private_Repl_Protocol *prp,Slapi_Entry *remote_entry,Slapi_Entry *local_entry)
{
- Slapi_Mods smods = {0};
+ Slapi_Mods smods;
int retval = 0;
Slapi_PBlock *pb = NULL;
int do_modify = 0;
@@ -5226,14 +5227,24 @@ windows_update_local_entry(Private_Repl_Protocol *prp,Slapi_Entry *remote_entry,
Slapi_DN *mapped_sdn = NULL;
Slapi_RDN rdn = {0};
Slapi_Entry *orig_local_entry = NULL;
+ const Slapi_DN *orig_local_sdn = NULL;
+ /* Variables for updating local groups */
+ Slapi_Entry **entries = NULL;
+ char *filter_string = NULL;
+ const Slapi_DN *local_subtree = NULL;
+ const Slapi_DN *local_subtree_sdn = NULL;
+ char *attrs[3];
+ /* Variables for updating local groups */
+
+ slapi_mods_init(&smods, 0);
windows_is_local_entry_user_or_group(local_entry, &is_user, &is_group);
/* Get the mapped DN. We don't want to locate the existing entry by
* guid or username. We want to get the mapped DN just as we would
* if we were creating a new entry. */
retval = map_entry_dn_inbound_ext(remote_entry, &mapped_sdn, prp->agmt, 0 /* use_guid */, 0 /* use_username */);
- if (retval != 0) {
+ if (retval || (NULL == mapped_sdn)) {
slapi_log_error(SLAPI_LOG_REPL, windows_repl_plugin_name,
"unable to map remote entry to local DN\n");
return retval;
@@ -5255,8 +5266,10 @@ windows_update_local_entry(Private_Repl_Protocol *prp,Slapi_Entry *remote_entry,
&newsuperior, 0 /* to_windows */);
if (newsuperior || newrdn) {
+ char *escaped_filter_val;
+ int free_it = 0;
/* remote parent is different from the local parent */
- Slapi_PBlock *pb = slapi_pblock_new ();
+ pb = slapi_pblock_new ();
if (NULL == newrdn) {
newdn = slapi_entry_get_dn_const(local_entry);
@@ -5303,9 +5316,108 @@ windows_update_local_entry(Private_Repl_Protocol *prp,Slapi_Entry *remote_entry,
orig_local_entry = NULL;
goto bail;
}
- }
- slapi_mods_init (&smods, 0);
+ /* WinSync control req does not return the member updates
+ * in the groups caused by moving member entries.
+ * We need to update the local groups manually... */
+ local_subtree = agmt_get_replarea(prp->agmt);
+ local_subtree_sdn = local_subtree;
+ orig_local_sdn = slapi_entry_get_sdn_const(orig_local_entry);
+ escaped_filter_val = slapi_escape_filter_value((char *)slapi_sdn_get_ndn(orig_local_sdn),
+ slapi_sdn_get_ndn_len(orig_local_sdn));
+ if(escaped_filter_val) {
+ free_it = 1;
+ } else {
+ escaped_filter_val = (char *)slapi_sdn_get_ndn(orig_local_sdn);
+ }
+ /* Search entries which have pre-renamed members */
+ filter_string = PR_smprintf("(&(objectclass=ntGroup)(|(member=%s)(uniquemember=%s)))",
+ escaped_filter_val, escaped_filter_val);
+ attrs[0] = "member";
+ attrs[1] = "uniquemember";
+ attrs[2] = NULL;
+ pb = slapi_pblock_new ();
+ slapi_search_internal_set_pb(pb, slapi_sdn_get_dn(local_subtree_sdn),
+ LDAP_SCOPE_SUBTREE, filter_string, attrs, 0, NULL, NULL,
+ repl_get_plugin_identity(PLUGIN_MULTIMASTER_REPLICATION), 0);
+ slapi_search_internal_pb(pb);
+ if (free_it) {
+ slapi_ch_free_string(&escaped_filter_val);
+ }
+ slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &retval);
+ if (LDAP_SUCCESS == retval) {
+ Slapi_Entry **ep;
+ const char *prev_member = slapi_sdn_get_ndn(orig_local_sdn);
+ const char *new_member = slapi_sdn_get_ndn(mapped_sdn);
+ size_t prev_member_len = slapi_sdn_get_ndn_len(orig_local_sdn);
+ size_t new_member_len = strlen(new_member);
+ slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_SEARCH_ENTRIES, &entries);
+ for (ep = entries; ep && *ep; ep++) {
+ /* there are group entries whose member matches the renamed entry. */
+ Slapi_PBlock *mod_pb = NULL;
+ Slapi_Attr *mattr = NULL;
+ Slapi_Attr *umattr = NULL;
+ char *type = NULL;
+ slapi_entry_attr_find(*ep, "member", &mattr);
+ slapi_entry_attr_find(*ep, "uniquemember", &umattr);
+ if (mattr) {
+ if (umattr) {
+ /* This entry has both member and uniquemember ... */
+ Slapi_Value *v = NULL;
+ int i = 0;
+ for (i = slapi_attr_first_value(mattr, &v);
+ v && (i != -1);
+ i = slapi_attr_next_value(mattr, i, &v)) {
+ const char *s = slapi_value_get_string(v);
+ if (NULL == s) {
+ continue;
+ }
+ if (0 == strcasecmp(s, prev_member)) {
+ type = "member";
+ break;
+ }
+ }
+ if (!type) {
+ type = "uniquemember";
+ }
+ } else {
+ type = "member";
+ }
+ } else {
+ if (umattr) {
+ type = "uniquemember";
+ }
+ }
+ if (type) {
+ mod_pb = slapi_pblock_new();
+ slapi_mods_add(&smods, LDAP_MOD_DELETE, type, prev_member_len, prev_member);
+ slapi_mods_add(&smods, LDAP_MOD_ADD, type, new_member_len, new_member);
+ slapi_modify_internal_set_pb_ext(mod_pb, slapi_entry_get_sdn(*ep),
+ slapi_mods_get_ldapmods_byref(&smods), NULL, NULL,
+ repl_get_plugin_identity(PLUGIN_MULTIMASTER_REPLICATION),
+ 0);
+ slapi_modify_internal_pb(mod_pb);
+ slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &retval);
+ if (retval) {
+ slapi_log_error(SLAPI_LOG_FATAL, windows_repl_plugin_name,
+ "windows_update_local_entry: "
+ "failed to modify entry %s replacing %s with %s "
+ "- error %d:%s\n",
+ slapi_entry_get_dn(*ep), prev_member, new_member,
+ retval, ldap_err2string(retval));
+ }
+ slapi_pblock_destroy(mod_pb);
+ slapi_mods_done(&smods);
+ } /* if (type) */
+ } /* for (ep = entries; ep && *ep; ep++) */
+ } /* if (LDAP_SUCCESS == retval) - searching with "(|(member=..)(uniquemember=..)) */
+ slapi_free_search_results_internal(pb);
+ slapi_pblock_destroy(pb);
+ if (filter_string) {
+ PR_smprintf_free(filter_string);
+ }
+ slapi_sdn_free((Slapi_DN **)&local_subtree);
+ } /* if (newsuperior || newrdn) */
retval = windows_generate_update_mods(prp,remote_entry,local_entry,0,&smods,&do_modify);
/* Now perform the modify if we need to */
| 0 |
c244f868db6ba086228bf8afd71aedbb2237eafd
|
389ds/389-ds-base
|
Bug 703990 - Support upgrade from Red Hat Directory Server
https://bugzilla.redhat.com/show_bug.cgi?id=703990
Resolves: bug 703990
Bug Description: Support upgrade from Red Hat Directory Server
Reviewed by: nkinder (Thanks!)
Branch: master
Fix Description: Couple of bugs with a previous patch
1) offline import did not work because the import function did not get
the instdir location of ldif2db
2) spelling error in error message
Platforms tested: RHEL6 x86_64 (from RHEL 5 32-bit and 64-bit)
Flag Day: no
Doc impact: yes
|
commit c244f868db6ba086228bf8afd71aedbb2237eafd
Author: Rich Megginson <[email protected]>
Date: Thu May 19 16:17:27 2011 -0600
Bug 703990 - Support upgrade from Red Hat Directory Server
https://bugzilla.redhat.com/show_bug.cgi?id=703990
Resolves: bug 703990
Bug Description: Support upgrade from Red Hat Directory Server
Reviewed by: nkinder (Thanks!)
Branch: master
Fix Description: Couple of bugs with a previous patch
1) offline import did not work because the import function did not get
the instdir location of ldif2db
2) spelling error in error message
Platforms tested: RHEL6 x86_64 (from RHEL 5 32-bit and 64-bit)
Flag Day: no
Doc impact: yes
diff --git a/ldap/admin/src/scripts/70upgradefromldif.pl b/ldap/admin/src/scripts/70upgradefromldif.pl
index a6ec644ed..e8b968d27 100644
--- a/ldap/admin/src/scripts/70upgradefromldif.pl
+++ b/ldap/admin/src/scripts/70upgradefromldif.pl
@@ -85,7 +85,7 @@ sub startTaskAndWait {
}
sub importLDIF {
- my ($conn, $file, $be, $isrunning, $rc) = @_;
+ my ($conn, $file, $be, $isrunning, $instdir, $rc) = @_;
if ($isrunning) {
my $cn = "import" . time;
@@ -104,7 +104,7 @@ sub importLDIF {
$? = 0; # clear
if ($rc = system("$instdir/ldif2db -n $be -i $file > /dev/null 2>&1")) {
debug(0, "Could not import $file to database $be - check errors log\n");
- return ('error_import_check_log', $file, $be, $rc);
+ return ('error_import_check_log', $file, $be, $?);
}
}
diff --git a/ldap/admin/src/scripts/setup-ds.res.in b/ldap/admin/src/scripts/setup-ds.res.in
index 674b4afa8..4c4c7979c 100644
--- a/ldap/admin/src/scripts/setup-ds.res.in
+++ b/ldap/admin/src/scripts/setup-ds.res.in
@@ -200,5 +200,5 @@ Please check the spelling of the hostname and/or your network configuration.\
If you proceed with this hostname, you may encounter problems.\
\
Do you want to proceed with hostname '%s'?
-error_import_check_log = Error: unable to import file '%s' for backend '%s' - %s. Check the errrors log for additional information\n
+error_import_check_log = Error: unable to import file '%s' for backend '%s' - %s. Check the errors log for additional information\n
error_could_not_parse_nsstate = Error: could not parse nsState from %s. Value: %s\n
| 0 |
884deb60a5083539f76ca4ba166780779c299a6e
|
389ds/389-ds-base
|
Bump version to 3.1.0
|
commit 884deb60a5083539f76ca4ba166780779c299a6e
Author: James Chapman <[email protected]>
Date: Wed May 15 09:56:42 2024 +0100
Bump version to 3.1.0
diff --git a/VERSION.sh b/VERSION.sh
index 9f2ed12c7..a85782a84 100644
--- a/VERSION.sh
+++ b/VERSION.sh
@@ -9,8 +9,8 @@ vendor="389 Project"
# PACKAGE_VERSION is constructed from these
VERSION_MAJOR=3
-VERSION_MINOR=0
-VERSION_MAINT=1
+VERSION_MINOR=1
+VERSION_MAINT=0
# NOTE: VERSION_PREREL is automatically set for builds made out of a git tree
VERSION_PREREL=
VERSION_DATE=$(date -u +%Y%m%d%H%M)
| 0 |
eec41e2fc71addeef503fd6e2294e723e68bf263
|
389ds/389-ds-base
|
use slapi_ldap_url_parse in the acl code
I missed a couple of places in the acl code that should use
slapi_ldap_url_parse - I also added some more debugging
|
commit eec41e2fc71addeef503fd6e2294e723e68bf263
Author: Rich Megginson <[email protected]>
Date: Wed Aug 25 12:45:11 2010 -0600
use slapi_ldap_url_parse in the acl code
I missed a couple of places in the acl code that should use
slapi_ldap_url_parse - I also added some more debugging
diff --git a/ldap/servers/plugins/acl/acllas.c b/ldap/servers/plugins/acl/acllas.c
index 9ba39259c..668316fd1 100644
--- a/ldap/servers/plugins/acl/acllas.c
+++ b/ldap/servers/plugins/acl/acllas.c
@@ -867,12 +867,13 @@ DS_LASGroupDnEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator,
groupName);
} else {
LDAPURLDesc *ludp = NULL;
+ int urlerr = 0;
int rval;
Slapi_PBlock *myPb = NULL;
Slapi_Entry **grpentries = NULL;
/* Groupdn is full ldapurl? */
- if (0 == ldap_url_parse(groupNameOrig, &ludp) &&
+ if ((0 == (urlerr = slapi_ldap_url_parse(groupNameOrig, &ludp, 0, NULL))) &&
NULL != ludp->lud_dn &&
-1 != ludp->lud_scope &&
NULL != ludp->lud_filter) {
@@ -911,6 +912,11 @@ DS_LASGroupDnEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator,
slapi_pblock_destroy (myPb);
} else {
+ if (urlerr) {
+ slapi_log_error ( SLAPI_LOG_ACL, plugin_name,
+ "DS_LASGroupDnEval: Groupname [%s] not a valid ldap url: %d (%s)\n",
+ groupNameOrig, urlerr, slapi_urlparse_err2string(urlerr));
+ }
/* normal evaluation */
matched = acllas_eval_one_group( groupName, &lasinfo );
}
@@ -3484,7 +3490,7 @@ acllas__client_match_URL (struct acl_pblock *aclpb, char *n_clientdn, char *url
{
LDAPURLDesc *ludp = NULL;
- int rc;
+ int rc = 0;
Slapi_Filter *f = NULL;
char *rawdn = NULL;
char *dn = NULL;
@@ -3603,12 +3609,19 @@ acllas__client_match_URL (struct acl_pblock *aclpb, char *n_clientdn, char *url
slapi_ch_free_string(&dn);
}
rc = ldap_url_parse(normed, &ludp);
- slapi_ch_free_string(&normed);
if (rc) {
+ slapi_log_error( SLAPI_LOG_FATAL, plugin_name,
+ "acllas__client_match_URL: url [%s] is invalid: %d (%s)\n",
+ normed, rc, slapi_urlparse_err2string(rc));
rc = ACL_FALSE;
goto done;
}
if ( ( NULL == ludp->lud_dn) || ( NULL == ludp->lud_filter) ) {
+ slapi_log_error( SLAPI_LOG_FATAL, plugin_name,
+ "acllas__client_match_URL: url [%s] has no base dn [%s] or filter [%s]\n",
+ normed,
+ NULL == ludp->lud_dn ? "null" : ludp->lud_dn,
+ NULL == ludp->lud_filter ? "null" : ludp->lud_filter );
rc = ACL_FALSE;
goto done;
}
@@ -3616,6 +3629,10 @@ acllas__client_match_URL (struct acl_pblock *aclpb, char *n_clientdn, char *url
/* Check the scope */
if ( ludp->lud_scope == LDAP_SCOPE_SUBTREE ) {
if (!slapi_dn_issuffix(n_clientdn, ludp->lud_dn)) {
+ slapi_log_error( SLAPI_LOG_FATAL, plugin_name,
+ "acllas__client_match_URL: url [%s] scope is subtree but dn [%s] "
+ "is not a suffix of [%s]\n",
+ normed, ludp->lud_dn, n_clientdn );
rc = ACL_FALSE;
goto done;
}
@@ -3623,6 +3640,11 @@ acllas__client_match_URL (struct acl_pblock *aclpb, char *n_clientdn, char *url
char *parent = slapi_dn_parent (n_clientdn);
if (slapi_utf8casecmp ((ACLUCHP)parent, (ACLUCHP)ludp->lud_dn) != 0 ) {
+ slapi_log_error( SLAPI_LOG_FATAL, plugin_name,
+ "acllas__client_match_URL: url [%s] scope is onelevel but dn [%s] "
+ "is not a direct child of [%s]\n",
+ normed, ludp->lud_dn, parent );
+ slapi_ch_free_string(&normed);
slapi_ch_free ( (void **) &parent);
rc = ACL_FALSE;
goto done;
@@ -3630,20 +3652,23 @@ acllas__client_match_URL (struct acl_pblock *aclpb, char *n_clientdn, char *url
slapi_ch_free ( (void **) &parent);
} else { /* default */
if (slapi_utf8casecmp ( (ACLUCHP)n_clientdn, (ACLUCHP)ludp->lud_dn) != 0 ) {
+ slapi_log_error( SLAPI_LOG_FATAL, plugin_name,
+ "acllas__client_match_URL: url [%s] scope is base but dn [%s] "
+ "does not match [%s]\n",
+ normed, ludp->lud_dn, n_clientdn );
rc = ACL_FALSE;
goto done;
}
}
-
/* Convert the filter string */
f = slapi_str2filter ( ludp->lud_filter );
if (ludp->lud_filter && (f == NULL)) { /* bogus filter */
slapi_log_error(SLAPI_LOG_FATAL, plugin_name,
- "DS_LASUserAttrEval: The member URL search filter in entry [%s] is not valid: [%s]\n",
- n_clientdn, ludp->lud_filter);
+ "DS_LASUserAttrEval: The member URL [%s] search filter in entry [%s] is not valid: [%s]\n",
+ normed, n_clientdn, ludp->lud_filter);
rc = ACL_FALSE;
goto done;
}
@@ -3653,9 +3678,9 @@ acllas__client_match_URL (struct acl_pblock *aclpb, char *n_clientdn, char *url
aclpb->aclpb_client_entry, f, 0 /* no acces chk */ )))
rc = ACL_FALSE;
- slapi_filter_free ( f, 1 ) ;
-
done:
+ slapi_filter_free ( f, 1 ) ;
+ slapi_ch_free_string(&normed);
slapi_ch_free_string(&hostport);
ldap_free_urldesc( ludp );
return rc;
| 0 |
47a59378cbf4b48eef492530ebc1c8ea6059a757
|
389ds/389-ds-base
|
fix rpmlint issues - config files and perl modules should not be executable
|
commit 47a59378cbf4b48eef492530ebc1c8ea6059a757
Author: Rich Megginson <[email protected]>
Date: Sun May 17 10:02:54 2009 -0600
fix rpmlint issues - config files and perl modules should not be executable
diff --git a/Makefile.am b/Makefile.am
index ffc27ddfd..6e6767e2a 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -260,7 +260,9 @@ bin_SCRIPTS = ldap/servers/slapd/tools/rsearch/scripts/dbgen.pl \
wrappers/repl-monitor \
ldap/admin/src/scripts/repl-monitor.pl
-perl_SCRIPTS = ldap/admin/src/scripts/SetupLog.pm \
+# SCRIPTS makes them executables - these are perl modules
+# and should not be marked as executable - so use DATA
+perl_DATA = ldap/admin/src/scripts/SetupLog.pm \
ldap/admin/src/scripts/Resource.pm \
ldap/admin/src/scripts/Util.pm \
ldap/admin/src/scripts/Setup.pm \
@@ -309,7 +311,7 @@ task_SCRIPTS = ldap/admin/src/scripts/template-bak2db \
init_SCRIPTS = wrappers/$(PACKAGE_NAME)
-initconfig_SCRIPTS = ldap/admin/src/$(PACKAGE_NAME)
+initconfig_DATA = ldap/admin/src/$(PACKAGE_NAME)
inf_DATA = ldap/admin/src/slapd.inf \
ldap/admin/src/scripts/dscreate.map \
diff --git a/Makefile.in b/Makefile.in
index 490193581..4ecb7d4d3 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -92,12 +92,12 @@ am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;
am__installdirs = "$(DESTDIR)$(serverdir)" \
"$(DESTDIR)$(serverplugindir)" "$(DESTDIR)$(bindir)" \
"$(DESTDIR)$(sbindir)" "$(DESTDIR)$(bindir)" \
- "$(DESTDIR)$(initdir)" "$(DESTDIR)$(initconfigdir)" \
- "$(DESTDIR)$(perldir)" "$(DESTDIR)$(sbindir)" \
+ "$(DESTDIR)$(initdir)" "$(DESTDIR)$(sbindir)" \
"$(DESTDIR)$(taskdir)" "$(DESTDIR)$(man1dir)" \
"$(DESTDIR)$(man8dir)" "$(DESTDIR)$(configdir)" \
- "$(DESTDIR)$(infdir)" "$(DESTDIR)$(mibdir)" \
- "$(DESTDIR)$(propertydir)" "$(DESTDIR)$(propertydir)" \
+ "$(DESTDIR)$(infdir)" "$(DESTDIR)$(initconfigdir)" \
+ "$(DESTDIR)$(mibdir)" "$(DESTDIR)$(propertydir)" \
+ "$(DESTDIR)$(perldir)" "$(DESTDIR)$(propertydir)" \
"$(DESTDIR)$(sampledatadir)" "$(DESTDIR)$(schemadir)"
serverLTLIBRARIES_INSTALL = $(INSTALL)
serverpluginLTLIBRARIES_INSTALL = $(INSTALL)
@@ -832,12 +832,10 @@ rsearch_bin_DEPENDENCIES = $(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1) \
$(am__DEPENDENCIES_1)
binSCRIPT_INSTALL = $(INSTALL_SCRIPT)
initSCRIPT_INSTALL = $(INSTALL_SCRIPT)
-initconfigSCRIPT_INSTALL = $(INSTALL_SCRIPT)
-perlSCRIPT_INSTALL = $(INSTALL_SCRIPT)
sbinSCRIPT_INSTALL = $(INSTALL_SCRIPT)
taskSCRIPT_INSTALL = $(INSTALL_SCRIPT)
-SCRIPTS = $(bin_SCRIPTS) $(init_SCRIPTS) $(initconfig_SCRIPTS) \
- $(perl_SCRIPTS) $(sbin_SCRIPTS) $(task_SCRIPTS)
+SCRIPTS = $(bin_SCRIPTS) $(init_SCRIPTS) $(sbin_SCRIPTS) \
+ $(task_SCRIPTS)
DEFAULT_INCLUDES = -I.@am__isrc@
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
@@ -923,13 +921,16 @@ NROFF = nroff
MANS = $(dist_man_MANS)
configDATA_INSTALL = $(INSTALL_DATA)
infDATA_INSTALL = $(INSTALL_DATA)
+initconfigDATA_INSTALL = $(INSTALL_DATA)
mibDATA_INSTALL = $(INSTALL_DATA)
nodist_propertyDATA_INSTALL = $(INSTALL_DATA)
+perlDATA_INSTALL = $(INSTALL_DATA)
propertyDATA_INSTALL = $(INSTALL_DATA)
sampledataDATA_INSTALL = $(INSTALL_DATA)
schemaDATA_INSTALL = $(INSTALL_DATA)
-DATA = $(config_DATA) $(inf_DATA) $(mib_DATA) $(nodist_property_DATA) \
- $(property_DATA) $(sampledata_DATA) $(schema_DATA)
+DATA = $(config_DATA) $(inf_DATA) $(initconfig_DATA) $(mib_DATA) \
+ $(nodist_property_DATA) $(perl_DATA) $(property_DATA) \
+ $(sampledata_DATA) $(schema_DATA)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@@ -1330,7 +1331,10 @@ bin_SCRIPTS = ldap/servers/slapd/tools/rsearch/scripts/dbgen.pl \
wrappers/repl-monitor \
ldap/admin/src/scripts/repl-monitor.pl
-perl_SCRIPTS = ldap/admin/src/scripts/SetupLog.pm \
+
+# SCRIPTS makes them executables - these are perl modules
+# and should not be marked as executable - so use DATA
+perl_DATA = ldap/admin/src/scripts/SetupLog.pm \
ldap/admin/src/scripts/Resource.pm \
ldap/admin/src/scripts/Util.pm \
ldap/admin/src/scripts/Setup.pm \
@@ -1378,7 +1382,7 @@ task_SCRIPTS = ldap/admin/src/scripts/template-bak2db \
ldap/admin/src/scripts/template-dbverify
init_SCRIPTS = wrappers/$(PACKAGE_NAME)
-initconfig_SCRIPTS = ldap/admin/src/$(PACKAGE_NAME)
+initconfig_DATA = ldap/admin/src/$(PACKAGE_NAME)
inf_DATA = ldap/admin/src/slapd.inf \
ldap/admin/src/scripts/dscreate.map \
ldap/admin/src/scripts/dsorgentries.map
@@ -4036,44 +4040,6 @@ uninstall-initSCRIPTS:
echo " rm -f '$(DESTDIR)$(initdir)/$$f'"; \
rm -f "$(DESTDIR)$(initdir)/$$f"; \
done
-install-initconfigSCRIPTS: $(initconfig_SCRIPTS)
- @$(NORMAL_INSTALL)
- test -z "$(initconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(initconfigdir)"
- @list='$(initconfig_SCRIPTS)'; for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- if test -f $$d$$p; then \
- f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
- echo " $(initconfigSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(initconfigdir)/$$f'"; \
- $(initconfigSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(initconfigdir)/$$f"; \
- else :; fi; \
- done
-
-uninstall-initconfigSCRIPTS:
- @$(NORMAL_UNINSTALL)
- @list='$(initconfig_SCRIPTS)'; for p in $$list; do \
- f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
- echo " rm -f '$(DESTDIR)$(initconfigdir)/$$f'"; \
- rm -f "$(DESTDIR)$(initconfigdir)/$$f"; \
- done
-install-perlSCRIPTS: $(perl_SCRIPTS)
- @$(NORMAL_INSTALL)
- test -z "$(perldir)" || $(MKDIR_P) "$(DESTDIR)$(perldir)"
- @list='$(perl_SCRIPTS)'; for p in $$list; do \
- if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
- if test -f $$d$$p; then \
- f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
- echo " $(perlSCRIPT_INSTALL) '$$d$$p' '$(DESTDIR)$(perldir)/$$f'"; \
- $(perlSCRIPT_INSTALL) "$$d$$p" "$(DESTDIR)$(perldir)/$$f"; \
- else :; fi; \
- done
-
-uninstall-perlSCRIPTS:
- @$(NORMAL_UNINSTALL)
- @list='$(perl_SCRIPTS)'; for p in $$list; do \
- f=`echo "$$p" | sed 's|^.*/||;$(transform)'`; \
- echo " rm -f '$(DESTDIR)$(perldir)/$$f'"; \
- rm -f "$(DESTDIR)$(perldir)/$$f"; \
- done
install-sbinSCRIPTS: $(sbin_SCRIPTS)
@$(NORMAL_INSTALL)
test -z "$(sbindir)" || $(MKDIR_P) "$(DESTDIR)$(sbindir)"
@@ -9144,6 +9110,23 @@ uninstall-infDATA:
echo " rm -f '$(DESTDIR)$(infdir)/$$f'"; \
rm -f "$(DESTDIR)$(infdir)/$$f"; \
done
+install-initconfigDATA: $(initconfig_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(initconfigdir)" || $(MKDIR_P) "$(DESTDIR)$(initconfigdir)"
+ @list='$(initconfig_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(initconfigDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(initconfigdir)/$$f'"; \
+ $(initconfigDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(initconfigdir)/$$f"; \
+ done
+
+uninstall-initconfigDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(initconfig_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(initconfigdir)/$$f'"; \
+ rm -f "$(DESTDIR)$(initconfigdir)/$$f"; \
+ done
install-mibDATA: $(mib_DATA)
@$(NORMAL_INSTALL)
test -z "$(mibdir)" || $(MKDIR_P) "$(DESTDIR)$(mibdir)"
@@ -9178,6 +9161,23 @@ uninstall-nodist_propertyDATA:
echo " rm -f '$(DESTDIR)$(propertydir)/$$f'"; \
rm -f "$(DESTDIR)$(propertydir)/$$f"; \
done
+install-perlDATA: $(perl_DATA)
+ @$(NORMAL_INSTALL)
+ test -z "$(perldir)" || $(MKDIR_P) "$(DESTDIR)$(perldir)"
+ @list='$(perl_DATA)'; for p in $$list; do \
+ if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+ f=$(am__strip_dir) \
+ echo " $(perlDATA_INSTALL) '$$d$$p' '$(DESTDIR)$(perldir)/$$f'"; \
+ $(perlDATA_INSTALL) "$$d$$p" "$(DESTDIR)$(perldir)/$$f"; \
+ done
+
+uninstall-perlDATA:
+ @$(NORMAL_UNINSTALL)
+ @list='$(perl_DATA)'; for p in $$list; do \
+ f=$(am__strip_dir) \
+ echo " rm -f '$(DESTDIR)$(perldir)/$$f'"; \
+ rm -f "$(DESTDIR)$(perldir)/$$f"; \
+ done
install-propertyDATA: $(property_DATA)
@$(NORMAL_INSTALL)
test -z "$(propertydir)" || $(MKDIR_P) "$(DESTDIR)$(propertydir)"
@@ -9414,7 +9414,7 @@ check: $(BUILT_SOURCES)
all-am: Makefile $(LIBRARIES) $(LTLIBRARIES) $(PROGRAMS) $(SCRIPTS) \
$(MANS) $(DATA) config.h
installdirs:
- for dir in "$(DESTDIR)$(serverdir)" "$(DESTDIR)$(serverplugindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(initdir)" "$(DESTDIR)$(initconfigdir)" "$(DESTDIR)$(perldir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(taskdir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(configdir)" "$(DESTDIR)$(infdir)" "$(DESTDIR)$(mibdir)" "$(DESTDIR)$(propertydir)" "$(DESTDIR)$(propertydir)" "$(DESTDIR)$(sampledatadir)" "$(DESTDIR)$(schemadir)"; do \
+ for dir in "$(DESTDIR)$(serverdir)" "$(DESTDIR)$(serverplugindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(bindir)" "$(DESTDIR)$(initdir)" "$(DESTDIR)$(sbindir)" "$(DESTDIR)$(taskdir)" "$(DESTDIR)$(man1dir)" "$(DESTDIR)$(man8dir)" "$(DESTDIR)$(configdir)" "$(DESTDIR)$(infdir)" "$(DESTDIR)$(initconfigdir)" "$(DESTDIR)$(mibdir)" "$(DESTDIR)$(propertydir)" "$(DESTDIR)$(perldir)" "$(DESTDIR)$(propertydir)" "$(DESTDIR)$(sampledatadir)" "$(DESTDIR)$(schemadir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: $(BUILT_SOURCES)
@@ -9543,10 +9543,9 @@ info: info-am
info-am:
install-data-am: install-configDATA install-infDATA \
- install-initSCRIPTS install-initconfigSCRIPTS install-man \
- install-mibDATA install-nodist_propertyDATA \
- install-perlSCRIPTS install-propertyDATA \
- install-sampledataDATA install-schemaDATA \
+ install-initSCRIPTS install-initconfigDATA install-man \
+ install-mibDATA install-nodist_propertyDATA install-perlDATA \
+ install-propertyDATA install-sampledataDATA install-schemaDATA \
install-serverLTLIBRARIES install-serverpluginLTLIBRARIES \
install-taskSCRIPTS
@@ -9589,8 +9588,8 @@ ps-am:
uninstall-am: uninstall-binPROGRAMS uninstall-binSCRIPTS \
uninstall-configDATA uninstall-infDATA uninstall-initSCRIPTS \
- uninstall-initconfigSCRIPTS uninstall-man uninstall-mibDATA \
- uninstall-nodist_propertyDATA uninstall-perlSCRIPTS \
+ uninstall-initconfigDATA uninstall-man uninstall-mibDATA \
+ uninstall-nodist_propertyDATA uninstall-perlDATA \
uninstall-propertyDATA uninstall-sampledataDATA \
uninstall-sbinPROGRAMS uninstall-sbinSCRIPTS \
uninstall-schemaDATA uninstall-serverLTLIBRARIES \
@@ -9613,11 +9612,11 @@ uninstall-man: uninstall-man1 uninstall-man8
install-data install-data-am install-dvi install-dvi-am \
install-exec install-exec-am install-html install-html-am \
install-infDATA install-info install-info-am \
- install-initSCRIPTS install-initconfigSCRIPTS install-man \
+ install-initSCRIPTS install-initconfigDATA install-man \
install-man1 install-man8 install-mibDATA \
install-nodist_propertyDATA install-pdf install-pdf-am \
- install-perlSCRIPTS install-propertyDATA install-ps \
- install-ps-am install-sampledataDATA install-sbinPROGRAMS \
+ install-perlDATA install-propertyDATA install-ps install-ps-am \
+ install-sampledataDATA install-sbinPROGRAMS \
install-sbinSCRIPTS install-schemaDATA \
install-serverLTLIBRARIES install-serverpluginLTLIBRARIES \
install-strip install-taskSCRIPTS installcheck installcheck-am \
@@ -9626,9 +9625,9 @@ uninstall-man: uninstall-man1 uninstall-man8
mostlyclean-libtool pdf pdf-am ps ps-am tags uninstall \
uninstall-am uninstall-binPROGRAMS uninstall-binSCRIPTS \
uninstall-configDATA uninstall-infDATA uninstall-initSCRIPTS \
- uninstall-initconfigSCRIPTS uninstall-man uninstall-man1 \
+ uninstall-initconfigDATA uninstall-man uninstall-man1 \
uninstall-man8 uninstall-mibDATA uninstall-nodist_propertyDATA \
- uninstall-perlSCRIPTS uninstall-propertyDATA \
+ uninstall-perlDATA uninstall-propertyDATA \
uninstall-sampledataDATA uninstall-sbinPROGRAMS \
uninstall-sbinSCRIPTS uninstall-schemaDATA \
uninstall-serverLTLIBRARIES uninstall-serverpluginLTLIBRARIES \
| 0 |
96dbbb21481e321590fffc90e83e429df6b4c200
|
389ds/389-ds-base
|
Issue 4925 - Performance ACI: targetfilter evaluation result can be reused (#4926)
Bug description:
An ACI may contain targetfilter. For a given returned entry, of a
SRCH request, the same targetfilter is evaluated for each of the
returned attributes.
Once the filter has been evaluated, it is useless to reevaluate
it for a next attribute.
Fix description:
The fix implements a very simple cache (linked list) that keeps
the results of the previously evaluated 'targetfilter'.
This cache is per-entry. For an operation, a aclpb is allocated
that is used to evaluate ACIs against each successive entry.
Each time a candidate entry is added in the aclpb
(acl_access_allowed), the cache (aclpb_curr_entry_targetfilters)
is freed. Then for each 'targetfilter', the original targetfilter
is lookup from the cache. If this is the first evaluation of it
then the result of the evaluation is stored into the cache using
the original targetfilter as the key in the cache
The key to lookup/store the cache is the string representation
of the targetfilter. The string contains a redzone to detect
that the filter exceeds the maximum size (2K). If it exceeds
then the key is invalid and the lookup/store is noop.
relates: #4925
Reviewed by: Mark Reynolds, William Brown (Thanks)
Platforms tested: F34
|
commit 96dbbb21481e321590fffc90e83e429df6b4c200
Author: tbordaz <[email protected]>
Date: Thu Sep 23 10:48:50 2021 +0200
Issue 4925 - Performance ACI: targetfilter evaluation result can be reused (#4926)
Bug description:
An ACI may contain targetfilter. For a given returned entry, of a
SRCH request, the same targetfilter is evaluated for each of the
returned attributes.
Once the filter has been evaluated, it is useless to reevaluate
it for a next attribute.
Fix description:
The fix implements a very simple cache (linked list) that keeps
the results of the previously evaluated 'targetfilter'.
This cache is per-entry. For an operation, a aclpb is allocated
that is used to evaluate ACIs against each successive entry.
Each time a candidate entry is added in the aclpb
(acl_access_allowed), the cache (aclpb_curr_entry_targetfilters)
is freed. Then for each 'targetfilter', the original targetfilter
is lookup from the cache. If this is the first evaluation of it
then the result of the evaluation is stored into the cache using
the original targetfilter as the key in the cache
The key to lookup/store the cache is the string representation
of the targetfilter. The string contains a redzone to detect
that the filter exceeds the maximum size (2K). If it exceeds
then the key is invalid and the lookup/store is noop.
relates: #4925
Reviewed by: Mark Reynolds, William Brown (Thanks)
Platforms tested: F34
diff --git a/ldap/servers/plugins/acl/acl.c b/ldap/servers/plugins/acl/acl.c
index c9e9794af..3eb3e1d79 100644
--- a/ldap/servers/plugins/acl/acl.c
+++ b/ldap/servers/plugins/acl/acl.c
@@ -67,6 +67,9 @@ static void print_access_control_summary(char *source,
const char *edn,
aclResultReason_t *acl_reason);
static int check_rdn_access(Slapi_PBlock *pb, Slapi_Entry *e, const char *newrdn, int access);
+static struct targetfilter_cached_result *targetfilter_cache_lookup(struct acl_pblock *aclpb, char *filter, PRBool filter_valid);
+static void targetfilter_cache_add(struct acl_pblock *aclpb, char *filter, int result, PRBool filter_valid);
+
/*
@@ -176,6 +179,70 @@ check_rdn_access(Slapi_PBlock *pb, Slapi_Entry *e, const char *dn, int access)
return (retCode);
}
+/* Retrieves, in the targetfilter cache (list), this
+ * filter in case it was already evaluated
+ *
+ * filter: key to retrieve the evaluation in the cache
+ * filter_valid: PR_FALSE means that the filter key is truncated, PR_TRUE else
+ */
+static struct targetfilter_cached_result *
+targetfilter_cache_lookup(struct acl_pblock *aclpb, char *filter, PRBool filter_valid)
+{
+ struct targetfilter_cached_result *results;
+ if (! aclpb->targetfilter_cache_enabled) {
+ /* targetfilter cache is disabled */
+ return NULL;
+ }
+ if (filter == NULL) {
+ return NULL;
+ }
+ for(results = aclpb->aclpb_curr_entry_targetfilters; results; results = results->next) {
+ if (strcmp(results->filter, filter) == 0) {
+ return results;
+ }
+ }
+
+ return NULL;
+}
+
+/* Free all evaluations cached for this current entry */
+void
+targetfilter_cache_free(struct acl_pblock *aclpb)
+{
+ struct targetfilter_cached_result *results, *next;
+ if (aclpb == NULL) {
+ return;
+ }
+ for(results = aclpb->aclpb_curr_entry_targetfilters; results;) {
+ next = results->next;
+ slapi_ch_free_string(&results->filter);
+ slapi_ch_free((void **) &results);
+ results = next;
+ }
+ aclpb->aclpb_curr_entry_targetfilters = NULL;
+}
+
+/* add a new targetfilter evaluation into the cache (per entry)
+ * ATM just use a linked list of evaluation
+ *
+ * filter: key to retrieve the evaluation in the cache
+ * result: result of the evaluation
+ * filter_valid: PR_FALSE means that the filter key is truncated, PR_TRUE else
+ */
+static void
+targetfilter_cache_add(struct acl_pblock *aclpb, char *filter, int result, PRBool filter_valid)
+{
+ struct targetfilter_cached_result *results;
+ if (! filter_valid || ! aclpb->targetfilter_cache_enabled) {
+ /* targetfilter cache is disabled or filter is truncated */
+ return;
+ }
+ results = (struct targetfilter_cached_result *) slapi_ch_calloc(1, (sizeof(struct targetfilter_cached_result)));
+ results->filter = slapi_ch_strdup(filter);
+ results->next = aclpb->aclpb_curr_entry_targetfilters;
+ results->matching_result = result;
+ aclpb->aclpb_curr_entry_targetfilters = results;
+}
/***************************************************************************
*
* acl_access_allowed
@@ -496,6 +563,7 @@ acl_access_allowed(
/* Keep the ptr to the current entry */
aclpb->aclpb_curr_entry = (Slapi_Entry *)e;
+ targetfilter_cache_free(aclpb);
/* Get the attr info */
deallocate_attrEval = acl__get_attrEval(aclpb, attr);
@@ -1927,7 +1995,7 @@ acl_modified(Slapi_PBlock *pb, int optype, Slapi_DN *e_sdn, void *change)
* None.
*
**************************************************************************/
-static int
+int
acl__scan_for_acis(Acl_PBlock *aclpb, int *err)
{
aci_t *aci;
@@ -2408,10 +2476,68 @@ acl__resource_match_aci(Acl_PBlock *aclpb, aci_t *aci, int skip_attrEval, int *a
ACL_EVAL_TARGET_FILTER);
slapi_ch_free((void **)&lasinfo);
} else {
- if (slapi_vattr_filter_test(NULL, aclpb->aclpb_curr_entry,
- aci->targetFilter,
- 0 /*don't do access check*/) != 0) {
- filter_matched = ACL_FALSE;
+ Slapi_DN *sdn;
+ char* attr_evaluated = "None";
+ char logbuf[2048] = {0};
+ char *redzone = "the redzone";
+ int32_t redzone_idx;
+ char *filterstr; /* key to retrieve/add targetfilter value in the cache */
+ PRBool valid_filter;
+ struct targetfilter_cached_result *previous_filter_test;
+
+ /* only usefull for debug purpose */
+ if (aclpb->aclpb_curr_attrEval && aclpb->aclpb_curr_attrEval->attrEval_name) {
+ attr_evaluated = aclpb->aclpb_curr_attrEval->attrEval_name;
+ }
+ sdn = slapi_entry_get_sdn(aclpb->aclpb_curr_entry);
+
+ /* The key for the cache is the string representation of the original filter
+ * If the string can not fit into the provided buffer (overwrite redzone)
+ * then the filter is said invalid (for the cache) and it will be evaluated
+ */
+ redzone_idx = sizeof(logbuf) - 1 - strlen(redzone);
+ strcpy(&logbuf[redzone_idx], redzone);
+ filterstr = slapi_filter_to_string(aci->targetFilter, logbuf, sizeof(logbuf));
+
+ /* if the redzone was overwritten that means filterstr is truncated and not valid */
+ valid_filter = (strcmp(&logbuf[redzone_idx], redzone) == 0);
+ if (!valid_filter) {
+ strcpy(&logbuf[50], "...");
+ slapi_log_err(SLAPI_LOG_ACL, "acl__ressource_match_aci", "targetfilter too large (can not be cache) %s\n", logbuf);
+ }
+
+ previous_filter_test = targetfilter_cache_lookup(aclpb, filterstr, valid_filter);
+ if (previous_filter_test) {
+ /* The filter was already evaluated against that same entry */
+ if (previous_filter_test->matching_result == 0) {
+ slapi_log_err(SLAPI_LOG_ACL, "acl__ressource_match_aci", "cached result for entry %s did NOT match %s (%s)\n",
+ slapi_sdn_get_ndn(sdn),
+ filterstr,
+ attr_evaluated);
+ filter_matched = ACL_FALSE;
+ } else {
+ slapi_log_err(SLAPI_LOG_ACL, "acl__ressource_match_aci", "cached result for entry %s did match %s (%s)\n",
+ slapi_sdn_get_ndn(sdn),
+ filterstr,
+ attr_evaluated);
+ }
+ } else {
+ /* The filter has not already been evaluated against that entry
+ * evaluate it and cache the result
+ */
+ if (slapi_vattr_filter_test(NULL, aclpb->aclpb_curr_entry,
+ aci->targetFilter,
+ 0 /*don't do access check*/) != 0) {
+ filter_matched = ACL_FALSE;
+ targetfilter_cache_add(aclpb, filterstr, 0, valid_filter); /* does not match */
+ } else {
+ targetfilter_cache_add(aclpb, filterstr, 1, valid_filter); /* does match */
+ }
+ slapi_log_err(SLAPI_LOG_ACL, "acl__ressource_match_aci", "entry %s %s match %s (%s)\n",
+ slapi_sdn_get_ndn(sdn),
+ filter_matched == ACL_FALSE ? "does not" : "does",
+ filterstr,
+ attr_evaluated);
}
}
@@ -2862,7 +2988,7 @@ acl__resource_match_aci_EXIT:
* None.
*
**************************************************************************/
-static int
+int
acl__TestRights(Acl_PBlock *aclpb, int access, const char **right, const char **map_generic, aclResultReason_t *result_reason)
{
ACLEvalHandle_t *acleval;
diff --git a/ldap/servers/plugins/acl/acl.h b/ldap/servers/plugins/acl/acl.h
index becc7f920..c9b9efa56 100644
--- a/ldap/servers/plugins/acl/acl.h
+++ b/ldap/servers/plugins/acl/acl.h
@@ -407,6 +407,17 @@ struct aci_container
};
typedef struct aci_container AciContainer;
+/* This structure is stored in the aclpb.
+ * It is a linked list containing the result of
+ * the filter matching against a specific entry.
+ *
+ * This list is free for each new entry in the aclpb*/
+struct targetfilter_cached_result {
+ char *filter; /* strdup of string representation of aci->targetFilter */
+ int matching_result; /* 0 does not match / 1 does match */
+ struct targetfilter_cached_result *next; /* next targetfilter already evaluated */
+};
+
struct acl_pblock
{
int aclpb_state;
@@ -476,6 +487,8 @@ struct acl_pblock
/* Current entry/dn/attr evaluation info */
Slapi_Entry *aclpb_curr_entry; /* current Entry being processed */
+ int32_t targetfilter_cache_enabled;
+ struct targetfilter_cached_result *aclpb_curr_entry_targetfilters;
int aclpb_num_entries;
Slapi_DN *aclpb_curr_entry_sdn; /* Entry's SDN */
Slapi_DN *aclpb_authorization_sdn; /* dn used for authorization */
@@ -723,6 +736,7 @@ void acl_modified(Slapi_PBlock *pb, int optype, Slapi_DN *e_sdn, void *change);
int acl_access_allowed_disjoint_resource(Slapi_PBlock *pb, Slapi_Entry *e, char *attr, struct berval *val, int access);
int acl_access_allowed_main(Slapi_PBlock *pb, Slapi_Entry *e, char **attrs, struct berval *val, int access, int flags, char **errbuf);
+void targetfilter_cache_free(struct acl_pblock *aclpb);
int acl_access_allowed(Slapi_PBlock *pb, Slapi_Entry *e, char *attr, struct berval *val, int access);
aclUserGroup *acl_get_usersGroup(struct acl_pblock *aclpb, char *n_dn);
void acl_print_acllib_err(NSErr_t *errp, char *str);
diff --git a/ldap/servers/plugins/acl/acl_ext.c b/ldap/servers/plugins/acl/acl_ext.c
index 797c5d2fd..c88f7389f 100644
--- a/ldap/servers/plugins/acl/acl_ext.c
+++ b/ldap/servers/plugins/acl/acl_ext.c
@@ -189,6 +189,11 @@ acl_operation_ext_constructor(void *object __attribute__((unused)), void *parent
slapi_log_err(SLAPI_LOG_ERR, plugin_name,
"acl_operation_ext_constructor - Operation extension allocation Failed\n");
}
+ /* targetfilter_cache toggle set during aclpb allocation
+ * to avoid accessing configuration during the evaluation
+ * of each aci
+ */
+ aclpb->targetfilter_cache_enabled = config_get_targetfilter_cache();
TNF_PROBE_0_DEBUG(acl_operation_ext_constructor_end, "ACL", "");
@@ -713,6 +718,7 @@ acl__free_aclpb(Acl_PBlock **aclpb_ptr)
slapi_ch_free((void **)&(aclpb->aclpb_curr_entryEval_context.acle_handles_matched_target));
slapi_ch_free((void **)&(aclpb->aclpb_prev_entryEval_context.acle_handles_matched_target));
slapi_ch_free((void **)&(aclpb->aclpb_prev_opEval_context.acle_handles_matched_target));
+ targetfilter_cache_free(aclpb);
slapi_sdn_free(&aclpb->aclpb_authorization_sdn);
slapi_sdn_free(&aclpb->aclpb_curr_entry_sdn);
if (aclpb->aclpb_macro_ht) {
@@ -921,6 +927,12 @@ acl__done_aclpb(struct acl_pblock *aclpb)
aclpb->aclpb_acleval ? (char *)aclpb->aclpb_acleval : "NULL");
}
+ /* This aclpb return to the aclpb pool, make sure
+ * the cached evaluations are freed and that
+ * aclpb_curr_entry_targetfilters is NULL
+ */
+ targetfilter_cache_free(aclpb);
+
/* Now Free the contents or clean it */
slapi_sdn_done(aclpb->aclpb_curr_entry_sdn);
if (aclpb->aclpb_Evalattr)
diff --git a/ldap/servers/slapd/libglobs.c b/ldap/servers/slapd/libglobs.c
index 4a1cd617f..b62a1e766 100644
--- a/ldap/servers/slapd/libglobs.c
+++ b/ldap/servers/slapd/libglobs.c
@@ -221,6 +221,7 @@ slapi_onoff_t init_return_exact_case;
slapi_onoff_t init_result_tweak;
slapi_onoff_t init_plugin_track;
slapi_onoff_t init_moddn_aci;
+slapi_onoff_t init_targetfilter_cache;
slapi_onoff_t init_lastmod;
slapi_onoff_t init_readonly;
slapi_onoff_t init_accesscontrol;
@@ -904,6 +905,11 @@ static struct config_get_and_set
(void **)&global_slapdFrontendConfig.moddn_aci,
CONFIG_ON_OFF, (ConfigGetFunc)config_get_moddn_aci,
&init_moddn_aci, NULL},
+ {CONFIG_TARGETFILTER_CACHE_ATTRIBUTE, config_set_targetfilter_cache,
+ NULL, 0,
+ (void **)&global_slapdFrontendConfig.targetfilter_cache,
+ CONFIG_ON_OFF, (ConfigGetFunc)config_get_targetfilter_cache,
+ &init_targetfilter_cache, NULL},
{CONFIG_ATTRIBUTE_NAME_EXCEPTION_ATTRIBUTE, config_set_attrname_exceptions,
NULL, 0,
(void **)&global_slapdFrontendConfig.attrname_exceptions,
@@ -1692,6 +1698,7 @@ FrontendConfig_init(void)
init_syntaxcheck = cfg->syntaxcheck = LDAP_ON;
init_plugin_track = cfg->plugin_track = LDAP_OFF;
init_moddn_aci = cfg->moddn_aci = LDAP_ON;
+ init_targetfilter_cache = cfg->targetfilter_cache = LDAP_ON;
init_syntaxlogging = cfg->syntaxlogging = LDAP_OFF;
init_dn_validate_strict = cfg->dn_validate_strict = LDAP_OFF;
init_ds4_compatible_schema = cfg->ds4_compatible_schema = LDAP_OFF;
@@ -4090,6 +4097,21 @@ config_set_moddn_aci(const char *attrname, char *value, char *errorbuf, int appl
return retVal;
}
+int32_t
+config_set_targetfilter_cache(const char *attrname, char *value, char *errorbuf, int apply)
+{
+ int32_t retVal = LDAP_SUCCESS;
+ slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig();
+
+ retVal = config_set_onoff(attrname,
+ value,
+ &(slapdFrontendConfig->targetfilter_cache),
+ errorbuf,
+ apply);
+
+ return retVal;
+}
+
int32_t
config_set_dynamic_plugins(const char *attrname, char *value, char *errorbuf, int apply)
{
@@ -5940,6 +5962,13 @@ config_get_moddn_aci(void)
return slapi_atomic_load_32(&(slapdFrontendConfig->moddn_aci), __ATOMIC_ACQUIRE);
}
+int32_t
+config_get_targetfilter_cache(void)
+{
+ slapdFrontendConfig_t *slapdFrontendConfig = getFrontendConfig();
+ return slapi_atomic_load_32(&(slapdFrontendConfig->targetfilter_cache), __ATOMIC_ACQUIRE);
+}
+
int32_t
config_get_security(void)
{
diff --git a/ldap/servers/slapd/proto-slap.h b/ldap/servers/slapd/proto-slap.h
index 2fb98af76..170f3e640 100644
--- a/ldap/servers/slapd/proto-slap.h
+++ b/ldap/servers/slapd/proto-slap.h
@@ -265,6 +265,7 @@ int config_set_lastmod(const char *attrname, char *value, char *errorbuf, int ap
int config_set_nagle(const char *attrname, char *value, char *errorbuf, int apply);
int config_set_accesscontrol(const char *attrname, char *value, char *errorbuf, int apply);
int config_set_moddn_aci(const char *attrname, char *value, char *errorbuf, int apply);
+int32_t config_set_targetfilter_cache(const char *attrname, char *value, char *errorbuf, int apply);
int config_set_security(const char *attrname, char *value, char *errorbuf, int apply);
int config_set_readonly(const char *attrname, char *value, char *errorbuf, int apply);
int config_set_schemacheck(const char *attrname, char *value, char *errorbuf, int apply);
@@ -472,6 +473,7 @@ int config_get_accesscontrol(void);
int config_get_return_exact_case(void);
int config_get_result_tweak(void);
int config_get_moddn_aci(void);
+int32_t config_get_targetfilter_cache(void);
int config_get_security(void);
int config_get_schemacheck(void);
int config_get_syntaxcheck(void);
diff --git a/ldap/servers/slapd/slap.h b/ldap/servers/slapd/slap.h
index 19ec4eec9..96d549133 100644
--- a/ldap/servers/slapd/slap.h
+++ b/ldap/servers/slapd/slap.h
@@ -2235,6 +2235,7 @@ typedef struct _slapdEntryPoints
#define CONFIG_REWRITE_RFC1274_ATTRIBUTE "nsslapd-rewrite-rfc1274"
#define CONFIG_PLUGIN_BINDDN_TRACKING_ATTRIBUTE "nsslapd-plugin-binddn-tracking"
#define CONFIG_MODDN_ACI_ATTRIBUTE "nsslapd-moddn-aci"
+#define CONFIG_TARGETFILTER_CACHE_ATTRIBUTE "nsslapd-targetfilter-cache"
#define CONFIG_GLOBAL_BACKEND_LOCK "nsslapd-global-backend-lock"
#define CONFIG_ENABLE_NUNC_STANS "nsslapd-enable-nunc-stans"
#define CONFIG_ENABLE_UPGRADE_HASH "nsslapd-enable-upgrade-hash"
@@ -2408,6 +2409,7 @@ typedef struct _slapdFrontendConfig
char **plugin;
slapi_onoff_t plugin_track;
slapi_onoff_t moddn_aci;
+ slapi_onoff_t targetfilter_cache;
struct pw_scheme *pw_storagescheme;
slapi_onoff_t pwpolicy_local;
slapi_onoff_t pw_is_global_policy;
| 0 |
64a425e4ea868bc1f08145490a7c8c9cf5c91581
|
389ds/389-ds-base
|
Ticket 49074 - incompatible nsEncryptionConfig object definition prevents RHEL 7->6 schema replication
Bug Description:
nsEncryptionConfig schema definition diverge since 1.3.x and 1.2.11.15-83.
Schema learning mechanism does not merge definition so the schema can not be pushed RHEL7->6.
This triggers schema violation errors
Fix Description:
Defines nsTLS10, nsTLS11 and nsTLS12 attributetypes and add them to the allowed
attributes list of nsEncryptionConfig
https://fedorahosted.org/389/ticket/49074
Reviewed by: Noriko Hosoi (thanks!!)
Platforms tested: RHEL7.3 vs RHEL6.8 and RHEL6.9
Flag Day: no
Doc impact: no
|
commit 64a425e4ea868bc1f08145490a7c8c9cf5c91581
Author: Thierry Bordaz <[email protected]>
Date: Wed Dec 21 16:31:48 2016 +0100
Ticket 49074 - incompatible nsEncryptionConfig object definition prevents RHEL 7->6 schema replication
Bug Description:
nsEncryptionConfig schema definition diverge since 1.3.x and 1.2.11.15-83.
Schema learning mechanism does not merge definition so the schema can not be pushed RHEL7->6.
This triggers schema violation errors
Fix Description:
Defines nsTLS10, nsTLS11 and nsTLS12 attributetypes and add them to the allowed
attributes list of nsEncryptionConfig
https://fedorahosted.org/389/ticket/49074
Reviewed by: Noriko Hosoi (thanks!!)
Platforms tested: RHEL7.3 vs RHEL6.8 and RHEL6.9
Flag Day: no
Doc impact: no
diff --git a/ldap/schema/01core389.ldif b/ldap/schema/01core389.ldif
index dfa47298f..5e5f69fcc 100644
--- a/ldap/schema/01core389.ldif
+++ b/ldap/schema/01core389.ldif
@@ -91,6 +91,9 @@ attributeTypes: ( nsKeyfile-oid NAME 'nsKeyfile' DESC 'Netscape defined attribut
attributeTypes: ( nsSSL2-oid NAME 'nsSSL2' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
attributeTypes: ( nsSSL3-oid NAME 'nsSSL3' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
attributeTypes: ( nsTLS1-oid NAME 'nsTLS1' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
+attributeTypes: ( nsTLS10-oid NAME 'nsTLS10' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
+attributeTypes: ( nsTLS11-oid NAME 'nsTLS11' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
+attributeTypes: ( nsTLS12-oid NAME 'nsTLS12' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
attributeTypes: ( sslVersionMin-oid NAME 'sslVersionMin' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
attributeTypes: ( sslVersionMax-oid NAME 'sslVersionMax' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
attributeTypes: ( nsSSLClientAuth-oid NAME 'nsSSLClientAuth' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
@@ -314,7 +317,7 @@ objectClasses: ( 2.16.840.1.113730.3.2.103 NAME 'nsDS5ReplicationAgreement' DESC
objectClasses: ( 2.16.840.1.113730.3.2.39 NAME 'nsslapdConfig' DESC 'Netscape defined objectclass' SUP top MAY ( cn ) X-ORIGIN 'Netscape Directory Server' )
objectClasses: ( 2.16.840.1.113730.3.2.317 NAME 'nsSaslMapping' DESC 'Netscape defined objectclass' SUP top MUST ( cn $ nsSaslMapRegexString $ nsSaslMapBaseDNTemplate $ nsSaslMapFilterTemplate ) MAY ( nsSaslMapPriority ) X-ORIGIN 'Netscape Directory Server' )
objectClasses: ( 2.16.840.1.113730.3.2.43 NAME 'nsSNMP' DESC 'Netscape defined objectclass' SUP top MUST ( cn $ nsSNMPEnabled ) MAY ( nsSNMPOrganization $ nsSNMPLocation $ nsSNMPContact $ nsSNMPDescription $ nsSNMPName $ nsSNMPMasterHost $ nsSNMPMasterPort ) X-ORIGIN 'Netscape Directory Server' )
-objectClasses: ( nsEncryptionConfig-oid NAME 'nsEncryptionConfig' DESC 'Netscape defined objectclass' SUP top MUST ( cn ) MAY ( nsCertfile $ nsKeyfile $ nsSSL2 $ nsSSL3 $ nsTLS1 $ sslVersionMin $ sslVersionMax $ nsSSLSessionTimeout $ nsSSL3SessionTimeout $ nsSSLClientAuth $ nsSSL2Ciphers $ nsSSL3Ciphers $ nsSSLSupportedCiphers $ allowWeakCipher $ CACertExtractFile $ allowWeakDHParam ) X-ORIGIN 'Netscape' )
+objectClasses: ( nsEncryptionConfig-oid NAME 'nsEncryptionConfig' DESC 'Netscape defined objectclass' SUP top MUST ( cn ) MAY ( nsCertfile $ nsKeyfile $ nsSSL2 $ nsSSL3 $ nsTLS1 $ nsTLS10 $ nsTLS11 $ nsTLS12 $ sslVersionMin $ sslVersionMax $ nsSSLSessionTimeout $ nsSSL3SessionTimeout $ nsSSLClientAuth $ nsSSL2Ciphers $ nsSSL3Ciphers $ nsSSLSupportedCiphers $ allowWeakCipher $ CACertExtractFile $ allowWeakDHParam ) X-ORIGIN 'Netscape' )
objectClasses: ( nsEncryptionModule-oid NAME 'nsEncryptionModule' DESC 'Netscape defined objectclass' SUP top MUST ( cn ) MAY ( nsSSLToken $ nsSSLPersonalityssl $ nsSSLActivation $ ServerKeyExtractFile $ ServerCertExtractFile ) X-ORIGIN 'Netscape' )
objectClasses: ( 2.16.840.1.113730.3.2.327 NAME 'rootDNPluginConfig' DESC 'Netscape defined objectclass' SUP top MUST ( cn ) MAY ( rootdn-open-time $ rootdn-close-time $ rootdn-days-allowed $ rootdn-allow-host $ rootdn-deny-host $ rootdn-allow-ip $ rootdn-deny-ip ) X-ORIGIN 'Netscape' )
objectClasses: ( 2.16.840.1.113730.3.2.328 NAME 'nsSchemaPolicy' DESC 'Netscape defined objectclass' SUP top MAY ( cn $ schemaUpdateObjectclassAccept $ schemaUpdateObjectclassReject $ schemaUpdateAttributeAccept $ schemaUpdateAttributeReject) X-ORIGIN 'Netscape Directory Server' )
| 0 |
990455004da5f237ea78a2bcb9dcbbec614457a9
|
389ds/389-ds-base
|
Issue 4758 - Add tests for WebUI
Description:
Adding WebUI tests for bz1654238. Test for bz1654238 checks that you are able to create new entries in LDAP Browser tab.
Relates: https://github.com/389ds/389-ds-base/issues/4758
Reviewed by: @droideck (Thanks!)
|
commit 990455004da5f237ea78a2bcb9dcbbec614457a9
Author: Vladimir Cech <[email protected]>
Date: Wed May 17 15:03:16 2023 +0200
Issue 4758 - Add tests for WebUI
Description:
Adding WebUI tests for bz1654238. Test for bz1654238 checks that you are able to create new entries in LDAP Browser tab.
Relates: https://github.com/389ds/389-ds-base/issues/4758
Reviewed by: @droideck (Thanks!)
diff --git a/dirsrvtests/tests/suites/webui/__init__.py b/dirsrvtests/tests/suites/webui/__init__.py
index 17d0d538e..ad52fe648 100644
--- a/dirsrvtests/tests/suites/webui/__init__.py
+++ b/dirsrvtests/tests/suites/webui/__init__.py
@@ -120,3 +120,86 @@ def setup_page(topology_st, page, browser_name, request):
remove_instance_through_webui(topology_st, page, browser_name)
request.addfinalizer(fin)
+
+
+def load_ldap_browser_tab(frame):
+ frame.get_by_role('tab', name='LDAP Browser', exact=True).click()
+ frame.get_by_role('button').filter(has_text='dc=example,dc=com').click()
+ frame.get_by_role('columnheader', name='Attribute').wait_for()
+ time.sleep(1)
+
+
+def prepare_page_for_entry(frame, entry_type):
+ frame.get_by_role("tabpanel", name="Tree View").get_by_role("button", name="Actions").click()
+ frame.get_by_role("menuitem", name="New ...").click()
+ frame.get_by_label(f"Create a new {entry_type}").check()
+ frame.get_by_role("button", name="Next").click()
+
+
+def finish_entry_creation(frame, entry_type, entry_data):
+ frame.get_by_role("button", name="Next").click()
+ if entry_type == "User":
+ frame.get_by_role("contentinfo").get_by_role("button", name="Create User").click()
+ elif entry_type == "custom Entry":
+ frame.get_by_role("button", name="Create Entry").click()
+ else:
+ frame.get_by_role("button", name="Create", exact=True).click()
+ frame.get_by_role("button", name="Finish").click()
+ frame.get_by_role("button").filter(has_text=entry_data['suffixTreeEntry']).wait_for()
+
+
+def create_entry(frame, entry_type, entry_data):
+ prepare_page_for_entry(frame, entry_type)
+
+ if entry_type == 'User':
+ frame.get_by_role("button", name="Options menu").click()
+ frame.get_by_role("option", name="Posix Account").click()
+ frame.get_by_role("button", name="Next", exact=True).click()
+ frame.get_by_role("button", name="Next", exact=True).click()
+
+ for row, value in enumerate(entry_data.values()):
+ if row > 5:
+ break
+ frame.get_by_role("button", name=f"Place row {row} in edit mode").click()
+ frame.get_by_role("textbox", name="_").fill(value)
+ frame.get_by_role("button", name=f"Save row edits for row {row}").click()
+
+ elif entry_type == 'Group':
+ frame.get_by_role("button", name="Next").click()
+ frame.locator("#groupName").fill(entry_data["group_name"])
+ frame.get_by_role("button", name="Next").click()
+
+ elif entry_type == 'Organizational Unit':
+ frame.get_by_role("button", name="Next", exact=True).click()
+ frame.get_by_role("button", name="Place row 0 in edit mode").click()
+ frame.get_by_role("textbox", name="_").fill(entry_data['ou_name'])
+ frame.get_by_role("button", name="Save row edits for row 0").click()
+
+ elif entry_type == 'Role':
+ frame.locator("#namingVal").fill(entry_data['role_name'])
+ frame.get_by_role("button", name="Next").click()
+ frame.get_by_role("button", name="Next", exact=True).click()
+
+ elif entry_type == 'custom Entry':
+ frame.get_by_role("checkbox", name="Select row 0").check()
+ frame.get_by_role("button", name="Next", exact=True).click()
+ frame.get_by_role("checkbox", name="Select row 1").check()
+ frame.get_by_role("button", name="Next", exact=True).click()
+ frame.get_by_role("button", name="Place row 0 in edit mode").click()
+ frame.get_by_role("textbox", name="_").fill(entry_data['uid'])
+ frame.get_by_role("button", name="Save row edits for row 0").click()
+ frame.get_by_role("button", name="Place row 1 in edit mode").click()
+ frame.get_by_role("textbox", name="_").fill(entry_data['entry_name'])
+ frame.get_by_role("button", name="Save row edits for row 1").click()
+
+ finish_entry_creation(frame, entry_type, entry_data)
+
+def delete_entry(frame):
+ frame.get_by_role("tabpanel", name="Tree View").get_by_role("button", name="Actions").click()
+ frame.get_by_role("menuitem", name="Delete ...").click()
+ frame.get_by_role("button", name="Next").click()
+ frame.get_by_role("button", name="Next").click()
+ frame.get_by_text("No, don't delete.").click()
+ frame.get_by_role("button", name="Delete").click()
+ frame.get_by_role("button", name="Finish").click()
+ time.sleep(1)
diff --git a/dirsrvtests/tests/suites/webui/ldap_browser/ldap_browser_test.py b/dirsrvtests/tests/suites/webui/ldap_browser/ldap_browser_test.py
index 93c43a2ca..265cc9489 100644
--- a/dirsrvtests/tests/suites/webui/ldap_browser/ldap_browser_test.py
+++ b/dirsrvtests/tests/suites/webui/ldap_browser/ldap_browser_test.py
@@ -14,13 +14,30 @@ from lib389.cli_idm.account import *
from lib389.tasks import *
from lib389.utils import *
from lib389.topologies import topology_st
-from .. import setup_page, check_frame_assignment, setup_login
+from .. import setup_page, check_frame_assignment, setup_login, create_entry, delete_entry, load_ldap_browser_tab
pytestmark = pytest.mark.skipif(os.getenv('WEBUI') is None, reason="These tests are only for WebUI environment")
pytest.importorskip('playwright')
SERVER_ID = 'standalone1'
+entry_data = {'User': {'cn': 'John Smith',
+ 'displayName': 'John Smith',
+ 'gidNumber': '1204',
+ 'homeDirectory': 'user/jsmith',
+ 'uid': '1204',
+ 'uidNumber': '1204',
+ 'suffixTreeEntry': 'cn=John Smith'},
+ 'Group': {'group_name': 'testgroup',
+ 'suffixTreeEntry': 'cn=testgroup'},
+ 'Organizational Unit': {'ou_name': 'testou',
+ 'suffixTreeEntry': 'ou=testou'},
+ 'Role': {'role_name': 'testrole',
+ 'suffixTreeEntry': 'cn=testrole'},
+ 'custom Entry': {'uid': '1234',
+ 'entry_name': 'test_entry',
+ 'suffixTreeEntry': 'uid=1234'}}
+
def test_ldap_browser_tab_visibility(topology_st, page, browser_name):
""" Test LDAP Browser tab visibility
@@ -70,6 +87,220 @@ def test_ldap_browser_tab_visibility(topology_st, page, browser_name):
assert frame.locator('#searchBase').is_visible()
+def test_create_and_delete_user(topology_st, page, browser_name):
+ """ Test to create and delete user
+
+ :id: eb08c1d7-cbee-4a37-b724-429e1cdfe092
+ :setup: Standalone instance
+ :steps:
+ 1. Call load_LDAP_browser_tab function.
+ 2. Click on ou=people.
+ 3. Call create_entry function to create new user.
+ 4. Check that new user is successfully created.
+ 5. Click on newly created user.
+ 6. Call delete_entry function to delete user.
+ 7. Check that newly created user is deleted.
+ :expectedresults:
+ 1. Success
+ 2. Success
+ 3. Success
+ 4. User is created
+ 5. Success
+ 6. Success
+ 7. User is deleted
+ """
+
+ setup_login(page)
+ time.sleep(1)
+ frame = check_frame_assignment(page, browser_name)
+
+ entry_type = 'User'
+ test_data = entry_data.get(entry_type)
+ load_ldap_browser_tab(frame)
+
+ log.info('Click on ou=people.')
+ frame.get_by_role('button').filter(has_text='ou=people').click()
+ frame.get_by_role('columnheader', name='Attribute').wait_for()
+ time.sleep(1)
+
+ log.info('Create a new user named John Smith by calling create_entry function.')
+ create_entry(frame, entry_type, test_data)
+ assert frame.get_by_role("button").filter(has_text=f"cn={test_data['displayName']}").is_visible()
+
+ log.info('Click on cn=John Smith and call delete_entry function to delete it.')
+ frame.get_by_role("button").filter(has_text=f"cn={test_data['displayName']}").click()
+ time.sleep(1)
+ delete_entry(frame)
+ assert frame.get_by_role("button").filter(has_text=f"cn={test_data['displayName']}").count() == 0
+
+
+def test_create_and_delete_group(topology_st, page, browser_name):
+ """ Test to create and delete group
+
+ :id: dcd61b3a-b6bc-4255-8a38-c1f98b435ad9
+ :setup: Standalone instance
+ :steps:
+ 1. Call load_LDAP_browser_tab function.
+ 2. Click on ou=groups.
+ 3. Call create_entry function to create new group.
+ 4. Check that new group is successfully created.
+ 5. Click on newly created group.
+ 6. Call delete_entry function to delete group.
+ 7. Check that newly created group is deleted.
+ :expectedresults:
+ 1. Success
+ 2. Success
+ 3. Success
+ 4. Group is created
+ 5. Success
+ 6. Success
+ 7. Group is deleted
+ """
+
+ setup_login(page)
+ time.sleep(1)
+ frame = check_frame_assignment(page, browser_name)
+
+ entry_type = 'Group'
+ test_data = entry_data.get(entry_type)
+ load_ldap_browser_tab(frame)
+
+ log.info('Click on groups.')
+ frame.get_by_role('button').filter(has_text='ou=groups').click()
+ frame.get_by_role('columnheader', name='Attribute').wait_for()
+ time.sleep(1)
+
+ log.info('Call create_entry function to create a new group.')
+ create_entry(frame, entry_type, test_data)
+ assert frame.get_by_role("button").filter(has_text=f"cn={test_data['group_name']}").is_visible()
+
+ log.info('Click on cn=testgroup and call delete_entry function to delete it.')
+ frame.get_by_role("button").filter(has_text=f"cn={test_data['group_name']}").click()
+ time.sleep(1)
+ delete_entry(frame)
+ assert frame.get_by_role("button").filter(has_text=f"cn={test_data['group_name']}").count() == 0
+
+
+def test_create_and_delete_organizational_unit(topology_st, page, browser_name):
+ """ Test to create and delete organizational unit
+
+ :id: ce42b85d-6eab-459b-a61d-b77e7979be73
+ :setup: Standalone instance
+ :steps:
+ 1. Call load_LDAP_browser_tab function.
+ 2. Call create_entry function to create new organizational unit.
+ 3. Check that new ou is successfully created.
+ 4. Click on newly created ou.
+ 5. Call delete_entry function to delete ou.
+ 6. Check that newly created ou is deleted.
+ :expectedresults:
+ 1. Success
+ 2. Success
+ 3. New organizational unit is created
+ 4. Success
+ 5. Success
+ 6. New organizational unit is deleted.
+ """
+
+ setup_login(page)
+ time.sleep(1)
+ frame = check_frame_assignment(page, browser_name)
+
+ entry_type = 'Organizational Unit'
+ test_data = entry_data.get(entry_type)
+ load_ldap_browser_tab(frame)
+
+ log.info('Call create_entry function to create new organizational unit named testou.')
+ create_entry(frame, entry_type, test_data)
+ assert frame.get_by_role("button").filter(has_text=f"ou={test_data['ou_name']}").is_visible()
+
+ log.info('Click on ou=testou and call delete_entry function to delete it.')
+ frame.get_by_role("button").filter(has_text=f"ou={test_data['ou_name']}").click()
+ time.sleep(1)
+ delete_entry(frame)
+ assert frame.get_by_role("button").filter(has_text=f"ou={test_data['ou_name']}").count() == 0
+
+
+def test_create_and_delete_role(topology_st, page, browser_name):
+ """ Test to create and delete role
+
+ :id: 39d54c08-5841-403c-9d88-0179f57c27b1
+ :setup: Standalone instance
+ :steps:
+ 1. Call load_LDAP_browser_tab function.
+ 2. Call create_entry function to create new role.
+ 3. Check that new role is successfully created.
+ 4. Click on newly created role.
+ 5. Call delete_entry function to delete role.
+ 6. Check that newly created role is deleted.
+ :expectedresults:
+ 1. Success
+ 2. Success
+ 3. New role is created
+ 4. Success
+ 5. Success
+ 6. New role is deleted
+ """
+
+ setup_login(page)
+ time.sleep(1)
+ frame = check_frame_assignment(page, browser_name)
+
+ entry_type = 'Role'
+ test_data = entry_data.get(entry_type)
+ load_ldap_browser_tab(frame)
+
+ log.info('Call create_entry function to create a new role named testrole.')
+ create_entry(frame, entry_type, test_data)
+ assert frame.get_by_role("button").filter(has_text=f"cn={test_data['role_name']}").is_visible()
+
+ log.info('Click on cn=testrole and call delete_entry function to delete it.')
+ frame.get_by_role("button").filter(has_text=f"cn={test_data['role_name']}").click()
+ time.sleep(1)
+ delete_entry(frame)
+ assert frame.get_by_role("button").filter(has_text=f"cn={test_data['role_name']}").count() == 0
+
+
+def test_create_and_delete_custom_entry(topology_st, page, browser_name):
+ """ Test to create and delete custom entry
+
+ :id: 21906d0f-f097-4f30-8308-16085519159a
+ :setup: Standalone instance
+ :steps:
+ 1. Call load_LDAP_browser_tab function.
+ 2. Call create_entry function to create new custom entry.
+ 3. Check that new custom entry is successfully created.
+ 4. Click on newly created custom entry.
+ 5. Call delete_entry function to delete custom entry.
+ 6. Check that newly created custom entry is deleted.
+ :expectedresults:
+ 1. Success
+ 2. Success
+ 3. New custom entry is created
+ 4. Success
+ 5. Success
+ 6. New custom entry is created
+ """
+
+ setup_login(page)
+ time.sleep(1)
+ frame = check_frame_assignment(page, browser_name)
+
+ entry_type = 'custom Entry'
+ test_data = entry_data.get(entry_type)
+ load_ldap_browser_tab(frame)
+
+ log.info('Call create_entry function to create new custom entry.')
+ create_entry(frame, entry_type, test_data)
+ assert frame.get_by_role("button").filter(has_text=f"uid={test_data['uid']}").is_visible()
+
+ log.info('Click on uid=1234 and call delete_entry function to delete it.')
+ frame.get_by_role("button").filter(has_text=f"uid={test_data['uid']}").click()
+ time.sleep(1)
+ delete_entry(frame)
+ assert frame.get_by_role("button").filter(has_text=f"uid={test_data['uid']}").count() == 0
+
+
if __name__ == '__main__':
# Run isolated
# -s for DEBUG mode
| 0 |
b116d7e2a7a8e7443be93ecb84efee1364b6ba86
|
389ds/389-ds-base
|
Ticket #47824 - paged results control is not working in some cases when we have a subsuffix.
Bug Description: When a simple paged result search is run against
multiple backends, subsuffix backends were not correctly set to the
next loop when crossing the backend boundary.
Fix Description: This patch changes the logic to detect the page
search finished and set the next backend correctly to the paged-
results handle. Also, when reusing the paged result handle in
pagedresults_parse_control_value, increment the refcnt.
https://fedorahosted.org/389/ticket/47824
Reviewed by [email protected] (Thank you, Mark!!)
|
commit b116d7e2a7a8e7443be93ecb84efee1364b6ba86
Author: Noriko Hosoi <[email protected]>
Date: Tue Jul 8 17:40:00 2014 -0700
Ticket #47824 - paged results control is not working in some cases when we have a subsuffix.
Bug Description: When a simple paged result search is run against
multiple backends, subsuffix backends were not correctly set to the
next loop when crossing the backend boundary.
Fix Description: This patch changes the logic to detect the page
search finished and set the next backend correctly to the paged-
results handle. Also, when reusing the paged result handle in
pagedresults_parse_control_value, increment the refcnt.
https://fedorahosted.org/389/ticket/47824
Reviewed by [email protected] (Thank you, Mark!!)
diff --git a/ldap/servers/slapd/opshared.c b/ldap/servers/slapd/opshared.c
index 3fb23fa9b..e222b0564 100644
--- a/ldap/servers/slapd/opshared.c
+++ b/ldap/servers/slapd/opshared.c
@@ -510,7 +510,6 @@ op_shared_search (Slapi_PBlock *pb, int send_result)
err_code = slapi_mapping_tree_select_all(pb, be_list, referral_list, errorbuf);
if (((err_code != LDAP_SUCCESS) && (err_code != LDAP_OPERATIONS_ERROR) && (err_code != LDAP_REFERRAL))
|| ((err_code == LDAP_OPERATIONS_ERROR) && (be_list[0] == NULL)))
-
{
send_ldap_result(pb, err_code, NULL, errorbuf, 0, NULL);
rc = -1;
@@ -713,10 +712,6 @@ op_shared_search (Slapi_PBlock *pb, int send_result)
curr_search_count = -1;
} else {
curr_search_count = pnentries;
- /* no more entries, but at least another backend */
- if (pagedresults_set_current_be(pb->pb_conn, next_be, pr_idx) < 0) {
- goto free_and_return;
- }
}
estimate = 0;
} else {
@@ -731,12 +726,20 @@ op_shared_search (Slapi_PBlock *pb, int send_result)
pagedresults_set_search_result_set_size_estimate(pb->pb_conn,
operation,
estimate, pr_idx);
- next_be = NULL; /* to break the loop */
- if (curr_search_count == -1) {
+ if (PAGEDRESULTS_SEARCH_END == pr_stat) {
pagedresults_lock(pb->pb_conn, pr_idx);
slapi_pblock_set(pb, SLAPI_SEARCH_RESULT_SET, NULL);
pagedresults_free_one(pb->pb_conn, operation, pr_idx);
pagedresults_unlock(pb->pb_conn, pr_idx);
+ if (next_be) {
+ /* no more entries, but at least another backend */
+ if (pagedresults_set_current_be(pb->pb_conn, next_be, pr_idx) < 0) {
+ goto free_and_return;
+ }
+ }
+ next_be = NULL; /* to break the loop */
+ } else if (PAGEDRESULTS_PAGE_END == pr_stat) {
+ next_be = NULL; /* to break the loop */
}
} else {
/* be_suffix null means that we are searching the default backend
diff --git a/ldap/servers/slapd/pagedresults.c b/ldap/servers/slapd/pagedresults.c
index edd76c628..d58970864 100644
--- a/ldap/servers/slapd/pagedresults.c
+++ b/ldap/servers/slapd/pagedresults.c
@@ -136,6 +136,7 @@ pagedresults_parse_control_value( Slapi_PBlock *pb,
}
conn->c_pagedresults.prl_count++;
} else {
+ PagedResults *prp = NULL;
/* Repeated paged results request.
* PagedResults is already allocated. */
char *ptr = slapi_ch_malloc(cookie.bv_len + 1);
@@ -143,6 +144,10 @@ pagedresults_parse_control_value( Slapi_PBlock *pb,
*(ptr+cookie.bv_len) = '\0';
*index = strtol(ptr, NULL, 10);
slapi_ch_free_string(&ptr);
+ prp = conn->c_pagedresults.prl_list + *index;
+ if (!(prp->pr_search_result_set)) { /* freed and reused for the next backend. */
+ conn->c_pagedresults.prl_count++;
+ }
}
/* reset sizelimit */
op->o_pagedresults_sizelimit = -1;
| 0 |
12fbf8f44ef2aac73c9b516097159c948fd01093
|
389ds/389-ds-base
|
Add new sync wizard help pages. Alter text of repl4 (summary) wizard page.
|
commit 12fbf8f44ef2aac73c9b516097159c948fd01093
Author: Thomas Lackey <[email protected]>
Date: Tue Apr 5 00:23:18 2005 +0000
Add new sync wizard help pages. Alter text of repl4 (summary) wizard page.
diff --git a/ldap/docs/dirhlp/help/configtab_synchronization1.htm b/ldap/docs/dirhlp/help/configtab_synchronization1.htm
new file mode 100644
index 000000000..5446d6a92
--- /dev/null
+++ b/ldap/docs/dirhlp/help/configtab_synchronization1.htm
@@ -0,0 +1,147 @@
+<html>
+
+
+<!--This html file is XHTML complaint, as set forth in the
+w3c recommendations except for the following:
+Lists work as they do in older versions on HTML and not as
+directed in XHTML.
+The <a name=" "> tags have targets that use spaces. -->
+
+
+<head>
+<meta name="keywords" content="e-commerce, ecommerce, Internet software, e-commerce applications, electronic commerce, ebusiness, e-business, enterprise software, net economy, software, ecommerce solutions, e-commerce services, netscape, marketplace, digital marketplace, Red Hat, Fedora" />
+
+<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
+<meta name="templatebase" content="Authored in FrameMaker. Converted to HTML in WebWorks Publisher. manual wdt 1.6" />
+<meta name="LASTUPDATED" content="04/29/03 15:35:33" />
+<title>Directory Server Help: Synchronization Summary</title>
+
+
+<!--The following is a javascript which determines whether the client
+is on a Windows machine, or is on another type of operating system. Once
+the operating system is determined, either a windows or other operating
+system cascading style sheet is used. -->
+<script type="text/JavaScript" src="/manual/en/slapd/help/sniffer.js">
+
+</script>
+
+
+</head>
+
+
+
+
+<body text="#000000" link="#006666" vlink="#006666" alink="#333366" bgcolor="#FFFFFF">
+
+<!--maincontent defines everything between the body tags -->
+<!--start maincontent-->
+
+<!--navigationcontent defines the top row of links and the banner -->
+<!--start navigationcontent-->
+
+<table border="0" cellspacing="0" cellpadding="0" width="100%">
+<tr>
+<td><table border="0" cellspacing="0" cellpadding="0">
+<tr>
+<td valign="bottom" width="67">
+</td>
+<td valign="middle">
+<span class="product">Directory Server</span>
+<span class="booktitle">Console Help</span>
+</td>
+</tr>
+</table>
+</td>
+</tr>
+
+<tr>
+<td>
+<hr size="1" noshade="noshade" />
+
+
+
+
+
+
+
+
+<span class="navigation">
+<!-- BEGIN DOC CONTROLLER --
+<a style="text-decoration: none; color:#006666" href="/manual/en/slapd/index.htm">
+DocHome
+</a>
+-- END DOC CONTROLLER -->
+</span>
+
+
+
+
+
+</td>
+</tr>
+</table>
+
+<!--end navigationcontent-->
+<!--bookcontent defines the actual content of the file, sans headers and footers --><!--start bookcontent-->
+<blockquote><br>
+ <p class="h1">
+ <a name="28816"> </a><a name="Replication Summary"> </a>Synchronization
+Summary
+ </p>
+ <p class="text">
+ <a name="28818"> </a>You use the synchronization agreement Summary
+tab to view status or change the name of the synchronization agreement.
+ </p>
+ <p class="text">
+ <a name="28819"> </a><b>Description. </b>Contains the text
+description of the synchronization agreement. </p>
+ <p class="text">
+ <a name="28820"> </a><b>General. </b>Displays information about:
+ </p>
+ <ul>
+ <li>
+Supplier—The name of the supplier server in the agreement.
+ <a name="28821"> </a><img src="/manual/en/slapd/help/pixel.gif"
+ align="top" height="22" alt="">
+ </li>
+ <li>
+Consumer—The name of the Windows server in the agreement.
+ <a name="28822"> </a><img src="/manual/en/slapd/help/pixel.gif"
+ align="top" height="22" alt=""></li>
+ <li>Windows Subtree—The Windows subtree synchronized in the
+agreement.</li>
+ <li>DS Subtree—The Directory Server subtree synchronized in the
+agreement.</li>
+ <li>
+Replicated subtree—The Directory Server suffix synchronized in the
+agreement.
+ <a name="28823"> </a><img src="/manual/en/slapd/help/pixel.gif"
+ align="top" height="22" alt="">
+ </li>
+ </ul>
+ <p class="text">
+ <a name="28824"> </a><b>Status. </b>This area displays information
+about the synchronization agreement, including the number of the last
+change sent to the consumer server, current status of the
+synchronization agreement, and the synchronization history.
+ </p>
+</blockquote>
+<!--end bookcontent-->
+<!--footercontent defines the bottom navigation and the copyright. It also includes
+the revision date--><!--start footercontent-->
+<br>
+<br>
+<span class="navigation">
+<a style="text-decoration: none; color: rgb(0, 102, 102);"
+ href="/manual/en/slapd/index.htm">DocHome
+</a></span>
+
+<hr noshade="noshade" size="1">
+<p class="copy">© 2001 Sun Microsystems, Inc. Portions copyright
+1999, 2002-2004 Netscape Communications Corporation, 2005 Red Hat, Inc.
+All rights reserved.</p>
+<br>
+<p class="update">Last Updated <b>April 1, 2005</b></p>
+<!--end footercontent--><!--end maincontent-->
+</body>
+</html>
diff --git a/ldap/docs/dirhlp/help/configtab_synchronization2.htm b/ldap/docs/dirhlp/help/configtab_synchronization2.htm
new file mode 100644
index 000000000..0bb958c72
--- /dev/null
+++ b/ldap/docs/dirhlp/help/configtab_synchronization2.htm
@@ -0,0 +1,126 @@
+<html>
+
+
+<!--This html file is XHTML complaint, as set forth in the
+w3c recommendations except for the following:
+Lists work as they do in older versions on HTML and not as
+directed in XHTML.
+The <a name=" "> tags have targets that use spaces. -->
+
+
+<head>
+<meta name="keywords" content="e-commerce, ecommerce, Internet software, e-commerce applications, electronic commerce, ebusiness, e-business, enterprise software, net economy, software, ecommerce solutions, e-commerce services, netscape, marketplace, digital marketplace, Red Hat, Fedora" />
+
+<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
+<meta name="templatebase" content="Authored in FrameMaker. Converted to HTML in WebWorks Publisher. manual wdt 1.6" />
+<meta name="LASTUPDATED" content="04/29/03 15:35:33" />
+<title>Directory Server Help: Synchronization Schedule</title>
+
+
+<!--The following is a javascript which determines whether the client
+is on a Windows machine, or is on another type of operating system. Once
+the operating system is determined, either a windows or other operating
+system cascading style sheet is used. -->
+<script type="text/JavaScript" src="/manual/en/slapd/help/sniffer.js">
+
+</script>
+
+
+</head>
+
+
+
+
+<body text="#000000" link="#006666" vlink="#006666" alink="#333366" bgcolor="#FFFFFF">
+
+<!--maincontent defines everything between the body tags -->
+<!--start maincontent-->
+
+<!--navigationcontent defines the top row of links and the banner -->
+<!--start navigationcontent-->
+
+<table border="0" cellspacing="0" cellpadding="0" width="100%">
+<tr>
+<td><table border="0" cellspacing="0" cellpadding="0">
+<tr>
+<td valign="bottom" width="67">
+</td>
+<td valign="middle">
+<span class="product">Directory Server</span>
+<span class="booktitle">Console Help</span>
+</td>
+</tr>
+</table>
+</td>
+</tr>
+
+<tr>
+<td>
+<hr size="1" noshade="noshade" />
+
+
+
+
+
+
+
+
+<span class="navigation">
+<!-- BEGIN DOC CONTROLLER --
+<a style="text-decoration: none; color:#006666" href="/manual/en/slapd/index.htm">
+DocHome
+</a>
+-- END DOC CONTROLLER -->
+</span>
+
+
+
+
+
+</td>
+</tr>
+</table>
+
+<!--end navigationcontent--><!--bookcontent defines the actual content of the file, sans headers and footers --><!--start bookcontent-->
+<blockquote><br>
+ <p class="h1">
+ <a name="28832"> </a><a name="Replication Schedule"> </a>Synchronization
+Schedule
+ </p>
+ <p class="text">
+ <a name="28834"> </a>This tab shows the synchronization schedule for
+a database, which is always in sync at a set interval. Changes to the
+schedulecannot be saved.<br>
+ </p>
+ <p class="text">
+ <a name="28835"> </a><b>Always Keep Directories in Sync. </b>The
+Directory Server and Windows peer server(s) are always kept in sync at
+5 minute intervals.<br>
+ </p>
+ <p class="text">
+ <a name="28836"> </a><b>Sync on the following days. </b>This option
+is not available for synchronization.
+ </p>
+ <p class="text">
+ <a name="28837"> </a><b>Replication will take place between.</b>
+This option is not available for synchronization. </p>
+</blockquote>
+<!--end bookcontent-->
+<!--footercontent defines the bottom navigation and the copyright. It also includes
+the revision date--><!--start footercontent-->
+<br>
+<br>
+<span class="navigation">
+<a style="text-decoration: none; color: rgb(0, 102, 102);"
+ href="/manual/en/slapd/index.htm">DocHome
+</a></span>
+
+<hr noshade="noshade" size="1">
+<p class="copy">© 2001 Sun Microsystems, Inc. Portions copyright
+1999, 2002-2004 Netscape Communications Corporation, 2005 Red Hat, Inc.
+All rights reserved.</p>
+<br>
+<p class="update">Last Updated <b>April 1, 2005</b></p>
+<!--end footercontent--><!--end maincontent-->
+</body>
+</html>
diff --git a/ldap/docs/dirhlp/help/configtab_synchronization3.htm b/ldap/docs/dirhlp/help/configtab_synchronization3.htm
new file mode 100644
index 000000000..16e50af28
--- /dev/null
+++ b/ldap/docs/dirhlp/help/configtab_synchronization3.htm
@@ -0,0 +1,139 @@
+<html>
+
+
+<!--This html file is XHTML complaint, as set forth in the
+w3c recommendations except for the following:
+Lists work as they do in older versions on HTML and not as
+directed in XHTML.
+The <a name=" "> tags have targets that use spaces. -->
+
+
+<head>
+<meta name="keywords" content="e-commerce, ecommerce, Internet software, e-commerce applications, electronic commerce, ebusiness, e-business, enterprise software, net economy, software, ecommerce solutions, e-commerce services, netscape, marketplace, digital marketplace, Red Hat, Fedora" />
+
+<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
+<meta name="templatebase" content="Authored in FrameMaker. Converted to HTML in WebWorks Publisher. manual wdt 1.6" />
+<meta name="LASTUPDATED" content="04/29/03 15:35:33" />
+<title>Directory Server Help: Synchronization Connection</title>
+
+
+<!--The following is a javascript which determines whether the client
+is on a Windows machine, or is on another type of operating system. Once
+the operating system is determined, either a windows or other operating
+system cascading style sheet is used. -->
+<script type="text/JavaScript" src="/manual/en/slapd/help/sniffer.js">
+
+</script>
+
+
+</head>
+
+
+
+
+<body text="#000000" link="#006666" vlink="#006666" alink="#333366" bgcolor="#FFFFFF">
+
+<!--maincontent defines everything between the body tags -->
+<!--start maincontent-->
+
+<!--navigationcontent defines the top row of links and the banner -->
+<!--start navigationcontent-->
+
+<table border="0" cellspacing="0" cellpadding="0" width="100%">
+<tr>
+<td><table border="0" cellspacing="0" cellpadding="0">
+<tr>
+<td valign="bottom" width="67">
+</td>
+<td valign="middle">
+<span class="product">Directory Server</span>
+<span class="booktitle">Console Help</span>
+</td>
+</tr>
+</table>
+</td>
+</tr>
+
+<tr>
+<td>
+<hr size="1" noshade="noshade" />
+
+
+
+
+
+
+
+
+<span class="navigation">
+<!-- BEGIN DOC CONTROLLER --
+<a style="text-decoration: none; color:#006666" href="/manual/en/slapd/index.htm">
+DocHome
+</a>
+-- END DOC CONTROLLER -->
+</span>
+
+
+
+
+
+</td>
+</tr>
+</table>
+
+<!--end navigationcontent-->
+<!--bookcontent defines the actual content of the file, sans headers and footers --><!--start bookcontent-->
+<blockquote><br>
+ <p class="h1">
+ <a name="28845"> </a><a name="Replication Connection"> </a>Synchronization
+Connection
+ </p>
+ <p class="text">
+ <a name="28939"> </a>Use the Connection tab to display the type of
+connection used by your servers during synchronization. You can use
+this tab to modify the user bind name and password. You cannot change
+the connection type since this would require changing the port number.
+To change the connection type, re-create the synchronization agreement.
+ </p>
+ <p class="text">
+ <a name="28848"> </a><b>Using Encrypted SSL Connection. </b>When
+selected, specifies that the supplier and consumer servers use SSL for
+secure communication.
+ </p>
+ <p class="text">
+ <a name="28849"> </a><b>SSL Client Authentication. </b>Client
+authentication is no used for synchronization; this option is ignored
+if selected.
+ </p>
+ <p class="text"><a name="28853"> </a>
+ <b>Simple Authentication. </b>This is the default authentication
+type for synchronization.
+ </p>
+ <p class="text">
+ <a name="28854"> </a><b>Bind As. </b>You can update the bind DN in
+the Bind As text box.
+ </p>
+ <p class="text">
+ <a name="28855"> </a><b>Password. </b>You can update the password
+corresponding to the bind DN in the Password field.
+ </p>
+</blockquote>
+<!--end bookcontent-->
+<!--footercontent defines the bottom navigation and the copyright. It also includes
+the revision date--><!--start footercontent-->
+<br>
+<br>
+<span class="navigation">
+<a style="text-decoration: none; color: rgb(0, 102, 102);"
+ href="/manual/en/slapd/index.htm">DocHome
+</a></span>
+
+<hr noshade="noshade" size="1">
+<p class="copy">© 2001 Sun Microsystems, Inc. Portions copyright
+1999, 2002-2004 Netscape Communications Corporation, 2005 Red Hat, Inc.
+All rights reserved.</p>
+<br>
+<p class="update">Last Updated <b>April 1, 2005</b></p>
+<!--end footercontent--><!--end maincontent-->
+</body>
+</html>
diff --git a/ldap/docs/dirhlp/help/replication_wizard4.htm b/ldap/docs/dirhlp/help/replication_wizard4.htm
index 8d6aa9acd..772f9c2b1 100644
--- a/ldap/docs/dirhlp/help/replication_wizard4.htm
+++ b/ldap/docs/dirhlp/help/replication_wizard4.htm
@@ -92,17 +92,19 @@ DocHome
<a name="28828"> </a>
<a name="Summary Dialog"> </a>
Summary Dialog
-</p>
-
-<p class="text">
-<a name="28830"> </a>
-This dialog box provides a summary of the information you provided to the replication agreement wizard. Make sure that the information on the summary dialog box is correct. If any information is incorrect, click Back to step back through the wizard and change the information. When you are finished, click Done.
-</p>
-<p class="text">
-<a name="28831"> </a>
-The server creates the replication agreement and dismisses the replication wizard. If you selected "Initialize Consumer Now" in the Initialize Consumer dialog box, the consumer is initialized immediately.
-</p>
-
+ </p>
+ <p class="text">
+ <a name="28830"> </a>This dialog box provides a summary of the
+information you provided to the replication/synchronization agreement
+wizard. Make sure that the information on the summary dialog box is
+correct. If any information is incorrect, click Back to step back
+through the wizard and change the information. When you are finished,
+click Done. <br>
+ </p>
+ <p class="text">If you selected "Initialize Consumer Now" in the
+Initialize Consumer dialog box, the consumer is initialized
+immediately. Synchronization begins immediately.<br>
+ </p>
</blockquote>
<!--end bookcontent-->
<!--footercontent defines the bottom navigation and the copyright. It also includes
diff --git a/ldap/docs/dirhlp/help/replication_wizard6.htm b/ldap/docs/dirhlp/help/replication_wizard6.htm
new file mode 100644
index 000000000..5e18b1972
--- /dev/null
+++ b/ldap/docs/dirhlp/help/replication_wizard6.htm
@@ -0,0 +1,146 @@
+<html>
+
+
+<!--This html file is XHTML complaint, as set forth in the
+w3c recommendations except for the following:
+Lists work as they do in older versions on HTML and not as
+directed in XHTML.
+The <a name=" "> tags have targets that use spaces. -->
+
+
+<head>
+<meta name="keywords" content="e-commerce, ecommerce, Internet software, e-commerce applications, electronic commerce, ebusiness, e-business, enterprise software, net economy, software, ecommerce solutions, e-commerce services, netscape, marketplace, digital marketplace, Red Hat, Fedora" />
+
+<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
+<meta name="templatebase" content="Authored in FrameMaker. Converted to HTML in WebWorks Publisher. manual wdt 1.6" />
+<meta name="LASTUPDATED" content="04/29/03 15:35:33" />
+<title>Directory Server Help: Fractional Dialog</title>
+
+
+<!--The following is a javascript which determines whether the client
+is on a Windows machine, or is on another type of operating system. Once
+the operating system is determined, either a windows or other operating
+system cascading style sheet is used. -->
+<script type="text/JavaScript" src="/manual/en/slapd/help/sniffer.js">
+
+</script>
+
+
+</head>
+
+
+
+
+<body text="#000000" link="#006666" vlink="#006666" alink="#333366" bgcolor="#FFFFFF">
+
+<!--maincontent defines everything between the body tags -->
+<!--start maincontent-->
+
+<!--navigationcontent defines the top row of links and the banner -->
+<!--start navigationcontent-->
+
+<table border="0" cellspacing="0" cellpadding="0" width="100%">
+<tr>
+<td><table border="0" cellspacing="0" cellpadding="0">
+<tr>
+<td valign="bottom" width="67">
+</td>
+<td valign="middle">
+<span class="product">Directory Server</span>
+<span class="booktitle">Console Help</span>
+</td>
+</tr>
+</table>
+</td>
+</tr>
+
+<tr>
+<td>
+<hr size="1" noshade="noshade" />
+
+
+
+
+
+
+
+
+<span class="navigation">
+<!-- BEGIN DOC CONTROLLER --
+<a style="text-decoration: none; color:#006666" href="/manual/en/slapd/index.htm">
+DocHome
+</a>
+-- END DOC CONTROLLER -->
+</span>
+
+
+
+
+
+</td>
+</tr>
+</table>
+
+<!--end navigationcontent-->
+<!--bookcontent defines the actual content of the file, sans headers and footers --><!--start bookcontent-->
+<blockquote><br>
+ <p class="h1">
+ <a name="28780"> </a><a name="Schedule Replication"> </a>Replicated
+Attributes<br>
+ </p>
+ <p class="text">
+ <a name="28782"> </a>This screen will identify any attributes that
+will not be replicated to the consumer, called <span
+ style="font-style: italic;">fractional replication</span>. Fractional
+replication is a way of protecting sensitive information from less
+secure machines or limiting the amount of information transmitted over
+slow connections. By default, all attributes should be in the
+"Included" column on the right, meaning all server attribute are
+replicated.<br>
+ </p>
+ <p class="text"><span style="font-weight: bold;">Enable Fractional
+Replication.</span> Check the check box to enable fractional
+replication. <br>
+ </p>
+ <p class="text">
+ <a name="28783"> </a><b>Add All. </b>If any or all attributes have
+been moved to the "Excluded" column on the left, selecting this button
+will move them back to the "Included" column. This button is grayed out
+unless the "Enable Fractional Replication" checkbox is selected.
+ </p>
+ <p class="text">
+ <a name="28784"> </a><b>Add ->. </b>This button will move
+the highlight entry/entries from the "Excluded" column on the left to
+the "Included" column on the right. This button is grayed out unless
+the "Enable Fractional Replication" checkbox is selected.
+ </p>
+ <p class="text">
+ <a name="28785"> </a><b><- Remove. </b>This button will move the
+highlight entry/entries from the "Included" column on the right to the
+"Excluded" column on the left. This button is grayed out unless the
+"Enable Fractional Replication" checkbox is selected.</p>
+ <p class="text"><b>Remove All. </b>This button will move all the
+attributes from the "Included" column to the "Excluded" column. This
+button is grayed out unless the "Enable Fractional Replication"
+checkbox is selected.
+ </p>
+</blockquote>
+<!--end bookcontent-->
+<!--footercontent defines the bottom navigation and the copyright. It also includes
+the revision date--><!--start footercontent-->
+<br>
+<br>
+<span class="navigation">
+<a style="text-decoration: none; color: rgb(0, 102, 102);"
+ href="/manual/en/slapd/index.htm">DocHome
+</a></span>
+
+<hr noshade="noshade" size="1">
+<p class="copy">© 2001 Sun Microsystems, Inc. Portions copyright
+1999, 2002-2004 Netscape Communications Corporation, 2005 Red Hat, Inc.
+All rights reserved.</p>
+<br>
+<p class="update">Last Updated <b>April 1, 2005</b></p>
+<!--end footercontent--><!--end maincontent-->
+</body>
+</html>
diff --git a/ldap/docs/dirhlp/help/synchronization_wizard1.htm b/ldap/docs/dirhlp/help/synchronization_wizard1.htm
new file mode 100644
index 000000000..79b00d746
--- /dev/null
+++ b/ldap/docs/dirhlp/help/synchronization_wizard1.htm
@@ -0,0 +1,122 @@
+<html>
+
+
+<!--This html file is XHTML complaint, as set forth in the
+w3c recommendations except for the following:
+Lists work as they do in older versions on HTML and not as
+directed in XHTML.
+The <a name=" "> tags have targets that use spaces. -->
+
+
+<head>
+<meta name="keywords" content="e-commerce, ecommerce, Internet software, e-commerce applications, electronic commerce, ebusiness, e-business, enterprise software, net economy, software, ecommerce solutions, e-commerce services, netscape, marketplace, digital marketplace, Red Hat, Fedora" />
+
+<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
+<meta name="templatebase" content="Authored in FrameMaker. Converted to HTML in WebWorks Publisher. manual wdt 1.6" />
+<meta name="LASTUPDATED" content="04/29/03 15:35:33" />
+<title>Directory Server Help: Synchronization Agreement Name</title>
+
+
+<!--The following is a javascript which determines whether the client
+is on a Windows machine, or is on another type of operating system. Once
+the operating system is determined, either a windows or other operating
+system cascading style sheet is used. -->
+<script type="text/JavaScript" src="/manual/en/slapd/help/sniffer.js">
+
+</script>
+
+
+</head>
+
+
+
+
+<body text="#000000" link="#006666" vlink="#006666" alink="#333366" bgcolor="#FFFFFF">
+
+<!--maincontent defines everything between the body tags -->
+<!--start maincontent-->
+
+<!--navigationcontent defines the top row of links and the banner -->
+<!--start navigationcontent-->
+
+<table border="0" cellspacing="0" cellpadding="0" width="100%">
+<tr>
+<td><table border="0" cellspacing="0" cellpadding="0">
+<tr>
+<td valign="bottom" width="67">
+</td>
+<td valign="middle">
+<span class="product">Directory Server</span>
+<span class="booktitle">Console Help</span>
+</td>
+</tr>
+</table>
+</td>
+</tr>
+
+<tr>
+<td>
+<hr size="1" noshade="noshade" />
+
+
+
+
+
+
+
+
+<span class="navigation">
+<!-- BEGIN DOC CONTROLLER --
+<a style="text-decoration: none; color:#006666" href="/manual/en/slapd/index.htm">
+DocHome
+</a>
+-- END DOC CONTROLLER -->
+</span>
+
+
+
+
+
+</td>
+</tr>
+</table>
+
+<!--end navigationcontent-->
+<!--bookcontent defines the actual content of the file, sans headers and footers --><!--start bookcontent-->
+<blockquote><br>
+ <p class="h1">
+ <a name="28839"> </a><a name="Replication Agreement Name"> </a>Synchronization
+Agreement Name
+ </p>
+ <p class="text">
+ <a name="28841"> </a>Use this dialog box to name and describe your
+synchronization agreement.
+ </p>
+ <p class="text">
+ <a name="28842"> </a><b>Name. </b>Enter a meaningful name for the
+synchronization agreement. This field is required.
+ </p>
+ <p class="text">
+ <a name="28843"> </a><b>Description. </b>Enter a brief description
+of your synchronization agreement. This field is optional.
+ </p>
+</blockquote>
+<!--end bookcontent-->
+<!--footercontent defines the bottom navigation and the copyright. It also includes
+the revision date--><!--start footercontent-->
+<br>
+<br>
+<span class="navigation">
+<a style="text-decoration: none; color: rgb(0, 102, 102);"
+ href="/manual/en/slapd/index.htm">DocHome
+</a></span>
+
+<hr noshade="noshade" size="1">
+<p class="copy">© 2001 Sun Microsystems, Inc. Portions copyright
+1999, 2002-2004 Netscape Communications Corporation, 2005 Red Hat Inc.
+All rights reserved.</p>
+<br>
+<p class="update">Last Updated <b>April 1, 2005</b></p>
+<!--end footercontent--><!--end maincontent-->
+</body>
+</html>
diff --git a/ldap/docs/dirhlp/help/synchronization_wizard2.htm b/ldap/docs/dirhlp/help/synchronization_wizard2.htm
new file mode 100644
index 000000000..909e4fe94
--- /dev/null
+++ b/ldap/docs/dirhlp/help/synchronization_wizard2.htm
@@ -0,0 +1,177 @@
+<html>
+
+
+<!--This html file is XHTML complaint, as set forth in the
+w3c recommendations except for the following:
+Lists work as they do in older versions on HTML and not as
+directed in XHTML.
+The <a name=" "> tags have targets that use spaces. -->
+
+
+<head>
+<meta name="keywords" content="e-commerce, ecommerce, Internet software, e-commerce applications, electronic commerce, ebusiness, e-business, enterprise software, net economy, software, ecommerce solutions, e-commerce services, netscape, marketplace, digital marketplace, Red Hat, Fedora" />
+
+<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
+<meta name="templatebase" content="Authored in FrameMaker. Converted to HTML in WebWorks Publisher. manual wdt 1.6" />
+<meta name="LASTUPDATED" content="04/29/03 15:35:33" />
+<title>Directory Server Help: Synchronization Source and Destination</title>
+
+
+<!--The following is a javascript which determines whether the client
+is on a Windows machine, or is on another type of operating system. Once
+the operating system is determined, either a windows or other operating
+system cascading style sheet is used. -->
+<script type="text/JavaScript" src="/manual/en/slapd/help/sniffer.js">
+
+</script>
+
+
+</head>
+
+
+
+
+<body text="#000000" link="#006666" vlink="#006666" alink="#333366" bgcolor="#FFFFFF">
+
+<!--maincontent defines everything between the body tags -->
+<!--start maincontent-->
+
+<!--navigationcontent defines the top row of links and the banner -->
+<!--start navigationcontent-->
+
+<table border="0" cellspacing="0" cellpadding="0" width="100%">
+<tr>
+<td><table border="0" cellspacing="0" cellpadding="0">
+<tr>
+<td valign="bottom" width="67">
+</td>
+<td valign="middle">
+<span class="product">Directory Server</span>
+<span class="booktitle">Console Help</span>
+</td>
+</tr>
+</table>
+</td>
+</tr>
+
+<tr>
+<td>
+<hr size="1" noshade="noshade" />
+
+
+
+
+
+
+
+
+<span class="navigation">
+<!-- BEGIN DOC CONTROLLER --
+<a style="text-decoration: none; color:#006666" href="/manual/en/slapd/index.htm">
+DocHome
+</a>
+-- END DOC CONTROLLER -->
+</span>
+
+
+
+
+
+</td>
+</tr>
+</table>
+
+<!--end navigationcontent-->
+<!--bookcontent defines the actual content of the file, sans headers and footers --><!--start bookcontent-->
+<blockquote><br>
+ <p class="h1"> <a name="28757"> </a><a name="Source and Destination">
+ </a>Source and Destination </p>
+ <p class="text"> <a name="28759"> </a>Use this dialog box to
+identify the Windows
+synchronization peer with which you will synchronize directory entries.
+In addition, this dialog box allows you to define whether SSL is used
+for the connection and the content you want synchronized. </p>
+ <p class="text"> <a name="28760"> </a><b>Supplier. </b>This field
+contains a static
+display of the name and port number of the Directory Server in this
+agreement. </p>
+ <p class="text"> <a name="28761"> </a><b>Windows Domain Name. </b>This
+is the name
+of the Windows domain that contains the Windows subtree which you are
+synchronizing with the Directory Server subtree. For example: <span
+ style="font-family: courier new,courier,monospace;">example.com</span><br>
+ </p>
+ <p class="text"> <span style="font-weight: bold;">Sync New Windows
+Users</span><b>. </b>Check
+this checkbox if you want to add new Windows users automatically to the
+Directory Server.<br>
+ </p>
+ <p class="text"><span style="font-weight: bold;">Windows Subtree</span><b>.
+ </b>This is the Windows subtree which you are synchronizing with the
+Directory Server subtree. If the subtree which you are synchronizing is
+ <span style="font-family: courier new,courier,monospace;">ou=People</span>,
+than the Windows subtree is set by default to <span
+ style="font-family: courier new,courier,monospace;">cn=Users</span>,
+and
+the remaining information is supplied by the Windows domain information.<br>
+ </p>
+ <p class="text"><span style="font-weight: bold;">DS Subtree</span><b>.
+ </b>The Directory Server subtree that is synchronized. This is set by
+default depending on the database that you have selected in the
+agreement.<br>
+ </p>
+ <p class="text"><span style="font-weight: bold;">Domain Controller
+Host</span><b>. </b>This is the hostname of the domain controller in
+the
+Windows domain you wish to use for sync operations. This name must be
+resolvable and, if SSL is being used, must match the CN of the
+certificate issued to the domain controller. That is normally the fully
+qualified DNS name. For example: <span
+ style="font-family: courier new,courier,monospace;">dc01.example.com</span></p>
+ <span style="font-family: courier new,courier,monospace;"></span>
+ <p class="text"> </p>
+ <p class="text"><span style="font-weight: bold;">Port Num</span><b>. </b>The
+Windows domain controller port number. By default, this is 389; this is
+automatically reset to 636 if you check the "Using encrypted SSL
+connection" checkbox (even if you had previously set a different
+value). </p>
+ <p class="text"> <a name="28763"> </a><b>Using Encrypted SSL
+Connection. </b>If you
+want the Directory Server and Windows servers to use SSL for secure
+communication, select this checkbox. To use this option, you must have
+first configured your servers to use SSL. It is strongly recommended
+that you use an SSL connection. Passwords will not be synchronized if
+you do not enable SSL.<br>
+ </p>
+ <a name="28769"></a><b>Bind As. </b>Enter the supplier bind
+DN defined on the Windows server in the Bind As text box. This must be
+a valid DN.
+ <p class="text"> <a name="28770"> </a><b>Password. </b>Enter the
+supplier DN
+password in the Password field. </p>
+ <p class="text"> <a name="28772"> </a>When you are creating a new
+synchronization
+agreement from the Replication folder, you can choose the subtree you
+want to synchronize. If you are creating a new synchronization
+agreement from
+a database under the Replication folder, the subtree is the same as
+that contained by the database and cannot be changed. </p>
+</blockquote>
+<!--end bookcontent-->
+<!--footercontent defines the bottom navigation and the copyright. It also includes
+the revision date--><!--start footercontent--><br>
+<br>
+<span class="navigation">
+<a style="text-decoration: none; color: rgb(0, 102, 102);"
+ href="/manual/en/slapd/index.htm">DocHome
+</a></span>
+<hr noshade="noshade" size="1">
+<p class="copy">© 2001 Sun Microsystems, Inc. Portions copyright
+1999, 2002-2004 Netscape Communications Corporation, 2005 Red Hat, Inc.
+All rights
+reserved.</p>
+<br>
+<p class="update">Last Updated <b>April 1, 2005</b></p>
+<!--end footercontent--><!--end maincontent-->
+</body>
+</html>
diff --git a/ldap/docs/dirhlp/help/synchronization_wizard3.htm b/ldap/docs/dirhlp/help/synchronization_wizard3.htm
new file mode 100644
index 000000000..f1ce6a794
--- /dev/null
+++ b/ldap/docs/dirhlp/help/synchronization_wizard3.htm
@@ -0,0 +1,117 @@
+<html>
+
+
+<!--This html file is XHTML complaint, as set forth in the
+w3c recommendations except for the following:
+Lists work as they do in older versions on HTML and not as
+directed in XHTML.
+The <a name=" "> tags have targets that use spaces. -->
+
+
+<head>
+<meta name="keywords" content="e-commerce, ecommerce, Internet software, e-commerce applications, electronic commerce, ebusiness, e-business, enterprise software, net economy, software, ecommerce solutions, e-commerce services, netscape, marketplace, digital marketplace, Red Hat, Fedora" />
+
+<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
+<meta name="templatebase" content="Authored in FrameMaker. Converted to HTML in WebWorks Publisher. manual wdt 1.6" />
+<meta name="LASTUPDATED" content="04/29/03 15:35:33" />
+<title>Directory Server Help: Synchronization Summary</title>
+
+
+<!--The following is a javascript which determines whether the client
+is on a Windows machine, or is on another type of operating system. Once
+the operating system is determined, either a windows or other operating
+system cascading style sheet is used. -->
+<script type="text/JavaScript" src="/manual/en/slapd/help/sniffer.js">
+
+</script>
+
+
+</head>
+
+
+
+
+<body text="#000000" link="#006666" vlink="#006666" alink="#333366" bgcolor="#FFFFFF">
+
+<!--maincontent defines everything between the body tags -->
+<!--start maincontent-->
+
+<!--navigationcontent defines the top row of links and the banner -->
+<!--start navigationcontent-->
+
+<table border="0" cellspacing="0" cellpadding="0" width="100%">
+<tr>
+<td><table border="0" cellspacing="0" cellpadding="0">
+<tr>
+<td valign="bottom" width="67">
+</td>
+<td valign="middle">
+<span class="product">Directory Server</span>
+<span class="booktitle">Console Help</span>
+</td>
+</tr>
+</table>
+</td>
+</tr>
+
+<tr>
+<td>
+<hr size="1" noshade="noshade" />
+
+
+
+
+
+
+
+
+<span class="navigation">
+<!-- BEGIN DOC CONTROLLER --
+<a style="text-decoration: none; color:#006666" href="/manual/en/slapd/index.htm">
+DocHome
+</a>
+-- END DOC CONTROLLER -->
+</span>
+
+
+
+
+
+</td>
+</tr>
+</table>
+
+<!--end navigationcontent-->
+<!--bookcontent defines the actual content of the file, sans headers and footers --><!--start bookcontent-->
+<blockquote><br>
+ <p class="h1">
+ <a name="28828"> </a><a name="Summary Dialog"> </a>
+Summary Dialog
+ </p>
+ <p class="text">
+ <a name="28830"> </a>This dialog box provides a summary of the
+information you provided to the synchronization agreement wizard. Make
+sure that the information on the summary dialog box is correct. If any
+information is incorrect, click Back to step back through the wizard
+and change the information. When you are finished, click Done. </p>
+ <p class="text">
+ <a name="28831"> </a>The server creates the synchronization
+agreement and dismisses the synchronization wizard. Synchronization
+begins immediately. </p>
+</blockquote>
+<br>
+<br>
+<span class="navigation">
+<a style="text-decoration: none; color: rgb(0, 102, 102);"
+ href="/manual/en/slapd/index.htm">DocHome
+</a></span>
+
+<hr noshade="noshade" size="1">
+<p class="copy">© 2001 Sun Microsystems, Inc. Portions copyright
+1999, 2002-2004 Netscape Communications Corporation, Red Hat, Inc. All
+rights reserved.</p>
+<br>
+<p class="update">Last Updated <b>April 1, 2005</b></p>
+<!--end footercontent--><!--end maincontent-->
+</body>
+</html>
| 0 |
b329cc4830d512c1781326ef19da6d7fb389ccb6
|
389ds/389-ds-base
|
Issue 5561 - Nightly tests are failing
Bug Description:
We use ubuntu-latest as our runner image for testing in containers.
Recently there was a switch from 20.04 to 22.04 that caused test failures.
Fix Description:
* Pin runner image to 22.04
* Remove cgroups mount from docker cmd since ubuntu-22.04 now supports cgroupsv2
Fixes: https://github.com/389ds/389-ds-base/issues/5561
Reviewed-by: @droideck (Thanks!)
|
commit b329cc4830d512c1781326ef19da6d7fb389ccb6
Author: Viktor Ashirov <[email protected]>
Date: Mon Dec 12 17:51:20 2022 +0100
Issue 5561 - Nightly tests are failing
Bug Description:
We use ubuntu-latest as our runner image for testing in containers.
Recently there was a switch from 20.04 to 22.04 that caused test failures.
Fix Description:
* Pin runner image to 22.04
* Remove cgroups mount from docker cmd since ubuntu-22.04 now supports cgroupsv2
Fixes: https://github.com/389ds/389-ds-base/issues/5561
Reviewed-by: @droideck (Thanks!)
diff --git a/.github/workflows/pytest.yml b/.github/workflows/pytest.yml
index ed9dcb9e0..eb45782de 100644
--- a/.github/workflows/pytest.yml
+++ b/.github/workflows/pytest.yml
@@ -19,7 +19,7 @@ on:
jobs:
build:
name: Build
- runs-on: ubuntu-latest
+ runs-on: ubuntu-22.04
container:
image: quay.io/389ds/ci-images:test
outputs:
@@ -49,7 +49,7 @@ jobs:
test:
name: Test
- runs-on: ubuntu-latest
+ runs-on: ubuntu-22.04
needs: build
strategy:
fail-fast: false
@@ -84,7 +84,7 @@ jobs:
- name: Run pytest in a container
run: |
set -x
- CID=$(sudo docker run -d -h server.example.com --ulimit core=-1 --cap-add=SYS_PTRACE --privileged --rm --shm-size=4gb -v /sys/fs/cgroup:/sys/fs/cgroup:rw,rslave -v ${PWD}:/workspace quay.io/389ds/ci-images:test)
+ CID=$(sudo docker run -d -h server.example.com --ulimit core=-1 --cap-add=SYS_PTRACE --privileged --rm --shm-size=4gb -v ${PWD}:/workspace quay.io/389ds/ci-images:test)
sudo docker exec $CID sh -c "dnf install -y -v dist/rpms/*rpm"
export PASSWD=$(openssl rand -base64 32)
sudo docker exec $CID sh -c "echo \"${PASSWD}\" | passwd --stdin root"
| 0 |
f1f7ff126def61f2c132241442e78cce0f73f6e2
|
389ds/389-ds-base
|
Issue 4680 - 389ds coredump (@389ds/389-ds-base-nightly) in replica install with CA (#4715)
* Issue 4680 - 389ds coredump (@389ds/389-ds-base-nightly) in replica install with CA
* Issue 4680 - 389ds coredump (@389ds/389-ds-base-nightly) in replica install with CA (Added Thierry's check)
|
commit f1f7ff126def61f2c132241442e78cce0f73f6e2
Author: progier389 <[email protected]>
Date: Fri Apr 2 15:48:50 2021 +0200
Issue 4680 - 389ds coredump (@389ds/389-ds-base-nightly) in replica install with CA (#4715)
* Issue 4680 - 389ds coredump (@389ds/389-ds-base-nightly) in replica install with CA
* Issue 4680 - 389ds coredump (@389ds/389-ds-base-nightly) in replica install with CA (Added Thierry's check)
diff --git a/ldap/servers/plugins/replication/cl5_clcache.c b/ldap/servers/plugins/replication/cl5_clcache.c
index 8480731af..7c34d63a3 100644
--- a/ldap/servers/plugins/replication/cl5_clcache.c
+++ b/ldap/servers/plugins/replication/cl5_clcache.c
@@ -1103,7 +1103,7 @@ clcache_cursor_get(dbi_cursor_t *cursor, CLC_Buffer *buf, dbi_op_t dbop)
* if not sufficient it will be increased again
*/
slapi_ch_free(&bulkdata->data);
- dblayer_bulk_set_buffer(cursor->be, &buf->buf_bulk, buf, WORK_CLC_BUFFER_PAGE_SIZE, DBI_VF_BULK_RECORD);
+ dblayer_bulk_set_buffer(cursor->be, &buf->buf_bulk, buf->buf_bulkdata, WORK_CLC_BUFFER_PAGE_SIZE, DBI_VF_BULK_RECORD);
}
rc = dblayer_cursor_bulkop(cursor, dbop, &buf->buf_key, &buf->buf_bulk);
diff --git a/ldap/servers/slapd/back-ldbm/dbimpl.c b/ldap/servers/slapd/back-ldbm/dbimpl.c
index d2c9a9184..5c4f384df 100644
--- a/ldap/servers/slapd/back-ldbm/dbimpl.c
+++ b/ldap/servers/slapd/back-ldbm/dbimpl.c
@@ -51,7 +51,9 @@ static inline dblayer_private *dblayer_get_priv(Slapi_Backend *be)
static int dblayer_value_set_int(Slapi_Backend *be __attribute__((unused)), dbi_val_t *data,
void *ptr, size_t size, size_t ulen, int flags)
{
- dblayer_value_free(be, data);
+ if (ptr != data->data) {
+ dblayer_value_free(be, data);
+ }
data->flags = flags;
data->data = ptr;
data->size = size;
| 0 |
16445ac913a7e8eff2b48edf76a42e2bab7d6bb1
|
389ds/389-ds-base
|
Ticket #48782 - Make sure that when LDAP_OPT_X_TLS_NEWCTX is set, the value is set to zero.
Description: The attached patch is for the optval issue described above.
Optval is explicitly set to zero, rather than using whatever arbitrary
value is present in optval from the earlier ldap_set_option call.
https://fedorahosted.org/389/ticket/48782
Reviewed by [email protected].
|
commit 16445ac913a7e8eff2b48edf76a42e2bab7d6bb1
Author: Graham Leggett <[email protected]>
Date: Thu Mar 31 02:48:43 2016 +0200
Ticket #48782 - Make sure that when LDAP_OPT_X_TLS_NEWCTX is set, the value is set to zero.
Description: The attached patch is for the optval issue described above.
Optval is explicitly set to zero, rather than using whatever arbitrary
value is present in optval from the earlier ldap_set_option call.
https://fedorahosted.org/389/ticket/48782
Reviewed by [email protected].
diff --git a/ldap/servers/slapd/ldaputil.c b/ldap/servers/slapd/ldaputil.c
index e62d1f221..3851be5c8 100644
--- a/ldap/servers/slapd/ldaputil.c
+++ b/ldap/servers/slapd/ldaputil.c
@@ -605,7 +605,8 @@ setup_ol_tls_conn(LDAP *ld, int clientauth)
/* have to do this last - this creates the new TLS handle and sets/copies
all of the parameters set above into that TLS handle context - note
- that optval is ignored - what matters is that it is not NULL */
+ that optval is zero, meaning create a context for a client */
+ optval = 0;
if ((rc = ldap_set_option(ld, LDAP_OPT_X_TLS_NEWCTX, &optval))) {
slapi_log_error(SLAPI_LOG_FATAL, "setup_ol_tls_conn",
"failed: unable to create new TLS context - %d\n", rc);
| 0 |
47cfac880bcb3f67abf9617addb34cba7efa742b
|
389ds/389-ds-base
|
Issue 49156 - Fix typo in the import
Description: Fix an accidently made typo.
https://pagure.io/389-ds-base/issue/49156
Reviewed by: vashirov (Thanks!)
|
commit 47cfac880bcb3f67abf9617addb34cba7efa742b
Author: Simon Pichugin <[email protected]>
Date: Thu Mar 9 13:52:46 2017 +0100
Issue 49156 - Fix typo in the import
Description: Fix an accidently made typo.
https://pagure.io/389-ds-base/issue/49156
Reviewed by: vashirov (Thanks!)
diff --git a/dirsrvtests/tests/suites/replication/acceptance_test.py b/dirsrvtests/tests/suites/replication/acceptance_test.py
index 501786f9a..5b785f3e2 100644
--- a/dirsrvtests/tests/suites/replication/acceptance_test.py
+++ b/dirsrvtests/tests/suites/replication/acceptance_test.py
@@ -9,7 +9,7 @@
import pytest
from lib389.tasks import *
from lib389.utils import *
-from lib390.topologies import topology_m4 as topo
+from lib389.topologies import topology_m4 as topo
TEST_ENTRY_NAME = 'mmrepl_test'
TEST_ENTRY_DN = 'uid={},{}'.format(TEST_ENTRY_NAME, DEFAULT_SUFFIX)
| 0 |
cbe3d10359fa9099820423da9f7d60d91634dcec
|
389ds/389-ds-base
|
Bug 630094 - (cov#15455) Remove deadcode in attr_index_config()
If the index types (argv[1]) are not specified, attr_index_config()
bails. We can remove some dead code where we check if "argc == 1"
later in the function since that case can never happen.
Additionally, we need to check if argc is 0, or if argv is NULL
before attempting to parse the list of attributes to be indexed.
|
commit cbe3d10359fa9099820423da9f7d60d91634dcec
Author: Nathan Kinder <[email protected]>
Date: Wed Sep 8 15:39:30 2010 -0700
Bug 630094 - (cov#15455) Remove deadcode in attr_index_config()
If the index types (argv[1]) are not specified, attr_index_config()
bails. We can remove some dead code where we check if "argc == 1"
later in the function since that case can never happen.
Additionally, we need to check if argc is 0, or if argv is NULL
before attempting to parse the list of attributes to be indexed.
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_attr.c b/ldap/servers/slapd/back-ldbm/ldbm_attr.c
index 28ccc2e91..6a10f2355 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_attr.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_attr.c
@@ -185,6 +185,11 @@ attr_index_config(
int return_value = -1;
int *substrlens = NULL;
+ if ((argc == 0) || (argv == NULL)) {
+ LDAPDebug(LDAP_DEBUG_ANY, "attr_index_config: Missing indexing arguments\n", 0, 0, 0);
+ goto done;
+ }
+
attrs = slapi_str2charray( argv[0], "," );
if ( argc > 1 ) {
indexes = slapi_str2charray( argv[1], "," );
@@ -209,143 +214,138 @@ attr_index_config(
them */
a->ai_type = slapi_attr_basetype( attrs[i], NULL, 0 );
attrsyntax_oid = attr_get_syntax_oid(&a->ai_sattr);
- if ( argc == 1 ) {
- a->ai_indexmask = (INDEX_PRESENCE | INDEX_EQUALITY |
- INDEX_APPROX | INDEX_SUB);
- } else {
- a->ai_indexmask = 0;
- for ( j = 0; indexes[j] != NULL; j++ ) {
- if ( strncasecmp( indexes[j], "pres", 4 ) == 0 ) {
- a->ai_indexmask |= INDEX_PRESENCE;
- } else if ( strncasecmp( indexes[j], "eq", 2 ) == 0 ) {
- a->ai_indexmask |= INDEX_EQUALITY;
- } else if ( strncasecmp( indexes[j], "approx", 6 ) == 0 ) {
- a->ai_indexmask |= INDEX_APPROX;
- } else if ( strncasecmp( indexes[j], "subtree", 7 ) == 0 ) {
- /* subtree should be located before "sub" */
- a->ai_indexmask |= INDEX_SUBTREE;
- a->ai_dup_cmp_fn = entryrdn_compare_dups;
- } else if ( strncasecmp( indexes[j], "sub", 3 ) == 0 ) {
- a->ai_indexmask |= INDEX_SUB;
- } else if ( strncasecmp( indexes[j], "none", 4 ) == 0 ) {
- if ( a->ai_indexmask != 0 ) {
- LDAPDebug(LDAP_DEBUG_ANY,
- "%s: line %d: index type \"none\" cannot be combined with other types\n",
- fname, lineno, 0);
- }
- a->ai_indexmask = INDEX_OFFLINE; /* note that the index isn't available */
- } else {
+ a->ai_indexmask = 0;
+ for ( j = 0; indexes[j] != NULL; j++ ) {
+ if ( strncasecmp( indexes[j], "pres", 4 ) == 0 ) {
+ a->ai_indexmask |= INDEX_PRESENCE;
+ } else if ( strncasecmp( indexes[j], "eq", 2 ) == 0 ) {
+ a->ai_indexmask |= INDEX_EQUALITY;
+ } else if ( strncasecmp( indexes[j], "approx", 6 ) == 0 ) {
+ a->ai_indexmask |= INDEX_APPROX;
+ } else if ( strncasecmp( indexes[j], "subtree", 7 ) == 0 ) {
+ /* subtree should be located before "sub" */
+ a->ai_indexmask |= INDEX_SUBTREE;
+ a->ai_dup_cmp_fn = entryrdn_compare_dups;
+ } else if ( strncasecmp( indexes[j], "sub", 3 ) == 0 ) {
+ a->ai_indexmask |= INDEX_SUB;
+ } else if ( strncasecmp( indexes[j], "none", 4 ) == 0 ) {
+ if ( a->ai_indexmask != 0 ) {
LDAPDebug(LDAP_DEBUG_ANY,
- "%s: line %d: unknown index type \"%s\" (ignored)\n",
- fname, lineno, indexes[j]);
- LDAPDebug(LDAP_DEBUG_ANY,
- "valid index types are \"pres\", \"eq\", \"approx\", or \"sub\"\n",
- 0, 0, 0);
+ "%s: line %d: index type \"none\" cannot be combined with other types\n",
+ fname, lineno, 0);
}
+ a->ai_indexmask = INDEX_OFFLINE; /* note that the index isn't available */
+ } else {
+ LDAPDebug(LDAP_DEBUG_ANY,
+ "%s: line %d: unknown index type \"%s\" (ignored)\n",
+ fname, lineno, indexes[j]);
+ LDAPDebug(LDAP_DEBUG_ANY,
+ "valid index types are \"pres\", \"eq\", \"approx\", or \"sub\"\n",
+ 0, 0, 0);
}
+ }
- /* compute a->ai_index_rules: */
- /* for index rules there are two uses:
- * 1) a simple way to define an ordered index to support <= and >= searches
- * for those attributes which do not have an ORDERING matching rule defined
- * for them in their schema definition. The index generated is not a :RULE:
- * index, it is a normal = EQUALITY index, with the keys ordered using the
- * comparison function provided by the syntax plugin for the attribute. For
- * example - the uidNumber attribute has INTEGER syntax, but the standard
- * definition of the attribute does not specify an ORDERING matching rule.
- * By default, this means that you cannot perform searches like
- * (uidNumber>=501) - but many users expect to be able to perform this type of
- * search. By specifying that you want an ordered index, using an integer
- * matching rule, you can support indexed seaches of this type.
- * 2) a RULE index - the index key prefix is :NAMEOROID: - this is used
- * to support extensible match searches like (cn:fr-CA.3:=gilles), which would
- * find the index key :fr-CA.3:gilles in the cn index.
- * We check first to see if this is a simple ordered index - user specified an
- * ordering matching rule compatible with the attribute syntax, and there is
- * a compare function. If not, we assume it is a RULE index definition.
- */
- j = 0;
- if (index_rules != NULL) for (; index_rules[j] != NULL; ++j);
- if (j > 0) { /* there are some candidates */
- char** official_rules =
- (char**)slapi_ch_malloc ((j + 1) * sizeof (char*));
- size_t k = 0;
- for (j = 0; index_rules[j] != NULL; ++j) {
- /* Check that index_rules[j] is an official OID */
- char* officialOID = NULL;
- IFP mrINDEX = NULL;
- Slapi_PBlock* pb = NULL;
- int do_continue = 0; /* can we skip the RULE parsing stuff? */
-
- if (strstr(index_rules[j], INDEX_ATTR_SUBSTRBEGIN)) {
- _set_attr_substrlen(INDEX_SUBSTRBEGIN, index_rules[j],
- &substrlens);
- do_continue = 1; /* done with j - next j */
- } else if (strstr(index_rules[j], INDEX_ATTR_SUBSTRMIDDLE)) {
- _set_attr_substrlen(INDEX_SUBSTRMIDDLE, index_rules[j],
- &substrlens);
- do_continue = 1; /* done with j - next j */
- } else if (strstr(index_rules[j], INDEX_ATTR_SUBSTREND)) {
- _set_attr_substrlen(INDEX_SUBSTREND, index_rules[j],
- &substrlens);
- do_continue = 1; /* done with j - next j */
- /* check if this is a simple ordering specification
- for an attribute that has no ordering matching rule */
- } else if (slapi_matchingrule_is_ordering(index_rules[j], attrsyntax_oid) &&
- !a->ai_sattr.a_mr_ord_plugin) { /* no ordering for this attribute */
- need_compare_fn = 1; /* get compare func for this attr */
- do_continue = 1; /* done with j - next j */
- }
+ /* compute a->ai_index_rules: */
+ /* for index rules there are two uses:
+ * 1) a simple way to define an ordered index to support <= and >= searches
+ * for those attributes which do not have an ORDERING matching rule defined
+ * for them in their schema definition. The index generated is not a :RULE:
+ * index, it is a normal = EQUALITY index, with the keys ordered using the
+ * comparison function provided by the syntax plugin for the attribute. For
+ * example - the uidNumber attribute has INTEGER syntax, but the standard
+ * definition of the attribute does not specify an ORDERING matching rule.
+ * By default, this means that you cannot perform searches like
+ * (uidNumber>=501) - but many users expect to be able to perform this type of
+ * search. By specifying that you want an ordered index, using an integer
+ * matching rule, you can support indexed seaches of this type.
+ * 2) a RULE index - the index key prefix is :NAMEOROID: - this is used
+ * to support extensible match searches like (cn:fr-CA.3:=gilles), which would
+ * find the index key :fr-CA.3:gilles in the cn index.
+ * We check first to see if this is a simple ordered index - user specified an
+ * ordering matching rule compatible with the attribute syntax, and there is
+ * a compare function. If not, we assume it is a RULE index definition.
+ */
+ j = 0;
+ if (index_rules != NULL) for (; index_rules[j] != NULL; ++j);
+ if (j > 0) { /* there are some candidates */
+ char** official_rules =
+ (char**)slapi_ch_malloc ((j + 1) * sizeof (char*));
+ size_t k = 0;
+ for (j = 0; index_rules[j] != NULL; ++j) {
+ /* Check that index_rules[j] is an official OID */
+ char* officialOID = NULL;
+ IFP mrINDEX = NULL;
+ Slapi_PBlock* pb = NULL;
+ int do_continue = 0; /* can we skip the RULE parsing stuff? */
+
+ if (strstr(index_rules[j], INDEX_ATTR_SUBSTRBEGIN)) {
+ _set_attr_substrlen(INDEX_SUBSTRBEGIN, index_rules[j],
+ &substrlens);
+ do_continue = 1; /* done with j - next j */
+ } else if (strstr(index_rules[j], INDEX_ATTR_SUBSTRMIDDLE)) {
+ _set_attr_substrlen(INDEX_SUBSTRMIDDLE, index_rules[j],
+ &substrlens);
+ do_continue = 1; /* done with j - next j */
+ } else if (strstr(index_rules[j], INDEX_ATTR_SUBSTREND)) {
+ _set_attr_substrlen(INDEX_SUBSTREND, index_rules[j],
+ &substrlens);
+ do_continue = 1; /* done with j - next j */
+ /* check if this is a simple ordering specification
+ for an attribute that has no ordering matching rule */
+ } else if (slapi_matchingrule_is_ordering(index_rules[j], attrsyntax_oid) &&
+ !a->ai_sattr.a_mr_ord_plugin) { /* no ordering for this attribute */
+ need_compare_fn = 1; /* get compare func for this attr */
+ do_continue = 1; /* done with j - next j */
+ }
- if (do_continue) {
- continue; /* done with index_rules[j] */
- }
+ if (do_continue) {
+ continue; /* done with index_rules[j] */
+ }
- /* must be a RULE specification */
- pb = slapi_pblock_new();
- /* next check if this is a RULE type index
- try to actually create an indexer and see if the indexer
- actually has a regular INDEX_FN or an INDEX_SV_FN */
- if (!slapi_pblock_set (pb, SLAPI_PLUGIN_MR_OID, index_rules[j]) &&
- !slapi_pblock_set (pb, SLAPI_PLUGIN_MR_TYPE, a->ai_type) &&
- !slapi_mr_indexer_create (pb) &&
- ((!slapi_pblock_get (pb, SLAPI_PLUGIN_MR_INDEX_FN, &mrINDEX) &&
- mrINDEX != NULL) ||
- (!slapi_pblock_get (pb, SLAPI_PLUGIN_MR_INDEX_SV_FN, &mrINDEX) &&
- mrINDEX != NULL)) &&
- !slapi_pblock_get (pb, SLAPI_PLUGIN_MR_OID, &officialOID) &&
- officialOID != NULL) {
- if (!strcasecmp (index_rules[j], officialOID)) {
- official_rules[k++] = slapi_ch_strdup (officialOID);
- } else {
- char* preamble = slapi_ch_smprintf("%s: line %d", fname, lineno);
- LDAPDebug (LDAP_DEBUG_ANY, "%s: use \"%s\" instead of \"%s\" (ignored)\n",
- preamble, officialOID, index_rules[j] );
- slapi_ch_free((void**)&preamble);
- }
- } else { /* we don't know what this is */
- LDAPDebug (LDAP_DEBUG_ANY, "%s: line %d: "
- "unknown or invalid matching rule \"%s\" in index configuration (ignored)\n",
- fname, lineno, index_rules[j] );
- }
- {/* It would improve speed to save the indexer, for future use.
- But, for simplicity, we destroy it now: */
- IFP mrDESTROY = NULL;
- if (!slapi_pblock_get (pb, SLAPI_PLUGIN_DESTROY_FN, &mrDESTROY) &&
- mrDESTROY != NULL) {
- mrDESTROY (pb);
- }
+ /* must be a RULE specification */
+ pb = slapi_pblock_new();
+ /* next check if this is a RULE type index
+ try to actually create an indexer and see if the indexer
+ actually has a regular INDEX_FN or an INDEX_SV_FN */
+ if (!slapi_pblock_set (pb, SLAPI_PLUGIN_MR_OID, index_rules[j]) &&
+ !slapi_pblock_set (pb, SLAPI_PLUGIN_MR_TYPE, a->ai_type) &&
+ !slapi_mr_indexer_create (pb) &&
+ ((!slapi_pblock_get (pb, SLAPI_PLUGIN_MR_INDEX_FN, &mrINDEX) &&
+ mrINDEX != NULL) ||
+ (!slapi_pblock_get (pb, SLAPI_PLUGIN_MR_INDEX_SV_FN, &mrINDEX) &&
+ mrINDEX != NULL)) &&
+ !slapi_pblock_get (pb, SLAPI_PLUGIN_MR_OID, &officialOID) &&
+ officialOID != NULL) {
+ if (!strcasecmp (index_rules[j], officialOID)) {
+ official_rules[k++] = slapi_ch_strdup (officialOID);
+ } else {
+ char* preamble = slapi_ch_smprintf("%s: line %d", fname, lineno);
+ LDAPDebug (LDAP_DEBUG_ANY, "%s: use \"%s\" instead of \"%s\" (ignored)\n",
+ preamble, officialOID, index_rules[j] );
+ slapi_ch_free((void**)&preamble);
}
- slapi_pblock_destroy (pb);
+ } else { /* we don't know what this is */
+ LDAPDebug (LDAP_DEBUG_ANY, "%s: line %d: "
+ "unknown or invalid matching rule \"%s\" in index configuration (ignored)\n",
+ fname, lineno, index_rules[j] );
}
- official_rules[k] = NULL;
- a->ai_substr_lens = substrlens;
- if (k > 0) {
- a->ai_index_rules = official_rules;
- a->ai_indexmask |= INDEX_RULES;
- } else {
- slapi_ch_free((void**)&official_rules);
+ {/* It would improve speed to save the indexer, for future use.
+ But, for simplicity, we destroy it now: */
+ IFP mrDESTROY = NULL;
+ if (!slapi_pblock_get (pb, SLAPI_PLUGIN_DESTROY_FN, &mrDESTROY) &&
+ mrDESTROY != NULL) {
+ mrDESTROY (pb);
+ }
}
+ slapi_pblock_destroy (pb);
+ }
+ official_rules[k] = NULL;
+ a->ai_substr_lens = substrlens;
+ if (k > 0) {
+ a->ai_index_rules = official_rules;
+ a->ai_indexmask |= INDEX_RULES;
+ } else {
+ slapi_ch_free((void**)&official_rules);
}
}
| 0 |
5a41728cf75eea021b73b166aea12a00f39eebd8
|
389ds/389-ds-base
|
Bug 668862 - init scripts return wrong error code
The dirsrv init script returns an exit code of 0 when no instances
are configured or if an invalid instance name is specified. This
patch makes the dirsrv init script return the proper exit codes.
The exit codes for the status action are different than the codes
for non-status actions per the Fedora SysV init script packaging
guidelines.
In addition, the dirsrv and dirsrv-snmp inistscripts need to return
a non-0 exit code when networking is disabled or if the binaries
do not exist. This patch handles those cases as well.
|
commit 5a41728cf75eea021b73b166aea12a00f39eebd8
Author: Nathan Kinder <[email protected]>
Date: Tue Feb 1 15:00:40 2011 -0800
Bug 668862 - init scripts return wrong error code
The dirsrv init script returns an exit code of 0 when no instances
are configured or if an invalid instance name is specified. This
patch makes the dirsrv init script return the proper exit codes.
The exit codes for the status action are different than the codes
for non-status actions per the Fedora SysV init script packaging
guidelines.
In addition, the dirsrv and dirsrv-snmp inistscripts need to return
a non-0 exit code when networking is disabled or if the binaries
do not exist. This patch handles those cases as well.
diff --git a/wrappers/initscript.in b/wrappers/initscript.in
index 65874d690..147b2d6ea 100644
--- a/wrappers/initscript.in
+++ b/wrappers/initscript.in
@@ -23,7 +23,13 @@ fi
if [ "${NETWORKING}" = "no" ]
then
echo "Networking is down"
- exit 0
+ if [ "$1" = "status" ]; then
+ # exit code 4 means unknown status for status action
+ exit 4
+ else
+ # exit code 1 means unspecified error for non-status actions
+ exit 1
+ fi
fi
# figure out which echo we're using
@@ -87,8 +93,16 @@ piddir="@localstatedir@/run/@package_name@"
# Instance basedir
instbase="@instconfigdir@"
-
-[ -f $exec ] || exit 0
+# Check that ns-slapd exists
+if [ ! -f $exec ] ; then
+ if [ "$1" = "status" ]; then
+ # exit code 4 means unknown status for status action
+ exit 4
+ else
+ # exit code 5 means program is not installed for non-status actions
+ exit 5
+ fi
+fi
umask 077
@@ -107,7 +121,13 @@ done
if [ -z "$INSTANCES" ]; then
echo " *** Error: no $prog instances configured"
- exit 0
+ if [ "$1" = "status" ]; then
+ # exit code 4 means unknown status for status action
+ exit 4
+ else
+ # exit code 6 means program is not configured for non-status actions
+ exit 6
+ fi
fi
if [ -n "$2" ]; then
@@ -119,7 +139,13 @@ if [ -n "$2" ]; then
if [ "$2" != "$INSTANCES" ]; then
echo_n "$2 is an invalid @package_name@ instance"
failure; echo
- exit 1
+ if [ "$1" = "status" ]; then
+ # exit code 4 means unknown status for status action
+ exit 4
+ else
+ # exit code 2 means invalid argument for non-status actions
+ exit 2
+ fi
fi
fi
diff --git a/wrappers/ldap-agent-initscript.in b/wrappers/ldap-agent-initscript.in
index d4e791f70..dd8ee9770 100644
--- a/wrappers/ldap-agent-initscript.in
+++ b/wrappers/ldap-agent-initscript.in
@@ -22,7 +22,13 @@ fi
if [ "${NETWORKING}" = "no" ]
then
echo "Networking is down"
- exit 0
+ if [ "$1" = "status" ]; then
+ # exit code 4 means unknown status for status action
+ exit 4
+ else
+ # exit code 1 means unspecified error for non-status actions
+ exit 1
+ fi
fi
# figure out which echo we're using
@@ -61,8 +67,16 @@ pidfile="@localstatedir@/run/ldap-agent.pid"
configfile="@sysconfdir@/@package_name@/config/ldap-agent.conf"
-
-[ -f $exec ] || exit 0
+# Check if ldap-agent exists
+if [ ! -f $exec ]; then
+ if [ "$1" = "status" ]; then
+ # exit code 4 means unknown status for status action
+ exit 4
+ else
+ # exit code 5 means program is not installed for non-status actions
+ exit 5
+ fi
+fi
umask 077
| 0 |
cd6fe6d7225656448034bc06e483dab3f36f3f3f
|
389ds/389-ds-base
|
170071 - Automatically add grouptype for new groups being synchd to NT4
|
commit cd6fe6d7225656448034bc06e483dab3f36f3f3f
Author: Nathan Kinder <[email protected]>
Date: Thu Oct 20 17:12:16 2005 +0000
170071 - Automatically add grouptype for new groups being synchd to NT4
diff --git a/ldap/servers/ntds/apacheds/usersync.schema b/ldap/servers/ntds/apacheds/usersync.schema
index 0dc36a3d2..4cf74fb15 100644
--- a/ldap/servers/ntds/apacheds/usersync.schema
+++ b/ldap/servers/ntds/apacheds/usersync.schema
@@ -522,7 +522,6 @@ objectclass ( 1.3.6.1.4.1.7114.2.2.12
isCriticalSystemObject $
member $
name $
- groupType $
showInAdvancedViewOnly $
systemFlags $
objectCategory $
diff --git a/ldap/servers/plugins/replication/windows_protocol_util.c b/ldap/servers/plugins/replication/windows_protocol_util.c
index 6fe7a8a6d..76fa15e5b 100644
--- a/ldap/servers/plugins/replication/windows_protocol_util.c
+++ b/ldap/servers/plugins/replication/windows_protocol_util.c
@@ -1362,6 +1362,19 @@ windows_create_remote_entry(Private_Repl_Protocol *prp,Slapi_Entry *original_ent
vs = NULL;
}
}
+ /* NT4 must have the groupType attribute set for groups. If it is not present, we will
+ * add it here with a value of 2 (global group).
+ */
+ if (is_nt4 && is_group)
+ {
+ Slapi_Attr *ap = NULL;
+ if(slapi_entry_attr_find(new_entry, "groupType", &ap))
+ {
+ /* groupType attribute wasn't found, so we'll add it */
+ slapi_entry_attr_set_int(new_entry, "groupType", 2 /* global group */);
+ }
+ }
+
if (remote_entry)
{
*remote_entry = new_entry;
| 0 |
53794a074af7c26c0b49ca700de5a5071c490d3d
|
389ds/389-ds-base
|
Bug 527912 - setup-ds.pl appears to hang when DNS is unreachable
The setup-ds.pl program will appear to hang when it attempts to
contact an unreachable DNS server to determine the FQDN. The
hostname prompt will eventually be displayed after a network
timeout is hit.
This patch makes the setup program log a warning message just
prior to trying to determine the FQDN. This message states that
setup may appear to hang if it can't reach the DNS servers, and
that one can re-run setup and pass the hostname as an option on
the command line instead.
|
commit 53794a074af7c26c0b49ca700de5a5071c490d3d
Author: Nathan Kinder <[email protected]>
Date: Thu Jan 20 15:10:09 2011 -0800
Bug 527912 - setup-ds.pl appears to hang when DNS is unreachable
The setup-ds.pl program will appear to hang when it attempts to
contact an unreachable DNS server to determine the FQDN. The
hostname prompt will eventually be displayed after a network
timeout is hit.
This patch makes the setup program log a warning message just
prior to trying to determine the FQDN. This message states that
setup may appear to hang if it can't reach the DNS servers, and
that one can re-run setup and pass the hostname as an option on
the command line instead.
diff --git a/ldap/admin/src/scripts/setup-ds.res.in b/ldap/admin/src/scripts/setup-ds.res.in
index 25f849351..344fcf9ae 100644
--- a/ldap/admin/src/scripts/setup-ds.res.in
+++ b/ldap/admin/src/scripts/setup-ds.res.in
@@ -33,7 +33,7 @@ dialog_setuptype_error = Invalid setup type\n\n
# ----------- HostName Dialog Resource ----------------
-dialog_hostname_text = Enter the fully qualified domain name of the computer\non which you're setting up server software. Using the form\n<hostname>.<domainname>\nExample: eros.example.com.\n\nTo accept the default shown in brackets, press the Enter key.\n\n
+dialog_hostname_text = Enter the fully qualified domain name of the computer\non which you're setting up server software. Using the form\n<hostname>.<domainname>\nExample: eros.example.com.\n\nTo accept the default shown in brackets, press the Enter key.\n\nWarning: This step may take a few minutes if your DNS servers\ncan not be reached or if DNS is not configured correctly. If\nyou would rather not wait, hit Ctrl-C and run this program again\nwith the following command line option to specify the hostname:\n\n General.FullMachineName=your.hostname.domain.name\n\n
dialog_hostname_prompt = Computer name
| 0 |
a8ae34212fb0f3f8a79b1d1342d5641e65883d0b
|
389ds/389-ds-base
|
Issue 5521 - RFE - split pass through auth cli
Bug Description: The pass through auth cli previously
was a "merge" of both ldap pass through and pam pass through. These
two do not share any commonality, and actually conflict on each other.
This caused a lot of confusion, especially in documentation where it
wasn't clear how to use either feature as a result.
Fix Description: Split the cli into two seperate plugins with their own
config domains. This clarifies the situation for users, and makes it far
easier to configure the various pass through layers.
fixes: https://github.com/389ds/389-ds-base/issues/5521
Author: William Brown <[email protected]>
Review by: @mreynolds389 @droideck (Thanks!)
|
commit a8ae34212fb0f3f8a79b1d1342d5641e65883d0b
Author: William Brown <[email protected]>
Date: Thu Nov 24 18:59:22 2022 +1000
Issue 5521 - RFE - split pass through auth cli
Bug Description: The pass through auth cli previously
was a "merge" of both ldap pass through and pam pass through. These
two do not share any commonality, and actually conflict on each other.
This caused a lot of confusion, especially in documentation where it
wasn't clear how to use either feature as a result.
Fix Description: Split the cli into two seperate plugins with their own
config domains. This clarifies the situation for users, and makes it far
easier to configure the various pass through layers.
fixes: https://github.com/389ds/389-ds-base/issues/5521
Author: William Brown <[email protected]>
Review by: @mreynolds389 @droideck (Thanks!)
diff --git a/src/lib389/lib389/cli_conf/plugin.py b/src/lib389/lib389/cli_conf/plugin.py
index e0c93c52b..a0bdb21e8 100644
--- a/src/lib389/lib389/cli_conf/plugin.py
+++ b/src/lib389/lib389/cli_conf/plugin.py
@@ -23,7 +23,8 @@ from lib389.cli_conf.plugins import attruniq as cli_attruniq
from lib389.cli_conf.plugins import dna as cli_dna
from lib389.cli_conf.plugins import linkedattr as cli_linkedattr
from lib389.cli_conf.plugins import managedentries as cli_managedentries
-from lib389.cli_conf.plugins import passthroughauth as cli_passthroughauth
+from lib389.cli_conf.plugins import pampassthrough as cli_pampassthrough
+from lib389.cli_conf.plugins import ldappassthrough as cli_ldappassthrough
from lib389.cli_conf.plugins import retrochangelog as cli_retrochangelog
from lib389.cli_conf.plugins import automember as cli_automember
from lib389.cli_conf.plugins import posix_winsync as cli_posix_winsync
@@ -110,9 +111,10 @@ def create_parser(subparsers):
cli_accountpolicy.create_parser(subcommands)
cli_attruniq.create_parser(subcommands)
cli_dna.create_parser(subcommands)
+ cli_ldappassthrough.create_parser(subcommands)
cli_linkedattr.create_parser(subcommands)
cli_managedentries.create_parser(subcommands)
- cli_passthroughauth.create_parser(subcommands)
+ cli_pampassthrough.create_parser(subcommands)
cli_retrochangelog.create_parser(subcommands)
cli_posix_winsync.create_parser(subcommands)
cli_contentsync.create_parser(subcommands)
diff --git a/src/lib389/lib389/cli_conf/plugins/ldappassthrough.py b/src/lib389/lib389/cli_conf/plugins/ldappassthrough.py
new file mode 100644
index 000000000..584297ed4
--- /dev/null
+++ b/src/lib389/lib389/cli_conf/plugins/ldappassthrough.py
@@ -0,0 +1,156 @@
+# --- BEGIN COPYRIGHT BLOCK ---
+# Copyright (C) 2020 Red Hat, Inc.
+# Copyright (C) 2022 William Brown <[email protected]>
+# All rights reserved.
+#
+# License: GPL (version 3 or any later version).
+# See LICENSE for details.
+# --- END COPYRIGHT BLOCK ---
+
+import json
+import ldap
+from lib389.plugins import (PassThroughAuthenticationPlugin)
+
+from lib389.cli_conf import add_generic_plugin_parsers, generic_object_edit, generic_object_add, generic_show, generic_enable, generic_disable, generic_status
+
+
+def _get_url_next_num(url_attrs):
+ existing_nums = list(map(lambda url: int(url.split('nsslapd-pluginarg')[1]),
+ [i for i, _ in url_attrs.items()]))
+ if len(existing_nums) > 0:
+ existing_nums.sort()
+ full_num_list = list(range(existing_nums[-1]+2))
+ if not full_num_list:
+ next_num_list = ["0"]
+ else:
+ next_num_list = list(filter(lambda x: x not in existing_nums, full_num_list))
+ else:
+ next_num_list = ["0"]
+
+ return next_num_list[0]
+
+def _get_url_attr(url_attrs, this_url):
+ for attr, val in url_attrs.items():
+ if val.lower() == this_url.lower():
+ return attr
+
+ return "nsslapd-pluginarg0"
+
+def _validate_url(url):
+ failed = False
+ if len(url.split(" ")) == 2:
+ link = url.split(" ")[0]
+ params = url.split(" ")[1]
+ else:
+ link = url
+ params = ""
+
+ if (":" not in link) or ("//" not in link) or ("/" not in link) or (params and "," not in params):
+ failed = False
+
+ if not ldap.dn.is_dn(link.split("/")[-1]):
+ raise ValueError("Subtree is an invalid DN")
+
+ if params and len(params.split(",")) != 6 and not all(map(str.isdigit, params.split(","))):
+ failed = False
+
+ if failed:
+ raise ValueError("URL should be in one of the next formats (all parameters after a space should be digits): "
+ "'ldap|ldaps://authDS/subtree maxconns,maxops,timeout,ldver,connlifetime,startTLS' or "
+ "'ldap|ldaps://authDS/subtree'")
+ return url
+
+
+def pta_list(inst, basedn, log, args):
+ log = log.getChild('pta_list')
+ plugin = PassThroughAuthenticationPlugin(inst)
+ urls = plugin.get_urls()
+ if args.json:
+ log.info(json.dumps({"type": "list",
+ "items": [{"id": id, "url": value} for id, value in urls.items()]},
+ indent=4))
+ else:
+ if len(urls) > 0:
+ for _, value in urls.items():
+ log.info(value)
+ else:
+ log.info("No Pass Through Auth URLs were found")
+
+
+def pta_add(inst, basedn, log, args):
+ log = log.getChild('pta_add')
+ new_url_l = _validate_url(args.URL.lower())
+ plugin = PassThroughAuthenticationPlugin(inst)
+ url_attrs = plugin.get_urls()
+ urls = list(map(lambda url: url.lower(),
+ [i for _, i in url_attrs.items()]))
+ next_num = _get_url_next_num(url_attrs)
+ if new_url_l in urls:
+ raise ldap.ALREADY_EXISTS("Entry %s already exists" % args.URL)
+ plugin.add("nsslapd-pluginarg%s" % next_num, args.URL)
+
+
+def pta_edit(inst, basedn, log, args):
+ log = log.getChild('pta_edit')
+ plugin = PassThroughAuthenticationPlugin(inst)
+ url_attrs = plugin.get_urls()
+ urls = list(map(lambda url: url.lower(),
+ [i for _, i in url_attrs.items()]))
+ _validate_url(args.NEW_URL.lower())
+ old_url_l = args.OLD_URL.lower()
+ if old_url_l not in urls:
+ raise ValueError("URL %s doesn't exist." % args.OLD_URL)
+ else:
+ for attr, value in url_attrs.items():
+ if value.lower() == old_url_l:
+ plugin.remove(attr, old_url_l)
+ break
+ plugin.add("%s" % _get_url_attr(url_attrs, old_url_l), args.NEW_URL)
+
+
+def pta_del(inst, basedn, log, args):
+ log = log.getChild('pta_del')
+ plugin = PassThroughAuthenticationPlugin(inst)
+ url_attrs = plugin.get_urls()
+ urls = list(map(lambda url: url.lower(),
+ [i for _, i in url_attrs.items()]))
+ old_url_l = args.URL.lower()
+ if old_url_l not in urls:
+ raise ldap.NO_SUCH_OBJECT("Entry %s doesn't exists" % args.URL)
+
+ plugin.remove_all("%s" % _get_url_attr(url_attrs, old_url_l))
+ log.info("Successfully deleted %s", args.URL)
+
+
+def create_parser(subparsers):
+ passthroughauth_parser = subparsers.add_parser('ldap-pass-through-auth',
+ help='Manage and configure LDAP Pass-Through Authentication Plugin')
+ subcommands = passthroughauth_parser.add_subparsers(help='action')
+
+ add_generic_plugin_parsers(subcommands, PassThroughAuthenticationPlugin)
+
+ list_urls = subcommands.add_parser('list', help='Lists LDAP URLs')
+ list_urls.set_defaults(func=pta_list)
+
+ # url = subcommands.add_parser('url', help='Manage PTA LDAP URL configurations')
+ # subcommands_url = url.add_subparsers(help='action')
+
+ add_url = subcommands.add_parser('add', help='Add an LDAP url to the config entry')
+ add_url.add_argument('URL',
+ help='The full LDAP URL in format '
+ '"ldap|ldaps://authDS/subtree maxconns,maxops,timeout,ldver,connlifetime,startTLS". '
+ 'If one optional parameter is specified the rest should be specified too')
+ add_url.set_defaults(func=pta_add)
+
+ edit_url = subcommands.add_parser('modify', help='Edit the LDAP pass through config entry')
+ edit_url.add_argument('OLD_URL', help='The full LDAP URL you get from the "list" command')
+ edit_url.add_argument('NEW_URL',
+ help='Sets the full LDAP URL in format '
+ '"ldap|ldaps://authDS/subtree maxconns,maxops,timeout,ldver,connlifetime,startTLS". '
+ 'If one optional parameter is specified the rest should be specified too.')
+ edit_url.set_defaults(func=pta_edit)
+
+ delete_url = subcommands.add_parser('delete', help='Delete a URL from the config entry')
+ delete_url.add_argument('URL', help='The full LDAP URL you get from the "list" command')
+ delete_url.set_defaults(func=pta_del)
+
diff --git a/src/lib389/lib389/cli_conf/plugins/pampassthrough.py b/src/lib389/lib389/cli_conf/plugins/pampassthrough.py
new file mode 100644
index 000000000..810f24422
--- /dev/null
+++ b/src/lib389/lib389/cli_conf/plugins/pampassthrough.py
@@ -0,0 +1,133 @@
+# --- BEGIN COPYRIGHT BLOCK ---
+# Copyright (C) 2022 William Brown <[email protected]>
+# All rights reserved.
+#
+# License: GPL (version 3 or any later version).
+# See LICENSE for details.
+# --- END COPYRIGHT BLOCK ---
+
+import json
+import ldap
+from lib389.plugins import (PAMPassThroughAuthPlugin,
+ PAMPassThroughAuthConfigs, PAMPassThroughAuthConfig)
+
+from lib389.cli_conf import add_generic_plugin_parsers, generic_object_edit, generic_object_add
+
+
+arg_to_attr_pam = {
+ 'exclude_suffix': 'pamExcludeSuffix',
+ 'include_suffix': 'pamIncludeSuffix',
+ 'missing_suffix': 'pamMissingSuffix',
+ 'filter': 'pamFilter',
+ 'id_attr': 'pamIDAttr',
+ 'id_map_method': 'pamIDMapMethod',
+ 'fallback': 'pamFallback',
+ 'secure': 'pamSecure',
+ 'service': 'pamService'
+}
+
+
+def pam_pta_list(inst, basedn, log, args):
+ log = log.getChild('pam_pta_list')
+ configs = PAMPassThroughAuthConfigs(inst)
+ result = []
+ result_json = []
+ for config in configs.list():
+ if args.json:
+ result_json.append(json.loads(config.get_all_attrs_json()))
+ else:
+ result.append(config.rdn)
+ if args.json:
+ log.info(json.dumps({"type": "list", "items": result_json}, indent=4))
+ else:
+ if len(result) > 0:
+ for i in result:
+ log.info(i)
+ else:
+ log.info("No PAM Pass Through Auth plugin config instances")
+
+
+def pam_pta_add(inst, basedn, log, args):
+ log = log.getChild('pam_pta_add')
+ plugin = PAMPassThroughAuthPlugin(inst)
+ props = {'cn': args.NAME}
+ generic_object_add(PAMPassThroughAuthConfig, inst, log, args, arg_to_attr_pam, basedn=plugin.dn, props=props)
+
+
+def pam_pta_edit(inst, basedn, log, args):
+ log = log.getChild('pam_pta_edit')
+ configs = PAMPassThroughAuthConfigs(inst)
+ config = configs.get(args.NAME)
+ generic_object_edit(config, log, args, arg_to_attr_pam)
+
+
+def pam_pta_show(inst, basedn, log, args):
+ log = log.getChild('pam_pta_show')
+ configs = PAMPassThroughAuthConfigs(inst)
+ config = configs.get(args.NAME)
+
+ if not config.exists():
+ raise ldap.NO_SUCH_OBJECT("Entry %s doesn't exists" % args.name)
+ if args and args.json:
+ o_str = config.get_all_attrs_json()
+ log.info(o_str)
+ else:
+ log.info(config.display())
+
+
+def pam_pta_del(inst, basedn, log, args):
+ log = log.getChild('pam_pta_del')
+ configs = PAMPassThroughAuthConfigs(inst)
+ config = configs.get(args.NAME)
+ config.delete()
+ log.info("Successfully deleted the %s", config.dn)
+
+
+def _add_parser_args_pam(parser):
+ parser.add_argument('--exclude-suffix', nargs='+',
+ help='Specifies a suffix to exclude from PAM authentication (pamExcludeSuffix)')
+ parser.add_argument('--include-suffix', nargs='+',
+ help='Sets a suffix to include for PAM authentication (pamIncludeSuffix)')
+ parser.add_argument('--missing-suffix', choices=['ERROR', 'ALLOW', 'IGNORE', 'delete', ''],
+ help='Identifies how to handle missing include or exclude suffixes (pamMissingSuffix)')
+ parser.add_argument('--filter',
+ help='Sets an LDAP filter to use to identify specific entries within '
+ 'the included suffixes for which to use PAM pass-through authentication (pamFilter)')
+ parser.add_argument('--id-attr',
+ help='Contains the attribute name which is used to hold the PAM user ID (pamIDAttr)')
+ parser.add_argument('--id_map_method',
+ help='Sets the method to use to map the LDAP bind DN to a PAM identity (pamIDMapMethod)')
+ parser.add_argument('--fallback', choices=['TRUE', 'FALSE'], type=str.upper,
+ help='Sets whether to fallback to regular LDAP authentication '
+ 'if PAM authentication fails (pamFallback)')
+ parser.add_argument('--secure', choices=['TRUE', 'FALSE'], type=str.upper,
+ help='Requires secure TLS connection for PAM authentication (pamSecure)')
+ parser.add_argument('--service',
+ help='Contains the service name to pass to PAM (pamService)')
+
+
+def create_parser(subparsers):
+ passthroughauth_parser = subparsers.add_parser('pam-pass-through-auth',
+ help='Manage and configure Pass-Through Authentication plugins '
+ '(LDAP URLs and PAM)')
+ subcommands = passthroughauth_parser.add_subparsers(help='action')
+
+ add_generic_plugin_parsers(subcommands, PAMPassThroughAuthPlugin)
+
+ list_pam = subcommands.add_parser('list', help='Lists PAM configurations')
+ list_pam.set_defaults(func=pam_pta_list)
+
+ pam = subcommands.add_parser('config', help='Manage PAM PTA configurations.')
+ pam.add_argument('NAME', help='The PAM PTA configuration name')
+ subcommands_pam = pam.add_subparsers(help='action')
+
+ add = subcommands_pam.add_parser('add', help='Add the config entry')
+ add.set_defaults(func=pam_pta_add)
+ _add_parser_args_pam(add)
+ edit = subcommands_pam.add_parser('set', help='Edit the config entry')
+ edit.set_defaults(func=pam_pta_edit)
+ _add_parser_args_pam(edit)
+ show = subcommands_pam.add_parser('show', help='Display the config entry')
+ show.set_defaults(func=pam_pta_show)
+ delete = subcommands_pam.add_parser('delete', help='Delete the config entry')
+ delete.set_defaults(func=pam_pta_del)
diff --git a/src/lib389/lib389/cli_conf/plugins/passthroughauth.py b/src/lib389/lib389/cli_conf/plugins/passthroughauth.py
deleted file mode 100644
index e0e2ba2ac..000000000
--- a/src/lib389/lib389/cli_conf/plugins/passthroughauth.py
+++ /dev/null
@@ -1,297 +0,0 @@
-# --- BEGIN COPYRIGHT BLOCK ---
-# Copyright (C) 2020 Red Hat, Inc.
-# All rights reserved.
-#
-# License: GPL (version 3 or any later version).
-# See LICENSE for details.
-# --- END COPYRIGHT BLOCK ---
-
-import json
-import ldap
-from lib389.plugins import (PassThroughAuthenticationPlugin, PAMPassThroughAuthPlugin,
- PAMPassThroughAuthConfigs, PAMPassThroughAuthConfig)
-
-from lib389.cli_conf import add_generic_plugin_parsers, generic_object_edit, generic_object_add, generic_show, generic_enable, generic_disable, generic_status
-
-arg_to_attr_pam = {
- 'exclude_suffix': 'pamExcludeSuffix',
- 'include_suffix': 'pamIncludeSuffix',
- 'missing_suffix': 'pamMissingSuffix',
- 'filter': 'pamFilter',
- 'id_attr': 'pamIDAttr',
- 'id_map_method': 'pamIDMapMethod',
- 'fallback': 'pamFallback',
- 'secure': 'pamSecure',
- 'service': 'pamService'
-}
-
-
-def _get_url_next_num(url_attrs):
- existing_nums = list(map(lambda url: int(url.split('nsslapd-pluginarg')[1]),
- [i for i, _ in url_attrs.items()]))
- if len(existing_nums) > 0:
- existing_nums.sort()
- full_num_list = list(range(existing_nums[-1]+2))
- if not full_num_list:
- next_num_list = ["0"]
- else:
- next_num_list = list(filter(lambda x: x not in existing_nums, full_num_list))
- else:
- next_num_list = ["0"]
-
- return next_num_list[0]
-
-def _get_url_attr(url_attrs, this_url):
- for attr, val in url_attrs.items():
- if val.lower() == this_url.lower():
- return attr
-
- return "nsslapd-pluginarg0"
-
-def _validate_url(url):
- failed = False
- if len(url.split(" ")) == 2:
- link = url.split(" ")[0]
- params = url.split(" ")[1]
- else:
- link = url
- params = ""
-
- if (":" not in link) or ("//" not in link) or ("/" not in link) or (params and "," not in params):
- failed = False
-
- if not ldap.dn.is_dn(link.split("/")[-1]):
- raise ValueError("Subtree is an invalid DN")
-
- if params and len(params.split(",")) != 6 and not all(map(str.isdigit, params.split(","))):
- failed = False
-
- if failed:
- raise ValueError("URL should be in one of the next formats (all parameters after a space should be digits): "
- "'ldap|ldaps://authDS/subtree maxconns,maxops,timeout,ldver,connlifetime,startTLS' or "
- "'ldap|ldaps://authDS/subtree'")
- return url
-
-
-def pta_list(inst, basedn, log, args):
- log = log.getChild('pta_list')
- plugin = PassThroughAuthenticationPlugin(inst)
- urls = plugin.get_urls()
- if args.json:
- log.info(json.dumps({"type": "list",
- "items": [{"id": id, "url": value} for id, value in urls.items()]},
- indent=4))
- else:
- if len(urls) > 0:
- for _, value in urls.items():
- log.info(value)
- else:
- log.info("No Pass Through Auth URLs were found")
-
-
-def pta_add(inst, basedn, log, args):
- log = log.getChild('pta_add')
- new_url_l = _validate_url(args.URL.lower())
- plugin = PassThroughAuthenticationPlugin(inst)
- url_attrs = plugin.get_urls()
- urls = list(map(lambda url: url.lower(),
- [i for _, i in url_attrs.items()]))
- next_num = _get_url_next_num(url_attrs)
- if new_url_l in urls:
- raise ldap.ALREADY_EXISTS("Entry %s already exists" % args.URL)
- plugin.add("nsslapd-pluginarg%s" % next_num, args.URL)
-
-
-def pta_edit(inst, basedn, log, args):
- log = log.getChild('pta_edit')
- plugin = PassThroughAuthenticationPlugin(inst)
- url_attrs = plugin.get_urls()
- urls = list(map(lambda url: url.lower(),
- [i for _, i in url_attrs.items()]))
- _validate_url(args.NEW_URL.lower())
- old_url_l = args.OLD_URL.lower()
- if old_url_l not in urls:
- raise ValueError("URL %s doesn't exist." % args.OLD_URL)
- else:
- for attr, value in url_attrs.items():
- if value.lower() == old_url_l:
- plugin.remove(attr, old_url_l)
- break
- plugin.add("%s" % _get_url_attr(url_attrs, old_url_l), args.NEW_URL)
-
-
-def pta_del(inst, basedn, log, args):
- log = log.getChild('pta_del')
- plugin = PassThroughAuthenticationPlugin(inst)
- url_attrs = plugin.get_urls()
- urls = list(map(lambda url: url.lower(),
- [i for _, i in url_attrs.items()]))
- old_url_l = args.URL.lower()
- if old_url_l not in urls:
- raise ldap.NO_SUCH_OBJECT("Entry %s doesn't exists" % args.URL)
-
- plugin.remove_all("%s" % _get_url_attr(url_attrs, old_url_l))
- log.info("Successfully deleted %s", args.URL)
-
-
-def pam_pta_list(inst, basedn, log, args):
- log = log.getChild('pam_pta_list')
- configs = PAMPassThroughAuthConfigs(inst)
- result = []
- result_json = []
- for config in configs.list():
- if args.json:
- result_json.append(json.loads(config.get_all_attrs_json()))
- else:
- result.append(config.rdn)
- if args.json:
- log.info(json.dumps({"type": "list", "items": result_json}, indent=4))
- else:
- if len(result) > 0:
- for i in result:
- log.info(i)
- else:
- log.info("No PAM Pass Through Auth plugin config instances")
-
-
-def pam_pta_add(inst, basedn, log, args):
- log = log.getChild('pam_pta_add')
- plugin = PAMPassThroughAuthPlugin(inst)
- props = {'cn': args.NAME}
- generic_object_add(PAMPassThroughAuthConfig, inst, log, args, arg_to_attr_pam, basedn=plugin.dn, props=props)
-
-
-def pam_pta_edit(inst, basedn, log, args):
- log = log.getChild('pam_pta_edit')
- configs = PAMPassThroughAuthConfigs(inst)
- config = configs.get(args.NAME)
- generic_object_edit(config, log, args, arg_to_attr_pam)
-
-
-def pam_pta_show(inst, basedn, log, args):
- log = log.getChild('pam_pta_show')
- configs = PAMPassThroughAuthConfigs(inst)
- config = configs.get(args.NAME)
-
- if not config.exists():
- raise ldap.NO_SUCH_OBJECT("Entry %s doesn't exists" % args.name)
- if args and args.json:
- o_str = config.get_all_attrs_json()
- log.info(o_str)
- else:
- log.info(config.display())
-
-
-def pam_pta_del(inst, basedn, log, args):
- log = log.getChild('pam_pta_del')
- configs = PAMPassThroughAuthConfigs(inst)
- config = configs.get(args.NAME)
- config.delete()
- log.info("Successfully deleted the %s", config.dn)
-
-
-def enable_plugins(inst, basedn, log, args):
- log.debug("Enabling the Pass Through Authentication & Pam Passthru Auth plugins")
- passthru_plugin = PassThroughAuthenticationPlugin(inst)
- pam_passthru_plugin = PAMPassThroughAuthPlugin(inst)
- passthru_plugin.enable()
- pam_passthru_plugin.enable();
- log.info("Plugins disabled.")
-
-
-def disable_plugins(inst, basedn, log, args):
- log.debug("Disabling the Pass Through Authentication & Pam Passthru Auth plugins")
- passthru_plugin = PassThroughAuthenticationPlugin(inst)
- pam_passthru_plugin = PAMPassThroughAuthPlugin(inst)
- passthru_plugin.disable()
- pam_passthru_plugin.disable();
- log.info("Plugins disabled.")
-
-
-def _add_parser_args_pam(parser):
- parser.add_argument('--exclude-suffix', nargs='+',
- help='Specifies a suffix to exclude from PAM authentication (pamExcludeSuffix)')
- parser.add_argument('--include-suffix', nargs='+',
- help='Sets a suffix to include for PAM authentication (pamIncludeSuffix)')
- parser.add_argument('--missing-suffix', choices=['ERROR', 'ALLOW', 'IGNORE', 'delete', ''],
- help='Identifies how to handle missing include or exclude suffixes (pamMissingSuffix)')
- parser.add_argument('--filter',
- help='Sets an LDAP filter to use to identify specific entries within '
- 'the included suffixes for which to use PAM pass-through authentication (pamFilter)')
- parser.add_argument('--id-attr',
- help='Contains the attribute name which is used to hold the PAM user ID (pamIDAttr)')
- parser.add_argument('--id_map_method',
- help='Sets the method to use to map the LDAP bind DN to a PAM identity (pamIDMapMethod)')
- parser.add_argument('--fallback', choices=['TRUE', 'FALSE'], type=str.upper,
- help='Sets whether to fallback to regular LDAP authentication '
- 'if PAM authentication fails (pamFallback)')
- parser.add_argument('--secure', choices=['TRUE', 'FALSE'], type=str.upper,
- help='Requires secure TLS connection for PAM authentication (pamSecure)')
- parser.add_argument('--service',
- help='Contains the service name to pass to PAM (pamService)')
-
-
-def create_parser(subparsers):
- passthroughauth_parser = subparsers.add_parser('pass-through-auth',
- help='Manage and configure Pass-Through Authentication plugins '
- '(LDAP URLs and PAM)')
- subcommands = passthroughauth_parser.add_subparsers(help='action')
-
- add_generic_plugin_parsers(subcommands, PassThroughAuthenticationPlugin)
-
- list = subcommands.add_parser('list', help='List pass-though plugin LDAP URLs or PAM configurations')
- subcommands_list = list.add_subparsers(help='action')
- list_urls = subcommands_list.add_parser('urls', help='Lists LDAP URLs')
- list_urls.set_defaults(func=pta_list)
- list_pam = subcommands_list.add_parser('pam-configs', help='Lists PAM configurations')
- list_pam.set_defaults(func=pam_pta_list)
-
- url = subcommands.add_parser('url', help='Manage PTA LDAP URL configurations')
- subcommands_url = url.add_subparsers(help='action')
-
- add_url = subcommands_url.add_parser('add', help='Add the config entry')
- add_url.add_argument('URL',
- help='The full LDAP URL in format '
- '"ldap|ldaps://authDS/subtree maxconns,maxops,timeout,ldver,connlifetime,startTLS". '
- 'If one optional parameter is specified the rest should be specified too')
- add_url.set_defaults(func=pta_add)
-
- edit_url = subcommands_url.add_parser('modify', help='Edit the config entry')
- edit_url.add_argument('OLD_URL', help='The full LDAP URL you get from the "list" command')
- edit_url.add_argument('NEW_URL',
- help='Sets the full LDAP URL in format '
- '"ldap|ldaps://authDS/subtree maxconns,maxops,timeout,ldver,connlifetime,startTLS". '
- 'If one optional parameter is specified the rest should be specified too.')
- edit_url.set_defaults(func=pta_edit)
-
- delete_url = subcommands_url.add_parser('delete', help='Delete the config entry')
- delete_url.add_argument('URL', help='The full LDAP URL you get from the "list" command')
- delete_url.set_defaults(func=pta_del)
-
- # Pam PTA and PTA are not the same plugin! We need to enable and control them seperately!
- show_parser = subcommands.add_parser('pam-show', help='Displays the plugin configuration')
- show_parser.set_defaults(func=generic_show, plugin_cls=PAMPassThroughAuthPlugin)
-
- enable_parser = subcommands.add_parser('pam-enable', help='Enables the plugin')
- enable_parser.set_defaults(func=generic_enable, plugin_cls=PAMPassThroughAuthPlugin)
-
- disable_parser = subcommands.add_parser('pam-disable', help='Disables the plugin')
- disable_parser.set_defaults(func=generic_disable, plugin_cls=PAMPassThroughAuthPlugin)
-
- status_parser = subcommands.add_parser('pam-status', help='Displays the plugin status')
- status_parser.set_defaults(func=generic_status, plugin_cls=PAMPassThroughAuthPlugin)
-
- pam = subcommands.add_parser('pam-config', help='Manage PAM PTA configurations.')
- pam.add_argument('NAME', help='The PAM PTA configuration name')
- subcommands_pam = pam.add_subparsers(help='action')
-
- add = subcommands_pam.add_parser('add', help='Add the config entry')
- add.set_defaults(func=pam_pta_add)
- _add_parser_args_pam(add)
- edit = subcommands_pam.add_parser('set', help='Edit the config entry')
- edit.set_defaults(func=pam_pta_edit)
- _add_parser_args_pam(edit)
- show = subcommands_pam.add_parser('show', help='Display the config entry')
- show.set_defaults(func=pam_pta_show)
- delete = subcommands_pam.add_parser('delete', help='Delete the config entry')
- delete.set_defaults(func=pam_pta_del)
| 0 |
402289642004f6c51b591d9b22bdee33f592240e
|
389ds/389-ds-base
|
Revert "Change referential integrity to be a betxnpostoperation plugin"
This reverts commit d316a6717b18cba9826639d82116baa967734f35.
keep the code that allows switching between a regular and a betxn
plugin
|
commit 402289642004f6c51b591d9b22bdee33f592240e
Author: Rich Megginson <[email protected]>
Date: Thu Feb 16 17:08:23 2012 -0700
Revert "Change referential integrity to be a betxnpostoperation plugin"
This reverts commit d316a6717b18cba9826639d82116baa967734f35.
keep the code that allows switching between a regular and a betxn
plugin
diff --git a/ldap/servers/plugins/referint/referint.c b/ldap/servers/plugins/referint/referint.c
index 4606de6e9..8ece43894 100644
--- a/ldap/servers/plugins/referint/referint.c
+++ b/ldap/servers/plugins/referint/referint.c
@@ -77,7 +77,7 @@ int referint_postop_del( Slapi_PBlock *pb );
int referint_postop_modrdn( Slapi_PBlock *pb );
int referint_postop_start( Slapi_PBlock *pb);
int referint_postop_close( Slapi_PBlock *pb);
-int update_integrity(char **argv, Slapi_DN *sDN, char *newrDN, Slapi_DN *newsuperior, int logChanges, void *txn);
+int update_integrity(char **argv, Slapi_DN *sDN, char *newrDN, Slapi_DN *newsuperior, int logChanges);
void referint_thread_func(void *arg);
int GetNextLine(char *dest, int size_dest, PRFileDesc *stream);
void writeintegritylog(char *logfilename, Slapi_DN *sdn, char *newrdn, Slapi_DN *newsuperior, Slapi_DN *requestorsdn);
@@ -165,12 +165,10 @@ referint_postop_del( Slapi_PBlock *pb )
int delay;
int logChanges=0;
int isrepop = 0;
- void *txn = NULL;
if ( slapi_pblock_get( pb, SLAPI_IS_REPLICATED_OPERATION, &isrepop ) != 0 ||
- slapi_pblock_get( pb, SLAPI_DELETE_TARGET_SDN, &sdn ) != 0 ||
- slapi_pblock_get(pb, SLAPI_PLUGIN_OPRETURN, &oprc) != 0 ||
- slapi_pblock_get(pb, SLAPI_TXN, &txn) != 0)
+ slapi_pblock_get( pb, SLAPI_DELETE_TARGET_SDN, &sdn ) != 0 ||
+ slapi_pblock_get(pb, SLAPI_PLUGIN_OPRETURN, &oprc) != 0)
{
slapi_log_error( SLAPI_LOG_FATAL, REFERINT_PLUGIN_SUBSYSTEM,
"referint_postop_del: could not get parameters\n" );
@@ -215,7 +213,7 @@ referint_postop_del( Slapi_PBlock *pb )
}else if(delay == 0){
/* no delay */
/* call function to update references to entry */
- rc = update_integrity(argv, sdn, NULL, NULL, logChanges, txn);
+ rc = update_integrity(argv, sdn, NULL, NULL, logChanges);
}else{
/* write the entry to integrity log */
writeintegritylog(argv[1], sdn, NULL, NULL, NULL /* slapi_get_requestor_sdn(pb) */);
@@ -244,14 +242,12 @@ referint_postop_modrdn( Slapi_PBlock *pb )
int delay;
int logChanges=0;
int isrepop = 0;
- void *txn = NULL;
if ( slapi_pblock_get( pb, SLAPI_IS_REPLICATED_OPERATION, &isrepop ) != 0 ||
slapi_pblock_get( pb, SLAPI_MODRDN_TARGET_SDN, &sdn ) != 0 ||
slapi_pblock_get( pb, SLAPI_MODRDN_NEWRDN, &newrdn ) != 0 ||
slapi_pblock_get( pb, SLAPI_MODRDN_NEWSUPERIOR_SDN, &newsuperior ) != 0 ||
- slapi_pblock_get(pb, SLAPI_PLUGIN_OPRETURN, &oprc) != 0 ||
- slapi_pblock_get(pb, SLAPI_TXN, &txn) != 0) {
+ slapi_pblock_get(pb, SLAPI_PLUGIN_OPRETURN, &oprc) != 0 ){
slapi_log_error( SLAPI_LOG_FATAL, REFERINT_PLUGIN_SUBSYSTEM,
"referint_postop_modrdn: could not get parameters\n" );
@@ -301,7 +297,7 @@ referint_postop_modrdn( Slapi_PBlock *pb )
/* no delay */
/* call function to update references to entry */
rc = update_integrity(argv, sdn, newrdn,
- newsuperior, logChanges, txn);
+ newsuperior, logChanges);
}else{
/* write the entry to integrity log */
writeintegritylog(argv[1], sdn, newrdn, newsuperior, NULL /* slapi_get_requestor_sdn(pb) */);
@@ -332,13 +328,11 @@ int isFatalSearchError(int search_result)
}
static int
-_do_modify(Slapi_PBlock *mod_pb, Slapi_DN *entrySDN, LDAPMod **mods, void *txn)
+_do_modify(Slapi_PBlock *mod_pb, Slapi_DN *entrySDN, LDAPMod **mods)
{
int rc = 0;
slapi_pblock_init(mod_pb);
- /* set the transaction to use */
- slapi_pblock_set(mod_pb, SLAPI_TXN, txn);
/* Use internal operation API */
slapi_modify_internal_set_pb_ext(mod_pb, entrySDN, mods, NULL, NULL,
@@ -359,7 +353,7 @@ _update_one_per_mod(Slapi_DN *entrySDN, /* DN of the searched entry */
const char *origDN, /* original DN that was modified */
char *newRDN, /* new RDN from modrdn */
const char *newsuperior, /* new superior from modrdn */
- Slapi_PBlock *mod_pb, void *txn)
+ Slapi_PBlock *mod_pb)
{
LDAPMod *list_of_mods[3];
char *values_del[2];
@@ -382,7 +376,7 @@ _update_one_per_mod(Slapi_DN *entrySDN, /* DN of the searched entry */
list_of_mods[0] = &attribute1;
/* terminate list of mods. */
list_of_mods[1] = NULL;
- rc = _do_modify(mod_pb, entrySDN, list_of_mods, txn);
+ rc = _do_modify(mod_pb, entrySDN, list_of_mods);
if (rc) {
slapi_log_error( SLAPI_LOG_FATAL, REFERINT_PLUGIN_SUBSYSTEM,
"_update_one_value: entry %s: deleting \"%s: %s\" failed (%d)"
@@ -471,7 +465,7 @@ _update_one_per_mod(Slapi_DN *entrySDN, /* DN of the searched entry */
attribute2.mod_values = values_add;
list_of_mods[1] = &attribute2;
list_of_mods[2] = NULL;
- rc = _do_modify(mod_pb, entrySDN, list_of_mods, txn);
+ rc = _do_modify(mod_pb, entrySDN, list_of_mods);
if (rc) {
slapi_log_error( SLAPI_LOG_FATAL, REFERINT_PLUGIN_SUBSYSTEM,
"_update_one_value: entry %s: replacing \"%s: %s\" "
@@ -501,7 +495,7 @@ _update_one_per_mod(Slapi_DN *entrySDN, /* DN of the searched entry */
attribute2.mod_values = values_add;
list_of_mods[1] = &attribute2;
list_of_mods[2] = NULL;
- rc = _do_modify(mod_pb, entrySDN, list_of_mods, txn);
+ rc = _do_modify(mod_pb, entrySDN, list_of_mods);
if (rc) {
slapi_log_error( SLAPI_LOG_FATAL, REFERINT_PLUGIN_SUBSYSTEM,
"_update_one_value: entry %s: replacing \"%s: %s\" "
@@ -535,7 +529,7 @@ _update_all_per_mod(Slapi_DN *entrySDN, /* DN of the searched entry */
const char *origDN, /* original DN that was modified */
char *newRDN, /* new RDN from modrdn */
const char *newsuperior, /* new superior from modrdn */
- Slapi_PBlock *mod_pb, void *txn)
+ Slapi_PBlock *mod_pb)
{
Slapi_Mods *smods = NULL;
char *newDN = NULL;
@@ -562,7 +556,7 @@ _update_all_per_mod(Slapi_DN *entrySDN, /* DN of the searched entry */
mods[0] = &attribute1;
/* terminate list of mods. */
mods[1] = NULL;
- rc = _do_modify(mod_pb, entrySDN, mods, txn);
+ rc = _do_modify(mod_pb, entrySDN, mods);
if (rc) {
slapi_log_error( SLAPI_LOG_FATAL, REFERINT_PLUGIN_SUBSYSTEM,
"_update_all_per_mod: entry %s: deleting \"%s: %s\" failed (%d)"
@@ -654,7 +648,7 @@ _update_all_per_mod(Slapi_DN *entrySDN, /* DN of the searched entry */
/* else: value does not include the modified DN. Ignore it. */
slapi_ch_free_string(&sval);
}
- rc = _do_modify(mod_pb, entrySDN, slapi_mods_get_ldapmods_byref(smods), txn);
+ rc = _do_modify(mod_pb, entrySDN, slapi_mods_get_ldapmods_byref(smods));
if (rc) {
slapi_log_error( SLAPI_LOG_FATAL, REFERINT_PLUGIN_SUBSYSTEM,
"_update_all_per_mod: entry %s failed (%d)\n",
@@ -676,7 +670,7 @@ bail:
int
update_integrity(char **argv, Slapi_DN *origSDN,
char *newrDN, Slapi_DN *newsuperior,
- int logChanges, void *txn)
+ int logChanges)
{
Slapi_PBlock *search_result_pb = NULL;
Slapi_PBlock *mod_pb = slapi_pblock_new();
@@ -697,7 +691,7 @@ update_integrity(char **argv, Slapi_DN *origSDN,
rc = -1;
goto free_and_return;
}
-
+
/* for now, just putting attributes to keep integrity on in conf file,
until resolve the other timing mode issue */
search_result_pb = slapi_pblock_new();
@@ -721,8 +715,6 @@ update_integrity(char **argv, Slapi_DN *origSDN,
/* Use new search API */
slapi_pblock_init(search_result_pb);
- /* set the parent txn for the search ops */
- slapi_pblock_set(search_result_pb, SLAPI_TXN, txn);
slapi_search_internal_set_pb(search_result_pb, search_base,
LDAP_SCOPE_SUBTREE, filter, attrs, 0 /* attrs only */,
NULL, NULL, referint_plugin_identity, 0);
@@ -774,13 +766,13 @@ update_integrity(char **argv, Slapi_DN *origSDN,
slapi_entry_get_sdn(search_entries[j]),
attr, attrName, origDN, newrDN,
slapi_sdn_get_dn(newsuperior),
- mod_pb, txn);
+ mod_pb);
} else {
rc = _update_all_per_mod(
slapi_entry_get_sdn(search_entries[j]),
attr, attrName, origDN, newrDN,
slapi_sdn_get_dn(newsuperior),
- mod_pb, txn);
+ mod_pb);
}
/* Should we stop if one modify returns an error? */
}
@@ -988,7 +980,7 @@ referint_thread_func(void *arg)
}
update_integrity(plugin_argv, sdn, tmprdn,
- tmpsuperior, logChanges, NULL);
+ tmpsuperior, logChanges);
slapi_sdn_free(&sdn);
slapi_ch_free_string(&tmprdn);
| 0 |
3cb911d59035b06abc88e2b0ea5e069bdb9238bb
|
389ds/389-ds-base
|
Ticket 49814 - skip standard ports for selinux labelling
Description: Skip labelling ports that use the the standard
port numbers (389, 636).
https://pagure.io/389-ds-base/issue/49814
Reviewed by: mreynolds(one line commit rule)
|
commit 3cb911d59035b06abc88e2b0ea5e069bdb9238bb
Author: Mark Reynolds <[email protected]>
Date: Wed Oct 24 13:42:46 2018 -0400
Ticket 49814 - skip standard ports for selinux labelling
Description: Skip labelling ports that use the the standard
port numbers (389, 636).
https://pagure.io/389-ds-base/issue/49814
Reviewed by: mreynolds(one line commit rule)
diff --git a/src/lib389/lib389/utils.py b/src/lib389/lib389/utils.py
index 68a06e316..8b1609eaf 100644
--- a/src/lib389/lib389/utils.py
+++ b/src/lib389/lib389/utils.py
@@ -184,7 +184,7 @@ def selinux_label_port(port, remove_label=False):
:raises: ValueError: Error message
"""
- if not selinux.is_selinux_enabled():
+ if not selinux.is_selinux_enabled() or port == 389 or port == 636:
return
label_set = False
| 0 |
28744c2c93ff384e10203d52a0226d4fcc4dab73
|
389ds/389-ds-base
|
forgot to tell Makefile.am about removed obsolete files
|
commit 28744c2c93ff384e10203d52a0226d4fcc4dab73
Author: Rich Megginson <[email protected]>
Date: Tue Jul 24 20:06:40 2007 +0000
forgot to tell Makefile.am about removed obsolete files
diff --git a/Makefile.am b/Makefile.am
index 64c81d0e4..4ea75be74 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -131,14 +131,11 @@ config_DATA = $(srcdir)/lib/ldaputil/certmap.conf \
$(srcdir)/ldap/schema/slapd-collations.conf
sampledata_DATA = $(srcdir)/ldap/ldif/Ace.ldif \
- $(srcdir)/ldap/ldif/commonTasks.ldif \
$(srcdir)/ldap/ldif/European.ldif \
$(srcdir)/ldap/ldif/Eurosuffix.ldif \
$(srcdir)/ldap/ldif/Example.ldif \
$(srcdir)/ldap/ldif/Example-roles.ldif \
$(srcdir)/ldap/ldif/Example-views.ldif \
- $(srcdir)/ldap/ldif/roledit.ldif \
- $(srcdir)/ldap/ldif/tasks.ldif \
$(srcdir)/ldap/ldif/template.ldif \
ldap/ldif/template-dse.ldif \
ldap/ldif/template-suffix-db.ldif \
diff --git a/Makefile.in b/Makefile.in
index d9a833974..b36da1a07 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1039,14 +1039,11 @@ config_DATA = $(srcdir)/lib/ldaputil/certmap.conf \
$(srcdir)/ldap/schema/slapd-collations.conf
sampledata_DATA = $(srcdir)/ldap/ldif/Ace.ldif \
- $(srcdir)/ldap/ldif/commonTasks.ldif \
$(srcdir)/ldap/ldif/European.ldif \
$(srcdir)/ldap/ldif/Eurosuffix.ldif \
$(srcdir)/ldap/ldif/Example.ldif \
$(srcdir)/ldap/ldif/Example-roles.ldif \
$(srcdir)/ldap/ldif/Example-views.ldif \
- $(srcdir)/ldap/ldif/roledit.ldif \
- $(srcdir)/ldap/ldif/tasks.ldif \
$(srcdir)/ldap/ldif/template.ldif \
ldap/ldif/template-dse.ldif \
ldap/ldif/template-suffix-db.ldif \
| 0 |
eb0cef2a2e3a0ee37e15f93ead2744a8bde38da5
|
389ds/389-ds-base
|
Issue 6625 - UI - various fixes part 3
Description:
This PR addresses the following issues:
- Add new user type "traditional" for legacy objectclasses
- Display entry types in wizard header when adding new users, groups, and roles
- Update lib389 and monitor charts to use psutil instead of the UI
directly calling "ps", "netstat", and "top"
- Improved format of numbers displayed in monitor: adding commas and
converting bytes to more readable values
- Improved replication manager table to allow password edits
Relates: https://github.com/389ds/389-ds-base/issues/6625
Reviewed by: spichugi, vashirov, and progier(Thanks!!!)
|
commit eb0cef2a2e3a0ee37e15f93ead2744a8bde38da5
Author: Mark Reynolds <[email protected]>
Date: Tue Feb 25 08:00:54 2025 -0500
Issue 6625 - UI - various fixes part 3
Description:
This PR addresses the following issues:
- Add new user type "traditional" for legacy objectclasses
- Display entry types in wizard header when adding new users, groups, and roles
- Update lib389 and monitor charts to use psutil instead of the UI
directly calling "ps", "netstat", and "top"
- Improved format of numbers displayed in monitor: adding commas and
converting bytes to more readable values
- Improved replication manager table to allow password edits
Relates: https://github.com/389ds/389-ds-base/issues/6625
Reviewed by: spichugi, vashirov, and progier(Thanks!!!)
diff --git a/rpm/389-ds-base.spec.in b/rpm/389-ds-base.spec.in
index 19dd3f736..798a84d2b 100644
--- a/rpm/389-ds-base.spec.in
+++ b/rpm/389-ds-base.spec.in
@@ -151,6 +151,7 @@ BuildRequires: python%{python3_pkgversion}-argparse-manpage
BuildRequires: python%{python3_pkgversion}-policycoreutils
BuildRequires: python%{python3_pkgversion}-libselinux
BuildRequires: python%{python3_pkgversion}-cryptography
+BuildRequires: python%{python3_pkgversion}-psutil
# For cockpit
%if %{with cockpit}
@@ -326,6 +327,7 @@ Requires: python%{python3_pkgversion}-argcomplete
Requires: python%{python3_pkgversion}-libselinux
Requires: python%{python3_pkgversion}-setuptools
Requires: python%{python3_pkgversion}-cryptography
+Requires: python%{python3_pkgversion}-psutil
Recommends: bash-completion
%{?python_provide:%python_provide python%{python3_pkgversion}-lib389}
diff --git a/src/cockpit/389-console/src/lib/ldap_editor/wizards/operations/addGroup.jsx b/src/cockpit/389-console/src/lib/ldap_editor/wizards/operations/addGroup.jsx
index fd58ee20b..832b48276 100644
--- a/src/cockpit/389-console/src/lib/ldap_editor/wizards/operations/addGroup.jsx
+++ b/src/cockpit/389-console/src/lib/ldap_editor/wizards/operations/addGroup.jsx
@@ -135,6 +135,12 @@ class AddGroup extends React.Component {
}
};
+ this.handleBack = ({ id }) => {
+ this.setState({
+ stepIdReached: id
+ });
+ };
+
this.handleSearchClick = () => {
this.setState({
isSearchRunning: true,
@@ -639,7 +645,12 @@ class AddGroup extends React.Component {
const title = (
<>
- {_("Parent DN: ")} <strong>{this.props.wizardEntryDn}</strong>
+ {_("Parent DN: ")} <strong>{this.props.wizardEntryDn}</strong>
+ {stepIdReached >= 2 &&
+ <>
+ <br />Group type: <strong>{this.state.groupType}</strong>
+ </>
+ }
</>
);
@@ -648,6 +659,7 @@ class AddGroup extends React.Component {
isOpen={this.props.isWizardOpen}
onClose={this.props.handleToggleWizard}
onNext={this.handleNext}
+ onBack={this.handleBack}
title={_("Add A Group")}
description={title}
steps={addGroupSteps}
diff --git a/src/cockpit/389-console/src/lib/ldap_editor/wizards/operations/addRole.jsx b/src/cockpit/389-console/src/lib/ldap_editor/wizards/operations/addRole.jsx
index 0c21f8573..d0e11a99a 100644
--- a/src/cockpit/389-console/src/lib/ldap_editor/wizards/operations/addRole.jsx
+++ b/src/cockpit/389-console/src/lib/ldap_editor/wizards/operations/addRole.jsx
@@ -196,6 +196,9 @@ class AddRole extends React.Component {
// true ==> Do not check the attribute selection when navigating back.
this.updateValuesTableRows(true);
}
+ this.setState({
+ stepIdReached: id
+ });
};
this.handleSearchClick = () => {
@@ -1067,6 +1070,11 @@ class AddRole extends React.Component {
const title = (
<>
{_("Parent DN: ")} <strong>{this.props.wizardEntryDn}</strong>
+ {stepIdReached >= 2 &&
+ <>
+ <br />Role type: <strong>{this.state.roleType}</strong>
+ </>
+ }
</>
);
diff --git a/src/cockpit/389-console/src/lib/ldap_editor/wizards/operations/addUser.jsx b/src/cockpit/389-console/src/lib/ldap_editor/wizards/operations/addUser.jsx
index 47c083cb2..6ff98a00b 100644
--- a/src/cockpit/389-console/src/lib/ldap_editor/wizards/operations/addUser.jsx
+++ b/src/cockpit/389-console/src/lib/ldap_editor/wizards/operations/addUser.jsx
@@ -1,32 +1,33 @@
import cockpit from "cockpit";
import React from 'react';
import {
- Alert,
- Card,
- CardBody,
- CardTitle,
- Form,
- Grid,
- GridItem,
- Label,
- Pagination,
- SearchInput,
- SimpleList,
- SimpleListItem,
- Spinner,
- Text,
- TextContent,
- TextVariants
+ Alert,
+ Card,
+ CardBody,
+ CardTitle,
+ Form,
+ Grid,
+ GridItem,
+ Label,
+ Pagination,
+ SearchInput,
+ Select,
+ SelectOption,
+ SelectList,
+ MenuToggle,
+ SimpleList,
+ SimpleListItem,
+ Spinner,
+ Text,
+ TextContent,
+ TextVariants
} from '@patternfly/react-core';
import {
- BadgeToggle,
- Dropdown,
- DropdownItem,
- DropdownPosition,
- Select,
- SelectOption,
- SelectVariant,
- Wizard
+ BadgeToggle,
+ Dropdown,
+ DropdownItem,
+ DropdownPosition,
+ Wizard
} from '@patternfly/react-core/deprecated';
import {
InfoCircleIcon,
@@ -38,7 +39,7 @@ import {
Th,
Tbody,
Td,
- headerCol
+ headerCol
} from '@patternfly/react-table';
import EditableTable from '../../lib/editableTable.jsx';
import {
@@ -64,6 +65,12 @@ class AddUser extends React.Component {
'objectClass: nsAccount',
'objectClass: nsOrgPerson',
],
+ 'Traditional Account': [
+ 'objectclass: top',
+ 'objectClass: person',
+ 'objectClass: organizationalPerson',
+ 'objectClass: inetOrgPerson',
+ ],
'Posix Account': [
'objectclass: top',
'objectClass: nsPerson',
@@ -89,6 +96,21 @@ class AddUser extends React.Component {
'uid', 'userCertificate', 'userPassword', 'userSMIMECertificate',
'userPKCS12', 'x500UniqueIdentifier'
],
+ 'Traditional Account': [
+ 'userPassword', 'telephoneNumber', 'seeAlso', 'description',
+ 'title', 'registeredAddress', 'destinationIndicator',
+ 'preferredDeliveryMethod', 'telexNumber', 'teletexTerminalIdentifier',
+ 'internationalISDNNumber', 'facsimileTelephoneNumber', 'street',
+ 'postOfficeBox', 'postalCode', 'postalAddress',
+ 'physicalDeliveryOfficeName', 'ou', 'st', 'l', 'audio',
+ 'businessCategory', 'carLicense', 'departmentNumber', 'displayName',
+ 'employeeNumber', 'employeeType', 'givenName', 'homePhone',
+ 'homePostalAddress', 'initials', 'jpegPhoto', 'labeledURI',
+ 'mail', 'manager', 'mobile', 'o', 'pager', 'photo', 'roomNumber',
+ 'secretary', 'uid', 'userCertificate', 'preferredLanguage',
+ 'userSMIMECertificate', 'userPKCS12', 'x500uniqueIdentifier',
+ 'x121Address'
+ ],
'Posix Account': [
'businessCategory', 'carLicense', 'departmentNumber',
'description', 'employeeNumber', 'employeeType', 'homePhone',
@@ -109,6 +131,9 @@ class AddUser extends React.Component {
'Basic Account': [
'cn', 'displayName',
],
+ 'Traditional Account': [
+ 'cn', 'sn',
+ ],
'Posix Account': [
'cn', 'uid', 'uidNumber', 'gidNumber', 'homeDirectory',
'displayName'
@@ -123,6 +148,10 @@ class AddUser extends React.Component {
'preferredDeliveryMethod', 'displayName', 'employeeNumber',
'preferredLanguage', 'userPassword',
],
+ 'Traditional Account': [
+ 'displayName', 'employeeNumber', 'preferredLanguage',
+ 'userPassword', 'preferredDeliveryMethod',
+ ],
'Posix Account': [
'preferredDeliveryMethod', 'displayName', 'employeeNumber',
'preferredLanguage', 'userPassword', 'uidNumber', 'gidNumber',
@@ -229,11 +258,15 @@ class AddUser extends React.Component {
// true ==> Do not check the attribute selection when navigating back.
this.updateValuesTableRows(true);
}
+ this.setState({
+ stepIdReached: id
+ });
};
- this.handleToggleType = (_event, isOpenType) => {
+ this.handleToggleType = () => {
+ const open = !this.state.isOpenType;
this.setState({
- isOpenType
+ isOpenType: open
});
};
this.handleSelectType = (event, selection) => {
@@ -600,31 +633,37 @@ class AddUser extends React.Component {
</Text>
</TextContent>
</div>
- <div className="ds-indent">
+ <div className="ds-indent ds-margin-top">
<Select
id="user-type-select"
aria-label="Select user type"
toggle={(toggleRef) => (
- <SelectToggle
+ <MenuToggle
ref={toggleRef}
- onToggle={(event, isOpen) => this.handleToggleType(event, isOpen)}
+ onClick={this.handleToggleType}
isExpanded={this.state.isOpenType}
>
{this.state.accountType}
- </SelectToggle>
+ </MenuToggle>
)}
onSelect={this.handleSelectType}
selected={this.state.accountType}
isOpen={this.state.isOpenType}
>
- <SelectOption key="user" value="Basic Account" />
- <SelectOption key="posix" value="Posix Account" />
- <SelectOption key="service" value="Service Account" />
+ <SelectList>
+ <SelectOption value="Basic Account">Basic Account</SelectOption>
+ <SelectOption value="Traditional Account" >Traditional Account</SelectOption>
+ <SelectOption value="Posix Account" >Posix Account</SelectOption>
+ <SelectOption value="Service Account" >Service Account</SelectOption>
+ </SelectList>
</Select>
<TextContent className="ds-margin-top-xlg">
<Text component={TextVariants.h6} className="ds-margin-top-lg ds-font-size-md">
<b>{_("Basic Account")}</b>{_(" - This type of user entry uses a common set of objectclasses (nsPerson, nsAccount, and nsOrgPerson).")}
</Text>
+ <Text component={TextVariants.h6} className="ds-margin-top-lg ds-font-size-md">
+ <b>Traditional Account</b> - This type of user entry uses a traditional/legacy set of objectclasses (person, organizationalPerson, and inetOrgPerson).
+ </Text>
<Text component={TextVariants.h6} className="ds-margin-top-lg ds-font-size-md">
<b>{_("Posix Account")}</b>{_(" - This type of user entry uses a similar set of objectclasses as the ")}<i>{_("Basic Account")}</i> {_("(nsPerson, nsAccount, nsOrgPerson, and posixAccount), but it includes POSIX attributes like:")}
<i>{_("uidNumber, gidNumber, homeDirectory, loginShell, and gecos")}</i>.
@@ -871,6 +910,11 @@ class AddUser extends React.Component {
const title = (
<>
{_("Parent DN: ")} <strong>{this.props.wizardEntryDn}</strong>
+ {stepIdReached >= 2 &&
+ <>
+ <br />Entry type: <strong>{this.state.accountType}</strong>
+ </>
+ }
</>
);
diff --git a/src/cockpit/389-console/src/lib/monitor/monitorTables.jsx b/src/cockpit/389-console/src/lib/monitor/monitorTables.jsx
index 17e2c4bba..5f1b80b55 100644
--- a/src/cockpit/389-console/src/lib/monitor/monitorTables.jsx
+++ b/src/cockpit/389-console/src/lib/monitor/monitorTables.jsx
@@ -5,29 +5,25 @@ import {
Grid,
GridItem,
Pagination,
- PaginationVariant,
SearchInput,
Text,
TextContent,
TextVariants,
} from '@patternfly/react-core';
import {
- expandable,
- TableVariant,
- sortable,
- SortByDirection,
- Table,
- Thead,
- Tr,
- Th,
- Tbody,
- Td,
- ExpandableRowContent,
+ SortByDirection,
+ Table,
+ Thead,
+ Tr,
+ Th,
+ Tbody,
+ Td,
+ ExpandableRowContent,
ActionsColumn
} from '@patternfly/react-table';
import { ExclamationTriangleIcon } from '@patternfly/react-icons/dist/js/icons/exclamation-triangle-icon';
import PropTypes from "prop-types";
-import { get_date_string } from "../tools.jsx";
+import { get_date_string, numToCommas } from "../tools.jsx";
const _ = cockpit.gettext;
@@ -72,9 +68,9 @@ class AbortCleanALLRUVTable extends React.Component {
getLog(log) {
return (
<TextContent>
- <Text
+ <Text
component={TextVariants.pre}
- style={{
+ style={{
whiteSpace: 'pre-wrap',
wordBreak: 'break-word'
}}
@@ -88,7 +84,7 @@ class AbortCleanALLRUVTable extends React.Component {
createRows(tasks) {
let rows = [];
let columns = [...this.state.columns];
-
+
for (const task of tasks) {
rows.push({
isOpen: false,
@@ -101,12 +97,12 @@ class AbortCleanALLRUVTable extends React.Component {
originalData: task
});
}
-
+
if (rows.length === 0) {
rows = [{ cells: [_("No Tasks")] }];
columns = [{ title: _("Abort CleanAllRUV Tasks") }];
}
-
+
return { rows, columns };
}
@@ -189,7 +185,7 @@ class AbortCleanALLRUVTable extends React.Component {
<Tr>
{!hasNoTasks && <Th screenReaderText="Row expansion" />}
{columns.map((column, columnIndex) => (
- <Th
+ <Th
key={columnIndex}
sort={column.sortable ? {
sortBy,
@@ -207,7 +203,7 @@ class AbortCleanALLRUVTable extends React.Component {
<React.Fragment key={rowIndex}>
<Tr>
{!hasNoTasks && (
- <Td
+ <Td
expand={{
rowIndex,
isExpanded: row.isOpen,
@@ -222,7 +218,7 @@ class AbortCleanALLRUVTable extends React.Component {
{row.isOpen && row.originalData && (
<Tr isExpanded={true}>
<Td />
- <Td
+ <Td
colSpan={columns.length + 1}
noPadding
>
@@ -291,9 +287,9 @@ class CleanALLRUVTable extends React.Component {
getLog(log) {
return (
<TextContent>
- <Text
+ <Text
component={TextVariants.pre}
- style={{
+ style={{
whiteSpace: 'pre-wrap',
wordBreak: 'break-word'
}}
@@ -307,7 +303,7 @@ class CleanALLRUVTable extends React.Component {
createRows(tasks) {
let rows = [];
let columns = [...this.state.columns];
-
+
for (const task of tasks) {
rows.push({
isOpen: false,
@@ -320,12 +316,12 @@ class CleanALLRUVTable extends React.Component {
originalData: task
});
}
-
+
if (rows.length === 0) {
rows = [{ cells: [_("No Tasks")] }];
columns = [{ title: _("CleanAllRUV Tasks") }];
}
-
+
return { rows, columns };
}
@@ -408,7 +404,7 @@ class CleanALLRUVTable extends React.Component {
<Tr>
{!hasNoTasks && <Th screenReaderText="Row expansion" />}
{columns.map((column, columnIndex) => (
- <Th
+ <Th
key={columnIndex}
sort={column.sortable ? {
sortBy,
@@ -426,7 +422,7 @@ class CleanALLRUVTable extends React.Component {
<React.Fragment key={rowIndex}>
<Tr>
{!hasNoTasks && (
- <Td
+ <Td
expand={{
rowIndex,
isExpanded: row.isOpen,
@@ -441,7 +437,7 @@ class CleanALLRUVTable extends React.Component {
{row.isOpen && row.originalData && (
<Tr isExpanded={true}>
<Td />
- <Td
+ <Td
colSpan={columns.length + 1}
noPadding
>
@@ -512,7 +508,7 @@ class WinsyncAgmtTable extends React.Component {
<GridItem span={3}>{_("Session In Progress:")}</GridItem>
<GridItem span={9}><b>{ agmt['update-in-progress'][0] }</b></GridItem>
<GridItem span={3}>{_("Changes Sent:")}</GridItem>
- <GridItem span={9}><b>{ agmt['number-changes-sent'][0] }</b></GridItem>
+ <GridItem span={9}><b>{ numToCommas(agmt['number-changes-sent'][0]) }</b></GridItem>
<hr />
<GridItem span={3}>{_("Last Init Started:")}</GridItem>
<GridItem span={9}><b>{ get_date_string(agmt['last-init-start'][0]) }</b></GridItem>
@@ -550,7 +546,7 @@ class WinsyncAgmtTable extends React.Component {
let rows = [];
let columns = [...this.state.columns];
let count = 0;
-
+
for (const agmt of this.props.agmts) {
rows.push({
isOpen: false,
@@ -564,12 +560,12 @@ class WinsyncAgmtTable extends React.Component {
});
count += 1;
}
-
+
if (rows.length === 0) {
rows = [{ cells: [_("No Agreements")] }];
columns = [{ title: _("Winsync Agreements") }];
}
-
+
this.setState({
rows,
columns
@@ -599,7 +595,7 @@ class WinsyncAgmtTable extends React.Component {
if (direction !== SortByDirection.asc) {
sorted_agmts.reverse();
}
-
+
for (let agmt of sorted_agmts) {
agmt = agmt.agmt;
rows.push({
@@ -613,7 +609,7 @@ class WinsyncAgmtTable extends React.Component {
originalData: agmt
});
}
-
+
this.setState({
sortBy: {
index,
@@ -640,7 +636,7 @@ class WinsyncAgmtTable extends React.Component {
<Tr>
{!hasNoAgreements && <Th screenReaderText="Row expansion" />}
{columns.map((column, columnIndex) => (
- <Th
+ <Th
key={columnIndex}
sort={column.sortable ? {
sortBy,
@@ -658,7 +654,7 @@ class WinsyncAgmtTable extends React.Component {
<React.Fragment key={rowIndex}>
<Tr>
{!hasNoAgreements && (
- <Td
+ <Td
expand={{
rowIndex,
isExpanded: row.isOpen,
@@ -673,7 +669,7 @@ class WinsyncAgmtTable extends React.Component {
{row.isOpen && row.originalData && (
<Tr isExpanded={true}>
<Td />
- <Td
+ <Td
colSpan={columns.length + 1}
noPadding
>
@@ -742,9 +738,9 @@ class AgmtTable extends React.Component {
<GridItem span={3}>{_("Session In Progress:")}</GridItem>
<GridItem span={9}><b>{ agmt['update-in-progress'][0] }</b></GridItem>
<GridItem span={3}>{_("Changes Sent:")}</GridItem>
- <GridItem span={9}><b>{ agmt['number-changes-sent'][0] }</b></GridItem>
+ <GridItem span={9}><b>{ numToCommas(agmt['number-changes-sent'][0]) }</b></GridItem>
<GridItem span={3}>{_("Changes Skipped:")}</GridItem>
- <GridItem span={9}><b>{ agmt['number-changes-skipped'][0] }</b></GridItem>
+ <GridItem span={9}><b>{ numToCommas(agmt['number-changes-skipped'][0]) }</b></GridItem>
<GridItem span={3}>{_("Reap Active:")}</GridItem>
<GridItem span={9}><b>{ agmt['reap-active'][0] }</b></GridItem>
<hr />
@@ -784,7 +780,7 @@ class AgmtTable extends React.Component {
let rows = [];
let columns = [...this.state.columns];
let count = 0;
-
+
for (const agmt of this.props.agmts) {
rows.push({
isOpen: false,
@@ -798,12 +794,12 @@ class AgmtTable extends React.Component {
});
count += 1;
}
-
+
if (rows.length === 0) {
rows = [{ cells: [_("No Agreements")] }];
columns = [{ title: _("Replication Agreements") }];
}
-
+
this.setState({
rows,
columns
@@ -833,7 +829,7 @@ class AgmtTable extends React.Component {
if (direction !== SortByDirection.asc) {
sorted_agmts.reverse();
}
-
+
for (let agmt of sorted_agmts) {
agmt = agmt.agmt;
rows.push({
@@ -847,7 +843,7 @@ class AgmtTable extends React.Component {
originalData: agmt
});
}
-
+
this.setState({
sortBy: {
index,
@@ -874,7 +870,7 @@ class AgmtTable extends React.Component {
<Tr>
{!hasNoAgreements && <Th screenReaderText="Row expansion" />}
{columns.map((column, columnIndex) => (
- <Th
+ <Th
key={columnIndex}
sort={column.sortable ? {
sortBy,
@@ -893,7 +889,7 @@ class AgmtTable extends React.Component {
<React.Fragment key={rowIndex}>
<Tr>
{!hasNoAgreements && (
- <Td
+ <Td
expand={{
rowIndex,
isExpanded: row.isOpen,
@@ -908,7 +904,7 @@ class AgmtTable extends React.Component {
{row.isOpen && row.originalData && (
<Tr isExpanded={true}>
<Td />
- <Td
+ <Td
colSpan={columns.length + 1}
noPadding
>
@@ -983,7 +979,7 @@ class ConnectionTable extends React.Component {
getExpandedRow(ip, conn_date, parts) {
return (
- <Grid className="ds-indent">
+ <Grid className="ds-indent ds-margin-top ds-margin-bottom">
<GridItem span={3}>{_("IP Address:")}</GridItem>
<GridItem span={4}><b>{ip}</b></GridItem>
<GridItem span={3}>{_("File Descriptor:")}</GridItem>
@@ -991,22 +987,21 @@ class ConnectionTable extends React.Component {
<GridItem span={3}>{_("Connection Opened:")}</GridItem>
<GridItem span={4}><b>{conn_date}</b></GridItem>
<GridItem span={3}>{_("Operations Started:")}</GridItem>
- <GridItem span={2}><b>{parts[2]}</b></GridItem>
+ <GridItem span={2}><b>{numToCommas(parts[2])}</b></GridItem>
<GridItem span={3}>{_("Connection ID:")}</GridItem>
<GridItem span={4}><b>{parts[9]}</b></GridItem>
<GridItem span={3}>{_("Operations Finished:")}</GridItem>
- <GridItem span={2}><b>{parts[3]}</b></GridItem>
+ <GridItem span={2}><b>{numToCommas(parts[3])}</b></GridItem>
<GridItem span={3}>{_("Bind DN:")}</GridItem>
<GridItem span={4}><b>{parts[5]}</b></GridItem>
<GridItem span={3}>{_("Read/write Blocked:")}</GridItem>
- <GridItem span={2}><b>{parts[4]}</b></GridItem>
- <hr />
- <GridItem span={6}>{_("Connection Currently At Max Threads:")}</GridItem>
- <GridItem span={6}><b>{parts[6] === "1" ? _("Yes") : _("No")}</b></GridItem>
- <GridItem span={6}>{_("Number Of Times Connection Hit Max Threads:")}</GridItem>
- <GridItem span={6}><b>{parts[7]}</b></GridItem>
- <GridItem span={6}>{_("Number Of Operations Blocked By Max Threads:")}</GridItem>
- <GridItem span={6}><b>{parts[8]}</b></GridItem>
+ <GridItem span={2}><b>{numToCommas(parts[4])}</b></GridItem>
+ <GridItem className="ds-margin-top-lg" span={5}>{_("Connection Currently At Max Threads:")}</GridItem>
+ <GridItem className="ds-margin-top-lg" span={7}><b>{parts[6] === "1" ? _("Yes") : _("No")}</b></GridItem>
+ <GridItem span={5}>{_("Number Of Times Connection Hit Max Threads:")}</GridItem>
+ <GridItem span={7}><b>{numToCommas(parts[7])}</b></GridItem>
+ <GridItem span={5}>{_("Number Of Operations Blocked By Max Threads:")}</GridItem>
+ <GridItem span={7}><b>{numToCommas(parts[8])}</b></GridItem>
</Grid>
);
}
@@ -1185,7 +1180,7 @@ class ConnectionTable extends React.Component {
<div className="ds-margin-top-xlg">
<TextContent>
<Text component={TextVariants.h4}>
- {_("Client Connections:")}<b className="ds-left-margin">{this.props.conns.length}</b>
+ {_("Client Connections:")}<b className="ds-left-margin">{numToCommas(this.props.conns.length)}</b>
</Text>
</TextContent>
<SearchInput
@@ -1203,7 +1198,7 @@ class ConnectionTable extends React.Component {
<Tr>
<Th screenReaderText="Row expansion" />
{columns.map((column, columnIndex) => (
- <Th
+ <Th
key={columnIndex}
sort={column.sortable ? {
sortBy,
@@ -1222,12 +1217,12 @@ class ConnectionTable extends React.Component {
if (row.parent !== undefined) {
// This is an expanded row
return (
- <Tr
+ <Tr
key={rowIndex}
isExpanded={tableRows[row.parent].isOpen}
>
<Td />
- <Td
+ <Td
colSpan={columns.length + 1}
noPadding
>
@@ -1242,7 +1237,7 @@ class ConnectionTable extends React.Component {
// This is a regular row
return (
<Tr key={rowIndex}>
- <Td
+ <Td
expand={{
rowIndex,
isExpanded: row.isOpen,
@@ -1321,7 +1316,7 @@ class GlueTable extends React.Component {
handleSort(_event, index, direction) {
const sortedGlues = [...this.state.rows];
-
+
sortedGlues.sort((a, b) => {
const aValue = a[index];
const bValue = b[index];
@@ -1358,7 +1353,7 @@ class GlueTable extends React.Component {
render() {
const { columns, rows, perPage, page, sortBy } = this.state;
const hasRows = this.props.glues.length > 0;
-
+
// Calculate pagination
const startIdx = (perPage * page) - perPage;
let tableRows = [...rows].splice(startIdx, perPage);
@@ -1401,7 +1396,7 @@ class GlueTable extends React.Component {
))}
{hasRows && (
<Td isActionCell>
- <ActionsColumn
+ <ActionsColumn
items={this.getActions(row)}
/>
</Td>
@@ -1496,7 +1491,7 @@ class ConflictTable extends React.Component {
handleSort(_event, index, direction) {
const sortedConflicts = [...this.state.rows];
-
+
sortedConflicts.sort((a, b) => {
const aValue = a[index];
const bValue = b[index];
@@ -1522,7 +1517,7 @@ class ConflictTable extends React.Component {
render() {
const { columns, rows, perPage, page, sortBy } = this.state;
-
+
// Calculate pagination
const startIdx = (perPage * page) - perPage;
const tableRows = [...rows].splice(startIdx, perPage);
@@ -1673,7 +1668,7 @@ class ReportAliasesTable extends React.Component {
let columns = this.state.columns;
let rows = JSON.parse(JSON.stringify(this.props.rows)); // Deep copy
const hasRows = rows.length > 0;
-
+
if (!hasRows) {
rows = [[_("No Aliases")]];
columns = [{ title: _("Instance Aliases") }];
@@ -1710,7 +1705,7 @@ class ReportAliasesTable extends React.Component {
<Tbody>
{rows.map((row, rowIndex) => (
<Tr key={rowIndex}>
- {Array.isArray(row) ?
+ {Array.isArray(row) ?
row.map((cell, cellIndex) => (
<Td key={cellIndex}>{cell}</Td>
))
@@ -1719,7 +1714,7 @@ class ReportAliasesTable extends React.Component {
}
{hasRows && (
<Td isActionCell>
- <ActionsColumn
+ <ActionsColumn
items={this.getActions(row)}
/>
</Td>
@@ -1773,7 +1768,7 @@ class ReportCredentialsTable extends React.Component {
const rowCopy = JSON.parse(JSON.stringify(row)); // Deep copy
const pwInteractive = rowCopy.pwInputInterractive;
let pwField = <i>{_("Interactive Input is set")}</i>;
-
+
if (!pwInteractive) {
if (rowCopy.credsBindpw === "") {
pwField = <i>{_("Both Password or Interactive Input flag are not set")}</i>;
@@ -1824,7 +1819,7 @@ class ReportCredentialsTable extends React.Component {
<Tbody>
{tableRows.map((row, rowIndex) => (
<Tr key={rowIndex}>
- {Array.isArray(row) ?
+ {Array.isArray(row) ?
row.map((cell, cellIndex) => (
<Td key={cellIndex}>{cell}</Td>
))
@@ -1833,7 +1828,7 @@ class ReportCredentialsTable extends React.Component {
}
{hasRows && (
<Td isActionCell>
- <ActionsColumn
+ <ActionsColumn
items={this.getActions(row)}
/>
</Td>
@@ -1856,8 +1851,8 @@ class ReportSingleTable extends React.Component {
sortBy: {},
rows: [],
columns: [
- {
- title: _("Supplier"),
+ {
+ title: _("Supplier"),
sortable: true
},
{ title: _("Agreement"), sortable: true },
@@ -1904,9 +1899,9 @@ class ReportSingleTable extends React.Component {
<GridItem span={3}>{_("Consumer:")}</GridItem>
<GridItem span={9}><b>{ agmt.replica[0] }</b></GridItem>
<GridItem span={3}>{_("Changes Sent:")}</GridItem>
- <GridItem span={9}><b>{ agmt['number-changes-sent'][0] }</b></GridItem>
+ <GridItem span={9}><b>{ numToCommas(agmt['number-changes-sent'][0]) }</b></GridItem>
<GridItem span={3}>{_("Changes Skipped:")}</GridItem>
- <GridItem span={9}><b>{ agmt['number-changes-skipped'][0] }</b></GridItem>
+ <GridItem span={9}><b>{ numToCommas(agmt['number-changes-skipped'][0]) }</b></GridItem>
<GridItem span={3}>{_("Reap Active:")}</GridItem>
<GridItem span={9}><b>{ agmt['reap-active'][0] }</b></GridItem>
<hr />
@@ -2066,7 +2061,7 @@ class ReportSingleTable extends React.Component {
<Tr>
<Th screenReaderText="Row expansion" />
{columns.map((column, columnIndex) => (
- <Th
+ <Th
key={columnIndex}
sort={column.sortable ? {
sortBy,
@@ -2084,12 +2079,12 @@ class ReportSingleTable extends React.Component {
if (row.parent !== undefined) {
// Expanded row
return (
- <Tr
+ <Tr
key={rowIndex}
isExpanded={rows[row.parent].isOpen}
>
<Td />
- <Td
+ <Td
colSpan={columns.length + 1}
noPadding
>
@@ -2103,7 +2098,7 @@ class ReportSingleTable extends React.Component {
// Regular row
return (
<Tr key={rowIndex}>
- <Td
+ <Td
expand={{
rowIndex,
isExpanded: row.isOpen,
@@ -2177,9 +2172,9 @@ class ReportConsumersTable extends React.Component {
<GridItem span={3}>{_("Consumer:")}</GridItem>
<GridItem span={9}><b>{ agmt.replica[0] }</b></GridItem>
<GridItem span={3}>{_("Changes Sent:")}</GridItem>
- <GridItem span={9}><b>{ agmt['number-changes-sent'][0] }</b></GridItem>
+ <GridItem span={9}><b>{ numToCommas(agmt['number-changes-sent'][0]) }</b></GridItem>
<GridItem span={3}>{_("Changes Skipped:")}</GridItem>
- <GridItem span={9}><b>{ agmt['number-changes-skipped'][0] }</b></GridItem>
+ <GridItem span={9}><b>{ numToCommas(agmt['number-changes-skipped'][0]) }</b></GridItem>
<GridItem span={3}>{_("Reap Active:")}</GridItem>
<GridItem span={9}><b>{ agmt['reap-active'][0] }</b></GridItem>
<hr />
@@ -2336,7 +2331,7 @@ class ReportConsumersTable extends React.Component {
<Tr>
<Th screenReaderText="Row expansion" />
{columns.map((column, columnIndex) => (
- <Th
+ <Th
key={columnIndex}
sort={column.sortable ? {
sortBy,
@@ -2353,12 +2348,12 @@ class ReportConsumersTable extends React.Component {
{rows.map((row, rowIndex) => {
if (row.parent !== undefined) {
return (
- <Tr
+ <Tr
key={rowIndex}
isExpanded={rows[row.parent].isOpen}
>
<Td />
- <Td
+ <Td
colSpan={columns.length + 1}
noPadding
>
@@ -2371,7 +2366,7 @@ class ReportConsumersTable extends React.Component {
}
return (
<Tr key={rowIndex}>
- <Td
+ <Td
expand={{
rowIndex,
isExpanded: row.isOpen,
@@ -2460,7 +2455,7 @@ class ReplDSRCTable extends React.Component {
return (
<div className="ds-margin-top-xlg">
- <Table
+ <Table
aria-label="Sortable DSRC Table"
variant="compact"
>
@@ -2552,7 +2547,7 @@ class ReplDSRCAliasTable extends React.Component {
return (
<div className="ds-margin-top-xlg">
- <Table
+ <Table
aria-label="Sortable DSRC Table"
variant="compact"
>
diff --git a/src/cockpit/389-console/src/lib/monitor/serverMonitor.jsx b/src/cockpit/389-console/src/lib/monitor/serverMonitor.jsx
index 0fe5f047d..513e1d792 100644
--- a/src/cockpit/389-console/src/lib/monitor/serverMonitor.jsx
+++ b/src/cockpit/389-console/src/lib/monitor/serverMonitor.jsx
@@ -1,7 +1,13 @@
import cockpit from "cockpit";
import React from "react";
import PropTypes from "prop-types";
-import { log_cmd, get_date_string, get_date_diff, displayKBytes } from "../tools.jsx";
+import {
+ log_cmd,
+ get_date_string,
+ get_date_diff,
+ displayBytes,
+ numToCommas
+} from "../tools.jsx";
import {
ConnectionTable,
DiskTable,
@@ -10,6 +16,7 @@ import {
Button,
Card,
CardBody,
+ Divider,
Grid,
GridItem,
Tab,
@@ -35,14 +42,21 @@ export class ServerMonitor extends React.Component {
constructor (props) {
super(props);
- const initChart = [];
- for (let idx = 1; idx <= 10; idx++) {
- initChart.push({ name: '', x: idx.toString(), y: 0 });
+ const initCPUChart = [];
+ const initVirtChart = [];
+ const initResChart = [];
+ const initSwapChart = [];
+ const initConnChart = [];
+ for (let idx = 1; idx <= 6; idx++) {
+ initCPUChart.push({ name: 'CPU', x: "0:00:00", y: 0 });
+ initResChart.push({ name: 'Resident', x: "0:00:00", y: 0 });
+ initVirtChart.push({ name: 'Virtual', x: "0:00:00", y: 0 });
+ initSwapChart.push({ name: 'Swap', x: "0:00:00", y: 0 });
+ initConnChart.push({ name: 'Connection', x: "0:00:00", y: 0 });
}
this.state = {
- activeKey: 0,
- count: 10,
+ activeKey: this.props.serverTab,
port: 389,
secure_port: 636,
conn_highmark: 1000,
@@ -50,12 +64,18 @@ export class ServerMonitor extends React.Component {
mem_tick_values: [25, 50, 75, 100],
conn_tick_values: [250, 500, 750, 1000],
mem_ratio: 0,
+ total_threads: 0,
chart_refresh: "",
- initChart,
- cpuChart: [...initChart],
- memVirtChart: [...initChart],
- memResChart: [...initChart],
- connChart: [...initChart],
+ initCPUChart,
+ initVirtChart,
+ initResChart,
+ initSwapChart,
+ initConnChart,
+ cpuChart: [...initCPUChart],
+ memVirtChart: [...initVirtChart],
+ memResChart: [...initResChart],
+ swapChart: [...initSwapChart],
+ connChart: [...initConnChart],
};
this.handleNavSelect = (event, tabIndex) => {
@@ -79,189 +99,123 @@ export class ServerMonitor extends React.Component {
this.stopRefresh();
}
- getPorts() {
- const cmd = [
- "dsconf", "-j", "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
- "config", "get", "nsslapd-port", "nsslapd-secureport"
- ];
- log_cmd("getPorts", "Get the server port numbers", cmd);
- cockpit
- .spawn(cmd, { superuser: true, err: "message" })
- .done(content => {
- const config = JSON.parse(content);
- this.setState({
- port: config.attrs['nsslapd-port'][0],
- secure_port: config.attrs['nsslapd-secureport'] === undefined
- ? "-1"
- : config.attrs['nsslapd-secureport'][0],
- });
- });
- }
-
resetChartData() {
this.setState({
conn_highmark: 1000,
cpu_tick_values: [25, 50, 75, 100],
mem_tick_values: [],
conn_tick_values: [250, 500, 750, 1000],
- cpuChart: [...this.state.initChart],
- memVirtChart: [...this.state.initChart],
- memResChart: [...this.state.initChart],
- connChart: [...this.state.initChart],
+ cpuChart: [...this.state.initCPUChart],
+ memVirtChart: [...this.state.initVirtChart],
+ memResChart: [...this.state.initResChart],
+ swapChart: [...this.state.initSwapChart],
+ connChart: [...this.state.initConnChart],
});
}
- convertMemory(mem_str) {
- mem_str = mem_str.replace(",", ".");
- if (mem_str.endsWith('m')) {
- // Convert MB to KB
- const mem = mem_str.slice(0, -1);
- return parseInt(Math.round(mem * 1024));
- } else if (mem_str.endsWith('g')) {
- // Convert GB to KB
- const mem = mem_str.slice(0, -1);
- return parseInt(Math.round(mem * 1024 * 1024));
- } else if (mem_str.endsWith('t')) {
- // Convert TB to KB
- const mem = mem_str.slice(0, -1);
- return parseInt(Math.round(mem * 1024 * 1024 * 1024));
- } else if (mem_str.endsWith('p')) {
- // Convert PB to KB
- const mem = mem_str.slice(0, -1);
- return parseInt(Math.round(mem * 1024 * 1024 * 1024 * 1024));
- } else {
- return mem_str;
- }
- }
-
refreshCharts() {
- const cmd = "ps -ef | grep -v grep | grep dirsrv/slapd-" + this.props.serverId;
let cpu = 0;
- let pid = 0;
- let max_mem = 0;
+ let mem_total = 0;
+ let mem_rss_usage = 0;
+ let mem_vms_usage = 0;
+ let mem_swap_usage = 0;
let virt_mem = 0;
let res_mem = 0;
+ let swap_mem = 0;
let current_conns = 0;
+ let total_threads = 0;
let conn_highmark = this.state.conn_highmark;
let cpu_tick_values = this.state.cpu_tick_values;
let conn_tick_values = this.state.conn_tick_values;
-
- // log_cmd("refreshCharts", "Get server pid", [cmd]);
+ let interval = "0:00:00";
+ const cmd = [
+ "dsconf", "-j", this.props.serverId,
+ "monitor", "server", "--just-resources"
+ ];
cockpit
- .script(cmd, [], { superuser: true, err: "message" })
- .done(output => {
- pid = output.split(/\s+/)[1];
- const cpu_cmd = "top -n 1 -b -p " + pid + " | tail -1";
- // log_cmd("refreshCharts", "Get cpu and memory stats", [cpu_cmd]);
- cockpit
- .script(cpu_cmd, [], { superuser: true, err: "message" })
- .done(top_output => {
- const top_parts = top_output.trim().split(/\s+/);
- virt_mem = this.convertMemory(top_parts[4]);
- res_mem = this.convertMemory(top_parts[5]);
- cpu = parseInt(top_parts[8]);
- const mem_cmd = "awk '/MemTotal/{print $2}' /proc/meminfo";
- // log_cmd("refreshCharts", "Get total memory", [mem_cmd]);
- cockpit
- .script(mem_cmd, [], { superuser: true, err: "message" })
- .done(mem_output => {
- max_mem = parseInt(mem_output);
- const conn_cmd = "netstat -anp | grep ':" + this.state.port + "\\|:" + this.state.secure_port +
- "' | grep ESTABLISHED | grep ns-slapd | wc -l";
- // log_cmd("refreshCharts", "Get current count", [conn_cmd]);
- cockpit
- .script(conn_cmd, [], { superuser: true, err: "message" })
- .done(conn_output => {
- current_conns = parseInt(conn_output);
- let count = this.state.count + 1; // This is used by all the charts
- if (count === 100) {
- // Keep progress count in check
- count = 1;
- }
-
- // Adjust CPU chart ticks if CPU goes above 100%
- if (cpu > 100) {
- let resize = true;
- for (const stat of this.state.cpuChart) {
- if (stat.y > cpu) {
- // There is already a higher CPU in the data
- resize = false;
- break;
- }
- }
- if (resize) {
- let incr = Math.ceil(cpu / 4);
- cpu_tick_values = [incr, incr += incr, incr += incr, cpu];
- }
- } else {
- let okToReset = true;
- for (const stat of this.state.cpuChart) {
- if (stat.y > 100) {
- okToReset = false;
- break;
- }
- }
- if (okToReset) {
- cpu_tick_values = [25, 50, 75, 100];
- }
- }
-
- // Set conn tick values
- if (current_conns > conn_highmark) {
- conn_highmark = Math.ceil(current_conns / 1000) * 1000;
- const conn_incr = Math.ceil(conn_highmark / 4);
- let tick = conn_incr;
- conn_tick_values = [
- tick,
- tick += conn_incr,
- tick += conn_incr,
- tick += conn_incr
- ];
- }
-
- const cpuChart = this.state.cpuChart;
- cpuChart.shift();
- cpuChart.push({ name: _("CPU"), x: count.toString(), y: parseInt(cpu) });
-
- const memVirtChart = this.state.memVirtChart;
- memVirtChart.shift();
- memVirtChart.push({ name: _("Virtual Memory"), x: count.toString(), y: parseInt(Math.round((virt_mem / max_mem) * 100)) });
-
- const memResChart = this.state.memResChart;
- memResChart.shift();
- memResChart.push({ name: _("Resident Memory"), x: count.toString(), y: parseInt(Math.round((res_mem / max_mem) * 100)) });
-
- const connChart = this.state.connChart;
- connChart.shift();
- connChart.push({ name: _("Connections"), x: count.toString(), y: parseInt(current_conns) });
-
- this.setState({
- count,
- cpu_tick_values,
- conn_tick_values,
- cpuChart,
- memVirtChart,
- memResChart,
- connChart,
- conn_highmark,
- current_conns,
- mem_virt_size: virt_mem,
- mem_res_size: res_mem,
- mem_ratio: Math.round((virt_mem / max_mem) * 100),
- cpu,
- });
- })
- .fail(() => {
- this.resetChartData();
- });
- })
- .fail(() => {
- this.resetChartData();
- });
- })
- .fail(() => {
- this.resetChartData();
- });
+ .spawn(cmd, { superuser: true, err: "message" })
+ .done(content => {
+ const data = JSON.parse(content);
+ const attrs = data.attrs;
+ const date = new Date;
+
+ cpu = attrs['cpu_usage'][0];
+ mem_rss_usage = attrs['mem_rss_percent'][0];
+ mem_vms_usage = attrs['mem_vms_percent'][0];
+ mem_swap_usage = attrs['mem_swap_percent'][0];
+ virt_mem = attrs['vms'][0];
+ res_mem = attrs['rss'][0];
+ swap_mem = attrs['swap'][0];
+ current_conns = attrs['connection_count'][0];
+ total_threads = attrs['total_threads'][0];
+ mem_total = attrs['total_mem'][0];
+
+ // Build time interval
+ let hour = date.getHours().toString();
+ let min = date.getMinutes();
+ let sec = date.getSeconds();
+
+ if (min < 10) {
+ min = "0" + min;
+ }
+ if (sec < 10) {
+ sec = "0" + sec;
+ }
+ interval = hour + ":" + min + ":" + sec;
+
+ // Set conn tick values
+ if (current_conns > conn_highmark) {
+ conn_highmark = Math.ceil(current_conns / 1000) * 1000;
+ const conn_incr = Math.ceil(conn_highmark / 4);
+ let tick = conn_incr;
+ conn_tick_values = [
+ tick,
+ tick += conn_incr,
+ tick += conn_incr,
+ tick += conn_incr
+ ];
+ }
+
+ const cpuChart = this.state.cpuChart;
+ cpuChart.shift();
+ cpuChart.push({ name: _("CPU"), x: interval, y: parseInt(cpu) });
+
+ const memVirtChart = this.state.memVirtChart;
+ memVirtChart.shift();
+ memVirtChart.push({ name: _("Virtual Memory"), x: interval, y: parseInt(mem_vms_usage) });
+
+ const memResChart = this.state.memResChart;
+ memResChart.shift();
+ memResChart.push({ name: _("Resident Memory"), x: interval, y: parseInt(mem_rss_usage) });
+
+ const swapChart = this.state.swapChart;
+ swapChart.shift();
+ swapChart.push({ name: "Swap", x: interval, y: parseInt(mem_swap_usage) });
+
+ const connChart = this.state.connChart;
+ connChart.shift();
+ connChart.push({ name: _("Connections"), x: interval, y: parseInt(current_conns) });
+
+ this.setState({
+ cpu_tick_values,
+ conn_tick_values,
+ cpuChart,
+ memVirtChart,
+ memResChart,
+ swapChart,
+ connChart,
+ conn_highmark,
+ current_conns,
+ mem_virt_size: virt_mem,
+ mem_res_size: res_mem,
+ mem_swap_size: swap_mem,
+ mem_rss_ratio: mem_rss_usage,
+ mem_vms_ratio: mem_vms_usage,
+ mem_swap_ratio: mem_swap_usage,
+ mem_total,
+ cpu,
+ total_threads,
+ });
})
.fail(() => {
this.resetChartData();
@@ -270,7 +224,7 @@ export class ServerMonitor extends React.Component {
startRefresh() {
this.setState({
- chart_refresh: setInterval(this.refreshCharts, 3000),
+ chart_refresh: setInterval(this.refreshCharts, 10000),
});
}
@@ -286,9 +240,15 @@ export class ServerMonitor extends React.Component {
current_conns,
memResChart,
memVirtChart,
+ swapChart,
mem_virt_size,
mem_res_size,
- mem_ratio,
+ mem_swap_size,
+ mem_rss_ratio,
+ mem_vms_ratio,
+ mem_swap_ratio,
+ mem_total,
+ total_threads,
} = this.state;
// Generate start time and uptime
@@ -298,23 +258,33 @@ export class ServerMonitor extends React.Component {
const uptime = get_date_diff(startTime, currTime);
const conn_tick_values = this.state.conn_tick_values;
let cpu_tick_values = this.state.cpu_tick_values;
- const mem_tick_values = this.state.mem_tick_values;
+ let mem_tick_values = this.state.mem_tick_values;
// Adjust chart if CPU goes above 100%
if (cpu > 100) {
- let incr = Math.ceil(cpu / 4);
- cpu_tick_values = [incr, incr += incr, incr += incr, incr += incr];
+ let tick = (Math.ceil(cpu/100)*100)/4;
+ let incr = tick;
+ cpu_tick_values = [tick, tick += incr, tick += incr, tick += incr];
} else {
- let okToReset = true;
- for (const stat of cpuChart) {
- if (stat.y > 100) {
- okToReset = false;
- break;
- }
- }
- if (okToReset) {
- cpu_tick_values = [25, 50, 75, 100];
+ cpu_tick_values = [25, 50, 75, 100];
+ }
+
+ // Adjust chart if memory usage goes above 100%
+ if (mem_vms_ratio > 100 || mem_rss_ratio > 100 || mem_swap_ratio > 100) {
+ // Find the highest ratio to resize the chart with
+ let mem_ratio;
+ if (mem_vms_ratio >= mem_rss_ratio && mem_vms_ratio >= mem_swap_ratio) {
+ mem_ratio = mem_vms_ratio;
+ } else if (mem_rss_ratio >= mem_vms_ratio && mem_rss_ratio >= mem_swap_ratio) {
+ mem_ratio = mem_rss_ratio;
+ } else {
+ mem_ratio = mem_swap_ratio;
}
+ let tick = (Math.ceil(mem_ratio/100)*100)/4;
+ let incr = tick;
+ mem_tick_values = [tick, tick += incr, tick += incr, tick += incr];
+ } else {
+ mem_tick_values = [25, 50, 75, 100];
}
return (
@@ -327,7 +297,7 @@ export class ServerMonitor extends React.Component {
<Button
variant="plain"
aria-label={_("Refresh suffix monitor")}
- onClick={this.props.handleReload}
+ onClick={() => this.props.handleReload(this.state.activeKey)}
>
<SyncAltIcon />
</Button>
@@ -337,110 +307,42 @@ export class ServerMonitor extends React.Component {
</Grid>
<Tabs isFilled className="ds-margin-top-lg" activeKey={this.state.activeKey} onSelect={this.handleNavSelect}>
<Tab eventKey={0} title={<TabTitleText>{_("Resource Charts")}</TabTitleText>}>
- <Card className="ds-margin-top-lg" isSelectable>
- <CardBody>
- <Grid>
- <GridItem span="2" className="ds-center" title={_("Established client connections to the server")}>
- <TextContent>
- <Text component={TextVariants.h5}>
- {_("Connections")}
- </Text>
- </TextContent>
- <TextContent>
- <Text component={TextVariants.h2}>
- <b>{current_conns}</b>
- </Text>
- </TextContent>
- </GridItem>
- <GridItem span="10" style={{ height: '175px', width: '600px' }}>
- <Chart
- ariaDesc="connection stats"
- ariaTitle={_("Live Connection Statistics")}
- containerComponent={<ChartVoronoiContainer labels={({ datum }) => `${datum.name}: ${datum.y}`} constrainToVisibleArea />}
- height={175}
- minDomain={{ y: 0 }}
- padding={{
- bottom: 30,
- left: 50,
- top: 10,
- right: 15,
- }}
- width={600}
- >
- <ChartAxis />
- <ChartAxis dependentAxis showGrid tickValues={conn_tick_values} />
- <ChartGroup>
- <ChartArea
- data={connChart}
- />
- </ChartGroup>
- </Chart>
- </GridItem>
- </Grid>
- </CardBody>
- </Card>
<Grid className="ds-margin-top-lg" hasGutter>
- <GridItem span={6}>
- <Card isSelectable>
+ <GridItem span="6">
+ <Card className="ds-margin-top-lg">
<CardBody>
<Grid>
- <GridItem className="ds-center" span="4">
- <TextContent>
- <Text component={TextVariants.h5}>
- {_("Memory Usage")}
- </Text>
- </TextContent>
+ <GridItem span="4" className="ds-center" title={_("Established client connections to the server")}>
<TextContent>
- <Text component={TextVariants.h3}>
- <b>{mem_ratio}%</b>
+ <Text className="ds-margin-top-xlg" component={TextVariants.h3}>
+ {_("Connections")}
</Text>
</TextContent>
<TextContent>
- <Text className="ds-margin-top-lg" component={TextVariants.h5}>
- {_("Virtual Size")}
- </Text>
- </TextContent>
- <TextContent>
- <Text component={TextVariants.h3}>
- <b>{displayKBytes(mem_virt_size)}</b>
- </Text>
- </TextContent>
- <TextContent>
- <Text className="ds-margin-top-lg" component={TextVariants.h5}>
- {_("Resident Size")}
- </Text>
- </TextContent>
- <TextContent>
- <Text component={TextVariants.h3}>
- <b>{displayKBytes(mem_res_size)}</b>
+ <Text component={TextVariants.h6}>
+ <b>{numToCommas(current_conns)}</b>
</Text>
</TextContent>
</GridItem>
- <GridItem span="8" style={{ height: '225px' }}>
+ <GridItem span="8">
<Chart
- ariaDesc="Server Memory Utilization"
- ariaTitle={_("Live Server Memory Statistics")}
+ ariaDesc="connection stats"
+ ariaTitle={_("Live Connection Statistics")}
containerComponent={<ChartVoronoiContainer labels={({ datum }) => `${datum.name}: ${datum.y}`} constrainToVisibleArea />}
- height={225}
+ height={200}
minDomain={{ y: 0 }}
padding={{
bottom: 30,
- left: 40,
+ left: 55,
top: 10,
- right: 15,
+ right: 25,
}}
- themeColor={ChartThemeColor.multiUnordered}
>
<ChartAxis />
- <ChartAxis dependentAxis showGrid tickValues={mem_tick_values} />
+ <ChartAxis dependentAxis showGrid tickValues={conn_tick_values} />
<ChartGroup>
<ChartArea
- data={memVirtChart}
- interpolation="monotoneX"
- />
- <ChartArea
- data={memResChart}
- interpolation="monotoneX"
+ data={connChart}
/>
</ChartGroup>
</Chart>
@@ -450,38 +352,43 @@ export class ServerMonitor extends React.Component {
</Card>
</GridItem>
<GridItem span={6}>
- <Card isSelectable>
+ <Card className="ds-margin-top-lg">
<CardBody>
<Grid>
<GridItem span="4" className="ds-center">
<TextContent>
- <Text className="ds-margin-top-xlg" component={TextVariants.h5}>
+ <Text className="ds-margin-top-xlg" component={TextVariants.h3}>
{_("CPU Usage")}
</Text>
</TextContent>
<TextContent>
- <Text component={TextVariants.h3}>
+ <Text component={TextVariants.h6}>
<b>{cpu}%</b>
</Text>
</TextContent>
</GridItem>
- <GridItem span="8" style={{ height: '225px' }}>
+ <GridItem span="8">
<Chart
ariaDesc="cpu"
ariaTitle={_("Server CPU Usage")}
- containerComponent={<ChartVoronoiContainer labels={({ datum }) => `${datum.name}: ${datum.y}`} constrainToVisibleArea />}
- height={225}
+ containerComponent={<ChartVoronoiContainer labels={({ datum }) => `${datum.name}: ${datum.y}%`} constrainToVisibleArea />}
+ height={200}
minDomain={{ y: 0 }}
padding={{
bottom: 30,
- left: 40,
+ left: 55,
top: 10,
- right: 15,
+ right: 25,
}}
themeColor={ChartThemeColor.multiUnordered}
>
<ChartAxis />
- <ChartAxis dependentAxis showGrid tickValues={cpu_tick_values} />
+ <ChartAxis
+ dependentAxis
+ showGrid
+ tickFormat={(value) => `${value}%`}
+ tickValues={cpu_tick_values}
+ />
<ChartGroup>
<ChartArea
data={cpuChart}
@@ -495,6 +402,101 @@ export class ServerMonitor extends React.Component {
</Card>
</GridItem>
</Grid>
+
+ <Card className="ds-margin-top-lg ds-margin-bottom-md">
+ <CardBody>
+ <Grid hasGutter>
+ <GridItem className="ds-center ds-margin-top-xl" span="3">
+ <TextContent className="ds-margin-top" title="The percentage of system memory used by Directory Server">
+ <Text component={TextVariants.h3}>
+ Total System Memory
+ </Text>
+ </TextContent>
+ <TextContent>
+ <Text component={TextVariants.h6}>
+ <b>{displayBytes(mem_total)}</b>
+ </Text>
+ </TextContent>
+ <Divider className="ds-margin-top ds-margin-bottom"/>
+ <TextContent className="ds-margin-top-lg">
+ <Text component={TextVariants.h3}>
+ {_("Resident Size")}
+ </Text>
+ </TextContent>
+ <TextContent>
+ <Text component={TextVariants.h6}>
+ <b>{displayBytes(mem_res_size)}</b> ({mem_rss_ratio}%)
+ </Text>
+ </TextContent>
+ <TextContent>
+ <Text className="ds-margin-top-lg" component={TextVariants.h3}>
+ {_("Virtual Size")}
+ </Text>
+ </TextContent>
+ <TextContent>
+ <Text component={TextVariants.h6}>
+ <b>{displayBytes(mem_virt_size)}</b> ({mem_vms_ratio}%)
+ </Text>
+ </TextContent>
+ <TextContent className="ds-margin-top-lg">
+ <Text component={TextVariants.h3}>
+ Swap Size
+ </Text>
+ </TextContent>
+ <TextContent>
+ <Text component={TextVariants.h6}>
+ <b>{displayBytes(mem_swap_size)}</b> ({mem_swap_ratio}%)
+ </Text>
+ </TextContent>
+ </GridItem>
+ <GridItem span="9">
+ <Chart
+ ariaDesc="Server Memory Utilization"
+ ariaTitle={_("Live Server Memory Statistics")}
+ containerComponent={<ChartVoronoiContainer labels={({ datum }) => `${datum.name}: ${datum.y}%`} constrainToVisibleArea />}
+ height={125}
+ minDomain={{ y: 0 }}
+ padding={{
+ bottom: 30,
+ left: 60,
+ top: 10,
+ right: 30,
+ }}
+ themeColor={ChartThemeColor.multiUnordered}
+ >
+ <ChartAxis />
+ <ChartAxis
+ dependentAxis
+ showGrid
+ style={{
+ tickLabels: {
+ fontSize: 8,
+ }
+ }}
+ tickFormat={(value) => `${value}%`} tickValues={mem_tick_values}
+ />
+ <ChartGroup>
+ <ChartArea
+ data={memVirtChart}
+ interpolation="monotoneX"
+ themeColor={ChartThemeColor.blue}
+ />
+ <ChartArea
+ data={memResChart}
+ interpolation="monotoneX"
+ themeColor={ChartThemeColor.green}
+ />
+ <ChartArea
+ data={swapChart}
+ interpolation="monotoneX"
+ themeColor={ChartThemeColor.red}
+ />
+ </ChartGroup>
+ </Chart>
+ </GridItem>
+ </Grid>
+ </CardBody>
+ </Card>
</Tab>
<Tab eventKey={1} title={<TabTitleText>{_("Server Stats")}</TabTitleText>}>
<Grid hasGutter className="ds-margin-top-xlg">
@@ -529,59 +531,66 @@ export class ServerMonitor extends React.Component {
<GridItem span={2}>
<b>{this.props.data.threads}</b>
</GridItem>
+
+ <GridItem span={3} title="Count of all the threads the server has created. Includes replication agrements, housekeeping, worker threads, tasks, etc">
+ {_("Total Threads")}
+ </GridItem>
+ <GridItem span={2}>
+ <b>{total_threads}</b>
+ </GridItem>
<GridItem span={3}>
{_("Threads Waiting To Read")}
</GridItem>
<GridItem span={2}>
- <b>{this.props.data.readwaiters}</b>
+ <b>{numToCommas(this.props.data.readwaiters)}</b>
</GridItem>
<GridItem span={3}>
{_("Conns At Max Threads")}
</GridItem>
<GridItem span={2}>
- <b>{this.props.data.currentconnectionsatmaxthreads}</b>
+ <b>{numToCommas(this.props.data.currentconnectionsatmaxthreads)}</b>
</GridItem>
<GridItem span={3}>
{_("Conns Exceeded Max Threads")}
</GridItem>
<GridItem span={2}>
- <b>{this.props.data.maxthreadsperconnhits}</b>
+ <b>{numToCommas(this.props.data.maxthreadsperconnhits)}</b>
</GridItem>
<GridItem span={3}>
{_("Total Connections")}
</GridItem>
<GridItem span={2}>
- <b>{this.props.data.totalconnections}</b>
+ <b>{numToCommas(this.props.data.totalconnections)}</b>
</GridItem>
<GridItem span={3}>
{_("Current Connections")}
</GridItem>
<GridItem span={2}>
- <b>{this.props.data.currentconnections}</b>
+ <b>{numToCommas(this.props.data.currentconnections)}</b>
</GridItem>
<GridItem span={3}>
{_("Operations Started")}
</GridItem>
<GridItem span={2}>
- <b>{this.props.data.opsinitiated}</b>
+ <b>{numToCommas(this.props.data.opsinitiated)}</b>
</GridItem>
<GridItem span={3}>
{_("Operations Completed")}
</GridItem>
<GridItem span={2}>
- <b>{this.props.data.opscompleted}</b>
+ <b>{numToCommas(this.props.data.opscompleted)}</b>
</GridItem>
<GridItem span={3}>
{_("Entries Returned To Clients")}
</GridItem>
<GridItem span={2}>
- <b>{this.props.data.entriessent}</b>
+ <b>{numToCommas(this.props.data.entriessent)}</b>
</GridItem>
<GridItem span={3}>
- {_("Bytes Sent to Clients")}
+ {_("Data Sent to Clients")}
</GridItem>
<GridItem span={2}>
- <b>{this.props.data.bytessent}</b>
+ <b>{displayBytes(this.props.data.bytessent)}</b>
</GridItem>
</Grid>
</Tab>
@@ -593,10 +602,14 @@ export class ServerMonitor extends React.Component {
rows={this.props.disks}
/>
<Button
- className="ds-margin-top"
+ className="ds-margin-top-lg"
+ variant="secondary"
onClick={this.props.handleReloadDisks}
+ isLoading={this.props.diskReloadSpinning}
+ spinnerAriaValueText={this.props.diskReloadSpinning ? "Refreshing" : undefined}
+ isDisabled={this.props.diskReloadSpinning}
>
- {_("Refresh")}
+ {this.props.diskReloadSpinning ? "Refreshing" : _("Refresh")}
</Button>
</Tab>
<Tab eventKey={4} title={<TabTitleText>{_("SNMP Counters")}</TabTitleText>}>
@@ -605,151 +618,151 @@ export class ServerMonitor extends React.Component {
{_("Anonymous Binds")}
</GridItem>
<GridItem span={2}>
- <b>{this.props.snmpData.anonymousbinds}</b>
+ <b>{numToCommas(this.props.snmpData.anonymousbinds[0])}</b>
</GridItem>
<GridItem span={4}>
{_("Referrals")}
</GridItem>
<GridItem span={2}>
- <b>{this.props.snmpData.referrals}</b>
+ <b>{numToCommas(this.props.snmpData.referrals[0])}</b>
</GridItem>
<GridItem span={4}>
{_("Unauthenticated Binds")}
</GridItem>
<GridItem span={2}>
- <b>{this.props.snmpData.unauthbinds}</b>
+ <b>{numToCommas(this.props.snmpData.unauthbinds[0])}</b>
</GridItem>
<GridItem span={4}>
{_("Returned Referrals")}
</GridItem>
<GridItem span={2}>
- <b>{this.props.snmpData.referralsreturned}</b>
+ <b>{numToCommas(this.props.snmpData.referralsreturned[0])}</b>
</GridItem>
<GridItem span={4}>
{_("Simple Auth Binds")}
</GridItem>
<GridItem span={2}>
- <b>{this.props.snmpData.simpleauthbinds}</b>
+ <b>{numToCommas(this.props.snmpData.simpleauthbinds[0])}</b>
</GridItem>
<GridItem span={4}>
{_("Bind Security Errors")}
</GridItem>
<GridItem span={2}>
- <b>{this.props.snmpData.bindsecurityerrors}</b>
+ <b>{numToCommas(this.props.snmpData.bindsecurityerrors[0])}</b>
</GridItem>
<GridItem span={4}>
{_("Strong Auth Binds")}
</GridItem>
<GridItem span={2}>
- <b>{this.props.snmpData.strongauthbinds}</b>
+ <b>{numToCommas(this.props.snmpData.strongauthbinds[0])}</b>
</GridItem>
<GridItem span={4}>
{_("Security Errors")}
</GridItem>
<GridItem span={2}>
- <b>{this.props.snmpData.securityerrors}</b>
+ <b>{numToCommas(this.props.snmpData.securityerrors[0])}</b>
</GridItem>
<GridItem span={4}>
{_("Initiated Operations")}
</GridItem>
<GridItem span={2}>
- <b>{this.props.snmpData.inops}</b>
+ <b>{numToCommas(this.props.snmpData.inops[0])}</b>
</GridItem>
<GridItem span={4}>
{_("Errors")}
</GridItem>
<GridItem span={2}>
- <b>{this.props.snmpData.errors}</b>
+ <b>{numToCommas(this.props.snmpData.errors[0])}</b>
</GridItem>
<GridItem span={4}>
{_("Compare Operations")}
</GridItem>
<GridItem span={2}>
- <b>{this.props.snmpData.compareops}</b>
+ <b>{numToCommas(this.props.snmpData.compareops[0])}</b>
</GridItem>
<GridItem span={4}>
{_("Current Connections")}
</GridItem>
<GridItem span={2}>
- <b>{this.props.snmpData.connections}</b>
+ <b>{numToCommas(this.props.snmpData.connections[0])}</b>
</GridItem>
<GridItem span={4}>
{_("Add Operations")}
</GridItem>
<GridItem span={2}>
- <b>{this.props.snmpData.addentryops}</b>
+ <b>{numToCommas(this.props.snmpData.addentryops[0])}</b>
</GridItem>
<GridItem span={4}>
{_("Total Connections")}
</GridItem>
<GridItem span={2}>
- <b>{this.props.snmpData.connectionseq}</b>
+ <b>{numToCommas(this.props.snmpData.connectionseq[0])}</b>
</GridItem>
<GridItem span={4}>
{_("Delete Operations")}
</GridItem>
<GridItem span={2}>
- <b>{this.props.snmpData.removeentryops}</b>
+ <b>{numToCommas(this.props.snmpData.removeentryops[0])}</b>
</GridItem>
<GridItem span={4}>
{_("Conns in Max Threads")}
</GridItem>
<GridItem span={2}>
- <b>{this.props.snmpData.connectionsinmaxthreads}</b>
+ <b>{numToCommas(this.props.snmpData.connectionsinmaxthreads[0])}</b>
</GridItem>
<GridItem span={4}>
{_("Modify Operations")}
</GridItem>
<GridItem span={2}>
- <b>{this.props.snmpData.modifyentryops}</b>
+ <b>{numToCommas(this.props.snmpData.modifyentryops[0])}</b>
</GridItem>
<GridItem span={4}>
{_("Conns Exceeded Max Threads")}
</GridItem>
<GridItem span={2}>
- <b>{this.props.snmpData.connectionsmaxthreadscount}</b>
+ <b>{numToCommas(this.props.snmpData.connectionsmaxthreadscount[0])}</b>
</GridItem>
<GridItem span={4}>
{_("ModRDN Operations")}
</GridItem>
<GridItem span={2}>
- <b>{this.props.snmpData.modifyrdnops}</b>
+ <b>{numToCommas(this.props.snmpData.modifyrdnops[0])}</b>
</GridItem>
<GridItem span={4}>
- {_("Bytes Received")}
+ {_("Data Received")}
</GridItem>
<GridItem span={2}>
- <b>{this.props.snmpData.bytesrecv}</b>
+ <b>{displayBytes(this.props.snmpData.bytesrecv[0])}</b>
</GridItem>
<GridItem span={4}>
{_("Search Operations")}
</GridItem>
<GridItem span={2}>
- <b>{this.props.snmpData.searchops}</b>
+ <b>{numToCommas(this.props.snmpData.searchops[0])}</b>
</GridItem>
<GridItem span={4}>
- {_("Bytes Sent")}
+ {_("Data Sent")}
</GridItem>
<GridItem span={2}>
- <b>{this.props.snmpData.bytessent}</b>
+ <b>{displayBytes(this.props.snmpData.bytessent[0])}</b>
</GridItem>
<GridItem span={4}>
{_("One Level Searches")}
</GridItem>
<GridItem span={2}>
- <b>{this.props.snmpData.onelevelsearchops}</b>
+ <b>{numToCommas(this.props.snmpData.onelevelsearchops[0])}</b>
</GridItem>
<GridItem span={4}>
{_("Entries Returned")}
</GridItem>
<GridItem span={2}>
- <b>{this.props.snmpData.entriesreturned}</b>
+ <b>{numToCommas(this.props.snmpData.entriesreturned[0])}</b>
</GridItem>
<GridItem span={4}>
{_("Whole Tree Searches")}
</GridItem>
<GridItem span={2}>
- <b>{this.props.snmpData.wholesubtreesearchops}</b>
+ <b>{numToCommas(this.props.snmpData.wholesubtreesearchops[0])}</b>
</GridItem>
</Grid>
</Tab>
diff --git a/src/cockpit/389-console/src/lib/replication/replConfig.jsx b/src/cockpit/389-console/src/lib/replication/replConfig.jsx
index 2b56e6602..902be1485 100644
--- a/src/cockpit/389-console/src/lib/replication/replConfig.jsx
+++ b/src/cockpit/389-console/src/lib/replication/replConfig.jsx
@@ -3,7 +3,7 @@ import React from "react";
import { log_cmd, valid_dn, callCmdStreamPassword } from "../tools.jsx";
import { DoubleConfirmModal } from "../notifications.jsx";
import { ManagerTable } from "./replTables.jsx";
-import { AddManagerModal, ChangeReplRoleModal } from "./replModals.jsx";
+import { AddEditManagerModal, ChangeReplRoleModal } from "./replModals.jsx";
import {
Button,
Checkbox,
@@ -25,9 +25,10 @@ export class ReplConfig extends React.Component {
this.state = {
saving: false,
showConfirmManagerDelete: false,
- showAddManagerModal: false,
+ showAddEditManagerModal: false,
showPromoteDemoteModal: false,
- addManagerSpinning: false,
+ addEditManagerSpinning: false,
+ editManager: false,
roleChangeSpinning: false,
manager: "cn=replication manager,cn=config",
manager_passwd: "",
@@ -110,7 +111,8 @@ export class ReplConfig extends React.Component {
this.closeConfirmManagerDelete = this.closeConfirmManagerDelete.bind(this);
this.deleteManager = this.deleteManager.bind(this);
this.handleShowAddManager = this.handleShowAddManager.bind(this);
- this.closeAddManagerModal = this.closeAddManagerModal.bind(this);
+ this.handleShowEditManager = this.handleShowEditManager.bind(this);
+ this.closeAddEditManagerModal = this.closeAddEditManagerModal.bind(this);
this.addManager = this.addManager.bind(this);
this.handleChange = this.handleChange.bind(this);
this.onModalChange = this.onModalChange.bind(this);
@@ -185,18 +187,19 @@ export class ReplConfig extends React.Component {
});
}
- closeAddManagerModal () {
+ closeAddEditManagerModal () {
this.setState({
- showAddManagerModal: false
+ showAddEditManagerModal: false
});
}
handleShowAddManager () {
this.setState({
- showAddManagerModal: true,
+ showAddEditManagerModal: true,
manager: "cn=replication manager,cn=config",
manager_passwd: "",
manager_passwd_confirm: "",
+ editManager: false,
errObj: {
manager_passwd: true,
manager_passwd_confirm: true,
@@ -204,6 +207,20 @@ export class ReplConfig extends React.Component {
});
}
+ handleShowEditManager (manager) {
+ this.setState({
+ showAddEditManagerModal: true,
+ manager: manager,
+ manager_passwd: "",
+ manager_passwd_confirm: "",
+ editManager: true,
+ errObj: {
+ manager_passwd: false,
+ manager_passwd_confirm: false,
+ }
+ });
+ }
+
addManager () {
// Validate DN
if (!valid_dn(this.state.manager)) {
@@ -228,7 +245,7 @@ export class ReplConfig extends React.Component {
}
this.setState({
- addManagerSpinning: true
+ addEditManagerSpinning: true
});
const cmd = [
@@ -243,18 +260,22 @@ export class ReplConfig extends React.Component {
passwd: this.state.manager_passwd,
addNotification: this.props.addNotification,
msg: _("Replication Manager"),
- success_msg: _("Successfully added Replication Manager"),
- error_msg: _("Failure adding Replication Manager"),
+ success_msg: this.state.editManager ?
+ "Successfully edited Replication Manager" :
+ _("Successfully added Replication Manager"),
+ error_msg:this.state.editManager ?
+ "Failure editing Replication Manager" :
+ _("Failure adding Replication Manager"),
state_callback: () => {
this.setState({
- addManagerSpinning: false,
- showAddManagerModal: false
+ addEditManagerSpinning: false,
+ showAddEditManagerModal: false
});
},
reload_func: this.props.reloadConfig,
reload_arg: this.props.suffix,
funcName: "addManager",
- funcDesc: _("Adding Replication Manager")
+ funcDesc: this.state.editManager ? "Editing Replication Manager" : _("Adding Replication Manager")
};
callCmdStreamPassword(config);
}
@@ -360,6 +381,13 @@ export class ReplConfig extends React.Component {
errObj.manager_passwd = false;
}
}
+ if (attr === "manager") {
+ if (!valid_dn(value)) {
+ valueErr = true;
+ } else {
+ errObj[attr] = false;
+ }
+ }
errObj[attr] = valueErr;
this.setState({
@@ -586,10 +614,11 @@ export class ReplConfig extends React.Component {
<GridItem className="ds-label" span={12}>
{_("Replication Managers")}
</GridItem>
- <GridItem className="ds-margin-top" span={9}>
+ <GridItem className="ds-margin-top" span={7}>
<ManagerTable
rows={manager_rows}
confirmDelete={this.confirmManagerDelete}
+ showEditManager={this.handleShowEditManager}
/>
</GridItem>
</Grid>
@@ -861,16 +890,17 @@ export class ReplConfig extends React.Component {
mSpinningMsg={_("Removing Manager ...")}
mBtnName={_("Remove Manager")}
/>
- <AddManagerModal
- showModal={this.state.showAddManagerModal}
- closeHandler={this.closeAddManagerModal}
+ <AddEditManagerModal
+ showModal={this.state.showAddEditManagerModal}
+ closeHandler={this.closeAddEditManagerModal}
handleChange={this.onManagerChange}
saveHandler={this.addManager}
- spinning={this.state.addManagerSpinning}
+ spinning={this.state.addEditManagerSpinning}
manager={this.state.manager}
manager_passwd={this.state.manager_passwd}
manager_passwd_confirm={this.state.manager_passwd_confirm}
error={this.state.errObj}
+ edit={this.state.editManager}
/>
<ChangeReplRoleModal
showModal={this.state.showPromoteDemoteModal}
diff --git a/src/cockpit/389-console/src/lib/replication/replModals.jsx b/src/cockpit/389-console/src/lib/replication/replModals.jsx
index 5dfa72a60..68a2ecae5 100644
--- a/src/cockpit/389-console/src/lib/replication/replModals.jsx
+++ b/src/cockpit/389-console/src/lib/replication/replModals.jsx
@@ -1582,7 +1582,7 @@ export class ChangeReplRoleModal extends React.Component {
}
}
-export class AddManagerModal extends React.Component {
+export class AddEditManagerModal extends React.Component {
render() {
const {
showModal,
@@ -1593,18 +1593,19 @@ export class AddManagerModal extends React.Component {
manager,
manager_passwd,
manager_passwd_confirm,
- error
+ error,
+ edit,
} = this.props;
- let saveBtnName = _("Add Replication Manager");
+ let saveBtnName = this.props.edit ? "Save Replication Manager" : _("Add Replication Manager");
const extraPrimaryProps = {};
if (spinning) {
- saveBtnName = _("Adding Replication Manager ...");
+ saveBtnName = this.props.edit ? "Saving Replication Manager ..." : _("Adding Replication Manager ...");
}
return (
<Modal
variant={ModalVariant.medium}
- title={_("Add Replication Manager")}
+ title={this.props.edit ? "Edit Replication Manager" : _("Add Replication Manager")}
aria-labelledby="ds-modal"
isOpen={showModal}
onClose={closeHandler}
@@ -1628,7 +1629,10 @@ export class AddManagerModal extends React.Component {
<Form isHorizontal autoComplete="off">
<TextContent>
<Text component={TextVariants.h3}>
- {_("Create a Replication Manager entry, and add it to the replication configuration for this suffix. If the entry already exists it will be overwritten with the new credentials.")}
+ {this.props.edit ?
+ ""
+ :
+ _("Create a Replication Manager entry, and add it to the replication configuration for this suffix. If the entry already exists it will be overwritten with the new credentials.")}
</Text>
</TextContent>
<Grid className="ds-margin-top-lg" title={_("The DN of the replication manager")}>
@@ -1645,13 +1649,14 @@ export class AddManagerModal extends React.Component {
onChange={(e, str) => {
handleChange(e);
}}
+ isDisabled={this.props.edit}
validated={error.manager ? ValidatedOptions.error : ValidatedOptions.default}
/>
</GridItem>
</Grid>
<Grid className="ds-margin-top" title={_("Replication Manager password")}>
<GridItem className="ds-label" span={3}>
- {_("Password")}
+ {this.props.edit ? "New password" : _("Password")}
</GridItem>
<GridItem span={9}>
<TextInput
@@ -1669,7 +1674,7 @@ export class AddManagerModal extends React.Component {
</Grid>
<Grid className="ds-margin-top" title={_("Replication Manager password")}>
<GridItem className="ds-label" span={3}>
- {_("Confirm Password")}
+ {this.props.edit ? "Confirm new password" : _("Confirm Password")}
</GridItem>
<GridItem span={9}>
<TextInput
@@ -2041,16 +2046,17 @@ EnableReplModal.defaultProps = {
error: {},
};
-AddManagerModal.propTypes = {
+AddEditManagerModal.propTypes = {
showModal: PropTypes.bool,
closeHandler: PropTypes.func,
handleChange: PropTypes.func,
saveHandler: PropTypes.func,
spinning: PropTypes.bool,
error: PropTypes.object,
+ edit: PropTypes.bool,
};
-AddManagerModal.defaultProps = {
+AddEditManagerModal.defaultProps = {
showModal: false,
spinning: false,
error: {},
diff --git a/src/cockpit/389-console/src/lib/replication/replTables.jsx b/src/cockpit/389-console/src/lib/replication/replTables.jsx
index 296de9464..f3ef66d2c 100644
--- a/src/cockpit/389-console/src/lib/replication/replTables.jsx
+++ b/src/cockpit/389-console/src/lib/replication/replTables.jsx
@@ -14,9 +14,8 @@ import {
Tbody,
Td,
ActionsColumn,
- SortByDirection
+ SortByDirection,
} from '@patternfly/react-table';
-import { TrashAltIcon } from '@patternfly/react-icons/dist/js/icons/trash-alt-icon';
import PropTypes from "prop-types";
const _ = cockpit.gettext;
@@ -196,30 +195,18 @@ class ManagerTable extends React.Component {
{
title: 'Manager Name',
sortable: true
- },
- {
- title: 'Actions',
- screenReaderText: 'Manager actions'
}
],
};
this.handleSort = this.handleSort.bind(this);
- this.getDeleteButton = this.getDeleteButton.bind(this);
}
componentDidMount() {
- let rows = [];
+ let rows = [...this.props.rows];
let columns = this.state.columns;
- for (const managerRow of this.props.rows) {
- rows.push([
- managerRow,
- this.getDeleteButton(managerRow)
- ]);
- }
-
- if (rows.length === 0) {
+ if (this.props.rows.length === 0) {
rows = [[_("No Replication Managers")]];
columns = [{ title: '' }];
}
@@ -244,19 +231,19 @@ class ManagerTable extends React.Component {
});
}
- getDeleteButton(name) {
- return (
- <a>
- <TrashAltIcon
- className="ds-center"
- onClick={() => {
- this.props.confirmDelete(name);
- }}
- title={_("Delete Replication Manager")}
- />
- </a>
- );
- }
+ getRowActions = (row) => [
+ {
+ title: 'Change password',
+ onClick: () => this.props.showEditManager(row)
+ },
+ {
+ isSeparator: true
+ },
+ {
+ title: 'Delete manager',
+ onClick: () => this.props.confirmDelete(row)
+ },
+ ];
render() {
return (
@@ -285,14 +272,16 @@ class ManagerTable extends React.Component {
<Tbody>
{this.state.rows.map((row, rowIndex) => (
<Tr key={rowIndex}>
- {row.map((cell, cellIndex) => (
- <Td
- key={cellIndex}
- textCenter={cellIndex === 1}
- >
- {cell}
+ <Td key={row}>
+ {row}
+ </Td>
+ {this.props.rows.length !== 0 &&
+ <Td isActionCell textCenter key={row +"action"}>
+ <ActionsColumn
+ items={this.getRowActions(row)}
+ />
</Td>
- ))}
+ }
</Tr>
))}
</Tbody>
diff --git a/src/cockpit/389-console/src/lib/tools.jsx b/src/cockpit/389-console/src/lib/tools.jsx
index 39904b051..ba43bdd6c 100644
--- a/src/cockpit/389-console/src/lib/tools.jsx
+++ b/src/cockpit/389-console/src/lib/tools.jsx
@@ -297,14 +297,18 @@ export function valid_filter(filter) {
export function numToCommas(num) {
// Convert a number to have human friendly commas
+ if (num === undefined || num === "") {
+ return num;
+ }
return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ",");
}
export function displayBytes(bytes) {
// Convert bytes into a more human readable value/unit
- if (bytes === 0 || isNaN(bytes)) {
+ if (bytes === 0 || bytes === "0" || isNaN(bytes)) {
return '0 Bytes';
}
+
const k = 1024;
const sizes = ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB'];
const i = Math.floor(Math.log(bytes) / Math.log(k));
diff --git a/src/cockpit/389-console/src/monitor.jsx b/src/cockpit/389-console/src/monitor.jsx
index 7119baff9..da959be07 100644
--- a/src/cockpit/389-console/src/monitor.jsx
+++ b/src/cockpit/389-console/src/monitor.jsx
@@ -49,6 +49,7 @@ export class Monitor extends React.Component {
snmpData: {},
ldbmData: {},
serverData: {},
+ serverTab: 0,
disks: [],
loadingMsg: "",
disableTree: false,
@@ -65,6 +66,7 @@ export class Monitor extends React.Component {
serverLoading: false,
ldbmLoading: false,
chainingLoading: false,
+ diskReloadSpinning: false,
// replication
replLoading: false,
replInitLoaded: false,
@@ -484,7 +486,7 @@ export class Monitor extends React.Component {
loadMonitorServer() {
const cmd = [
- "dsconf", "-j", "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
+ "dsconf", "-j", this.props.serverId,
"monitor", "server"
];
log_cmd("loadMonitorServer", "Load server monitor", cmd);
@@ -498,13 +500,12 @@ export class Monitor extends React.Component {
}, this.loadMonitorSNMP());
}
- reloadServer() {
+ reloadServer(tab) {
this.setState({
serverLoading: true
});
const cmd = [
- "dsconf", "-j", "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
- "monitor", "server"
+ "dsconf", "-j", this.props.serverId, "monitor", "server"
];
log_cmd("reloadServer", "Load server monitor", cmd);
cockpit
@@ -513,7 +514,8 @@ export class Monitor extends React.Component {
const config = JSON.parse(content);
this.setState({
serverLoading: false,
- serverData: config.attrs
+ serverData: config.attrs,
+ serverTab: tab
}, this.reloadDisks());
});
}
@@ -555,6 +557,9 @@ export class Monitor extends React.Component {
}
reloadDisks () {
+ this.setState({
+ diskReloadSpinning: true
+ });
const cmd = [
"dsconf", "-j", "ldapi://%2fvar%2frun%2fslapd-" + this.props.serverId + ".socket",
"monitor", "disk"
@@ -570,6 +575,7 @@ export class Monitor extends React.Component {
}
this.setState({
disks: rows,
+ diskReloadSpinning: false
});
});
}
@@ -977,9 +983,11 @@ export class Monitor extends React.Component {
serverId={this.props.serverId}
disks={this.state.disks}
handleReloadDisks={this.reloadDisks}
+ diskReloadSpinning={this.state.diskReloadSpinning}
snmpData={this.state.snmpData}
snmpReload={this.reloadSNMP}
enableTree={this.enableTree}
+ serverTab={this.state.serverTab}
/>
);
}
diff --git a/src/lib389/lib389/__init__.py b/src/lib389/lib389/__init__.py
index 6034cb872..9d12c8289 100644
--- a/src/lib389/lib389/__init__.py
+++ b/src/lib389/lib389/__init__.py
@@ -1367,7 +1367,7 @@ class DirSrv(SimpleLDAPObject, object):
# First check it if already exists a backup file
backup_dir, backup_pattern = self._infoBackupFS()
if not os.path.exists(backup_dir):
- os.makedirs(backup_dir)
+ os.makedirs(backup_dir)
# make the backup directory accessible for anybody so that any user can
# run the tests even if it existed a backup created by somebody else
os.chmod(backup_dir, stat.S_IRWXU | stat.S_IRWXG | stat.S_IRWXO)
@@ -3586,3 +3586,13 @@ class DirSrv(SimpleLDAPObject, object):
if self._containerised or container_result.returncode == 0:
return True
return False
+
+ def get_pid(self):
+ """
+ Get the pid of the running server
+ """
+ pid = pid_from_file(self.pid_file())
+ if pid == 0 or pid is None:
+ return 0
+ else:
+ return pid
diff --git a/src/lib389/lib389/cli_base/__init__.py b/src/lib389/lib389/cli_base/__init__.py
index 5892290d4..57b4f4555 100644
--- a/src/lib389/lib389/cli_base/__init__.py
+++ b/src/lib389/lib389/cli_base/__init__.py
@@ -181,6 +181,17 @@ def _format_status(log, mtype, json=False):
log.info('{}: {}'.format(k, vi))
+def _format_status_with_option(log, mtype, json=False, option=False):
+ if json:
+ print(mtype.get_status_json(option))
+ else:
+ status_dict = mtype.get_status(option)
+ log.info('dn: ' + mtype._dn)
+ for k, v in list(status_dict.items()):
+ # For each value in the multivalue attr
+ for vi in v:
+ log.info('{}: {}'.format(k, vi))
+
def _generic_list(inst, basedn, log, manager_class, args=None):
mc = manager_class(inst, basedn)
ol = mc.list()
@@ -388,14 +399,14 @@ class CustomHelpFormatter(argparse.HelpFormatter):
if len(actions) > 0:
# Check if this is the main options section by looking for the help action
is_main_section = any(
- isinstance(action, argparse._HelpAction)
+ isinstance(action, argparse._HelpAction)
for action in actions
)
-
+
# Only add parent arguments to the main options section
if is_main_section:
actions = parent_arguments + actions
-
+
super(CustomHelpFormatter, self).add_arguments(actions)
def _format_usage(self, usage, actions, groups, prefix):
diff --git a/src/lib389/lib389/cli_conf/monitor.py b/src/lib389/lib389/cli_conf/monitor.py
index d69e2f06b..1f55fd8f8 100644
--- a/src/lib389/lib389/cli_conf/monitor.py
+++ b/src/lib389/lib389/cli_conf/monitor.py
@@ -1,6 +1,6 @@
# --- BEGIN COPYRIGHT BLOCK ---
# Copyright (C) 2019 William Brown <[email protected]>
-# Copyright (C) 2020 Red Hat, Inc.
+# Copyright (C) 2025 Red Hat, Inc.
# All rights reserved.
#
# License: GPL (version 3 or any later version).
@@ -10,16 +10,20 @@
import datetime
import json
import os
-from lib389.monitor import (Monitor, MonitorLDBM, MonitorSNMP, MonitorDiskSpace)
+from lib389.monitor import (Monitor, MonitorLDBM, MonitorSNMP,
+ MonitorDiskSpace)
from lib389.chaining import (ChainingLinks)
from lib389.backend import Backends
from lib389.utils import convert_bytes
-from lib389.cli_base import _format_status, CustomHelpFormatter
+from lib389.cli_base import (_format_status, _format_status_with_option,
+ CustomHelpFormatter)
def monitor(inst, basedn, log, args):
- monitor = Monitor(inst)
- _format_status(log, monitor, args.json)
+ """Server monitor"""
+ server_monitor = Monitor(inst)
+ _format_status_with_option(log, server_monitor, args.json,
+ args.just_resources)
def backend_monitor(inst, basedn, log, args):
@@ -302,6 +306,9 @@ def create_parser(subparsers):
server_parser = subcommands.add_parser('server', help="Displays the server statistics, connections, and operations", formatter_class=CustomHelpFormatter)
server_parser.set_defaults(func=monitor)
+ server_parser.add_argument('-r', '--just-resources', action='store_true',
+ default=False,
+ help="Just display the server resources being consumed")
dbmon_parser = subcommands.add_parser('dbmon', help="Monitor all database statistics in a single report", formatter_class=CustomHelpFormatter)
dbmon_parser.set_defaults(func=db_monitor)
diff --git a/src/lib389/lib389/monitor.py b/src/lib389/lib389/monitor.py
index 8f9d0001b..196577ed5 100644
--- a/src/lib389/lib389/monitor.py
+++ b/src/lib389/lib389/monitor.py
@@ -1,5 +1,5 @@
# --- BEGIN COPYRIGHT BLOCK ---
-# Copyright (C) 2021 Red Hat, Inc.
+# Copyright (C) 2025 Red Hat, Inc.
# All rights reserved.
#
# License: GPL (version 3 or any later version).
@@ -7,6 +7,7 @@
# --- END COPYRIGHT BLOCK ---
import copy
+import psutil
from lib389._constants import *
from lib389._mapped_object import DSLdapObject
from lib389.utils import (ds_is_older)
@@ -86,8 +87,55 @@ class Monitor(DSLdapObject):
starttime = self.get_attr_vals_utf8('starttime')
return (dtablesize, readwaiters, entriessent, bytessent, currenttime, starttime)
- def get_status(self, use_json=False):
- return self.get_attrs_vals_utf8([
+ def get_resource_stats(self):
+ """
+ Get CPU and memory stats
+ """
+ stats = {}
+ pid = self._instance.get_pid()
+ total_mem = psutil.virtual_memory()[0]
+ p = psutil.Process(pid)
+ memory_stats = p.memory_full_info()
+
+ # Get memory & CPU stats
+ stats['total_mem'] = [str(total_mem)]
+ stats['rss'] = [str(memory_stats[0])]
+ stats['vms'] = [str(memory_stats[1])]
+ stats['swap'] = [str(memory_stats[9])]
+ stats['mem_rss_percent'] = [str(round(p.memory_percent("rss")))]
+ stats['mem_vms_percent'] = [str(round(p.memory_percent("vms")))]
+ stats['mem_swap_percent'] = [str(round(p.memory_percent("swap")))]
+ stats['total_threads'] = [str(p.num_threads())]
+ stats['cpu_usage'] = [str(round(p.cpu_percent(interval=0.1)))]
+
+ # Connections to DS
+ if self._instance.port == "0":
+ port = "ignore"
+ else:
+ port = str(self._instance.port)
+ if self._instance.sslport == "0":
+ sslport = "ignore"
+ else:
+ sslport = str(self._instance.sslport)
+
+ conn_count = 0
+ conns = psutil.net_connections()
+ for conn in conns:
+ if len(conn[4]) > 0:
+ conn_port = str(conn[4][1])
+ if conn_port in (port, sslport):
+ conn_count += 1
+
+ stats['connection_count'] = [str(conn_count)]
+
+ return stats
+
+ def get_status(self, just_resources=False, use_json=False, ):
+ stats = self.get_resource_stats()
+ if just_resources:
+ return stats
+
+ status = self.get_attrs_vals_utf8([
'version',
'threads',
'connection',
@@ -105,6 +153,9 @@ class Monitor(DSLdapObject):
'starttime',
'nbackends',
])
+ status.update(stats)
+
+ return status
class MonitorLDBM(DSLdapObject):
diff --git a/src/lib389/requirements.txt b/src/lib389/requirements.txt
index 0a95185d1..88b3b4a88 100644
--- a/src/lib389/requirements.txt
+++ b/src/lib389/requirements.txt
@@ -7,3 +7,4 @@ python-ldap
setuptools
distro
cryptography
+psutil
diff --git a/src/lib389/setup.py.in b/src/lib389/setup.py.in
index 2175fe350..a45f72f59 100644
--- a/src/lib389/setup.py.in
+++ b/src/lib389/setup.py.in
@@ -98,7 +98,8 @@ setup(
'python-ldap',
'setuptools',
'distro',
- 'cryptography'
+ 'cryptography',
+ 'psutil'
],
cmdclass={
| 0 |
2ed96135a9567d3fa1f45a945c984eb80024fb97
|
389ds/389-ds-base
|
Resolves: #233215
Summary: verify-db.pl still assumes the db dir is always in the instance dir (Comment #14)
|
commit 2ed96135a9567d3fa1f45a945c984eb80024fb97
Author: Noriko Hosoi <[email protected]>
Date: Thu Apr 12 21:05:59 2007 +0000
Resolves: #233215
Summary: verify-db.pl still assumes the db dir is always in the instance dir (Comment #14)
diff --git a/Makefile.in b/Makefile.in
index c685a1089..f3c6db30d 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -857,7 +857,6 @@ PACKAGE_VERSION = @PACKAGE_VERSION@
PATH_SEPARATOR = @PATH_SEPARATOR@
PKG_CONFIG = @PKG_CONFIG@
RANLIB = @RANLIB@
-SED = @SED@
SET_MAKE = @SET_MAKE@
SHELL = @SHELL@
SOLARIS_FALSE = @SOLARIS_FALSE@
diff --git a/aclocal.m4 b/aclocal.m4
index c7c1c6fbc..9064efa9b 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1578,27 +1578,10 @@ linux*)
# before this can be enabled.
hardcode_into_libs=yes
- # find out which ABI we are using
- libsuff=
- case "$host_cpu" in
- x86_64*|s390x*|powerpc64*)
- echo '[#]line __oline__ "configure"' > conftest.$ac_ext
- if AC_TRY_EVAL(ac_compile); then
- case `/usr/bin/file conftest.$ac_objext` in
- *64-bit*)
- libsuff=64
- sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
- esac
-
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra"
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
fi
# We used to test for /lib/ld.so.1 and disable shared libraries on
@@ -4305,9 +4288,6 @@ CC=$lt_[]_LT_AC_TAGVAR(compiler, $1)
# Is the compiler the GNU C compiler?
with_gcc=$_LT_AC_TAGVAR(GCC, $1)
-gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\`
-gcc_ver=\`gcc -dumpversion\`
-
# An ERE matcher.
EGREP=$lt_EGREP
@@ -4441,11 +4421,11 @@ striplib=$lt_striplib
# Dependencies to place before the objects being linked to create a
# shared library.
-predep_objects=\`echo $lt_[]_LT_AC_TAGVAR(predep_objects, $1) | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+predep_objects=$lt_[]_LT_AC_TAGVAR(predep_objects, $1)
# Dependencies to place after the objects being linked to create a
# shared library.
-postdep_objects=\`echo $lt_[]_LT_AC_TAGVAR(postdep_objects, $1) | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+postdep_objects=$lt_[]_LT_AC_TAGVAR(postdep_objects, $1)
# Dependencies to place before the objects being linked to create a
# shared library.
@@ -4457,7 +4437,7 @@ postdeps=$lt_[]_LT_AC_TAGVAR(postdeps, $1)
# The library search path used internally by the compiler when linking
# a shared library.
-compiler_lib_search_path=\`echo $lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1) | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+compiler_lib_search_path=$lt_[]_LT_AC_TAGVAR(compiler_lib_search_path, $1)
# Method to check whether dependent libraries are shared objects.
deplibs_check_method=$lt_deplibs_check_method
@@ -4537,7 +4517,7 @@ variables_saved_for_relink="$variables_saved_for_relink"
link_all_deplibs=$_LT_AC_TAGVAR(link_all_deplibs, $1)
# Compile-time system search path for libraries
-sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
# Run-time system search path for libraries
sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
@@ -6373,7 +6353,6 @@ do
done
done
done
-IFS=$as_save_IFS
lt_ac_max=0
lt_ac_count=0
# Add /usr/xpg4/bin/sed as it is typically found on Solaris
@@ -6406,7 +6385,6 @@ for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
done
])
SED=$lt_cv_path_SED
-AC_SUBST([SED])
AC_MSG_RESULT([$SED])
])
diff --git a/autogen.sh b/autogen.sh
index 67eb4be1e..07c4af451 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -15,8 +15,8 @@ esac
# Check automake version
AM_VERSION=`automake --version | grep '^automake' | sed 's/.*) *//'`
case $AM_VERSION in
-'' | 0.* | 1.[0-8]* | 1.9.[0-1]* )
- echo "You must have automake version 1.9.2 or later installed (found version $AM_VERSION)."
+'' | 0.* | 1.[0-8]* | 1.9.[0-5]* )
+ echo "You must have automake version 1.9.6 or later installed (found version $AM_VERSION)."
exit 1
;;
* )
diff --git a/configure b/configure
index 8569144a4..f0aa808cd 100755
--- a/configure
+++ b/configure
@@ -465,7 +465,7 @@ ac_includes_default="\
#endif"
ac_default_prefix=/opt/$PACKAGE_NAME
-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT build build_cpu build_vendor build_os host host_cpu host_vendor host_os CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CC CFLAGS ac_ct_CC CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE SED EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CPP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL LIBOBJS debug_defs BUNDLE_TRUE BUNDLE_FALSE enable_pam_passthru_TRUE enable_pam_passthru_FALSE enable_dna_TRUE enable_dna_FALSE enable_ldapi_TRUE enable_ldapi_FALSE configdir sampledatadir propertydir schemadir serverdir serverplugindir scripttemplatedir instconfigdir WINNT_TRUE WINNT_FALSE LIBSOCKET LIBNSL LIBDL LIBCSTD LIBCRUN initdir HPUX_TRUE HPUX_FALSE SOLARIS_TRUE SOLARIS_FALSE PKG_CONFIG ICU_CONFIG NETSNMP_CONFIG nspr_inc nspr_lib nspr_libdir nss_inc nss_lib nss_libdir ldapsdk_inc ldapsdk_lib ldapsdk_libdir ldapsdk_bindir db_inc db_incdir db_lib db_libdir db_bindir db_libver sasl_inc sasl_lib sasl_libdir svrcore_inc svrcore_lib icu_lib icu_inc icu_bin netsnmp_inc netsnmp_lib netsnmp_libdir netsnmp_link LTLIBOBJS'
+ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT build build_cpu build_vendor build_os host host_cpu host_vendor host_os CXX CXXFLAGS LDFLAGS CPPFLAGS ac_ct_CXX EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CC CFLAGS ac_ct_CC CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB CPP CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL LIBOBJS debug_defs BUNDLE_TRUE BUNDLE_FALSE enable_pam_passthru_TRUE enable_pam_passthru_FALSE enable_dna_TRUE enable_dna_FALSE enable_ldapi_TRUE enable_ldapi_FALSE configdir sampledatadir propertydir schemadir serverdir serverplugindir scripttemplatedir instconfigdir WINNT_TRUE WINNT_FALSE LIBSOCKET LIBNSL LIBDL LIBCSTD LIBCRUN initdir HPUX_TRUE HPUX_FALSE SOLARIS_TRUE SOLARIS_FALSE PKG_CONFIG ICU_CONFIG NETSNMP_CONFIG nspr_inc nspr_lib nspr_libdir nss_inc nss_lib nss_libdir ldapsdk_inc ldapsdk_lib ldapsdk_libdir ldapsdk_bindir db_inc db_incdir db_lib db_libdir db_bindir db_libver sasl_inc sasl_lib sasl_libdir svrcore_inc svrcore_lib icu_lib icu_inc icu_bin netsnmp_inc netsnmp_lib netsnmp_libdir netsnmp_link LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
@@ -3832,7 +3832,6 @@ do
done
done
done
-IFS=$as_save_IFS
lt_ac_max=0
lt_ac_count=0
# Add /usr/xpg4/bin/sed as it is typically found on Solaris
@@ -3867,7 +3866,6 @@ done
fi
SED=$lt_cv_path_SED
-
echo "$as_me:$LINENO: result: $SED" >&5
echo "${ECHO_T}$SED" >&6
@@ -4308,7 +4306,7 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
- echo '#line 4311 "configure"' > conftest.$ac_ext
+ echo '#line 4309 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@@ -5443,7 +5441,7 @@ fi
# Provide some information about the compiler.
-echo "$as_me:5446:" \
+echo "$as_me:5444:" \
"checking for Fortran 77 compiler version" >&5
ac_compiler=`set X $ac_compile; echo $2`
{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
@@ -6506,11 +6504,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:6509: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:6507: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:6513: \$? = $ac_status" >&5
+ echo "$as_me:6511: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -6774,11 +6772,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:6777: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:6775: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:6781: \$? = $ac_status" >&5
+ echo "$as_me:6779: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -6878,11 +6876,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:6881: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:6879: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:6885: \$? = $ac_status" >&5
+ echo "$as_me:6883: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -8343,31 +8341,10 @@ linux*)
# before this can be enabled.
hardcode_into_libs=yes
- # find out which ABI we are using
- libsuff=
- case "$host_cpu" in
- x86_64*|s390x*|powerpc64*)
- echo '#line 8350 "configure"' > conftest.$ac_ext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- case `/usr/bin/file conftest.$ac_objext` in
- *64-bit*)
- libsuff=64
- sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
- esac
-
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra"
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
fi
# We used to test for /lib/ld.so.1 and disable shared libraries on
@@ -9244,7 +9221,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 9247 "configure"
+#line 9224 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -9344,7 +9321,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
-#line 9347 "configure"
+#line 9324 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@@ -9675,9 +9652,6 @@ CC=$lt_compiler
# Is the compiler the GNU C compiler?
with_gcc=$GCC
-gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\`
-gcc_ver=\`gcc -dumpversion\`
-
# An ERE matcher.
EGREP=$lt_EGREP
@@ -9811,11 +9785,11 @@ striplib=$lt_striplib
# Dependencies to place before the objects being linked to create a
# shared library.
-predep_objects=\`echo $lt_predep_objects | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+predep_objects=$lt_predep_objects
# Dependencies to place after the objects being linked to create a
# shared library.
-postdep_objects=\`echo $lt_postdep_objects | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+postdep_objects=$lt_postdep_objects
# Dependencies to place before the objects being linked to create a
# shared library.
@@ -9827,7 +9801,7 @@ postdeps=$lt_postdeps
# The library search path used internally by the compiler when linking
# a shared library.
-compiler_lib_search_path=\`echo $lt_compiler_lib_search_path | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+compiler_lib_search_path=$lt_compiler_lib_search_path
# Method to check whether dependent libraries are shared objects.
deplibs_check_method=$lt_deplibs_check_method
@@ -9907,7 +9881,7 @@ variables_saved_for_relink="$variables_saved_for_relink"
link_all_deplibs=$link_all_deplibs
# Compile-time system search path for libraries
-sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
# Run-time system search path for libraries
sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
@@ -11687,11 +11661,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:11690: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:11664: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:11694: \$? = $ac_status" >&5
+ echo "$as_me:11668: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -11791,11 +11765,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:11794: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:11768: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:11798: \$? = $ac_status" >&5
+ echo "$as_me:11772: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -12323,31 +12297,10 @@ linux*)
# before this can be enabled.
hardcode_into_libs=yes
- # find out which ABI we are using
- libsuff=
- case "$host_cpu" in
- x86_64*|s390x*|powerpc64*)
- echo '#line 12330 "configure"' > conftest.$ac_ext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- case `/usr/bin/file conftest.$ac_objext` in
- *64-bit*)
- libsuff=64
- sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
- esac
-
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra"
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
fi
# We used to test for /lib/ld.so.1 and disable shared libraries on
@@ -12731,9 +12684,6 @@ CC=$lt_compiler_CXX
# Is the compiler the GNU C compiler?
with_gcc=$GCC_CXX
-gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\`
-gcc_ver=\`gcc -dumpversion\`
-
# An ERE matcher.
EGREP=$lt_EGREP
@@ -12867,11 +12817,11 @@ striplib=$lt_striplib
# Dependencies to place before the objects being linked to create a
# shared library.
-predep_objects=\`echo $lt_predep_objects_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+predep_objects=$lt_predep_objects_CXX
# Dependencies to place after the objects being linked to create a
# shared library.
-postdep_objects=\`echo $lt_postdep_objects_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+postdep_objects=$lt_postdep_objects_CXX
# Dependencies to place before the objects being linked to create a
# shared library.
@@ -12883,7 +12833,7 @@ postdeps=$lt_postdeps_CXX
# The library search path used internally by the compiler when linking
# a shared library.
-compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_CXX | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+compiler_lib_search_path=$lt_compiler_lib_search_path_CXX
# Method to check whether dependent libraries are shared objects.
deplibs_check_method=$lt_deplibs_check_method
@@ -12963,7 +12913,7 @@ variables_saved_for_relink="$variables_saved_for_relink"
link_all_deplibs=$link_all_deplibs_CXX
# Compile-time system search path for libraries
-sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
# Run-time system search path for libraries
sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
@@ -13385,11 +13335,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:13388: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:13338: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:13392: \$? = $ac_status" >&5
+ echo "$as_me:13342: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -13489,11 +13439,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:13492: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:13442: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:13496: \$? = $ac_status" >&5
+ echo "$as_me:13446: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -14934,31 +14884,10 @@ linux*)
# before this can be enabled.
hardcode_into_libs=yes
- # find out which ABI we are using
- libsuff=
- case "$host_cpu" in
- x86_64*|s390x*|powerpc64*)
- echo '#line 14941 "configure"' > conftest.$ac_ext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- case `/usr/bin/file conftest.$ac_objext` in
- *64-bit*)
- libsuff=64
- sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
- esac
-
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra"
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
fi
# We used to test for /lib/ld.so.1 and disable shared libraries on
@@ -15342,9 +15271,6 @@ CC=$lt_compiler_F77
# Is the compiler the GNU C compiler?
with_gcc=$GCC_F77
-gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\`
-gcc_ver=\`gcc -dumpversion\`
-
# An ERE matcher.
EGREP=$lt_EGREP
@@ -15478,11 +15404,11 @@ striplib=$lt_striplib
# Dependencies to place before the objects being linked to create a
# shared library.
-predep_objects=\`echo $lt_predep_objects_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+predep_objects=$lt_predep_objects_F77
# Dependencies to place after the objects being linked to create a
# shared library.
-postdep_objects=\`echo $lt_postdep_objects_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+postdep_objects=$lt_postdep_objects_F77
# Dependencies to place before the objects being linked to create a
# shared library.
@@ -15494,7 +15420,7 @@ postdeps=$lt_postdeps_F77
# The library search path used internally by the compiler when linking
# a shared library.
-compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_F77 | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+compiler_lib_search_path=$lt_compiler_lib_search_path_F77
# Method to check whether dependent libraries are shared objects.
deplibs_check_method=$lt_deplibs_check_method
@@ -15574,7 +15500,7 @@ variables_saved_for_relink="$variables_saved_for_relink"
link_all_deplibs=$link_all_deplibs_F77
# Compile-time system search path for libraries
-sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
# Run-time system search path for libraries
sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
@@ -15716,11 +15642,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:15719: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:15645: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:15723: \$? = $ac_status" >&5
+ echo "$as_me:15649: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -15984,11 +15910,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:15987: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:15913: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
- echo "$as_me:15991: \$? = $ac_status" >&5
+ echo "$as_me:15917: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@@ -16088,11 +16014,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
- (eval echo "\"\$as_me:16091: $lt_compile\"" >&5)
+ (eval echo "\"\$as_me:16017: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
- echo "$as_me:16095: \$? = $ac_status" >&5
+ echo "$as_me:16021: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@@ -17553,31 +17479,10 @@ linux*)
# before this can be enabled.
hardcode_into_libs=yes
- # find out which ABI we are using
- libsuff=
- case "$host_cpu" in
- x86_64*|s390x*|powerpc64*)
- echo '#line 17560 "configure"' > conftest.$ac_ext
- if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
- (eval $ac_compile) 2>&5
- ac_status=$?
- echo "$as_me:$LINENO: \$? = $ac_status" >&5
- (exit $ac_status); }; then
- case `/usr/bin/file conftest.$ac_objext` in
- *64-bit*)
- libsuff=64
- sys_lib_search_path_spec="/lib${libsuff} /usr/lib${libsuff} /usr/local/lib${libsuff}"
- ;;
- esac
- fi
- rm -rf conftest*
- ;;
- esac
-
# Append ld.so.conf contents to the search path
if test -f /etc/ld.so.conf; then
- lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
- sys_lib_dlsearch_path_spec="/lib${libsuff} /usr/lib${libsuff} $lt_ld_extra"
+ lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;s/[:, ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;/^$/d' | tr '\n' ' '`
+ sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
fi
# We used to test for /lib/ld.so.1 and disable shared libraries on
@@ -17961,9 +17866,6 @@ CC=$lt_compiler_GCJ
# Is the compiler the GNU C compiler?
with_gcc=$GCC_GCJ
-gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\`
-gcc_ver=\`gcc -dumpversion\`
-
# An ERE matcher.
EGREP=$lt_EGREP
@@ -18097,11 +17999,11 @@ striplib=$lt_striplib
# Dependencies to place before the objects being linked to create a
# shared library.
-predep_objects=\`echo $lt_predep_objects_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+predep_objects=$lt_predep_objects_GCJ
# Dependencies to place after the objects being linked to create a
# shared library.
-postdep_objects=\`echo $lt_postdep_objects_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+postdep_objects=$lt_postdep_objects_GCJ
# Dependencies to place before the objects being linked to create a
# shared library.
@@ -18113,7 +18015,7 @@ postdeps=$lt_postdeps_GCJ
# The library search path used internally by the compiler when linking
# a shared library.
-compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_GCJ | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+compiler_lib_search_path=$lt_compiler_lib_search_path_GCJ
# Method to check whether dependent libraries are shared objects.
deplibs_check_method=$lt_deplibs_check_method
@@ -18193,7 +18095,7 @@ variables_saved_for_relink="$variables_saved_for_relink"
link_all_deplibs=$link_all_deplibs_GCJ
# Compile-time system search path for libraries
-sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
# Run-time system search path for libraries
sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
@@ -18445,9 +18347,6 @@ CC=$lt_compiler_RC
# Is the compiler the GNU C compiler?
with_gcc=$GCC_RC
-gcc_dir=\`gcc -print-file-name=. | $SED 's,/\.$,,'\`
-gcc_ver=\`gcc -dumpversion\`
-
# An ERE matcher.
EGREP=$lt_EGREP
@@ -18581,11 +18480,11 @@ striplib=$lt_striplib
# Dependencies to place before the objects being linked to create a
# shared library.
-predep_objects=\`echo $lt_predep_objects_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+predep_objects=$lt_predep_objects_RC
# Dependencies to place after the objects being linked to create a
# shared library.
-postdep_objects=\`echo $lt_postdep_objects_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+postdep_objects=$lt_postdep_objects_RC
# Dependencies to place before the objects being linked to create a
# shared library.
@@ -18597,7 +18496,7 @@ postdeps=$lt_postdeps_RC
# The library search path used internally by the compiler when linking
# a shared library.
-compiler_lib_search_path=\`echo $lt_compiler_lib_search_path_RC | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+compiler_lib_search_path=$lt_compiler_lib_search_path_RC
# Method to check whether dependent libraries are shared objects.
deplibs_check_method=$lt_deplibs_check_method
@@ -18677,7 +18576,7 @@ variables_saved_for_relink="$variables_saved_for_relink"
link_all_deplibs=$link_all_deplibs_RC
# Compile-time system search path for libraries
-sys_lib_search_path_spec=\`echo $lt_sys_lib_search_path_spec | \$SED -e "s@\${gcc_dir}@\\\${gcc_dir}@g;s@\${gcc_ver}@\\\${gcc_ver}@g"\`
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
# Run-time system search path for libraries
sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
@@ -24022,7 +23921,6 @@ else
echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi;
-db_bindir=/usr/bin
if test -z "$db_inc"; then
echo "$as_me:$LINENO: checking for db.h" >&5
@@ -24121,6 +24019,16 @@ fi
LDFLAGS="$save_ldflags"
+# if DB is not found yet, try pkg-config
+
+# last resort
+# Although the other db_* variables are correctly assigned at this point,
+# db_bindir needs to be set by pkg-config if possible (e.g., on 64-bit Solaris)
+if $PKG_CONFIG --exists db; then
+ db_bindir=`$PKG_CONFIG --variable=bindir db`
+else
+ db_bindir=/usr/bin
+fi
# BEGIN COPYRIGHT BLOCK
# Copyright (C) 2007 Red Hat, Inc.
@@ -24782,7 +24690,7 @@ else
echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
fi;
-# if not found yet, try pkg-config
+# if ICU is not found yet, try pkg-config
# last resort
if test -z "$icu_lib"; then
@@ -25843,7 +25751,6 @@ s,@ac_ct_CC@,$ac_ct_CC,;t t
s,@CCDEPMODE@,$CCDEPMODE,;t t
s,@am__fastdepCC_TRUE@,$am__fastdepCC_TRUE,;t t
s,@am__fastdepCC_FALSE@,$am__fastdepCC_FALSE,;t t
-s,@SED@,$SED,;t t
s,@EGREP@,$EGREP,;t t
s,@LN_S@,$LN_S,;t t
s,@ECHO@,$ECHO,;t t
diff --git a/ltmain.sh b/ltmain.sh
index 0223495a0..06823e057 100644
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -46,16 +46,10 @@ PACKAGE=libtool
VERSION=1.5.22
TIMESTAMP=" (1.1220.2.365 2005/12/18 22:14:06)"
-# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '${1+"$@"}'='"$@"'
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes.
+if test -n "${ZSH_VERSION+set}" ; then
setopt NO_GLOB_SUBST
-else
- case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
fi
# Check that we have a working $echo.
@@ -111,14 +105,12 @@ esac
# These must not be set unconditionally because not all systems understand
# e.g. LANG=C (notably SCO).
# We save the old values to restore during execute mode.
-for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
-do
- eval "if test \"\${$lt_var+set}\" = set; then
- save_$lt_var=\$$lt_var
- $lt_var=C
- export $lt_var
- fi"
-done
+if test "${LC_ALL+set}" = set; then
+ save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL
+fi
+if test "${LANG+set}" = set; then
+ save_LANG="$LANG"; LANG=C; export LANG
+fi
# Make sure IFS has a sensible default
lt_nl='
@@ -144,8 +136,6 @@ duplicate_deps=no
preserve_args=
lo2o="s/\\.lo\$/.${objext}/"
o2lo="s/\\.${objext}\$/.lo/"
-extracted_archives=
-extracted_serial=0
#####################################
# Shell function definitions:
@@ -337,17 +327,7 @@ func_extract_archives ()
*) my_xabs=`pwd`"/$my_xlib" ;;
esac
my_xlib=`$echo "X$my_xlib" | $Xsed -e 's%^.*/%%'`
- my_xlib_u=$my_xlib
- while :; do
- case " $extracted_archives " in
- *" $my_xlib_u "*)
- extracted_serial=`expr $extracted_serial + 1`
- my_xlib_u=lt$extracted_serial-$my_xlib ;;
- *) break ;;
- esac
- done
- extracted_archives="$extracted_archives $my_xlib_u"
- my_xdir="$my_gentop/$my_xlib_u"
+ my_xdir="$my_gentop/$my_xlib"
$show "${rm}r $my_xdir"
$run ${rm}r "$my_xdir"
@@ -778,7 +758,6 @@ if test -z "$show_help"; then
*.f90) xform=f90 ;;
*.for) xform=for ;;
*.java) xform=java ;;
- *.obj) xform=obj ;;
esac
libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"`
@@ -1159,9 +1138,8 @@ EOF
for arg
do
case $arg in
- -all-static | -static | -static-libtool-libs)
- case $arg in
- -all-static)
+ -all-static | -static)
+ if test "X$arg" = "X-all-static"; then
if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
$echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2
fi
@@ -1169,20 +1147,12 @@ EOF
dlopen_self=$dlopen_self_static
fi
prefer_static_libs=yes
- ;;
- -static)
+ else
if test -z "$pic_flag" && test -n "$link_static_flag"; then
dlopen_self=$dlopen_self_static
fi
prefer_static_libs=built
- ;;
- -static-libtool-libs)
- if test -z "$pic_flag" && test -n "$link_static_flag"; then
- dlopen_self=$dlopen_self_static
- fi
- prefer_static_libs=yes
- ;;
- esac
+ fi
build_libtool_libs=no
build_old_libs=yes
break
@@ -1742,7 +1712,7 @@ EOF
continue
;;
- -static | -static-libtool-libs)
+ -static)
# The effects of -static are defined in a previous loop.
# We used to do the same as -all-static on platforms that
# didn't have a PIC flag, but the assumption that the effects
@@ -2520,9 +2490,7 @@ EOF
if test "$linkmode,$pass" = "prog,link"; then
if test -n "$library_names" &&
- { { test "$prefer_static_libs" = no ||
- test "$prefer_static_libs,$installed" = "built,yes"; } ||
- test -z "$old_library"; }; then
+ { test "$prefer_static_libs" = no || test -z "$old_library"; }; then
# We need to hardcode the library path
if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
# Make sure the rpath contains only unique directories.
@@ -3218,7 +3186,7 @@ EOF
# which has an extra 1 added just for fun
#
case $version_type in
- darwin|linux|osf|windows|none)
+ darwin|linux|osf|windows)
current=`expr $number_major + $number_minor`
age="$number_minor"
revision="$number_revision"
@@ -3442,11 +3410,11 @@ EOF
fi
# Eliminate all temporary directories.
-# for path in $notinst_path; do
-# lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
-# deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
-# dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
-# done
+ for path in $notinst_path; do
+ lib_search_path=`$echo "$lib_search_path " | ${SED} -e "s% $path % %g"`
+ deplibs=`$echo "$deplibs " | ${SED} -e "s% -L$path % %g"`
+ dependency_libs=`$echo "$dependency_libs " | ${SED} -e "s% -L$path % %g"`
+ done
if test -n "$xrpath"; then
# If the user specified any rpath flags, then add them.
@@ -3547,12 +3515,13 @@ EOF
int main() { return 0; }
EOF
$rm conftest
- if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
+ $LTCC $LTCFLAGS -o conftest conftest.c $deplibs
+ if test "$?" -eq 0 ; then
ldd_output=`ldd conftest`
for i in $deplibs; do
name=`expr $i : '-l\(.*\)'`
# If $name is empty we are operating on a -L argument.
- if test "$name" != "" && test "$name" != "0"; then
+ if test "$name" != "" && test "$name" -ne "0"; then
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
case " $predeps $postdeps " in
*" $i "*)
@@ -3591,7 +3560,9 @@ EOF
# If $name is empty we are operating on a -L argument.
if test "$name" != "" && test "$name" != "0"; then
$rm conftest
- if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
+ $LTCC $LTCFLAGS -o conftest conftest.c $i
+ # Did it work?
+ if test "$?" -eq 0 ; then
ldd_output=`ldd conftest`
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
case " $predeps $postdeps " in
@@ -3623,7 +3594,7 @@ EOF
droppeddeps=yes
$echo
$echo "*** Warning! Library $i is needed by this library but I was not able to"
- $echo "*** make it link in! You will probably need to install it or some"
+ $echo "*** make it link in! You will probably need to install it or some"
$echo "*** library that it depends on before this library will be fully"
$echo "*** functional. Installing it before continuing would be even better."
fi
@@ -4268,14 +4239,12 @@ EOF
reload_conv_objs=
gentop=
# reload_cmds runs $LD directly, so let us get rid of
- # -Wl from whole_archive_flag_spec and hope we can get by with
- # turning comma into space..
+ # -Wl from whole_archive_flag_spec
wl=
if test -n "$convenience"; then
if test -n "$whole_archive_flag_spec"; then
- eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
- reload_conv_objs=$reload_objs\ `$echo "X$tmp_whole_archive_flags" | $Xsed -e 's|,| |g'`
+ eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\"
else
gentop="$output_objdir/${obj}x"
generated="$generated $gentop"
@@ -4723,16 +4692,16 @@ static const void *lt_preloaded_setup() {
case $host in
*cygwin* | *mingw* )
if test -f "$output_objdir/${outputname}.def" ; then
- compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
- finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%" | $NL2SP`
+ compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
+ finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}.def $output_objdir/${outputname}S.${objext}%"`
else
- compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
- finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
+ compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+ finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
fi
;;
* )
- compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
- finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%" | $NL2SP`
+ compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
+ finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"`
;;
esac
;;
@@ -4747,13 +4716,13 @@ static const void *lt_preloaded_setup() {
# really was required.
# Nullify the symbol file.
- compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
- finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "s% @SYMFILE@%%" | $NL2SP`
+ compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"`
+ finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"`
fi
if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
# Replace the output file specification.
- compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$output"'%g' | $NL2SP`
+ compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'`
link_command="$compile_command$compile_rpath"
# We have no uninstalled library dependencies, so finalize right now.
@@ -4840,7 +4809,7 @@ static const void *lt_preloaded_setup() {
if test "$fast_install" != no; then
link_command="$finalize_var$compile_command$finalize_rpath"
if test "$fast_install" = yes; then
- relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $SP2NL | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g' | $NL2SP`
+ relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'`
else
# fast_install is set to needless
relink_command=
@@ -4877,7 +4846,7 @@ static const void *lt_preloaded_setup() {
fi
done
relink_command="(cd `pwd`; $relink_command)"
- relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
+ relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
fi
# Quote $echo for shipping.
@@ -5284,18 +5253,6 @@ EOF
Xsed='${SED} -e 1s/^X//'
sed_quote_subst='$sed_quote_subst'
-# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
-if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
- emulate sh
- NULLCMD=:
- # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
- # is contrary to our usage. Disable this feature.
- alias -g '\${1+\"\$@\"}'='\"\$@\"'
- setopt NO_GLOB_SUBST
-else
- case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
-fi
-
# The HP-UX ksh and POSIX shell print the target directory to stdout
# if CDPATH is set.
(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
@@ -5438,7 +5395,7 @@ else
;;
esac
$echo >> $output "\
- \$echo \"\$0: cannot exec \$program \$*\"
+ \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\"
exit $EXIT_FAILURE
fi
else
@@ -5624,7 +5581,7 @@ fi\
done
# Quote the link command for shipping.
relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
- relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e "$sed_quote_subst" | $NL2SP`
+ relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"`
if test "$hardcode_automatic" = yes ; then
relink_command=
fi
@@ -5969,9 +5926,9 @@ relink_command=\"$relink_command\""
if test -n "$inst_prefix_dir"; then
# Stick the inst_prefix_dir data into the link command.
- relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%" | $NL2SP`
+ relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
else
- relink_command=`$echo "$relink_command" | $SP2NL | $SED "s%@inst_prefix_dir@%%" | $NL2SP`
+ relink_command=`$echo "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
fi
$echo "$modename: warning: relinking \`$file'" 1>&2
@@ -6180,7 +6137,7 @@ relink_command=\"$relink_command\""
file=`$echo "X$file$stripped_ext" | $Xsed -e 's%^.*/%%'`
outputname="$tmpdir/$file"
# Replace the output file specification.
- relink_command=`$echo "X$relink_command" | $SP2NL | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g' | $NL2SP`
+ relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'`
$show "$relink_command"
if $run eval "$relink_command"; then :
@@ -6456,15 +6413,12 @@ relink_command=\"$relink_command\""
fi
# Restore saved environment variables
- for lt_var in LANG LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
- do
- eval "if test \"\${save_$lt_var+set}\" = set; then
- $lt_var=\$save_$lt_var; export $lt_var
- else
- $lt_unset $lt_var
- fi"
- done
-
+ if test "${save_LC_ALL+set}" = set; then
+ LC_ALL="$save_LC_ALL"; export LC_ALL
+ fi
+ if test "${save_LANG+set}" = set; then
+ LANG="$save_LANG"; export LANG
+ fi
# Now prepare to actually exec the command.
exec_cmd="\$cmd$args"
@@ -6821,9 +6775,9 @@ The following components of LINK-COMMAND are treated specially:
-dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols
-export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
-export-symbols SYMFILE
- try to export only the symbols listed in SYMFILE
+ try to export only the symbols listed in SYMFILE
-export-symbols-regex REGEX
- try to export only the symbols matching REGEX
+ try to export only the symbols matching REGEX
-LLIBDIR search LIBDIR for required installed libraries
-lNAME OUTPUT-FILE requires the installed library libNAME
-module build a library that can dlopened
@@ -6837,11 +6791,9 @@ The following components of LINK-COMMAND are treated specially:
-release RELEASE specify package release information
-rpath LIBDIR the created library will eventually be installed in LIBDIR
-R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries
- -static do not do any dynamic linking of uninstalled libtool libraries
- -static-libtool-libs
- do not do any dynamic linking of libtool libraries
+ -static do not do any dynamic linking of libtool libraries
-version-info CURRENT[:REVISION[:AGE]]
- specify library version info [each variable defaults to 0]
+ specify library version info [each variable defaults to 0]
All other options (arguments beginning with \`-') are ignored.
| 0 |
bb335e01c480b762fb752d8fbc021d99a4fa91f3
|
389ds/389-ds-base
|
Ticket 49864 - Revised replication status messages for transient errors
Description: Transient errors are temporary conditions that usually resolve
themselves. But the message are vague and alarming. This
patch changes it to a "warning" message.
https://pagure.io/389-ds-base/issue/49864
Reviewed by: spichugi & firstyear(Thanks!)
|
commit bb335e01c480b762fb752d8fbc021d99a4fa91f3
Author: Mark Reynolds <[email protected]>
Date: Tue Dec 4 14:08:09 2018 -0500
Ticket 49864 - Revised replication status messages for transient errors
Description: Transient errors are temporary conditions that usually resolve
themselves. But the message are vague and alarming. This
patch changes it to a "warning" message.
https://pagure.io/389-ds-base/issue/49864
Reviewed by: spichugi & firstyear(Thanks!)
diff --git a/ldap/servers/plugins/replication/repl5_inc_protocol.c b/ldap/servers/plugins/replication/repl5_inc_protocol.c
index 2aefb795f..9140c342d 100644
--- a/ldap/servers/plugins/replication/repl5_inc_protocol.c
+++ b/ldap/servers/plugins/replication/repl5_inc_protocol.c
@@ -1065,7 +1065,7 @@ repl5_inc_run(Private_Repl_Protocol *prp)
} else if (rc == UPDATE_TRANSIENT_ERROR) {
dev_debug("repl5_inc_run(STATE_SENDING_UPDATES) -> send_updates = UPDATE_TRANSIENT_ERROR -> STATE_BACKOFF_START");
agmt_set_last_update_status(prp->agmt, 0, NSDS50_REPL_TRANSIENT_ERROR,
- "Incremental update transient error. Backing off, will retry update later.");
+ "Incremental update transient warning. Backing off, will retry update later.");
next_state = STATE_BACKOFF_START;
} else if (rc == UPDATE_FATAL_ERROR) {
dev_debug("repl5_inc_run(STATE_SENDING_UPDATES) -> send_updates = UPDATE_FATAL_ERROR -> STATE_STOP_FATAL_ERROR");
diff --git a/ldap/servers/plugins/replication/repl5_protocol_util.c b/ldap/servers/plugins/replication/repl5_protocol_util.c
index 78159ad29..a48d4d02a 100644
--- a/ldap/servers/plugins/replication/repl5_protocol_util.c
+++ b/ldap/servers/plugins/replication/repl5_protocol_util.c
@@ -662,7 +662,7 @@ protocol_response2string(int response)
case NSDS50_REPL_CONN_TIMEOUT:
return "connection timeout";
case NSDS50_REPL_TRANSIENT_ERROR:
- return "transient error";
+ return "transient warning";
case NSDS50_REPL_RUV_ERROR:
return "RUV error";
default:
| 0 |
de61f34aea3ffe197a173bfa6ef7a34137d6e36c
|
389ds/389-ds-base
|
Ticket 47315 - filter option in fixup-memberof requires more clarification
Bug Description: The usgae/documentaton states that if you don't supply a filter,
then "all" the entries will be checked. Actually only users that
have "objectclass: inetuser" are checked.
Fix Description: Added another objectclass to the default query, inetadmin.
inetuser & inetadmin are the only standard objectclasses that have
memberOf in thier definitions. Also updated the man page, and the
script usage to state what the internal query/filter is.
https://fedorahosted.org/389/ticket/47315
Reviewed by: richm(Thanks!)
|
commit de61f34aea3ffe197a173bfa6ef7a34137d6e36c
Author: Mark Reynolds <[email protected]>
Date: Tue Apr 9 09:59:20 2013 -0400
Ticket 47315 - filter option in fixup-memberof requires more clarification
Bug Description: The usgae/documentaton states that if you don't supply a filter,
then "all" the entries will be checked. Actually only users that
have "objectclass: inetuser" are checked.
Fix Description: Added another objectclass to the default query, inetadmin.
inetuser & inetadmin are the only standard objectclasses that have
memberOf in thier definitions. Also updated the man page, and the
script usage to state what the internal query/filter is.
https://fedorahosted.org/389/ticket/47315
Reviewed by: richm(Thanks!)
diff --git a/ldap/admin/src/scripts/fixup-memberof.pl.in b/ldap/admin/src/scripts/fixup-memberof.pl.in
index 43c24d281..a495249d6 100644
--- a/ldap/admin/src/scripts/fixup-memberof.pl.in
+++ b/ldap/admin/src/scripts/fixup-memberof.pl.in
@@ -61,8 +61,8 @@ sub usage {
print(STDERR " -j filename - Read Directory Manager's password from file\n");
print(STDERR " -b baseDN - Base DN that contains entries to fix up.\n");
print(STDERR " -f filter - Filter for entries to fix up\n");
- print(STDERR " If omitted, all entries under the specified\n");
- print(STDERR " base will have their memberOf attribute regenerated.\n");
+ print(STDERR " If omitted, all entries with objectclass inetuser/inetadmin under the\n");
+ print(STDERR " specified base will have their memberOf attribute regenerated.\n");
print(STDERR " -P protocol - STARTTLS, LDAPS, LDAPI, LDAP (default: uses most secure protocol available)\n");
print(STDERR " -v - Verbose output\n");
print(STDERR " -h - Display usage\n");
diff --git a/ldap/servers/plugins/memberof/memberof.c b/ldap/servers/plugins/memberof/memberof.c
index 8fcc88cc2..1c50b6784 100644
--- a/ldap/servers/plugins/memberof/memberof.c
+++ b/ldap/servers/plugins/memberof/memberof.c
@@ -2393,7 +2393,7 @@ int memberof_task_add(Slapi_PBlock *pb, Slapi_Entry *e,
goto out;
}
- if ((filter = fetch_attr(e, "filter", "(objectclass=inetuser)")) == NULL)
+ if ((filter = fetch_attr(e, "filter", "(|(objectclass=inetuser)(objectclass=inetadmin))")) == NULL)
{
*returncode = LDAP_OBJECT_CLASS_VIOLATION;
rv = SLAPI_DSE_CALLBACK_ERROR;
diff --git a/man/man8/fixup-memberof.pl.8 b/man/man8/fixup-memberof.pl.8
index 250997d82..7716a5892 100644
--- a/man/man8/fixup-memberof.pl.8
+++ b/man/man8/fixup-memberof.pl.8
@@ -46,7 +46,8 @@ The name of the file that contains the root DN password.
The DN of the subtree containing the entries to update.
.TP
.B \fB\-f\fR \fIfilter\fR
-An LDAP query filter to use to select the entries within the subtree to update. If there is no filter set, then the memberOf attribute is regenerated for every entry in the subtree.
+An LDAP query filter to use to select the entries within the subtree to update. If there is no filter set, then
+the memberOf attribute is regenerated for every entry in the subtree that has the objectclass inetuser/inetadmin.
.TP
.B \fB\-P\fR \fIprotocol\fR
The connection protocol to connect to the Directory Server. Protocols are STARTTLS, LDAPS, LDAPI, and LDAP.
| 0 |
b3ca9eec5d50c2ca503582e55b6681b9b3ad6ad3
|
389ds/389-ds-base
|
Ticket 518 - dse.ldif is 0 length after server kill or machine kill
Bug Description: If a machine is powered off while slapd is running, dse.ldif can have 0 bytes and
server doesn't start even if a dse.ldif.tmp or dse.ldif.bak exists
Fix Description: I see no way to prevent a 0 byte ldif in case of a machine crash from slapd code,
but the server should try all avaialble backup dse.ldif files to be able to start,
https://fedorahosted.org/389/ticket/518
Reviewed by: RichM (Thanks)
|
commit b3ca9eec5d50c2ca503582e55b6681b9b3ad6ad3
Author: Ludwig Krispenz <[email protected]>
Date: Fri Nov 23 11:15:52 2012 +0100
Ticket 518 - dse.ldif is 0 length after server kill or machine kill
Bug Description: If a machine is powered off while slapd is running, dse.ldif can have 0 bytes and
server doesn't start even if a dse.ldif.tmp or dse.ldif.bak exists
Fix Description: I see no way to prevent a 0 byte ldif in case of a machine crash from slapd code,
but the server should try all avaialble backup dse.ldif files to be able to start,
https://fedorahosted.org/389/ticket/518
Reviewed by: RichM (Thanks)
diff --git a/ldap/servers/slapd/config.c b/ldap/servers/slapd/config.c
index d97a575c1..3edc24b3e 100644
--- a/ldap/servers/slapd/config.c
+++ b/ldap/servers/slapd/config.c
@@ -165,6 +165,7 @@ slapd_bootstrap_config(const char *configdir)
char *buf = 0;
char *lastp = 0;
char *entrystr = 0;
+ char tmpfile[MAXPATHLEN+1];
if (NULL == configdir) {
slapi_log_error(SLAPI_LOG_FATAL,
@@ -173,33 +174,14 @@ slapd_bootstrap_config(const char *configdir)
}
PR_snprintf(configfile, sizeof(configfile), "%s/%s", configdir,
CONFIG_FILENAME);
- if ( (rc = PR_GetFileInfo( configfile, &prfinfo )) != PR_SUCCESS )
- {
- /* the "real" file does not exist; see if there is a tmpfile */
- char tmpfile[MAXPATHLEN+1];
- slapi_log_error(SLAPI_LOG_FATAL, "config",
- "The configuration file %s does not exist\n", configfile);
- PR_snprintf(tmpfile, sizeof(tmpfile), "%s/%s.tmp", configdir,
+ PR_snprintf(tmpfile, sizeof(tmpfile), "%s/%s.tmp", configdir,
CONFIG_FILENAME);
- if ( PR_GetFileInfo( tmpfile, &prfinfo ) == PR_SUCCESS ) {
- rc = PR_Rename(tmpfile, configfile);
- if (rc == PR_SUCCESS) {
- slapi_log_error(SLAPI_LOG_FATAL, "config",
- "The configuration file %s was restored from backup %s\n",
- configfile, tmpfile);
- } else {
- slapi_log_error(SLAPI_LOG_FATAL, "config",
- "The configuration file %s was not restored from backup %s, error %d\n",
- configfile, tmpfile, rc);
- return rc; /* Fail */
- }
- } else {
- slapi_log_error(SLAPI_LOG_FATAL, "config",
- "The backup configuration file %s does not exist, either.\n",
- tmpfile);
- return rc; /* Fail */
- }
+ if ( (rc = dse_check_file(configfile, tmpfile)) == 0 ) {
+ PR_snprintf(tmpfile, sizeof(tmpfile), "%s/%s.bak", configdir,
+ CONFIG_FILENAME);
+ rc = dse_check_file(configfile, tmpfile);
}
+
if ( (rc = PR_GetFileInfo( configfile, &prfinfo )) != PR_SUCCESS )
{
PRErrorCode prerr = PR_GetError();
diff --git a/ldap/servers/slapd/dse.c b/ldap/servers/slapd/dse.c
index 3d2955c65..53d873629 100644
--- a/ldap/servers/slapd/dse.c
+++ b/ldap/servers/slapd/dse.c
@@ -651,6 +651,40 @@ dse_updateNumSubOfParent(struct dse *pdse, const Slapi_DN *child, int op)
slapi_sdn_done(&parent);
}
+/* check if a file is valid, or if a provided backup file can be used.
+ * there is no way to determine if the file contents is usable, the only
+ * checks that can be done is that the file exists and that it is not size 0
+ */
+int
+dse_check_file(char *filename, char *backupname)
+{
+ int rc= 0; /* Fail */
+ PRFileInfo prfinfo;
+
+ if (PR_GetFileInfo( filename, &prfinfo ) == PR_SUCCESS) {
+ if ( prfinfo.size > 0)
+ return (1);
+ else {
+ rc = PR_Delete (filename);
+ }
+ }
+
+ if (backupname)
+ rc = PR_Rename (backupname, filename);
+ else
+ return (0);
+
+ if ( PR_GetFileInfo( filename, &prfinfo ) == PR_SUCCESS && prfinfo.size > 0 ) {
+ slapi_log_error(SLAPI_LOG_FATAL, "dse",
+ "The configuration file %s was restored from backup %s\n", filename, backupname);
+ return (1);
+ } else {
+ slapi_log_error(SLAPI_LOG_FATAL, "dse",
+ "The configuration file %s was not restored from backup %s, error %d\n",
+ filename, backupname, rc);
+ return (0);
+ }
+}
static int
dse_read_one_file(struct dse *pdse, const char *filename, Slapi_PBlock *pb,
int primary_file )
@@ -669,27 +703,11 @@ dse_read_one_file(struct dse *pdse, const char *filename, Slapi_PBlock *pb,
if ( (NULL != pdse) && (NULL != filename) )
{
- if ( (rc = PR_GetFileInfo( filename, &prfinfo )) != PR_SUCCESS )
- {
- /* the "real" file does not exist; see if there is a tmpfile */
- if ( pdse->dse_tmpfile &&
- PR_GetFileInfo( pdse->dse_tmpfile, &prfinfo ) == PR_SUCCESS ) {
- rc = PR_Rename(pdse->dse_tmpfile, filename);
- if (rc == PR_SUCCESS) {
- slapi_log_error(SLAPI_LOG_FATAL, "dse",
- "The configuration file %s was restored from backup %s\n",
- filename, pdse->dse_tmpfile);
- rc = 1;
- } else {
- slapi_log_error(SLAPI_LOG_FATAL, "dse",
- "The configuration file %s was not restored from backup %s, error %d\n",
- filename, pdse->dse_tmpfile, rc);
- rc = 0;
- }
- } else {
- rc = 0; /* fail */
- }
- }
+ /* check if the "real" file exists and cam be used, if not try tmp as backup */
+ rc = dse_check_file(filename, pdse->dse_tmpfile);
+ if (!rc)
+ rc = dse_check_file(filename, pdse->dse_fileback);
+
if ( (rc = PR_GetFileInfo( filename, &prfinfo )) != PR_SUCCESS )
{
slapi_log_error(SLAPI_LOG_FATAL, "dse",
diff --git a/ldap/servers/slapd/proto-slap.h b/ldap/servers/slapd/proto-slap.h
index d206c6db1..a17f40dff 100644
--- a/ldap/servers/slapd/proto-slap.h
+++ b/ldap/servers/slapd/proto-slap.h
@@ -661,6 +661,7 @@ struct dse *dse_new( char *filename, char *tmpfilename, char *backfilename, char
struct dse *dse_new_with_filelist(char *filename, char *tmpfilename, char *backfilename, char *startokfilename, const char *configdir, char **filelist);
int dse_deletedse(Slapi_PBlock *pb);
int dse_destroy(struct dse *pdse);
+int dse_check_file(char *filename, char *backupname);
int dse_read_file(struct dse *pdse, Slapi_PBlock *pb);
int dse_bind( Slapi_PBlock *pb );
int dse_unbind( Slapi_PBlock *pb );
| 0 |
65dd96fe4a1effd42dfecaebd58c384ba7624518
|
389ds/389-ds-base
|
Bug(s) fixed: 185780
Bug Description: one byte memory leak in modify
Reviewed by: nhosoi (Thanks!)
Files: see diff
Branch: HEAD
Fix Description: Just call slapi_ch_free_string() with the mod->mod_type. This is safe to call with NULL.
Platforms tested: RHEL4
Flag Day: no
Doc impact: no
|
commit 65dd96fe4a1effd42dfecaebd58c384ba7624518
Author: Rich Megginson <[email protected]>
Date: Thu Oct 12 22:30:32 2006 +0000
Bug(s) fixed: 185780
Bug Description: one byte memory leak in modify
Reviewed by: nhosoi (Thanks!)
Files: see diff
Branch: HEAD
Fix Description: Just call slapi_ch_free_string() with the mod->mod_type. This is safe to call with NULL.
Platforms tested: RHEL4
Flag Day: no
Doc impact: no
diff --git a/ldap/servers/slapd/modify.c b/ldap/servers/slapd/modify.c
index 0b578a834..c2bb3dd70 100644
--- a/ldap/servers/slapd/modify.c
+++ b/ldap/servers/slapd/modify.c
@@ -202,6 +202,7 @@ do_modify( Slapi_PBlock *pb )
send_ldap_result( pb, LDAP_INVALID_SYNTAX, NULL, ebuf, 0, NULL );
slapi_ch_free((void **)&type);
ber_bvecfree(mod->mod_bvalues);
+ slapi_ch_free_string(&mod->mod_type);
slapi_ch_free((void **)&mod);
goto free_and_return;
}
| 0 |
2a9d49a21c28b49e8bbaf34e834eb32bf4fb358d
|
389ds/389-ds-base
|
Ticket 48537 - undefined reference to `abstraction_increment'
Bug Description: Nunc-stan's has a component, liblfds. This was failing with
gcc 6.0.
Fix Description: Fix a macro check for correctly detecting gcc 6 or higher in
liblfds. Increase the DS version of nunc-stans to 0.1.8 to consume the fix.
https://fedorahosted.org/389/ticket/48537
Author: wibrown
Review by: nhosoi (Thanks!)
|
commit 2a9d49a21c28b49e8bbaf34e834eb32bf4fb358d
Author: William Brown <[email protected]>
Date: Mon Feb 29 11:12:03 2016 +1000
Ticket 48537 - undefined reference to `abstraction_increment'
Bug Description: Nunc-stan's has a component, liblfds. This was failing with
gcc 6.0.
Fix Description: Fix a macro check for correctly detecting gcc 6 or higher in
liblfds. Increase the DS version of nunc-stans to 0.1.8 to consume the fix.
https://fedorahosted.org/389/ticket/48537
Author: wibrown
Review by: nhosoi (Thanks!)
diff --git a/rpm/389-ds-base.spec.in b/rpm/389-ds-base.spec.in
index 9adc6f0b1..974e073f6 100644
--- a/rpm/389-ds-base.spec.in
+++ b/rpm/389-ds-base.spec.in
@@ -15,7 +15,7 @@
# To build without nunc-stans, set use_nunc_stans to 0.
%global use_nunc_stans __NUNC_STANS_ON__
%if 0%{?use_nunc_stans:1}
-%global nunc_stans_ver 0.1.7
+%global nunc_stans_ver 0.1.8
%endif
# Are we bundling jemalloc?
| 0 |
bf5a79c65b3ea0d837f287729704ae633e88655f
|
389ds/389-ds-base
|
Issue 4297- On ADD replication URP issue internal searches with filter containing unescaped chars (#4355)
Bug description:
In MMR a consumer receiving a ADD has to do some checking based on basedn.
It checks if the entry was a tombstone or if the conflicting parent entry was a tombstone.
To do this checking, URP does internal searches using basedn.
A '*' (ASTERISK) is valid in a RDN and in a DN. But using a DN in an assertionvalue of a filter, the ASTERISK needs to be escaped else the server will interprete the filtertype to be a substring. (see
https://tools.ietf.org/html/rfc4515#section-3)
The problem is that if a added entry contains an ASTERISK in the DN, it will not be escaped in internal search and trigger substring search (likely unindexed).
Fix description:
escape the DN before doing internal search in URP
Fixes: #4297
Reviewed by: Mark Reynolds, William Brown, Simon Pichugi (thanks !)
Platforms tested: F31
|
commit bf5a79c65b3ea0d837f287729704ae633e88655f
Author: tbordaz <[email protected]>
Date: Fri Oct 2 12:03:12 2020 +0200
Issue 4297- On ADD replication URP issue internal searches with filter containing unescaped chars (#4355)
Bug description:
In MMR a consumer receiving a ADD has to do some checking based on basedn.
It checks if the entry was a tombstone or if the conflicting parent entry was a tombstone.
To do this checking, URP does internal searches using basedn.
A '*' (ASTERISK) is valid in a RDN and in a DN. But using a DN in an assertionvalue of a filter, the ASTERISK needs to be escaped else the server will interprete the filtertype to be a substring. (see
https://tools.ietf.org/html/rfc4515#section-3)
The problem is that if a added entry contains an ASTERISK in the DN, it will not be escaped in internal search and trigger substring search (likely unindexed).
Fix description:
escape the DN before doing internal search in URP
Fixes: #4297
Reviewed by: Mark Reynolds, William Brown, Simon Pichugi (thanks !)
Platforms tested: F31
diff --git a/dirsrvtests/tests/suites/replication/acceptance_test.py b/dirsrvtests/tests/suites/replication/acceptance_test.py
index 192d08ef4..ed248c4f8 100644
--- a/dirsrvtests/tests/suites/replication/acceptance_test.py
+++ b/dirsrvtests/tests/suites/replication/acceptance_test.py
@@ -7,6 +7,7 @@
# --- END COPYRIGHT BLOCK ---
#
import pytest
+import logging
from lib389.replica import Replicas
from lib389.tasks import *
from lib389.utils import *
@@ -578,6 +579,68 @@ def test_csnpurge_large_valueset(topo_m2):
for i in range(21,25):
test_user.add('description', 'value {}'.format(str(i)))
[email protected]
+def test_urp_trigger_substring_search(topo_m2):
+ """Test that a ADD of a entry with a '*' in its DN, triggers
+ an internal search with a escaped DN
+
+ :id: 9869bb39-419f-42c3-a44b-c93eb0b77667
+ :setup: MMR with 2 masters
+ :steps:
+ 1. enable internal operation loggging for plugins
+ 2. Create on M1 a test_user with a '*' in its DN
+ 3. Check the test_user is replicated
+ 4. Check in access logs that the internal search does not contain '*'
+ :expectedresults:
+ 1. Should succeeds
+ 2. Should succeeds
+ 3. Should succeeds
+ 4. Should succeeds
+ """
+ m1 = topo_m2.ms["master1"]
+ m2 = topo_m2.ms["master2"]
+
+ # Enable loggging of internal operation logging to capture URP intop
+ log.info('Set nsslapd-plugin-logging to on')
+ for inst in (m1, m2):
+ inst.config.loglevel([AccessLog.DEFAULT, AccessLog.INTERNAL], service='access')
+ inst.config.set('nsslapd-plugin-logging', 'on')
+ inst.restart()
+
+ # add a user with a DN containing '*'
+ test_asterisk_uid = 'asterisk_*_in_value'
+ test_asterisk_dn = 'uid={},{}'.format(test_asterisk_uid, DEFAULT_SUFFIX)
+
+ test_user = UserAccount(m1, test_asterisk_dn)
+ if test_user.exists():
+ log.info('Deleting entry {}'.format(test_asterisk_dn))
+ test_user.delete()
+ test_user.create(properties={
+ 'uid': test_asterisk_uid,
+ 'cn': test_asterisk_uid,
+ 'sn': test_asterisk_uid,
+ 'userPassword': test_asterisk_uid,
+ 'uidNumber' : '1000',
+ 'gidNumber' : '2000',
+ 'homeDirectory' : '/home/asterisk',
+ })
+
+ # check that the ADD was replicated on M2
+ test_user_m2 = UserAccount(m2, test_asterisk_dn)
+ for i in range(1,5):
+ if test_user_m2.exists():
+ break
+ else:
+ log.info('Entry not yet replicated on M2, wait a bit')
+ time.sleep(2)
+
+ # check that M2 access logs does not "(&(objectclass=nstombstone)(nscpentrydn=uid=asterisk_*_in_value,dc=example,dc=com))"
+ log.info('Check that on M2, URP as not triggered such internal search')
+ pattern = ".*\(Internal\).*SRCH.*\(&\(objectclass=nstombstone\)\(nscpentrydn=uid=asterisk_\*_in_value,dc=example,dc=com.*"
+ found = m2.ds_access_log.match(pattern)
+ log.info("found line: %s" % found)
+ assert not found
+
if __name__ == '__main__':
# Run isolated
diff --git a/ldap/servers/plugins/replication/urp.c b/ldap/servers/plugins/replication/urp.c
index 79a817c90..301e9fa00 100644
--- a/ldap/servers/plugins/replication/urp.c
+++ b/ldap/servers/plugins/replication/urp.c
@@ -1411,9 +1411,12 @@ urp_add_check_tombstone (Slapi_PBlock *pb, char *sessionid, Slapi_Entry *entry,
Slapi_Entry **entries = NULL;
Slapi_PBlock *newpb;
char *basedn = slapi_entry_get_ndn(entry);
+ char *escaped_basedn;
const Slapi_DN *suffix = slapi_get_suffix_by_dn(slapi_entry_get_sdn (entry));
+ escaped_basedn = slapi_filter_escape_filter_value("nscpentrydn", basedn);
- char *filter = slapi_filter_sprintf("(&(objectclass=nstombstone)(nscpentrydn=%s))", basedn);
+ char *filter = slapi_filter_sprintf("(&(objectclass=nstombstone)(nscpentrydn=%s))", escaped_basedn);
+ slapi_ch_free((void **)&escaped_basedn);
newpb = slapi_pblock_new();
slapi_search_internal_set_pb(newpb,
slapi_sdn_get_dn(suffix), /* Base DN */
@@ -1602,12 +1605,15 @@ urp_find_tombstone_for_glue (Slapi_PBlock *pb, char *sessionid, const Slapi_Entr
Slapi_Entry **entries = NULL;
Slapi_PBlock *newpb;
const char *basedn = slapi_sdn_get_dn(parentdn);
+ char *escaped_basedn;
+ escaped_basedn = slapi_filter_escape_filter_value("nscpentrydn", basedn);
char *conflict_csnstr = (char*)slapi_entry_attr_get_ref((Slapi_Entry *)entry, "conflictcsn");
CSN *conflict_csn = csn_new_by_string(conflict_csnstr);
CSN *tombstone_csn = NULL;
- char *filter = slapi_filter_sprintf("(&(objectclass=nstombstone)(nscpentrydn=%s))", basedn);
+ char *filter = slapi_filter_sprintf("(&(objectclass=nstombstone)(nscpentrydn=%s))", escaped_basedn);
+ slapi_ch_free((void **)&escaped_basedn);
newpb = slapi_pblock_new();
char *parent_dn = slapi_dn_parent (basedn);
slapi_search_internal_set_pb(newpb,
diff --git a/ldap/servers/slapd/filter.c b/ldap/servers/slapd/filter.c
index 898417da1..40f11c230 100644
--- a/ldap/servers/slapd/filter.c
+++ b/ldap/servers/slapd/filter.c
@@ -130,6 +130,27 @@ filter_escape_filter_value(struct slapi_filter *f, const char *fmt, size_t len _
return ptr;
}
+/* Escaped an equality filter value (assertionValue) of a given attribute
+ * Caller must free allocated escaped filter value
+ */
+char *
+slapi_filter_escape_filter_value(char* filter_attr, char *filter_value)
+{
+ char *result;
+ struct slapi_filter *f;
+
+ if ((filter_attr == NULL) || (filter_value == NULL)) {
+ return NULL;
+ }
+ f = (struct slapi_filter *)slapi_ch_calloc(1, sizeof(struct slapi_filter));
+ f->f_choice = LDAP_FILTER_EQUALITY;
+ f->f_un.f_un_ava.ava_type = filter_attr;
+ f->f_un.f_un_ava.ava_value.bv_len = strlen(filter_value);
+ f->f_un.f_un_ava.ava_value.bv_val = filter_value;
+ result = filter_escape_filter_value(f, FILTER_EQ_FMT, FILTER_EQ_LEN);
+ slapi_ch_free((void**) &f);
+ return result;
+}
/*
* get_filter_internal(): extract an LDAP filter from a BerElement and create
diff --git a/ldap/servers/slapd/slapi-plugin.h b/ldap/servers/slapd/slapi-plugin.h
index c97f8ea0e..2b415070e 100644
--- a/ldap/servers/slapd/slapi-plugin.h
+++ b/ldap/servers/slapd/slapi-plugin.h
@@ -5264,6 +5264,7 @@ int slapi_vattr_filter_test_ext(Slapi_PBlock *pb, Slapi_Entry *e, Slapi_Filter *
int slapi_filter_compare(struct slapi_filter *f1, struct slapi_filter *f2);
Slapi_Filter *slapi_filter_dup(Slapi_Filter *f);
int slapi_filter_changetype(Slapi_Filter *f, const char *newtype);
+char *slapi_filter_escape_filter_value(char* filter_attr, char *filter_value);
int slapi_attr_is_last_mod(char *attr);
| 0 |
b28f7a54eba92c64ffed0570cc9313b365d76738
|
389ds/389-ds-base
|
Resolves: #492562
Summary: homePhone is not RFC 1274 compliant
Description: added "homeTelephoneNumber" to the NAME list of "homePhone".
|
commit b28f7a54eba92c64ffed0570cc9313b365d76738
Author: Noriko Hosoi <[email protected]>
Date: Fri Mar 27 16:45:41 2009 +0000
Resolves: #492562
Summary: homePhone is not RFC 1274 compliant
Description: added "homeTelephoneNumber" to the NAME list of "homePhone".
diff --git a/ldap/schema/01common.ldif b/ldap/schema/01common.ldif
index 83ece4f3f..01e0727d5 100644
--- a/ldap/schema/01common.ldif
+++ b/ldap/schema/01common.ldif
@@ -96,7 +96,7 @@ attributeTypes: ( 0.9.2342.19200300.100.1.1 NAME ( 'uid' 'userid' ) DESC 'Standa
attributeTypes: ( 0.9.2342.19200300.100.1.3 NAME ( 'mail' 'rfc822mailbox' ) DESC 'Standard LDAP attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 1274' )
attributeTypes: ( 0.9.2342.19200300.100.1.6 NAME 'roomNumber' DESC 'Standard LDAP attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 1274' )
attributeTypes: ( 0.9.2342.19200300.100.1.10 NAME 'manager' DESC 'Standard LDAP attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'RFC 1274' )
-attributeTypes: ( 0.9.2342.19200300.100.1.20 NAME 'homePhone' DESC 'Standard LDAP attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.50 X-ORIGIN 'RFC 1274' )
+attributeTypes: ( 0.9.2342.19200300.100.1.20 NAME ( 'homePhone' 'homeTelephoneNumber' ) DESC 'Standard LDAP attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.50 X-ORIGIN 'RFC 1274' )
attributeTypes: ( 0.9.2342.19200300.100.1.21 NAME 'secretary' DESC 'Standard LDAP attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'RFC 1274' )
attributeTypes: ( 0.9.2342.19200300.100.1.39 NAME 'homePostalAddress' DESC 'Standard LDAP attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'RFC 1274' )
attributeTypes: ( 0.9.2342.19200300.100.1.41 NAME ( 'mobile' 'mobileTelephoneNumber' ) DESC 'Standard LDAP attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.50 X-ORIGIN 'RFC 1274' )
| 0 |
095b720ab5dc1dab860da62826c227fc31630859
|
389ds/389-ds-base
|
Ticket 49026 - Support nunc-stans pkgconfig
Bug Description: Without pkgconfig we would have to provide a with path to
the our tools incase nunc-stans was in a weird location. This avoids that issue
Fix Description: Add the support to use pkgconfig for nunc-stans.
https://fedorahosted.org/389/ticket/49026
Author: wibrown
Review by: mreynolds (Thanks)
|
commit 095b720ab5dc1dab860da62826c227fc31630859
Author: William Brown <[email protected]>
Date: Tue Nov 1 15:45:31 2016 +1000
Ticket 49026 - Support nunc-stans pkgconfig
Bug Description: Without pkgconfig we would have to provide a with path to
the our tools incase nunc-stans was in a weird location. This avoids that issue
Fix Description: Add the support to use pkgconfig for nunc-stans.
https://fedorahosted.org/389/ticket/49026
Author: wibrown
Review by: mreynolds (Thanks)
diff --git a/m4/nunc-stans.m4 b/m4/nunc-stans.m4
index 6c3a360e8..442a0dfc0 100644
--- a/m4/nunc-stans.m4
+++ b/m4/nunc-stans.m4
@@ -61,3 +61,16 @@ AC_ARG_WITH(nunc-stans-lib, AS_HELP_STRING([--with-nunc-stans-lib=PATH],[nunc-st
fi
],
AC_MSG_RESULT(no))
+
+if test -z "$nunc_stans_inc" -o -z "$nunc_stans_lib"; then
+ AC_PATH_PROG(PKG_CONFIG, pkg-config)
+ AC_MSG_CHECKING(for nunc-stans with pkg-config)
+ if test -n "$PKG_CONFIG"; then
+ if $PKG_CONFIG --exists nunc-stans; then
+ nunc_stans_inc=`$PKG_CONFIG --cflags-only-I nunc-stans`
+ nunc_stans_lib=`$PKG_CONFIG --libs-only-L nunc-stans`
+ AC_MSG_RESULT([using system nunc-stans])
+ fi
+ fi
+fi
+
| 0 |
c48f4d98db2435e2ee436834089f20ad405d1cc2
|
389ds/389-ds-base
|
Issue 50928 - Unable to create a suffix with countryName either via dscreate or the admin console
Description: Added a test case to create a suffix with countryName and all other RDN attributes
via dscreate, also added a negative scenario.
Relates: https://pagure.io/389-ds-base/issue/50928
Reviewed by: vashirov, mreynolds (Thanks!)
|
commit c48f4d98db2435e2ee436834089f20ad405d1cc2
Author: Akshay Adhikari <[email protected]>
Date: Wed Jun 24 18:55:30 2020 +0530
Issue 50928 - Unable to create a suffix with countryName either via dscreate or the admin console
Description: Added a test case to create a suffix with countryName and all other RDN attributes
via dscreate, also added a negative scenario.
Relates: https://pagure.io/389-ds-base/issue/50928
Reviewed by: vashirov, mreynolds (Thanks!)
diff --git a/dirsrvtests/tests/suites/basic/basic_test.py b/dirsrvtests/tests/suites/basic/basic_test.py
index 120207321..44ffdd34d 100644
--- a/dirsrvtests/tests/suites/basic/basic_test.py
+++ b/dirsrvtests/tests/suites/basic/basic_test.py
@@ -1400,6 +1400,85 @@ def test_dscreate_multiple_dashes_name(dscreate_long_instance):
assert not dscreate_long_instance.exists()
[email protected](scope="module", params=('c=uk', 'cn=test_user', 'dc=example,dc=com', 'o=south', 'ou=sales', 'wrong=some_value'))
+def dscreate_test_rdn_value(request):
+ template_file = "/tmp/dssetup.inf"
+ template_text = f"""[general]
+config_version = 2
+# This invalid hostname ...
+full_machine_name = localhost.localdomain
+# Means we absolutely require this.
+strict_host_checking = False
+# In tests, we can be run in containers, NEVER trust
+# that systemd is there, or functional in any capacity
+systemd = False
+
+[slapd]
+instance_name = test_different_rdn
+root_dn = cn=directory manager
+root_password = someLongPassword_123
+# We do not have access to high ports in containers,
+# so default to something higher.
+port = 38999
+secure_port = 63699
+
+[backend-userroot]
+create_suffix_entry = True
+suffix = {request.param}
+"""
+
+ with open(template_file, "w") as template_fd:
+ template_fd.write(template_text)
+
+ # Unset PYTHONPATH to avoid mixing old CLI tools and new lib389
+ tmp_env = os.environ
+ if "PYTHONPATH" in tmp_env:
+ del tmp_env["PYTHONPATH"]
+
+ def fin():
+ os.remove(template_file)
+ if request.param != "wrong=some_value":
+ try:
+ subprocess.check_call(['dsctl', 'test_different_rdn', 'remove', '--do-it'])
+ except subprocess.CalledProcessError as e:
+ log.fatal(f"Failed to remove test instance Error ({e.returncode}) {e.output}")
+ else:
+ log.info("Wrong RDN is passed, instance not created")
+ request.addfinalizer(fin)
+ return template_file, tmp_env, request.param,
+
+
[email protected](not get_user_is_root() or ds_is_older('1.4.0.0'),
+ reason="This test is only required with new admin cli, and requires root.")
[email protected]
[email protected]
+def test_dscreate_with_different_rdn(dscreate_test_rdn_value):
+ """Test that dscreate works with different RDN attributes as suffix
+
+ :id: 77ed6300-6a2f-4e79-a862-1f1105f1e3ef
+ :setup: None
+ :steps:
+ 1. Create template file for dscreate with different RDN attributes as suffix
+ 2. Create instance using template file
+ 3. Create instance with 'wrong=some_value' as suffix's RDN attribute
+ :expectedresults:
+ 1. Should succeeds
+ 2. Should succeeds
+ 3. Should fail
+ """
+ try:
+ subprocess.check_call([
+ 'dscreate',
+ 'from-file',
+ dscreate_test_rdn_value[0]
+ ], env=dscreate_test_rdn_value[1])
+ except subprocess.CalledProcessError as e:
+ log.fatal(f"dscreate failed! Error ({e.returncode}) {e.output}")
+ if dscreate_test_rdn_value[2] != "wrong=some_value":
+ assert False
+ else:
+ assert True
+
if __name__ == '__main__':
# Run isolated
| 0 |
da7d2de1f760844e023040c32be33834af5dad6b
|
389ds/389-ds-base
|
Ticket 50282 - OPERATIONS ERROR when trying to delete a group with automember members
Bug Description:
When automember and memberof are enabled, if a user is member of a group
because of an automember rule. Then when the group is deleted,
memberof updates the member (to update 'memberof' attribute) that
trigger automember to reevaluate the automember rule and add the member
to the group. But at this time the group is already deleted.
Chaining back the failure up to the top level operation the deletion
of the group fails
Fix Description:
The fix consists to check that if a automember rule tries to add a user
in a group, then to check that the group exists before updating it.
https://pagure.io/389-ds-base/issue/50282
Reviewed by: Mark Reynolds, William Brown
Platforms tested: F29
Flag Day: no
Doc impact: no
|
commit da7d2de1f760844e023040c32be33834af5dad6b
Author: Thierry Bordaz <[email protected]>
Date: Thu Mar 14 17:33:35 2019 +0100
Ticket 50282 - OPERATIONS ERROR when trying to delete a group with automember members
Bug Description:
When automember and memberof are enabled, if a user is member of a group
because of an automember rule. Then when the group is deleted,
memberof updates the member (to update 'memberof' attribute) that
trigger automember to reevaluate the automember rule and add the member
to the group. But at this time the group is already deleted.
Chaining back the failure up to the top level operation the deletion
of the group fails
Fix Description:
The fix consists to check that if a automember rule tries to add a user
in a group, then to check that the group exists before updating it.
https://pagure.io/389-ds-base/issue/50282
Reviewed by: Mark Reynolds, William Brown
Platforms tested: F29
Flag Day: no
Doc impact: no
diff --git a/dirsrvtests/tests/suites/automember_plugin/automember_test.py b/dirsrvtests/tests/suites/automember_plugin/automember_test.py
index b13c1b2cc..1659ab663 100644
--- a/dirsrvtests/tests/suites/automember_plugin/automember_test.py
+++ b/dirsrvtests/tests/suites/automember_plugin/automember_test.py
@@ -4,7 +4,7 @@ import os
import ldap
from lib389.utils import ds_is_older
from lib389._constants import *
-from lib389.plugins import AutoMembershipPlugin, AutoMembershipDefinition, AutoMembershipDefinitions
+from lib389.plugins import AutoMembershipPlugin, AutoMembershipDefinition, AutoMembershipDefinitions, AutoMembershipRegexRule
from lib389._mapped_object import DSLdapObjects, DSLdapObject
from lib389 import agreement
from lib389.idm.user import UserAccount, UserAccounts, TEST_USER_PROPERTIES
@@ -137,3 +137,115 @@ def test_adduser(automember_fixture, topo):
user = users.create(properties=TEST_USER_PROPERTIES)
assert group.is_member(user.dn)
+ user.delete()
+
+def test_delete_default_group(automember_fixture, topo):
+ """If memberof is enable and a user became member of default group
+ because of automember rule then delete the default group should succeeds
+
+ :id: 8b55d077-8851-45a2-a547-b28a7983a3c2
+ :setup: Standalone instance, enabled Auto Membership Plugin
+ :steps:
+ 1. Enable memberof plugin
+ 2. Create a user
+ 3. Assert that the user is member of the default group
+ 4. Delete the default group
+ :expectedresults:
+ 1. Should be success
+ 2. Should be success
+ 3. Should be success
+ 4. Should be success
+ """
+
+ (group, automembers, automember) = automember_fixture
+
+ from lib389.plugins import MemberOfPlugin
+ memberof = MemberOfPlugin(topo.standalone)
+ memberof.enable()
+ topo.standalone.restart()
+ topo.standalone.setLogLevel(65536)
+
+ users = UserAccounts(topo.standalone, DEFAULT_SUFFIX)
+ user_1 = users.create_test_user(uid=1)
+
+ try:
+ assert group.is_member(user_1.dn)
+ group.delete()
+ error_lines = topo.standalone.ds_error_log.match('.*auto-membership-plugin - automember_update_member_value - group .default or target. does not exist .%s.$' % group.dn)
+ assert (len(error_lines) == 1)
+ finally:
+ user_1.delete()
+ topo.standalone.setLogLevel(0)
+
+def test_delete_target_group(automember_fixture, topo):
+ """If memberof is enabld and a user became member of target group
+ because of automember rule then delete the target group should succeeds
+
+ :id: bf5745e3-3de8-485d-8a68-e2fd460ce1cb
+ :setup: Standalone instance, enabled Auto Membership Plugin
+ :steps:
+ 1. Recreate the default group if it was deleted before
+ 2. Create a target group (using regex)
+ 3. Create a target group automember rule (regex)
+ 4. Enable memberof plugin
+ 5. Create a user that goes into the target group
+ 6. Assert that the user is member of the target group
+ 7. Delete the target group
+ 8. Check automember skipped the regex automember rule because target group did not exist
+ :expectedresults:
+ 1. Should be success
+ 2. Should be success
+ 3. Should be success
+ 4. Should be success
+ 5. Should be success
+ 6. Should be success
+ 7. Should be success
+ 8. Should be success
+ """
+
+ (group, automembers, automember) = automember_fixture
+
+ # default group that may have been deleted in previous tests
+ try:
+ groups = Groups(topo.standalone, DEFAULT_SUFFIX)
+ group = groups.create(properties={'cn': 'testgroup'})
+ except:
+ pass
+
+ # target group that will receive regex automember
+ groups = Groups(topo.standalone, DEFAULT_SUFFIX)
+ group_regex = groups.create(properties={'cn': 'testgroup_regex'})
+
+ # regex automember definition
+ automember_regex_prop = {
+ 'cn': 'automember regex',
+ 'autoMemberTargetGroup': group_regex.dn,
+ 'autoMemberInclusiveRegex': 'uid=.*1',
+ }
+ automember_regex_dn = 'cn=automember regex, %s' % automember.dn
+ automember_regexes = AutoMembershipRegexRule(topo.standalone, automember_regex_dn)
+ automember_regex = automember_regexes.create(properties=automember_regex_prop)
+
+ from lib389.plugins import MemberOfPlugin
+ memberof = MemberOfPlugin(topo.standalone)
+ memberof.enable()
+
+ topo.standalone.restart()
+ topo.standalone.setLogLevel(65536)
+
+ # create a user that goes into the target group but not in the default group
+ users = UserAccounts(topo.standalone, DEFAULT_SUFFIX)
+ user_1 = users.create_test_user(uid=1)
+
+ try:
+ assert group_regex.is_member(user_1.dn)
+ assert not group.is_member(user_1.dn)
+
+ # delete that target filter group
+ group_regex.delete()
+ error_lines = topo.standalone.ds_error_log.match('.*auto-membership-plugin - automember_update_member_value - group .default or target. does not exist .%s.$' % group_regex.dn)
+ # one line for default group and one for target group
+ assert (len(error_lines) == 1)
+ finally:
+ user_1.delete()
+ topo.standalone.setLogLevel(0)
diff --git a/ldap/servers/plugins/automember/automember.c b/ldap/servers/plugins/automember/automember.c
index abd6df805..c7b83e814 100644
--- a/ldap/servers/plugins/automember/automember.c
+++ b/ldap/servers/plugins/automember/automember.c
@@ -1637,6 +1637,29 @@ automember_update_member_value(Slapi_Entry *member_e, const char *group_dn, char
char *member_value = NULL;
int freeit = 0;
int rc = 0;
+ Slapi_DN *group_sdn;
+ Slapi_Entry *group_entry = NULL;
+
+ /* First thing check that the group still exists */
+ group_sdn = slapi_sdn_new_dn_byval(group_dn);
+ rc = slapi_search_internal_get_entry(group_sdn, NULL, &group_entry, automember_get_plugin_id());
+ slapi_sdn_free(&group_sdn);
+ if (rc != LDAP_SUCCESS || group_entry == NULL) {
+ if (rc == LDAP_NO_SUCH_OBJECT) {
+ /* the automember group (default or target) does not exist, just skip this definition */
+ slapi_log_err(SLAPI_LOG_PLUGIN, AUTOMEMBER_PLUGIN_SUBSYSTEM,
+ "automember_update_member_value - group (default or target) does not exist (%s)\n",
+ group_dn);
+ rc = 0;
+ } else {
+ slapi_log_err(SLAPI_LOG_ERR, AUTOMEMBER_PLUGIN_SUBSYSTEM,
+ "automember_update_member_value - group (default or target) can not be retrieved (%s) err=%d\n",
+ group_dn, rc);
+ }
+ slapi_entry_free(group_entry);
+ return rc;
+ }
+ slapi_entry_free(group_entry);
/* If grouping_value is dn, we need to fetch the dn instead. */
if (slapi_attr_type_cmp(grouping_value, "dn", SLAPI_TYPE_CMP_EXACT) == 0) {
| 0 |
7b7d22cd80cc827ab4c2b801fcfe3f02f1a3e690
|
389ds/389-ds-base
|
Ticket 48269 - ns-accountstatus status message improvement
Description: With the addition of support of account policy inactivity
limits, the inactivated messages should be more detailed.
https://fedorahosted.org/389/ticket/48269
Reviewed by: nhosoi(Thanks!)
|
commit 7b7d22cd80cc827ab4c2b801fcfe3f02f1a3e690
Author: Mark Reynolds <[email protected]>
Date: Tue May 3 15:51:51 2016 -0400
Ticket 48269 - ns-accountstatus status message improvement
Description: With the addition of support of account policy inactivity
limits, the inactivated messages should be more detailed.
https://fedorahosted.org/389/ticket/48269
Reviewed by: nhosoi(Thanks!)
diff --git a/ldap/admin/src/scripts/ns-accountstatus.pl.in b/ldap/admin/src/scripts/ns-accountstatus.pl.in
index 139160b04..5d92220b5 100644
--- a/ldap/admin/src/scripts/ns-accountstatus.pl.in
+++ b/ldap/admin/src/scripts/ns-accountstatus.pl.in
@@ -920,10 +920,10 @@ for(my $i = 0; $i <= $#entries; $i++){
if ($verbose){
printVerbose(\%info, "@suffixN", $entry, $createtime,
$modifytime, $lastlogintime,
- "inactivated through $throughRole", $limit,
+ "inactivated (indirectly through role: $throughRole)", $limit,
$acct_policy_enabled);
} else {
- out("$entry - inactivated through $throughRole.\n");
+ out("$entry - inactivated (indirectly through role: $throughRole).\n");
}
if($keep_processing){
next;
@@ -933,10 +933,10 @@ for(my $i = 0; $i <= $#entries; $i++){
debug("$entry locked individually\n");
if ($verbose){
printVerbose(\%info, "@suffixN", $entry, $createtime,
- $modifytime, $lastlogintime, "inactivated", $limit,
+ $modifytime, $lastlogintime, "inactivated (directly locked)", $limit,
$acct_policy_enabled);
} else {
- out("$entry - inactivated.\n");
+ out("$entry - inactivated (directly locked).\n");
}
if($keep_processing){
next;
@@ -1025,10 +1025,10 @@ for(my $i = 0; $i <= $#entries; $i++){
}
if($verbose){
printVerbose(\%info, "@suffixN", $entry, $createtime,
- $modifytime, $lastlogintime, "inactivated", $limit,
+ $modifytime, $lastlogintime, "inactivated (directly locked)", $limit,
$acct_policy_enabled);
} else {
- out("$entry - inactivated.\n");
+ out("$entry - inactivated (directly locked).\n");
}
if($keep_processing){
next;
| 0 |
45d2fd4b50227687ad042a0e17d8dcd9e4cd3023
|
389ds/389-ds-base
|
Ticket 49407 - status-dirsrv shows ellipsed lines
Bug Description: To show the full output you have to pass "-l" to systemctl,
but there is no way to use this option with the current design.
Fix Description: Just show the full lines by default, as adding options can break
the script's current usage.
https://pagure.io/389-ds-base/issue/49407
Reviewed by: tbordaz(Thanks!)
|
commit 45d2fd4b50227687ad042a0e17d8dcd9e4cd3023
Author: Mark Reynolds <[email protected]>
Date: Thu Oct 19 17:02:20 2017 -0400
Ticket 49407 - status-dirsrv shows ellipsed lines
Bug Description: To show the full output you have to pass "-l" to systemctl,
but there is no way to use this option with the current design.
Fix Description: Just show the full lines by default, as adding options can break
the script's current usage.
https://pagure.io/389-ds-base/issue/49407
Reviewed by: tbordaz(Thanks!)
diff --git a/ldap/admin/src/scripts/status-dirsrv.in b/ldap/admin/src/scripts/status-dirsrv.in
index 90428990b..8e492c115 100755
--- a/ldap/admin/src/scripts/status-dirsrv.in
+++ b/ldap/admin/src/scripts/status-dirsrv.in
@@ -37,7 +37,7 @@ status_instance() {
# Use systemctl if available.
#
if [ -d "@systemdsystemunitdir@" ] && [ $(id -u) -eq 0 ];then
- @bindir@/systemctl status @package_name@@$SERV_ID.service
+ @bindir@/systemctl status @package_name@@$SERV_ID.service -l
rv=$?
if [ $rv -ne 0 ]; then
return 1
@@ -65,7 +65,7 @@ found=0
if [ $# -eq 0 ]; then
# We're reporting the status of all instances.
ret=0
- @bindir@/systemctl status @[email protected]
+ @bindir@/systemctl status @[email protected] -l
initfiles=`get_initconfig_files $initconfig_dir` || { echo No instances found in $initconfig_dir ; exit 1 ; }
for i in $initfiles; do
inst=`normalize_server_id $i`
| 0 |
f1d509ec6f97fced6ad06b0fbe458444cd444825
|
389ds/389-ds-base
|
Bug 612242 - membership change on DS does not show on AD
When a change was made to a DN mapped attribute in DS (such as
uniqueMember in a group entry), we may end up searching for the
entries that those values point to in AD when winsync is being
used. We were overwriting the "raw entry" pointer every time we
searched for an entry in AD. The raw entry is intended to point
to the entry that the original modification was made to, not the
entry that a DN mapped attribute value points to.
The fix is to add a flag that will force the raw entry to be kept
when we search for an entry in AD. We set this flag when we search
for entries that are pointed to be DN mapped attribute values and
reset it when we are finished. This results in the raw entry being
the actual entry that is the target of the operation we are syncing.
|
commit f1d509ec6f97fced6ad06b0fbe458444cd444825
Author: Nathan Kinder <[email protected]>
Date: Fri Jul 9 10:23:51 2010 -0700
Bug 612242 - membership change on DS does not show on AD
When a change was made to a DN mapped attribute in DS (such as
uniqueMember in a group entry), we may end up searching for the
entries that those values point to in AD when winsync is being
used. We were overwriting the "raw entry" pointer every time we
searched for an entry in AD. The raw entry is intended to point
to the entry that the original modification was made to, not the
entry that a DN mapped attribute value points to.
The fix is to add a flag that will force the raw entry to be kept
when we search for an entry in AD. We set this flag when we search
for entries that are pointed to be DN mapped attribute values and
reset it when we are finished. This results in the raw entry being
the actual entry that is the target of the operation we are syncing.
diff --git a/ldap/servers/plugins/replication/windows_private.c b/ldap/servers/plugins/replication/windows_private.c
index d6f8e51ed..d855b85bc 100644
--- a/ldap/servers/plugins/replication/windows_private.c
+++ b/ldap/servers/plugins/replication/windows_private.c
@@ -72,6 +72,7 @@ struct windowsprivate {
Slapi_Filter *directory_filter; /* Used for checking if local entries need to be sync'd to AD */
Slapi_Filter *deleted_filter; /* Used for checking if an entry is an AD tombstone */
Slapi_Entry *raw_entry; /* "raw" un-schema processed last entry read from AD */
+ int keep_raw_entry; /* flag to control when the raw entry is set */
void *api_cookie; /* private data used by api callbacks */
time_t sync_interval; /* how often to run the dirsync search, in seconds */
};
@@ -845,12 +846,49 @@ void windows_private_set_raw_entry(const Repl_Agmt *ra, Slapi_Entry *e)
dp = (Dirsync_Private *) agmt_get_priv(ra);
PR_ASSERT (dp);
- slapi_entry_free(dp->raw_entry);
- dp->raw_entry = e;
+ /* If the keep raw entry flag is set, just free the passed
+ * in entry and leave the current raw entry in place. */
+ if (windows_private_get_keep_raw_entry(ra)) {
+ slapi_entry_free(e);
+ } else {
+ slapi_entry_free(dp->raw_entry);
+ dp->raw_entry = e;
+ }
LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_set_raw_entry\n" );
}
+/* Setting keep to 1 will cause the current raw entry to remain, even if
+ * windows_private_set_raw_entry() is called. This behavior will persist
+ * until this flag is set back to 0. */
+void windows_private_set_keep_raw_entry(const Repl_Agmt *ra, int keep)
+{
+ Dirsync_Private *dp;
+
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_set_keep_raw_entry\n" );
+
+ dp = (Dirsync_Private *) agmt_get_priv(ra);
+ PR_ASSERT (dp);
+
+ dp->keep_raw_entry = keep;
+
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_set_keep_raw_entry\n" );
+}
+
+int windows_private_get_keep_raw_entry(const Repl_Agmt *ra)
+{
+ Dirsync_Private *dp;
+
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "=> windows_private_get_keep_raw_entry\n" );
+
+ dp = (Dirsync_Private *) agmt_get_priv(ra);
+ PR_ASSERT (dp);
+
+ LDAPDebug0Args( LDAP_DEBUG_TRACE, "<= windows_private_get_keep_raw_entry\n" );
+
+ return dp->keep_raw_entry;
+}
+
void *windows_private_get_api_cookie(const Repl_Agmt *ra)
{
Dirsync_Private *dp;
diff --git a/ldap/servers/plugins/replication/windows_protocol_util.c b/ldap/servers/plugins/replication/windows_protocol_util.c
index 3c6b4d4c4..a3d007728 100644
--- a/ldap/servers/plugins/replication/windows_protocol_util.c
+++ b/ldap/servers/plugins/replication/windows_protocol_util.c
@@ -406,6 +406,10 @@ map_dn_values(Private_Repl_Protocol *prp,Slapi_ValueSet *original_values, Slapi_
Slapi_Value *original_value = NULL;
int retval = 0;
int i = 0;
+
+ /* Set the keep raw entry flag to avoid overwriting the existing raw entry. */
+ windows_private_set_keep_raw_entry(prp->agmt, 1);
+
/* For each value: */
i= slapi_valueset_first_value(original_values,&original_value);
while ( i != -1 ) {
@@ -531,6 +535,9 @@ map_dn_values(Private_Repl_Protocol *prp,Slapi_ValueSet *original_values, Slapi_
{
*mapped_values = new_vs;
}
+
+ /* Restore the keep raw entry flag. */
+ windows_private_set_keep_raw_entry(prp->agmt, 0);
}
static void
diff --git a/ldap/servers/plugins/replication/windowsrepl.h b/ldap/servers/plugins/replication/windowsrepl.h
index 3d216e05a..f41374616 100644
--- a/ldap/servers/plugins/replication/windowsrepl.h
+++ b/ldap/servers/plugins/replication/windowsrepl.h
@@ -78,6 +78,8 @@ const char* windows_private_get_purl(const Repl_Agmt *ra);
Slapi_Entry *windows_private_get_raw_entry(const Repl_Agmt *ra);
/* this is passin - windows_private owns the pointer, not a copy */
void windows_private_set_raw_entry(const Repl_Agmt *ra, Slapi_Entry *e);
+void windows_private_set_keep_raw_entry(const Repl_Agmt *ra, int keep);
+int windows_private_get_keep_raw_entry(const Repl_Agmt *ra);
void *windows_private_get_api_cookie(const Repl_Agmt *ra);
void windows_private_set_api_cookie(Repl_Agmt *ra, void *cookie);
time_t windows_private_get_sync_interval(const Repl_Agmt *ra);
| 0 |
5f5b3553309e0d28ae2b2b5defef6b1f8fd16149
|
389ds/389-ds-base
|
Ticket 47487 - enhance retro changelog
Bug Description: applications using retro cl might need the
full information on deleted entries
eg to verify if the entry matches filter or access
Fix Description: introduce a new attribute in the retro changelog
config entry: nsslapd-log-deleted (off by default)
https://fedorahosted.org/389/ticket/47487
Reviewed by: MarkR
|
commit 5f5b3553309e0d28ae2b2b5defef6b1f8fd16149
Author: Ludwig Krispenz <[email protected]>
Date: Tue Sep 17 10:48:19 2013 +0200
Ticket 47487 - enhance retro changelog
Bug Description: applications using retro cl might need the
full information on deleted entries
eg to verify if the entry matches filter or access
Fix Description: introduce a new attribute in the retro changelog
config entry: nsslapd-log-deleted (off by default)
https://fedorahosted.org/389/ticket/47487
Reviewed by: MarkR
diff --git a/ldap/servers/plugins/retrocl/retrocl.c b/ldap/servers/plugins/retrocl/retrocl.c
index 90c34556e..141cfd22f 100644
--- a/ldap/servers/plugins/retrocl/retrocl.c
+++ b/ldap/servers/plugins/retrocl/retrocl.c
@@ -80,6 +80,7 @@ PRLock *retrocl_internal_lock = NULL;
int retrocl_nattributes = 0;
char **retrocl_attributes = NULL;
char **retrocl_aliases = NULL;
+int retrocl_log_deleted = 0;
/* ----------------------------- Retrocl Plugin */
@@ -389,6 +390,21 @@ static int retrocl_start (Slapi_PBlock *pb)
slapi_ch_array_free(values);
}
+ retrocl_log_deleted = 0;
+ values = slapi_entry_attr_get_charray(e, "nsslapd-log-deleted");
+ if (values != NULL) {
+ if (values[1] != NULL) {
+ slapi_log_error(SLAPI_LOG_PLUGIN, RETROCL_PLUGIN_NAME,
+ "Multiple values specified for attribute: nsslapd-log-deleted\n");
+ } else if ( 0 == strcasecmp(values[0], "on")) {
+ retrocl_log_deleted = 1;
+ } else if (strcasecmp(values[0], "off")) {
+ slapi_log_error(SLAPI_LOG_PLUGIN, RETROCL_PLUGIN_NAME,
+ "Invalid value (%s) specified for attribute: nsslapd-log-deleted\n", values[0]);
+ }
+ slapi_ch_array_free(values);
+ }
+
retrocl_started = 1;
return 0;
diff --git a/ldap/servers/plugins/retrocl/retrocl.h b/ldap/servers/plugins/retrocl/retrocl.h
index 276912bb9..214f3afb1 100644
--- a/ldap/servers/plugins/retrocl/retrocl.h
+++ b/ldap/servers/plugins/retrocl/retrocl.h
@@ -113,6 +113,7 @@ enum {
extern void* g_plg_identity [PLUGIN_MAX];
extern Slapi_Backend *retrocl_be_changelog;
+extern int retrocl_log_deleted;
extern int retrocl_nattributes;
extern char** retrocl_attributes;
extern char** retrocl_aliases;
diff --git a/ldap/servers/plugins/retrocl/retrocl_po.c b/ldap/servers/plugins/retrocl/retrocl_po.c
index 382c98a1f..9c005b382 100644
--- a/ldap/servers/plugins/retrocl/retrocl_po.c
+++ b/ldap/servers/plugins/retrocl/retrocl_po.c
@@ -44,7 +44,7 @@
#include "retrocl.h"
static int
-entry2reple( Slapi_Entry *e, Slapi_Entry *oe );
+entry2reple( Slapi_Entry *e, Slapi_Entry *oe, int optype );
static int
mods2reple( Slapi_Entry *e, LDAPMod **ldm );
@@ -324,7 +324,7 @@ write_replog_db(
err = 0;
switch ( optype ) {
case OP_ADD:
- if ( entry2reple( e, log_e ) != 0 ) {
+ if ( entry2reple( e, log_e, OP_ADD ) != 0 ) {
err = 1;
}
break;
@@ -342,10 +342,17 @@ write_replog_db(
break;
case OP_DELETE:
- /* Set the changetype attribute */
- val.bv_val = "delete";
- val.bv_len = 6;
- slapi_entry_add_values( e, attr_changetype, vals );
+ if (log_e) {
+ /* we have to log the full entry */
+ if ( entry2reple( e, log_e, OP_DELETE ) != 0 ) {
+ err = 1;
+ }
+ } else {
+ /* Set the changetype attribute */
+ val.bv_val = "delete";
+ val.bv_len = 6;
+ slapi_entry_add_values( e, attr_changetype, vals );
+ }
break;
default:
slapi_log_error( SLAPI_LOG_FATAL, RETROCL_PLUGIN_NAME, "replog: Unknown LDAP operation type "
@@ -398,7 +405,7 @@ write_replog_db(
* to an entry obtained from slapi_entry_alloc().
*/
static int
-entry2reple( Slapi_Entry *e, Slapi_Entry *oe )
+entry2reple( Slapi_Entry *e, Slapi_Entry *oe, int optype )
{
char *p, *estr;
struct berval *vals[ 2 ];
@@ -409,8 +416,15 @@ entry2reple( Slapi_Entry *e, Slapi_Entry *oe )
vals[ 1 ] = NULL;
/* Set the changetype attribute */
- val.bv_val = "add";
- val.bv_len = 3;
+ if ( optype == OP_ADD ) {
+ val.bv_val = "add";
+ val.bv_len = 3;
+ } else if ( optype == OP_DELETE) {
+ val.bv_val = "delete";
+ val.bv_len = 6;
+ } else {
+ return (1);
+ }
slapi_entry_add_values( e, attr_changetype, vals );
estr = slapi_entry2str( oe, &len );
@@ -636,6 +650,8 @@ int retrocl_postob (Slapi_PBlock *pb,int optype)
}
break;
case OP_DELETE:
+ if (retrocl_log_deleted)
+ (void)slapi_pblock_get(pb, SLAPI_ENTRY_PRE_OP, &te);
break;
case OP_MODRDN:
/* newrdn is used just for logging; no need to be normalized */
| 0 |
01df89d34528a4551e079973a78586c87d521ba1
|
389ds/389-ds-base
|
Ticket 47569 - Fix build warnings
The previous commit for this ticket introduced some build warnings.
This patch corrects the build warnings.
|
commit 01df89d34528a4551e079973a78586c87d521ba1
Author: Nathan Kinder <[email protected]>
Date: Tue Oct 22 17:57:32 2013 -0700
Ticket 47569 - Fix build warnings
The previous commit for this ticket introduced some build warnings.
This patch corrects the build warnings.
diff --git a/ldap/servers/slapd/attrsyntax.c b/ldap/servers/slapd/attrsyntax.c
index a08ea9656..6386fbee1 100644
--- a/ldap/servers/slapd/attrsyntax.c
+++ b/ldap/servers/slapd/attrsyntax.c
@@ -542,14 +542,14 @@ attr_syntax_exists(const char *attr_name)
int free_attr = 0;
/* Ignore any attribute subtypes. */
- if (p = strchr(attr_name, ';')) {
+ if ((p = strchr(attr_name, ';'))) {
int check_attr_len = p - attr_name + 1;
check_attr_name = (char *)slapi_ch_malloc(check_attr_len);
PR_snprintf(check_attr_name, check_attr_len, "%s", attr_name);
free_attr = 1;
} else {
- check_attr_name = attr_name;
+ check_attr_name = (char *)attr_name;
}
asi = attr_syntax_get_by_name(check_attr_name);
| 0 |
25e1d16887ebd299dfe0088080b9ee0deec1e41f
|
389ds/389-ds-base
|
Issue 6090 - Fix dbscan options and man pages (#6315)
* Issue 6090 - Fix dbscan options and man pages
dbscan -d option is dangerously confusing as it removes a database instance while in db_stat it identify the database
(cf issue #5609 ).
This fix implements long options in dbscan, rename -d in --remove, and requires a new --do-it option for action that change the database content.
The fix should also align both the usage and the dbscan man page with the new set of options
Issue: #6090
Reviewed by: @tbordaz, @droideck (Thanks!)
|
commit 25e1d16887ebd299dfe0088080b9ee0deec1e41f
Author: progier389 <[email protected]>
Date: Fri Sep 6 14:45:06 2024 +0200
Issue 6090 - Fix dbscan options and man pages (#6315)
* Issue 6090 - Fix dbscan options and man pages
dbscan -d option is dangerously confusing as it removes a database instance while in db_stat it identify the database
(cf issue #5609 ).
This fix implements long options in dbscan, rename -d in --remove, and requires a new --do-it option for action that change the database content.
The fix should also align both the usage and the dbscan man page with the new set of options
Issue: #6090
Reviewed by: @tbordaz, @droideck (Thanks!)
diff --git a/dirsrvtests/tests/suites/clu/dbscan_test.py b/dirsrvtests/tests/suites/clu/dbscan_test.py
new file mode 100644
index 000000000..2c9a9651a
--- /dev/null
+++ b/dirsrvtests/tests/suites/clu/dbscan_test.py
@@ -0,0 +1,253 @@
+# --- BEGIN COPYRIGHT BLOCK ---
+# Copyright (C) 2024 Red Hat, Inc.
+# All rights reserved.
+#
+# License: GPL (version 3 or any later version).
+# See LICENSE for details.
+# --- END COPYRIGHT BLOCK ---
+#
+import logging
+import os
+import pytest
+import re
+import subprocess
+import sys
+
+from lib389 import DirSrv
+from lib389._constants import DBSCAN
+from lib389.topologies import topology_m2 as topo_m2
+from difflib import context_diff
+
+pytestmark = pytest.mark.tier0
+
+logging.getLogger(__name__).setLevel(logging.DEBUG)
+log = logging.getLogger(__name__)
+
+DEBUGGING = os.getenv("DEBUGGING", default=False)
+
+
+class CalledProcessUnexpectedReturnCode(subprocess.CalledProcessError):
+ def __init__(self, result, expected_rc):
+ super().__init__(cmd=result.args, returncode=result.returncode, output=result.stdout, stderr=result.stderr)
+ self.expected_rc = expected_rc
+ self.result = result
+
+ def __str__(self):
+ return f'Command {self.result.args} returned {self.result.returncode} instead of {self.expected_rc}'
+
+
+class DbscanPaths:
+ @staticmethod
+ def list_instances(inst, dblib, dbhome):
+ # compute db instance pathnames
+ instances = dbscan(['-D', dblib, '-L', dbhome], inst=inst).stdout
+ dbis = []
+ if dblib == 'bdb':
+ pattern = r'^ (.*) $'
+ prefix = f'{dbhome}/'
+ else:
+ pattern = r'^ (.*) flags:'
+ prefix = f''
+ for match in re.finditer(pattern, instances, flags=re.MULTILINE):
+ dbis.append(prefix+match.group(1))
+ return dbis
+
+ @staticmethod
+ def list_options(inst):
+ # compute supported options
+ options = []
+ usage = dbscan(['-h'], inst=inst, expected_rc=None).stdout
+ pattern = r'^\s+(?:(-[^-,]+), +)?(--[^ ]+).*$'
+ for match in re.finditer(pattern, usage, flags=re.MULTILINE):
+ for idx in range(1,3):
+ if match.group(idx) is not None:
+ options.append(match.group(idx))
+ return options
+
+ def __init__(self, inst):
+ dblib = inst.get_db_lib()
+ dbhome = inst.ds_paths.db_home_dir
+ self.inst = inst
+ self.dblib = dblib
+ self.dbhome = dbhome
+ self.options = DbscanPaths.list_options(inst)
+ self.dbis = DbscanPaths.list_instances(inst, dblib, dbhome)
+ self.ldif_dir = inst.ds_paths.ldif_dir
+
+ def get_dbi(self, attr, backend='userroot'):
+ for dbi in self.dbis:
+ if f'{backend}/{attr}.'.lower() in dbi.lower():
+ return dbi
+ raise KeyError(f'Unknown dbi {backend}/{attr}')
+
+ def __repr__(self):
+ attrs = ['inst', 'dblib', 'dbhome', 'ldif_dir', 'options', 'dbis' ]
+ res = ", ".join(map(lambda x: f'{x}={self.__dict__[x]}', attrs))
+ return f'DbscanPaths({res})'
+
+
+def dbscan(args, inst=None, expected_rc=0):
+ if inst is None:
+ prefix = os.environ.get('PREFIX', "")
+ prog = f'{prefix}/bin/dbscan'
+ else:
+ prog = os.path.join(inst.ds_paths.bin_dir, DBSCAN)
+ args.insert(0, prog)
+ output = subprocess.run(args, encoding='utf-8', stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+ log.debug(f'{args} result is {output.returncode} output is {output.stdout}')
+ if expected_rc is not None and expected_rc != output.returncode:
+ raise CalledProcessUnexpectedReturnCode(output, expected_rc)
+ return output
+
+
+def log_export_file(filename):
+ with open(filename, 'r') as file:
+ log.debug(f'=========== Dump of {filename} ================')
+ for line in file:
+ log.debug(line.rstrip('\n'))
+ log.debug(f'=========== Enf of {filename} =================')
+
+
[email protected](scope='module')
+def paths(topo_m2, request):
+ inst = topo_m2.ms["supplier1"]
+ if sys.version_info < (3,5):
+ pytest.skip('requires python version >= 3.5')
+ paths = DbscanPaths(inst)
+ if '--do-it' not in paths.options:
+ pytest.skip('Not supported with this dbscan version')
+ inst.stop()
+ return paths
+
+
+def test_dbscan_destructive_actions(paths, request):
+ """Test that dbscan remove/import actions
+
+ :id: f40b0c42-660a-11ef-9544-083a88554478
+ :setup: Stopped standalone instance
+ :steps:
+ 1. Export cn instance with dbscan
+ 2. Run dbscan --remove ...
+ 3. Check the error message about missing --do-it
+ 4. Check that cn instance is still present
+ 5. Run dbscan -I import_file ...
+ 6. Check it was properly imported
+ 7. Check that cn instance is still present
+ 8. Run dbscan --remove ... --doit
+ 9. Check the error message about missing --do-it
+ 10. Check that cn instance is still present
+ 11. Run dbscan -I import_file ... --do-it
+ 12. Check it was properly imported
+ 13. Check that cn instance is still present
+ 14. Export again the database
+ 15. Check that content of export files are the same
+ :expectedresults:
+ 1. Success
+ 2. dbscan return code should be 1 (error)
+ 3. Error message should be present
+ 4. cn instance should be present
+ 5. dbscan return code should be 1 (error)
+ 6. Error message should be present
+ 7. cn instance should be present
+ 8. dbscan return code should be 0 (success)
+ 9. Error message should not be present
+ 10. cn instance should not be present
+ 11. dbscan return code should be 0 (success)
+ 12. Error message should not be present
+ 13. cn instance should be present
+ 14. Success
+ 15. Export files content should be the same
+ """
+
+ # Export cn instance with dbscan
+ export_cn = f'{paths.ldif_dir}/dbscan_cn.data'
+ export_cn2 = f'{paths.ldif_dir}/dbscan_cn2.data'
+ cndbi = paths.get_dbi('replication_changelog')
+ inst = paths.inst
+ dblib = paths.dblib
+ exportok = False
+ def fin():
+ if os.path.exists(export_cn):
+ # Restore cn if it was exported successfully but does not exists any more
+ if exportok and cndbi not in DbscanPaths.list_instances(inst, dblib, paths.dbhome):
+ dbscan(['-D', dblib, '-f', cndbi, '-I', export_cn, '--do-it'], inst=inst)
+ if not DEBUGGING:
+ os.remove(export_cn)
+ if os.path.exists(export_cn) and not DEBUGGING:
+ os.remove(export_cn2)
+
+ fin()
+ request.addfinalizer(fin)
+ dbscan(['-D', dblib, '-f', cndbi, '-X', export_cn], inst=inst)
+ exportok = True
+
+ expected_msg = "without specifying '--do-it' parameter."
+
+ # Run dbscan --remove ...
+ result = dbscan(['-D', paths.dblib, '--remove', '-f', cndbi],
+ inst=paths.inst, expected_rc=1)
+
+ # Check the error message about missing --do-it
+ assert expected_msg in result.stdout
+
+ # Check that cn instance is still present
+ curdbis = DbscanPaths.list_instances(paths.inst, paths.dblib, paths.dbhome)
+ assert cndbi in curdbis
+
+ # Run dbscan -I import_file ...
+ result = dbscan(['-D', paths.dblib, '-f', cndbi, '-I', export_cn],
+ inst=paths.inst, expected_rc=1)
+
+ # Check the error message about missing --do-it
+ assert expected_msg in result.stdout
+
+ # Check that cn instance is still present
+ curdbis = DbscanPaths.list_instances(paths.inst, paths.dblib, paths.dbhome)
+ assert cndbi in curdbis
+
+ # Run dbscan --remove ... --doit
+ result = dbscan(['-D', paths.dblib, '--remove', '-f', cndbi, '--do-it'],
+ inst=paths.inst, expected_rc=0)
+
+ # Check the error message about missing --do-it
+ assert expected_msg not in result.stdout
+
+ # Check that cn instance is still present
+ curdbis = DbscanPaths.list_instances(paths.inst, paths.dblib, paths.dbhome)
+ assert cndbi not in curdbis
+
+ # Run dbscan -I import_file ... --do-it
+ result = dbscan(['-D', paths.dblib, '-f', cndbi,
+ '-I', export_cn, '--do-it'],
+ inst=paths.inst, expected_rc=0)
+
+ # Check the error message about missing --do-it
+ assert expected_msg not in result.stdout
+
+ # Check that cn instance is still present
+ curdbis = DbscanPaths.list_instances(paths.inst, paths.dblib, paths.dbhome)
+ assert cndbi in curdbis
+
+ # Export again the database
+ dbscan(['-D', dblib, '-f', cndbi, '-X', export_cn2], inst=inst)
+
+ # Check that content of export files are the same
+ with open(export_cn) as f1:
+ f1lines = f1.readlines()
+ with open(export_cn2) as f2:
+ f2lines = f2.readlines()
+ diffs = list(context_diff(f1lines, f2lines))
+ if len(diffs) > 0:
+ log.debug("Export file differences are:")
+ for d in diffs:
+ log.debug(d)
+ log_export_file(export_cn)
+ log_export_file(export_cn2)
+ assert diffs is None
+
+
+if __name__ == '__main__':
+ # Run isolated
+ # -s for DEBUG mode
+ CURRENT_FILE = os.path.realpath(__file__)
+ pytest.main("-s %s" % CURRENT_FILE)
diff --git a/dirsrvtests/tests/suites/clu/repl_monitor_test.py b/dirsrvtests/tests/suites/clu/repl_monitor_test.py
index 9a7a02392..83ffc4efe 100644
--- a/dirsrvtests/tests/suites/clu/repl_monitor_test.py
+++ b/dirsrvtests/tests/suites/clu/repl_monitor_test.py
@@ -77,13 +77,13 @@ def get_hostnames_from_log(port1, port2):
# search for Supplier :hostname:port
# and use \D to insure there is no more number is after
# the matched port (i.e that 10 is not matching 101)
- regexp = '(Supplier: )([^:]*)(:' + str(port1) + '\D)'
+ regexp = '(Supplier: )([^:]*)(:' + str(port1) + r'\D)'
match=re.search(regexp, logtext)
host_m1 = 'localhost.localdomain'
if (match is not None):
host_m1 = match.group(2)
# Same for supplier 2
- regexp = '(Supplier: )([^:]*)(:' + str(port2) + '\D)'
+ regexp = '(Supplier: )([^:]*)(:' + str(port2) + r'\D)'
match=re.search(regexp, logtext)
host_m2 = 'localhost.localdomain'
if (match is not None):
diff --git a/ldap/servers/slapd/back-ldbm/db-bdb/bdb_layer.c b/ldap/servers/slapd/back-ldbm/db-bdb/bdb_layer.c
index defb29c31..2e323ba29 100644
--- a/ldap/servers/slapd/back-ldbm/db-bdb/bdb_layer.c
+++ b/ldap/servers/slapd/back-ldbm/db-bdb/bdb_layer.c
@@ -5794,8 +5794,16 @@ bdb_import_file_name(ldbm_instance *inst)
static char *
bdb_restore_file_name(struct ldbminfo *li)
{
- char *fname = slapi_ch_smprintf("%s/../.restore", li->li_directory);
-
+ char *pt = strrchr(li->li_directory, '/');
+ char *fname = NULL;
+ if (pt == NULL) {
+ fname = slapi_ch_strdup(".restore");
+ } else {
+ size_t len = pt-li->li_directory;
+ fname = slapi_ch_malloc(len+10);
+ strncpy(fname, li->li_directory, len);
+ strcpy(fname+len, "/.restore");
+ }
return fname;
}
diff --git a/ldap/servers/slapd/back-ldbm/dbimpl.c b/ldap/servers/slapd/back-ldbm/dbimpl.c
index da4a4548e..041415c76 100644
--- a/ldap/servers/slapd/back-ldbm/dbimpl.c
+++ b/ldap/servers/slapd/back-ldbm/dbimpl.c
@@ -397,7 +397,48 @@ const char *dblayer_op2str(dbi_op_t op)
return str[idx];
}
-/* Open db env, db and db file privately */
+/* Get the li_directory directory from the database instance name -
+ * Caller should free the returned value
+ */
+static char *
+get_li_directory(const char *fname)
+{
+ /*
+ * li_directory is an existing directory.
+ * it can be fname or its parent or its greatparent
+ * in case of problem returns the provided name
+ */
+ char *lid = slapi_ch_strdup(fname);
+ struct stat sbuf = {0};
+ char *pt = NULL;
+ for (int count=0; count<3; count++) {
+ if (stat(lid, &sbuf) == 0) {
+ if (S_ISDIR(sbuf.st_mode)) {
+ return lid;
+ }
+ /* Non directory existing file could be regular
+ * at the first iteration otherwise it is an error.
+ */
+ if (count>0 || !S_ISREG(sbuf.st_mode)) {
+ break;
+ }
+ }
+ pt = strrchr(lid, '/');
+ if (pt == NULL) {
+ slapi_ch_free_string(&lid);
+ return slapi_ch_strdup(".");
+ }
+ *pt = '\0';
+ }
+ /*
+ * Error case. Returns a copy of the original string:
+ * and let dblayer_private_open_fn fail to open the database
+ */
+ slapi_ch_free_string(&lid);
+ return slapi_ch_strdup(fname);
+}
+
+/* Open db env, db and db file privately (for dbscan) */
int dblayer_private_open(const char *plgname, const char *dbfilename, int rw, Slapi_Backend **be, dbi_env_t **env, dbi_db_t **db)
{
struct ldbminfo *li;
@@ -412,7 +453,7 @@ int dblayer_private_open(const char *plgname, const char *dbfilename, int rw, Sl
li->li_plugin = (*be)->be_database;
li->li_plugin->plg_name = (char*) "back-ldbm-dbimpl";
li->li_plugin->plg_libpath = (char*) "libback-ldbm";
- li->li_directory = slapi_ch_strdup(dbfilename);
+ li->li_directory = get_li_directory(dbfilename);
/* Initialize database plugin */
rc = dbimpl_setup(li, plgname);
@@ -439,7 +480,10 @@ int dblayer_private_close(Slapi_Backend **be, dbi_env_t **env, dbi_db_t **db)
}
slapi_ch_free((void**)&li->li_dblayer_private);
slapi_ch_free((void**)&li->li_dblayer_config);
- ldbm_config_destroy(li);
+ if (dblayer_is_lmdb(*be)) {
+ /* Generate use after free and double free in bdb case */
+ ldbm_config_destroy(li);
+ }
slapi_ch_free((void**)&(*be)->be_database);
slapi_ch_free((void**)&(*be)->be_instance_info);
slapi_ch_free((void**)be);
diff --git a/ldap/servers/slapd/tools/dbscan.c b/ldap/servers/slapd/tools/dbscan.c
index 159096bd5..9e6bc5250 100644
--- a/ldap/servers/slapd/tools/dbscan.c
+++ b/ldap/servers/slapd/tools/dbscan.c
@@ -26,6 +26,7 @@
#include <string.h>
#include <ctype.h>
#include <errno.h>
+#include <getopt.h>
#include "../back-ldbm/dbimpl.h"
#include "../slapi-plugin.h"
#include "nspr.h"
@@ -85,6 +86,8 @@
#define DB_BUFFER_SMALL ENOMEM
#endif
+#define COUNTOF(array) ((sizeof(array))/sizeof(*(array)))
+
#if defined(linux)
#include <getopt.h>
#endif
@@ -130,9 +133,43 @@ long ind_cnt = 0;
long allids_cnt = 0;
long other_cnt = 0;
char *dump_filename = NULL;
+int do_it = 0;
static Slapi_Backend *be = NULL; /* Pseudo backend used to interact with db */
+/* For Long options without shortcuts */
+enum {
+ OPT_FIRST = 0x1000,
+ OPT_DO_IT,
+ OPT_REMOVE,
+};
+
+static const struct option options[] = {
+ /* Options without shortcut */
+ { "do-it", no_argument, 0, OPT_DO_IT },
+ { "remove", no_argument, 0, OPT_REMOVE },
+ /* Options with shortcut */
+ { "import", required_argument, 0, 'I' },
+ { "export", required_argument, 0, 'X' },
+ { "db-type", required_argument, 0, 'D' },
+ { "dbi", required_argument, 0, 'f' },
+ { "ascii", no_argument, 0, 'A' },
+ { "raw", no_argument, 0, 'R' },
+ { "truncate-entry", required_argument, 0, 't' },
+ { "entry-id", required_argument, 0, 'K' },
+ { "key", required_argument, 0, 'k' },
+ { "list", required_argument, 0, 'L' },
+ { "stats", required_argument, 0, 'S' },
+ { "id-list-max-size", required_argument, 0, 'l' },
+ { "id-list-min-size", required_argument, 0, 'G' },
+ { "show-id-list-lenghts", no_argument, 0, 'n' },
+ { "show-id-list", no_argument, 0, 'r' },
+ { "summary", no_argument, 0, 's' },
+ { "help", no_argument, 0, 'h' },
+ { 0, 0, 0, 0 }
+};
+
+
/** db_printf - functioning same as printf but a place for manipluating output.
*/
void
@@ -899,7 +936,7 @@ is_changelog(char *filename)
}
static void
-usage(char *argv0)
+usage(char *argv0, int error)
{
char *copy = strdup(argv0);
char *p0 = NULL, *p1 = NULL;
@@ -922,42 +959,52 @@ usage(char *argv0)
}
printf("\n%s - scan a db file and dump the contents\n", p0);
printf(" common options:\n");
- printf(" -D <dbimpl> specify db implementaion (may be: bdb or mdb)\n");
- printf(" -f <filename> specify db file\n");
- printf(" -A dump as ascii data\n");
- printf(" -R dump as raw data\n");
- printf(" -t <size> entry truncate size (bytes)\n");
+ printf(" -A, --ascii dump as ascii data\n");
+ printf(" -D, --db-type <dbimpl> specify db implementaion (may be: bdb or mdb)\n");
+ printf(" -f, --dbi <filename> specify db instance\n");
+ printf(" -R, --raw dump as raw data\n");
+ printf(" -t, --truncate-entry <size> entry truncate size (bytes)\n");
+
printf(" entry file options:\n");
- printf(" -K <entry_id> lookup only a specific entry id\n");
+ printf(" -K, --entry-id <entry_id> lookup only a specific entry id\n");
+
printf(" index file options:\n");
- printf(" -k <key> lookup only a specific key\n");
- printf(" -L <dbhome> list all db files\n");
- printf(" -S <dbhome> show statistics\n");
- printf(" -l <size> max length of dumped id list\n");
- printf(" (default %" PRIu32 "; 40 bytes <= size <= 1048576 bytes)\n", MAX_BUFFER);
- printf(" -G <n> only display index entries with more than <n> ids\n");
- printf(" -n display ID list lengths\n");
- printf(" -r display the conents of ID list\n");
- printf(" -s Summary of index counts\n");
- printf(" -I file Import database content from file\n");
- printf(" -X file Export database content in file\n");
+ printf(" -G, --id-list-min-size <n> only display index entries with more than <n> ids\n");
+ printf(" -I, --import file Import database instance from file.\n");
+ printf(" -k, --key <key> lookup only a specific key\n");
+ printf(" -l, --id-list-max-size <size> max length of dumped id list\n");
+ printf(" (default %" PRIu32 "; 40 bytes <= size <= 1048576 bytes)\n", MAX_BUFFER);
+ printf(" -n, --show-id-list-lenghts display ID list lengths\n");
+ printf(" --remove remove database instance\n");
+ printf(" -r, --show-id-list display the conents of ID list\n");
+ printf(" -S, --stats <dbhome> show statistics\n");
+ printf(" -X, --export file export database instance in file\n");
+
+ printf(" other options:\n");
+ printf(" -s, --summary summary of index counts\n");
+ printf(" -L, --list <dbhome> list all db files\n");
+ printf(" --do-it confirmation flags for destructive actions like --remove or --import\n");
+ printf(" -h, --help display this usage\n");
+
printf(" sample usages:\n");
- printf(" # list the db files\n");
- printf(" %s -D mdb -L /var/lib/dirsrv/slapd-i/db/\n", p0);
- printf(" %s -f id2entry.db\n", p0);
+ printf(" # list the database instances\n");
+ printf(" %s -L /var/lib/dirsrv/slapd-supplier1/db/\n", p0);
printf(" # dump the entry file\n");
printf(" %s -f id2entry.db\n", p0);
printf(" # display index keys in cn.db4\n");
printf(" %s -f cn.db4\n", p0);
+ printf(" # display index keys in cn on lmdb\n");
+ printf(" %s -f /var/lib/dirsrv/slapd-supplier1/db/userroot/cn.db\n", p0);
+ printf(" (Note: Use 'dbscan -L db_home_dir' to get the db instance path)\n");
printf(" # display index keys and the count of entries having the key in mail.db4\n");
printf(" %s -r -f mail.db4\n", p0);
printf(" # display index keys and the IDs having more than 20 IDs in sn.db4\n");
printf(" %s -r -G 20 -f sn.db4\n", p0);
printf(" # display summary of objectclass.db4\n");
- printf(" %s -f objectclass.db4\n", p0);
+ printf(" %s -s -f objectclass.db4\n", p0);
printf("\n");
free(copy);
- exit(1);
+ exit(error?1:0);
}
void dump_ascii_val(const char *str, dbi_val_t *val)
@@ -1126,12 +1173,12 @@ importdb(const char *dbimpl_name, const char *filename, const char *dump_name)
dblayer_init_pvt_txn();
if (!dump) {
- printf("Failed to open dump file %s. Error %d: %s\n", dump_name, errno, strerror(errno));
+ printf("Error: Failed to open dump file %s. Error %d: %s\n", dump_name, errno, strerror(errno));
return 1;
}
if (dblayer_private_open(dbimpl_name, filename, 1, &be, &env, &db)) {
- printf("Can't initialize db plugin: %s\n", dbimpl_name);
+ printf("Error: Can't initialize db plugin: %s\n", dbimpl_name);
fclose(dump);
return 1;
}
@@ -1141,11 +1188,16 @@ importdb(const char *dbimpl_name, const char *filename, const char *dump_name)
!_read_line(dump, &keyword, &data) && keyword == 'v') {
ret = dblayer_db_op(be, db, txn.txn, DBI_OP_PUT, &key, &data);
}
+ if (ret !=0) {
+ printf("Error: failed to write record in database. Error %d: %s\n", ret, dblayer_strerror(ret));
+ dump_ascii_val("Failing record key", &key);
+ dump_ascii_val("Failing record value", &data);
+ }
fclose(dump);
dblayer_value_free(be, &key);
dblayer_value_free(be, &data);
if (dblayer_private_close(&be, &env, &db)) {
- printf("Unable to shutdown the db plugin: %s\n", dblayer_strerror(1));
+ printf("Error: Unable to shutdown the db plugin: %s\n", dblayer_strerror(1));
return 1;
}
return ret;
@@ -1242,6 +1294,7 @@ removedb(const char *dbimpl_name, const char *filename)
return 1;
}
+ db = NULL; /* Database is already closed by dblayer_db_remove */
if (dblayer_private_close(&be, &env, &db)) {
printf("Unable to shutdown the db plugin: %s\n", dblayer_strerror(1));
return 1;
@@ -1249,7 +1302,6 @@ removedb(const char *dbimpl_name, const char *filename)
return 0;
}
-
int
main(int argc, char **argv)
{
@@ -1263,7 +1315,9 @@ main(int argc, char **argv)
uint32_t entry_id = 0xffffffff;
char *defdbimpl = getenv("NSSLAPD_DB_LIB");
char *dbimpl_name = (char*) "mdb";
- int c;
+ int longopt_idx = 0;
+ int c = 0;
+ char optstring[2*COUNTOF(options)+1] = {0};
if (defdbimpl) {
if (strcasecmp(defdbimpl, "bdb") == 0) {
@@ -1274,8 +1328,31 @@ main(int argc, char **argv)
}
}
- while ((c = getopt(argc, argv, "Af:RL:S:l:nG:srk:K:hvt:D:X:I:d")) != EOF) {
+ /* Compute getopt short option string */
+ {
+ char *pt = optstring;
+ for (struct option *opt = options; opt->name; opt++) {
+ if (opt->val>0 && opt->val<OPT_FIRST) {
+ *pt++ = (char)(opt->val);
+ if (opt->has_arg == required_argument) {
+ *pt++ = ':';
+ }
+ }
+ }
+ *pt = '\0';
+ }
+
+ while ((c = getopt_long(argc, argv, optstring, options, &longopt_idx)) != EOF) {
+ if (c == 0) {
+ c = longopt_idx;
+ }
switch (c) {
+ case OPT_DO_IT:
+ do_it = 1;
+ break;
+ case OPT_REMOVE:
+ display_mode |= REMOVE;
+ break;
case 'A':
display_mode |= ASCIIDATA;
break;
@@ -1341,32 +1418,48 @@ main(int argc, char **argv)
display_mode |= IMPORT;
dump_filename = optarg;
break;
- case 'd':
- display_mode |= REMOVE;
- break;
case 'h':
default:
- usage(argv[0]);
+ usage(argv[0], 1);
}
}
+ if (filename == NULL) {
+ fprintf(stderr, "PARAMETER ERROR! 'filename' parameter is missing.\n");
+ usage(argv[0], 1);
+ }
+
if (display_mode & EXPORT) {
return exportdb(dbimpl_name, filename, dump_filename);
}
if (display_mode & IMPORT) {
+ if (!strstr(filename, "/id2entry") && !strstr(filename, "/replication_changelog")) {
+ /* schema is unknown in dbscan ==> duplicate keys sort order is unknown
+ * ==> cannot create dbi with duplicate keys
+ * ==> only id2entry and repl changelog is importable.
+ */
+ fprintf(stderr, "ERROR: The only database instances that may be imported with dbscan are id2entry and replication_changelog.\n");
+ exit(1);
+ }
+
+ if (do_it == 0) {
+ fprintf(stderr, "PARAMETER ERROR! Trying to perform a destructive action (import)\n"
+ " without specifying '--do-it' parameter.\n");
+ exit(1);
+ }
return importdb(dbimpl_name, filename, dump_filename);
}
if (display_mode & REMOVE) {
+ if (do_it == 0) {
+ fprintf(stderr, "PARAMETER ERROR! Trying to perform a destructive action (remove)\n"
+ " without specifying '--do-it' parameter.\n");
+ exit(1);
+ }
return removedb(dbimpl_name, filename);
}
- if (filename == NULL) {
- fprintf(stderr, "PARAMETER ERROR! 'filename' parameter is missing.\n");
- usage(argv[0]);
- }
-
if (display_mode & LISTDBS) {
dbi_dbslist_t *dbs = dblayer_list_dbs(dbimpl_name, filename);
if (dbs) {
diff --git a/man/man1/dbscan.1 b/man/man1/dbscan.1
index 810608371..dfb6e8351 100644
--- a/man/man1/dbscan.1
+++ b/man/man1/dbscan.1
@@ -31,50 +31,94 @@ Scans a Directory Server database index file and dumps the contents.
.\" respectively.
.SH OPTIONS
A summary of options is included below:
+.IP
+common options:
+.TP
+.B \fB\-A, \-\-ascii\fR
+dump as ascii data
+.TP
+.B \fB\-D, \-\-db\-type\fR <filename>
+specify db type: bdb or mdb
.TP
-.B \fB\-f\fR <filename>
-specify db file
+.B \fB\-f, \-\-dbi\fR <filename>
+specify db instance
.TP
-.B \fB\-R\fR
+.B \fB\-R, \-\-raw\fR
dump as raw data
.TP
-.B \fB\-t\fR <size>
+.B \fB\-t, \-\-truncate\-entry\fR <size>
entry truncate size (bytes)
.IP
entry file options:
.TP
-.B \fB\-K\fR <entry_id>
+.B \fB\-K, \-\-entry\-id\fR <entry_id>
lookup only a specific entry id
+.IP
index file options:
.TP
-.B \fB\-k\fR <key>
+.B \fB\-G, \-\-id\-list\-min\-size\fR <n>
+only display index entries with more than <n> ids
+.TP
+.B \fB\-I, \-\-import\fR <file>
+Import database instance from file. Requires \-\-do\-it parameter
+WARNING! Only the id2entry and replication_changelog database instances
+may be imported by dbscan.
+.TP
+.B \fB\-k, \-\-key\fR <key>
lookup only a specific key
.TP
-.B \fB\-l\fR <size>
+.B \fB\-l, \-\-id\-list\-max\-size\fR <size>
max length of dumped id list
(default 4096; 40 bytes <= size <= 1048576 bytes)
.TP
-.B \fB\-G\fR <n>
-only display index entries with more than <n> ids
-.TP
-.B \fB\-n\fR
+.B \fB\-n, \-\-show\-id\-list\-lenghts\fR
display ID list lengths
.TP
-.B \fB\-r\fR
+.B \fB\-\-remove\fR
+remove a db instance. Requires \-\-do\-it parameter
+.TP
+.B \fB\-r, \-\-show\-id\-list\fR
display the contents of ID list
.TP
-.B \fB\-s\fR
+.B \fB\-S, \-\-stats\fR
+display statistics
+.TP
+.B \fB\-X, \-\-export\fR <file>
+Export database instance to file
+.IP
+other options:
+.TP
+.B \fB\-s, \-\-summary\fR
Summary of index counts
+.TP
+.B \fB\-L, \-\-list\fR
+List od database instances
+.TP
+.B \fB\-\-do\-it\fR
+confirmation required for actions that change the database contents
+.TP
+.B \fB\-h, \-\-help\-it\fR
+display the usage
.IP
.SH USAGE
Sample usages:
.TP
+List the database instances
+.B
+dbscan -L /var/lib/dirsrv/slapd-supplier1/db
+.TP
Dump the entry file:
.B
dbscan \fB\-f\fR id2entry.db4
.TP
Display index keys in cn.db4:
-.B dbscan \fB\-f\fR cn.db4
+.B
+dbscan \fB\-f\fR cn.db4
+.TP
+Display index keys in cn on lmdb:
+.B
+dbscan \fB\-f\fR /var/lib/dirsrv/slapd\-supplier1/db/userroot/cn.db
+ (Note: Use \fBdbscan \-L db_home_dir\R to get the db instance path)
.TP
Display index keys and the count of entries having the key in mail.db4:
.B
@@ -86,7 +130,7 @@ dbscan \fB\-r\fR \fB\-G\fR 20 \fB\-f\fR sn.db4
.TP
Display summary of objectclass.db4:
.B
-dbscan \fB\-f\fR objectclass.db4
+dbscan \fB\-s \-f\fR objectclass.db4
.br
.SH AUTHOR
dbscan was written by the 389 Project.
diff --git a/src/lib389/lib389/__init__.py b/src/lib389/lib389/__init__.py
index 95cfcb3f0..4d4fff749 100644
--- a/src/lib389/lib389/__init__.py
+++ b/src/lib389/lib389/__init__.py
@@ -3050,14 +3050,17 @@ class DirSrv(SimpleLDAPObject, object):
return self._dbisupport
# check if -D and -L options are supported
try:
- cmd = ["%s/dbscan" % self.get_bin_dir(), "--help"]
+ cmd = ["%s/dbscan" % self.get_bin_dir(), "-h"]
self.log.debug("DEBUG: checking dbscan supported options %s" % cmd)
p = subprocess.Popen(cmd, stdout=subprocess.PIPE)
except subprocess.CalledProcessError:
pass
output, stderr = p.communicate()
- self.log.debug("is_dbi_supported output " + output.decode())
- if "-D <dbimpl>" in output.decode() and "-L <dbhome>" in output.decode():
+ output = output.decode()
+ self.log.debug("is_dbi_supported output " + output)
+ if "-D <dbimpl>" in output and "-L <dbhome>" in output:
+ self._dbisupport = True
+ elif "--db-type" in output and "--list" in output:
self._dbisupport = True
else:
self._dbisupport = False
diff --git a/src/lib389/lib389/cli_ctl/dblib.py b/src/lib389/lib389/cli_ctl/dblib.py
index e9269e340..82f09c70c 100644
--- a/src/lib389/lib389/cli_ctl/dblib.py
+++ b/src/lib389/lib389/cli_ctl/dblib.py
@@ -158,6 +158,14 @@ def run_dbscan(args):
return output
+def does_dbscan_need_do_it():
+ prefix = os.environ.get('PREFIX', "")
+ prog = f'{prefix}/bin/dbscan'
+ args = [ prog, '-h' ]
+ output = subprocess.run(args, encoding='utf-8', stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
+ return '--do-it' in output.stdout
+
+
def export_changelog(be, dblib):
# Export backend changelog
try:
@@ -172,7 +180,10 @@ def import_changelog(be, dblib):
# import backend changelog
try:
cl5dbname = be['eccl5dbname'] if dblib == "bdb" else be['cl5dbname']
- run_dbscan(['-D', dblib, '-f', cl5dbname, '-I', be['cl5name']])
+ if does_dbscan_need_do_it():
+ run_dbscan(['-D', dblib, '-f', cl5dbname, '-I', be['cl5name'], '--do-it'])
+ else:
+ run_dbscan(['-D', dblib, '-f', cl5dbname, '-I', be['cl5name']])
return True
except subprocess.CalledProcessError as e:
return False
| 0 |
a5f9e7d4de3c0261bd63458a191a8e0a697112c0
|
389ds/389-ds-base
|
Ticket 47535 - update man page
Forgot to add the new flag to the top of the man page that gives the basic usage.
https://fedorahosted.org/389/ticket/47535
|
commit a5f9e7d4de3c0261bd63458a191a8e0a697112c0
Author: Mark Reynolds <[email protected]>
Date: Tue Oct 8 10:45:54 2013 -0400
Ticket 47535 - update man page
Forgot to add the new flag to the top of the man page that gives the basic usage.
https://fedorahosted.org/389/ticket/47535
diff --git a/man/man1/logconv.pl.1 b/man/man1/logconv.pl.1
index 0300baa10..e9c6245e3 100644
--- a/man/man1/logconv.pl.1
+++ b/man/man1/logconv.pl.1
@@ -20,7 +20,7 @@ logconv.pl \- analyzes Directory Server access log files
.SH SYNOPSIS
.B logconv.pl
[\fI\-h\fR] [\fI\-d <rootDN>\fR] [\fI\-s <size limit>\fR] [\fI\-v\fR] [\fI\-V\fR]
-[\fI\-S <start time>\fR] [\fI\-E <end time>\fR]
+[\fI\-S <start time>\fR] [\fI\-E <end time>\fR] [\fI\-T <min etime>\fR]
[\fI\-efcibaltnxgjuU\fR] [\fI access log ... ... \fR]
.PP
.SH DESCRIPTION
| 0 |
7def49594a6cf769a729af48b5532ca6bd5733f2
|
389ds/389-ds-base
|
Issue 5348 - RFE - CLI - add functionality to do bulk updates to entries
description: dsidm account allow doing bulk updates to a bunch of entries.
Add options for setting a filter, scope, and base, whether
to continue on error.
relates: https://github.com/389ds/389-ds-base/issues/5348
Reviewed by: spichugi(Thanks!)
|
commit 7def49594a6cf769a729af48b5532ca6bd5733f2
Author: Mark Reynolds <[email protected]>
Date: Sun Dec 18 16:23:37 2022 -0500
Issue 5348 - RFE - CLI - add functionality to do bulk updates to entries
description: dsidm account allow doing bulk updates to a bunch of entries.
Add options for setting a filter, scope, and base, whether
to continue on error.
relates: https://github.com/389ds/389-ds-base/issues/5348
Reviewed by: spichugi(Thanks!)
diff --git a/dirsrvtests/tests/suites/clu/dsidm_bulk_update_test.py b/dirsrvtests/tests/suites/clu/dsidm_bulk_update_test.py
new file mode 100644
index 000000000..7d63665f2
--- /dev/null
+++ b/dirsrvtests/tests/suites/clu/dsidm_bulk_update_test.py
@@ -0,0 +1,92 @@
+# --- BEGIN COPYRIGHT BLOCK ---
+# Copyright (C) 2023 Red Hat, Inc.
+# All rights reserved.
+#
+# License: GPL (version 3 or any later version).
+# See LICENSE for details.
+# --- END COPYRIGHT BLOCK ---
+#
+import ldap
+import logging
+import pytest
+import os
+from lib389._constants import DEFAULT_SUFFIX
+from lib389.topologies import topology_st as topo
+from lib389.cli_base import FakeArgs
+from lib389.cli_idm.account import bulk_update
+from lib389.idm.user import UserAccounts
+
+logging.getLogger(__name__).setLevel(logging.DEBUG)
+log = logging.getLogger(__name__)
+
+
[email protected](scope="function")
+def create_test_users(topo):
+ users = UserAccounts(topo.standalone, DEFAULT_SUFFIX)
+ u_range = list(range(5))
+ for idx in u_range:
+ try:
+ users.create(properties={
+ 'uid': f'testuser{idx}',
+ 'cn': f'testuser{idx}',
+ 'sn': f'user{idx}',
+ 'uidNumber': f'{1000 + idx}',
+ 'gidNumber': f'{1000 + idx}',
+ 'homeDirectory': f'/home/testuser{idx}'
+ })
+ except ldap.ALREADY_EXISTS:
+ pass
+
+
+def test_bulk_operations(topo, create_test_users):
+ """Testing adding, replacing, an removing attribute/values to a bulk set
+ of users
+
+ :id: c89ff057-2f44-4070-8d42-850257025b2b
+ :setup: Standalone Instance
+ :steps:
+ 1. Bulk add attribute
+ 2. Bulk replace attribute
+ 3. Bulk delete attribute
+ :expectedresults:
+ 1. Success
+ 2. Success
+ 3. Success
+ """
+ inst = topo.standalone
+
+ args = FakeArgs()
+ args.json = False
+ args.basedn = DEFAULT_SUFFIX
+ args.scope = ldap.SCOPE_SUBTREE
+ args.filter = "(uid=*)"
+ args.stop = False
+ args.changes = []
+
+ # Test ADD
+ args.changes = ['add:objectclass:extensibleObject']
+ bulk_update(inst, DEFAULT_SUFFIX, log, args)
+ users = UserAccounts(inst, DEFAULT_SUFFIX).list()
+ for user in users:
+ assert 'extensibleobject' in user.get_attr_vals_utf8_l('objectclass')
+
+ # Test REPLACE
+ args.changes = ['replace:cn:hello_new_cn']
+ bulk_update(inst, DEFAULT_SUFFIX, log, args)
+ users = UserAccounts(inst, DEFAULT_SUFFIX).list()
+ for user in users:
+ assert user.get_attr_val_utf8_l('cn') == "hello_new_cn"
+
+ # Test DELETE
+ args.changes = ['delete:objectclass:extensibleObject']
+ bulk_update(inst, DEFAULT_SUFFIX, log, args)
+ users = UserAccounts(inst, DEFAULT_SUFFIX).list()
+ for user in users:
+ assert 'extensibleobject' not in user.get_attr_vals_utf8_l('objectclass')
+
+
+if __name__ == '__main__':
+ # Run isolated
+ # -s for DEBUG mode
+ CURRENT_FILE = os.path.realpath(__file__)
+ pytest.main(["-s", CURRENT_FILE])
diff --git a/src/lib389/lib389/cli_idm/account.py b/src/lib389/lib389/cli_idm/account.py
index fd03576e5..7053cb81d 100644
--- a/src/lib389/lib389/cli_idm/account.py
+++ b/src/lib389/lib389/cli_idm/account.py
@@ -1,5 +1,5 @@
# --- BEGIN COPYRIGHT BLOCK ---
-# Copyright (C) 2017, Red Hat inc,
+# Copyright (C) 2023, Red Hat inc,
# Copyright (C) 2018, William Brown <[email protected]>
# All rights reserved.
#
@@ -80,6 +80,7 @@ def _print_entry_status(status, dn, log, args):
if args.json:
log.info(json.dumps({"type": "status", "info": info_dict}, indent=4))
+
def entry_status(inst, basedn, log, args):
dn = _get_dn_arg(args.dn, msg="Enter dn to check")
accounts = Accounts(inst, basedn)
@@ -118,6 +119,52 @@ def subtree_status(inst, basedn, log, args):
_print_entry_status(status, entry.dn, log)
+def bulk_update(inst, basedn, log, args):
+ basedn = _get_dn_arg(args.basedn, msg="Enter basedn to search")
+ search_filter = "(objectclass=*)"
+ scope = ldap.SCOPE_SUBTREE
+ scope_str = "sub"
+ if args.scope == "one":
+ scope = ldap.SCOPE_ONELEVEL
+ scope_str = "one"
+ if args.filter:
+ search_filter = args.filter
+ log.info(f"Searching '{basedn}' filter '{search_filter}' scope '{scope_str}' ...")
+ entry_list = Accounts(inst, basedn).filter(search_filter, scope=scope)
+ if not entry_list:
+ raise ValueError(f"No entries were found.")
+ log.info(f"Found {len(entry_list)} matching entries.")
+
+ failed_list = []
+ success_list = []
+ for entry in entry_list:
+ if entry.dn.lower() == basedn.lower():
+ # skip parent
+ failed_list.append(entry.dn + " (Base DN Entry Skipped)")
+ continue
+ try:
+ _generic_modify_dn(inst, basedn, log.getChild('_generic_modify_dn'), MANY, entry.dn, args)
+ success_list.append(entry.dn)
+ except ldap.LDAPError as e:
+ if "desc" in e.args[0]:
+ failed_list.append(entry.dn + f" ({e.args[0]['desc']})")
+ log.debug(f"Failed to update {entry.dn} ({e.args[0]['desc']})")
+ else:
+ failed_list.append(entry.dn + f" ({str(e)})")
+ log.debug(f"Failed to update {entry.dn} ({str(e)})")
+ if args.stop:
+ raise ValueError(f"Failed to update entry ({entry.dn}), error: {str(e)}")
+
+ log.info(f"Updates Finished.\nSuccessfully updated {len(success_list)} entries.")
+ if len(failed_list) > 0:
+ log.info(f"Failed to update {len(failed_list)} entries:")
+
+ count = 1
+ for dn in failed_list:
+ log.info(f"[{count}] {dn}")
+ count += 1
+
+
def lock(inst, basedn, log, args):
dn = _get_dn_arg(args.dn, msg="Enter dn to lock")
accounts = Accounts(inst, basedn)
@@ -221,3 +268,12 @@ like modify, locking and unlocking. To create an account, see "user" subcommand
change_pw_parser.add_argument('dn', nargs='?', help='The dn to change the password for')
change_pw_parser.add_argument('new_password', nargs='?', help='The new password to set')
change_pw_parser.add_argument('current_password', nargs='?', help='The accounts current password')
+
+ bulk_update_parser = subcommands.add_parser('bulk_update', help='Perform a common operation to a set of entries')
+ bulk_update_parser.set_defaults(func=bulk_update)
+ bulk_update_parser.add_argument('basedn', help="Search base for finding entries, only the children of this DN are processed")
+ bulk_update_parser.add_argument('-f', '--filter', help="Search filter for finding entries, default is '(objectclass=*)'")
+ bulk_update_parser.add_argument('-s', '--scope', choices=['one', 'sub'], help="Search scope (one, sub - default is sub")
+ bulk_update_parser.add_argument('-x', '--stop', action='store_true', default=False,
+ help="Stop processing updates when an error occurs. Default is False")
+ bulk_update_parser.add_argument('changes', nargs='+', help="A list of changes to apply in format: <add|delete|replace>:<attribute>:<value>")
| 0 |
d3f58b4832e92c6f7d36490f881889364452c1f2
|
389ds/389-ds-base
|
Issue 6676 - Add GitHub workflow action and fix pbkdf2 tests (#6677)
Description: Implement a GitHub workflow for CI to run Rust tests.
The workflow triggers on push, pull request, daily schedule,
and can be triggered manually.
Fix PBKDF2 test reliability issues by implementing thread-local storage
for test environments to prevent test interference.
Add proper test reset functions to ensure each test starts with clean state.
Fixes: https://github.com/389ds/389-ds-base/issues/6676
Reviewed by: @vashirov (Thanks!)
|
commit d3f58b4832e92c6f7d36490f881889364452c1f2
Author: Simon Pichugin <[email protected]>
Date: Mon Mar 24 16:04:10 2025 -0700
Issue 6676 - Add GitHub workflow action and fix pbkdf2 tests (#6677)
Description: Implement a GitHub workflow for CI to run Rust tests.
The workflow triggers on push, pull request, daily schedule,
and can be triggered manually.
Fix PBKDF2 test reliability issues by implementing thread-local storage
for test environments to prevent test interference.
Add proper test reset functions to ensure each test starts with clean state.
Fixes: https://github.com/389ds/389-ds-base/issues/6676
Reviewed by: @vashirov (Thanks!)
diff --git a/.github/workflows/cargotest.yml b/.github/workflows/cargotest.yml
new file mode 100644
index 000000000..80938cee4
--- /dev/null
+++ b/.github/workflows/cargotest.yml
@@ -0,0 +1,36 @@
+name: Rust Tests
+
+on:
+ push:
+ pull_request:
+ schedule:
+ - cron: '0 0 * * *' # Run daily at midnight UTC
+ workflow_dispatch: # Allow manual triggering
+
+permissions:
+ actions: read
+ packages: read
+ contents: read
+
+jobs:
+ rust-tests:
+ name: Cargo Tests
+ runs-on: ubuntu-latest
+ container:
+ image: quay.io/389ds/ci-images:fedora
+
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+
+ - name: Add GITHUB_WORKSPACE as a safe directory
+ run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
+
+ - name: Setup and build
+ run: |
+ autoreconf -fvi
+ ./configure --enable-debug
+ make V=0
+
+ - name: Run Rust tests
+ run: make check-local
diff --git a/src/plugins/pwdchan/src/lib.rs b/src/plugins/pwdchan/src/lib.rs
index e38b6729b..a9c80fa8e 100644
--- a/src/plugins/pwdchan/src/lib.rs
+++ b/src/plugins/pwdchan/src/lib.rs
@@ -20,6 +20,15 @@ static PBKDF2_ROUNDS_SHA1: AtomicUsize = AtomicUsize::new(DEFAULT_PBKDF2_ROUNDS)
static PBKDF2_ROUNDS_SHA256: AtomicUsize = AtomicUsize::new(DEFAULT_PBKDF2_ROUNDS);
static PBKDF2_ROUNDS_SHA512: AtomicUsize = AtomicUsize::new(DEFAULT_PBKDF2_ROUNDS);
+// Thread-local storage for test environment
+#[cfg(test)]
+thread_local! {
+ static TEST_PBKDF2_ROUNDS: std::cell::Cell<Option<usize>> = std::cell::Cell::new(None);
+ static TEST_PBKDF2_ROUNDS_SHA1: std::cell::Cell<Option<usize>> = std::cell::Cell::new(None);
+ static TEST_PBKDF2_ROUNDS_SHA256: std::cell::Cell<Option<usize>> = std::cell::Cell::new(None);
+ static TEST_PBKDF2_ROUNDS_SHA512: std::cell::Cell<Option<usize>> = std::cell::Cell::new(None);
+}
+
const PBKDF2_SALT_LEN: usize = 24;
const PBKDF2_SHA1_EXTRACT: usize = 20;
const PBKDF2_SHA256_EXTRACT: usize = 32;
@@ -253,6 +262,7 @@ impl PwdChanCrypto {
let mut output = String::with_capacity(str_length);
// Write the header
output.push_str(header);
+
// The iter + delim
write!(&mut output, "{}$", rounds).map_err(|e| {
log_error!(ErrorLevel::Error, "Format Error -> {:?}", e);
@@ -264,7 +274,7 @@ impl PwdChanCrypto {
output.push('$');
// Finally the base64 hash
base64::encode_config_buf(&hash_input, base64::STANDARD, &mut output);
- // Return it
+
Ok(output)
}
@@ -348,11 +358,59 @@ impl PwdChanCrypto {
return Err(PluginError::InvalidConfiguration);
}
- Self::get_rounds_atomic(digest).store(rounds, Ordering::Relaxed);
+ #[cfg(test)]
+ {
+ // In test mode, store in thread-local storage
+ match digest {
+ d if d == MessageDigest::sha1() => {
+ TEST_PBKDF2_ROUNDS_SHA1.with(|cell| cell.set(Some(rounds)));
+ },
+ d if d == MessageDigest::sha256() => {
+ TEST_PBKDF2_ROUNDS_SHA256.with(|cell| cell.set(Some(rounds)));
+ },
+ d if d == MessageDigest::sha512() => {
+ TEST_PBKDF2_ROUNDS_SHA512.with(|cell| cell.set(Some(rounds)));
+ },
+ _ => {
+ TEST_PBKDF2_ROUNDS.with(|cell| cell.set(Some(rounds)));
+ },
+ }
+ }
+
+ #[cfg(not(test))]
+ {
+ Self::get_rounds_atomic(digest).store(rounds, Ordering::Relaxed);
+ }
+
Ok(())
}
fn get_pbkdf2_rounds(digest: MessageDigest) -> Result<usize, PluginError> {
+ #[cfg(test)]
+ {
+ // In test mode, try to get from thread-local storage first
+ let thread_local_value = match digest {
+ d if d == MessageDigest::sha1() => {
+ TEST_PBKDF2_ROUNDS_SHA1.with(|cell| cell.get())
+ },
+ d if d == MessageDigest::sha256() => {
+ TEST_PBKDF2_ROUNDS_SHA256.with(|cell| cell.get())
+ },
+ d if d == MessageDigest::sha512() => {
+ TEST_PBKDF2_ROUNDS_SHA512.with(|cell| cell.get())
+ },
+ _ => {
+ TEST_PBKDF2_ROUNDS.with(|cell| cell.get())
+ },
+ };
+
+ // If thread-local value exists, use it; otherwise fall back to global
+ if let Some(value) = thread_local_value {
+ return Ok(value);
+ }
+ }
+
+ // If not in test mode or no thread-local value, use global
Ok(Self::get_rounds_atomic(digest).load(Ordering::Relaxed))
}
}
@@ -362,25 +420,6 @@ mod tests {
use super::*;
use crate::PwdChanCrypto;
- struct TestPbkdf2Sha1;
- struct TestPbkdf2Sha256;
- struct TestPbkdf2Sha512;
-
- impl Pbkdf2Plugin for TestPbkdf2Sha1 {
- fn digest_type() -> MessageDigest { MessageDigest::sha1() }
- fn scheme_name() -> &'static str { "PBKDF2-SHA1" }
- }
-
- impl Pbkdf2Plugin for TestPbkdf2Sha256 {
- fn digest_type() -> MessageDigest { MessageDigest::sha256() }
- fn scheme_name() -> &'static str { "PBKDF2-SHA256" }
- }
-
- impl Pbkdf2Plugin for TestPbkdf2Sha512 {
- fn digest_type() -> MessageDigest { MessageDigest::sha512() }
- fn scheme_name() -> &'static str { "PBKDF2-SHA512" }
- }
-
/*
* '{PBKDF2}10000$IlfapjA351LuDSwYC0IQ8Q$saHqQTuYnjJN/tmAndT.8mJt.6w'
* '{PBKDF2-SHA1}10000$ZBEH6B07rgQpJSikyvMU2w$TAA03a5IYkz1QlPsbJKvUsTqNV'
@@ -389,8 +428,73 @@ mod tests {
* '{ARGON2}$argon2id$v=19$m=65536,t=2,p=1$IyTQMsvzB2JHDiWx8fq7Ew$VhYOA7AL0kbRXI5g2kOyyp8St1epkNj7WZyUY4pAIQQ'
*/
+ // A helper function for tests to reset rounds to defaults
+ fn reset_pbkdf2_rounds() {
+ // Reset the rounds to defaults in thread-local storage
+ TEST_PBKDF2_ROUNDS.with(|cell| cell.set(None));
+ TEST_PBKDF2_ROUNDS_SHA1.with(|cell| cell.set(None));
+ TEST_PBKDF2_ROUNDS_SHA256.with(|cell| cell.set(None));
+ TEST_PBKDF2_ROUNDS_SHA512.with(|cell| cell.set(None));
+
+ // Set default values for this thread
+ PwdChanCrypto::set_pbkdf2_rounds(MessageDigest::sha1(), DEFAULT_PBKDF2_ROUNDS).unwrap();
+ PwdChanCrypto::set_pbkdf2_rounds(MessageDigest::sha256(), DEFAULT_PBKDF2_ROUNDS).unwrap();
+ PwdChanCrypto::set_pbkdf2_rounds(MessageDigest::sha512(), DEFAULT_PBKDF2_ROUNDS).unwrap();
+ }
+
+ #[test]
+ fn test_pbkdf2_encrypt_with_different_rounds() {
+ // Reset to defaults first
+ reset_pbkdf2_rounds();
+
+ // Set different rounds for each algorithm
+ assert!(PwdChanCrypto::set_pbkdf2_rounds(MessageDigest::sha1(), 15000).is_ok());
+ assert!(PwdChanCrypto::set_pbkdf2_rounds(MessageDigest::sha256(), 20000).is_ok());
+ assert!(PwdChanCrypto::set_pbkdf2_rounds(MessageDigest::sha512(), 25000).is_ok());
+
+ // Verify rounds are correctly set
+ assert_eq!(PwdChanCrypto::get_pbkdf2_rounds(MessageDigest::sha1()).unwrap(), 15000);
+ assert_eq!(PwdChanCrypto::get_pbkdf2_rounds(MessageDigest::sha256()).unwrap(), 20000);
+ assert_eq!(PwdChanCrypto::get_pbkdf2_rounds(MessageDigest::sha512()).unwrap(), 25000);
+
+ let test_password = "test_password";
+
+ // Test SHA1
+ let sha1_result = PwdChanCrypto::pbkdf2_encrypt(test_password, MessageDigest::sha1()).unwrap();
+ // Check if it has the header and extract the rounds
+ assert!(sha1_result.starts_with("{PBKDF2-SHA1}"));
+ let sha1_no_header = sha1_result.replace("{PBKDF2-SHA1}", "");
+ let sha1_parts: Vec<&str> = sha1_no_header.split('$').collect();
+ let rounds: usize = sha1_parts[0].parse().unwrap();
+ assert_eq!(rounds, 15000, "SHA1 rounds should be 15000, got {}", rounds);
+
+ // Test SHA256
+ let sha256_result = PwdChanCrypto::pbkdf2_encrypt(test_password, MessageDigest::sha256()).unwrap();
+ // Check if it has the header and extract the rounds
+ assert!(sha256_result.starts_with("{PBKDF2-SHA256}"));
+ let sha256_no_header = sha256_result.replace("{PBKDF2-SHA256}", "");
+ let sha256_parts: Vec<&str> = sha256_no_header.split('$').collect();
+ let rounds: usize = sha256_parts[0].parse().unwrap();
+ assert_eq!(rounds, 20000, "SHA256 rounds should be 20000, got {}", rounds);
+
+ // Test SHA512
+ let sha512_result = PwdChanCrypto::pbkdf2_encrypt(test_password, MessageDigest::sha512()).unwrap();
+ // Check if it has the header and extract the rounds
+ assert!(sha512_result.starts_with("{PBKDF2-SHA512}"));
+ let sha512_no_header = sha512_result.replace("{PBKDF2-SHA512}", "");
+ let sha512_parts: Vec<&str> = sha512_no_header.split('$').collect();
+ let rounds: usize = sha512_parts[0].parse().unwrap();
+ assert_eq!(rounds, 25000, "SHA512 rounds should be 25000, got {}", rounds);
+
+ // Reset to defaults after test
+ reset_pbkdf2_rounds();
+ }
+
#[test]
fn test_pbkdf2_rounds_configuration() {
+ // Reset to defaults first
+ reset_pbkdf2_rounds();
+
// Test different rounds for each algorithm
assert!(PwdChanCrypto::set_pbkdf2_rounds(MessageDigest::sha1(), 15000).is_ok());
assert!(PwdChanCrypto::set_pbkdf2_rounds(MessageDigest::sha256(), 20000).is_ok());
@@ -400,70 +504,34 @@ mod tests {
assert_eq!(PwdChanCrypto::get_pbkdf2_rounds(MessageDigest::sha1()).unwrap(), 15000);
assert_eq!(PwdChanCrypto::get_pbkdf2_rounds(MessageDigest::sha256()).unwrap(), 20000);
assert_eq!(PwdChanCrypto::get_pbkdf2_rounds(MessageDigest::sha512()).unwrap(), 25000);
+
+ // Reset to defaults after test
+ reset_pbkdf2_rounds();
}
#[test]
fn test_pbkdf2_rounds_limits() {
- // Test limits for SHA1
- assert!(matches!(
- PwdChanCrypto::set_pbkdf2_rounds(MessageDigest::sha1(), MAX_PBKDF2_ROUNDS + 1),
- Err(PluginError::InvalidConfiguration)
- ));
- assert!(PwdChanCrypto::set_pbkdf2_rounds(MessageDigest::sha1(), MIN_PBKDF2_ROUNDS).is_ok());
-
- // Test invalid rounds for SHA256 - too low
- assert!(matches!(
- PwdChanCrypto::set_pbkdf2_rounds(MessageDigest::sha256(), 5000),
- Err(PluginError::InvalidConfiguration)
- ));
- assert!(PwdChanCrypto::set_pbkdf2_rounds(MessageDigest::sha256(), MAX_PBKDF2_ROUNDS).is_ok());
-
- // Test invalid rounds for SHA512 - too high
- assert!(matches!(
- PwdChanCrypto::set_pbkdf2_rounds(MessageDigest::sha512(), 2_000_000),
- Err(PluginError::InvalidConfiguration)
- ));
- assert!(PwdChanCrypto::set_pbkdf2_rounds(MessageDigest::sha512(), MIN_PBKDF2_ROUNDS).is_ok());
- }
+ // Reset to defaults first
+ reset_pbkdf2_rounds();
- #[test]
- fn test_pbkdf2_encrypt_with_different_rounds() {
- // Set different rounds for each algorithm
- PwdChanCrypto::set_pbkdf2_rounds(MessageDigest::sha1(), 15000).unwrap();
- PwdChanCrypto::set_pbkdf2_rounds(MessageDigest::sha256(), 20000).unwrap();
- PwdChanCrypto::set_pbkdf2_rounds(MessageDigest::sha512(), 25000).unwrap();
+ // Test max limit - should fail
+ let result = PwdChanCrypto::set_pbkdf2_rounds(MessageDigest::sha1(), MAX_PBKDF2_ROUNDS + 1);
+ assert!(result.is_err());
- let test_password = "test_password";
+ // Test min rounds - should succeed
+ let result = PwdChanCrypto::set_pbkdf2_rounds(MessageDigest::sha1(), MIN_PBKDF2_ROUNDS);
+ assert!(result.is_ok());
- // Test SHA1
- let result = PwdChanCrypto::pbkdf2_encrypt(test_password, MessageDigest::sha1()).unwrap();
- assert!(result.contains("15000$"));
- let encrypted = result.replace("{PBKDF2-SHA1}", "");
- assert!(PwdChanCrypto::pbkdf2_compare(
- test_password,
- &encrypted,
- MessageDigest::sha1()
- ).unwrap());
+ // Test invalid rounds for SHA256 - too low - should fail
+ let result = PwdChanCrypto::set_pbkdf2_rounds(MessageDigest::sha256(), MIN_PBKDF2_ROUNDS - 1);
+ assert!(result.is_err());
- // Test SHA256
- let result = PwdChanCrypto::pbkdf2_encrypt(test_password, MessageDigest::sha256()).unwrap();
- assert!(result.contains("20000$"));
- let encrypted = result.replace("{PBKDF2-SHA256}", "");
- assert!(PwdChanCrypto::pbkdf2_compare(
- test_password,
- &encrypted,
- MessageDigest::sha256()
- ).unwrap());
+ // Test max rounds - should succeed
+ let result = PwdChanCrypto::set_pbkdf2_rounds(MessageDigest::sha256(), MAX_PBKDF2_ROUNDS);
+ assert!(result.is_ok());
- // Test SHA512
- let result = PwdChanCrypto::pbkdf2_encrypt(test_password, MessageDigest::sha512()).unwrap();
- assert!(result.contains("25000$"));
- let encrypted = result.replace("{PBKDF2-SHA512}", "");
- assert!(PwdChanCrypto::pbkdf2_compare(
- test_password,
- &encrypted,
- MessageDigest::sha512()
- ).unwrap());
+ // Reset to defaults after test
+ reset_pbkdf2_rounds();
}
#[test]
@@ -471,7 +539,7 @@ mod tests {
let valid_hash = "10000$salt123$hash456";
let result = PwdChanCrypto::pbkdf2_decompose(valid_hash);
assert!(result.is_ok());
- let (iter, salt, hash) = result.unwrap();
+ let (iter, _salt, _hash) = result.unwrap();
assert_eq!(iter, 10000);
// Test invalid format
@@ -481,6 +549,9 @@ mod tests {
#[test]
fn pwdchan_pbkdf2_sha1_basic() {
+ // Reset to defaults first
+ reset_pbkdf2_rounds();
+
PwdChanCrypto::set_pbkdf2_rounds(MessageDigest::sha1(), 10000).unwrap();
let encrypted = "10000$IlfapjA351LuDSwYC0IQ8Q$saHqQTuYnjJN/tmAndT.8mJt.6w";
@@ -496,10 +567,16 @@ mod tests {
let test_enc = test_enc.replace("{PBKDF2-SHA1}", "");
assert!(PwdChanCrypto::pbkdf2_compare("password", &test_enc, MessageDigest::sha1()) == Ok(true));
assert!(PwdChanCrypto::pbkdf2_compare("password!", &test_enc, MessageDigest::sha1()) == Ok(false));
+
+ // Reset to defaults after test
+ reset_pbkdf2_rounds();
}
#[test]
fn pwdchan_pbkdf2_sha256_basic() {
+ // Reset to defaults first
+ reset_pbkdf2_rounds();
+
PwdChanCrypto::set_pbkdf2_rounds(MessageDigest::sha256(), 10000).unwrap();
let encrypted = "10000$henZGfPWw79Cs8ORDeVNrQ$1dTJy73v6n3bnTmTZFghxHXHLsAzKaAy8SksDfZBPIw";
@@ -523,10 +600,16 @@ mod tests {
let test_enc = test_enc.replace("{PBKDF2-SHA256}", "");
assert!(PwdChanCrypto::pbkdf2_compare("password", &test_enc, MessageDigest::sha256()) == Ok(true));
assert!(PwdChanCrypto::pbkdf2_compare("password!", &test_enc, MessageDigest::sha256()) == Ok(false));
+
+ // Reset to defaults after test
+ reset_pbkdf2_rounds();
}
#[test]
fn pwdchan_pbkdf2_sha512_basic() {
+ // Reset to defaults first
+ reset_pbkdf2_rounds();
+
PwdChanCrypto::set_pbkdf2_rounds(MessageDigest::sha512(), 10000).unwrap();
let encrypted = "10000$Je1Uw19Bfv5lArzZ6V3EPw$g4T/1sqBUYWl9o93MVnyQ/8zKGSkPbKaXXsT8WmysXQJhWy8MRP2JFudSL.N9RklQYgDPxPjnfum/F2f/TrppA";
@@ -539,5 +622,8 @@ mod tests {
let test_enc = test_enc.replace("{PBKDF2-SHA512}", "");
assert!(PwdChanCrypto::pbkdf2_compare("password", &test_enc, MessageDigest::sha512()) == Ok(true));
assert!(PwdChanCrypto::pbkdf2_compare("password!", &test_enc, MessageDigest::sha512()) == Ok(false));
+
+ // Reset to defaults after test
+ reset_pbkdf2_rounds();
}
}
| 0 |
33f1e8722d417463e80f5f0ef1a5915427472393
|
389ds/389-ds-base
|
Resolves: bug 237356
Description: Move DS Admin Code into Admin Server - Inf, ds_newinst.pl
Fix Description: Some minor cleanup:
1) Setup must not write to the user supplied inf file. Setup uses the user supplied inf to initialize its cache, but creates a tempfile for writing.
2) When writing an Inf, preserve the continuation lines.
3) Added Noriko's fix for suffix generation to ds_newinst.pl
Platforms tested: RHEL4
Flag Day: No.
Doc impact: No.
|
commit 33f1e8722d417463e80f5f0ef1a5915427472393
Author: Rich Megginson <[email protected]>
Date: Wed Jun 20 14:40:24 2007 +0000
Resolves: bug 237356
Description: Move DS Admin Code into Admin Server - Inf, ds_newinst.pl
Fix Description: Some minor cleanup:
1) Setup must not write to the user supplied inf file. Setup uses the user supplied inf to initialize its cache, but creates a tempfile for writing.
2) When writing an Inf, preserve the continuation lines.
3) Added Noriko's fix for suffix generation to ds_newinst.pl
Platforms tested: RHEL4
Flag Day: No.
Doc impact: No.
diff --git a/ldap/admin/src/ds_newinst.pl.in b/ldap/admin/src/ds_newinst.pl.in
index 974e14c1b..739f7a2ad 100644
--- a/ldap/admin/src/ds_newinst.pl.in
+++ b/ldap/admin/src/ds_newinst.pl.in
@@ -217,6 +217,7 @@ if (!$table{slapd}->{RootDN}) {
if (!$table{slapd}->{Suffix}) {
my $suffix = $table{General}->{FullMachineName};
# convert fqdn to dc= domain components
+ $suffix =~ s/^[^\.]*\.//; # just the domain part
$suffix = "dc=$suffix";
$suffix =~ s/\./, dc=/g;
$table{slapd}->{Suffix} = $suffix;
diff --git a/ldap/admin/src/scripts/Inf.pm b/ldap/admin/src/scripts/Inf.pm
index 4c6bd2c60..27a840ade 100644
--- a/ldap/admin/src/scripts/Inf.pm
+++ b/ldap/admin/src/scripts/Inf.pm
@@ -131,7 +131,9 @@ sub writeSection {
print $fh "[$name]\n";
for my $key (keys %{$section}) {
if (defined($section->{$key})) {
- print $fh "$key = ", $section->{$key}, "\n";
+ my $val = $section->{$key};
+ $val =~ s/\n/\\\n/g; # make continuation lines
+ print $fh "$key = $val\n";
}
}
}
diff --git a/ldap/admin/src/scripts/Setup.pm.in b/ldap/admin/src/scripts/Setup.pm.in
index dd2b5b64d..48ca474e5 100644
--- a/ldap/admin/src/scripts/Setup.pm.in
+++ b/ldap/admin/src/scripts/Setup.pm.in
@@ -132,17 +132,17 @@ sub new {
$self->{preonly} = $preonly;
$self->{logfile} = $logfile;
$self->{log} = new SetupLog($self->{logfile});
- if (!$self->{inffile}) {
- my ($fh, $filename) = tempfile("setupXXXXXX", UNLINK => !$keep,
- SUFFIX => ".inf", OPEN => 0,
- DIR => File::Spec->tmpdir);
- $self->{inffile} = $filename;
- $self->{inf} = new Inf;
- $self->{inf}->{filename} = $self->{inffile};
- } else {
+ # if user supplied inf file, use that to initialize
+ if (defined($self->{inffile})) {
$self->{inf} = new Inf($self->{inffile});
- $self->{keep} = 1; # do not delete user supplied inf file
}
+ my $fh;
+ # create a temp inf file for writing for other processes
+ # never overwrite the user supplied inf file
+ ($fh, $self->{inffile}) = tempfile("setupXXXXXX", UNLINK => !$keep,
+ SUFFIX => ".inf", OPEN => 0,
+ DIR => File::Spec->tmpdir);
+ $self->{inf}->{filename} = $self->{inffile};
# see if user passed in default inf values - also, command line
# arguments override those passed in via an inf file - this
@@ -157,6 +157,8 @@ sub new {
}
}
+ # this is the base config directory - the directory containing
+ # the slapd-instance instance specific config directories
$self->{configdir} = $ENV{DS_CONFIG_DIR} || "@instconfigdir@";
$self = bless $self, $type;
| 0 |
2ebeaf1fbbba60e8ed0040bb904c1bb858a876c3
|
389ds/389-ds-base
|
Resolves: #250347
Summary: rsearch - make search timeout a configurable parameter
Description: Introduced a new option "-o <search time limit>"
|
commit 2ebeaf1fbbba60e8ed0040bb904c1bb858a876c3
Author: Noriko Hosoi <[email protected]>
Date: Wed Aug 1 17:51:10 2007 +0000
Resolves: #250347
Summary: rsearch - make search timeout a configurable parameter
Description: Introduced a new option "-o <search time limit>"
diff --git a/ldap/servers/slapd/tools/rsearch/rsearch.c b/ldap/servers/slapd/tools/rsearch/rsearch.c
index 17e998d28..313eed3dc 100644
--- a/ldap/servers/slapd/tools/rsearch/rsearch.c
+++ b/ldap/servers/slapd/tools/rsearch/rsearch.c
@@ -96,6 +96,7 @@ void usage()
"-a file -- list of attributes for search request in a file\n"
" -- (use '-a \\?' to see the format ; -a & -A are mutually exclusive)\n"
"-n number -- (reserved for future use)\n"
+ "-o number -- Search time limit, in seconds; (default: 30; no time limit: 0)\n"
"-j number -- sample interval, in seconds (default: %u)\n"
"-t number -- threads (default: %d)\n"
"-T number -- Time limit, in seconds; cmd stops when exceeds <number>\n"
@@ -202,6 +203,7 @@ char **string_to_list(char* s)
char *hostname = DEFAULT_HOSTNAME;
int port = DEFAULT_PORT;
int numeric = 0;
+int searchTimelimit = 30;
int threadCount = DEFAULT_THREADS;
int verbose = 0;
int logging = 0;
@@ -251,7 +253,7 @@ int main(int argc, char** argv)
}
while ((ch = getopt(argc, argv,
- "B:a:j:i:h:s:f:p:t:T:D:w:n:A:S:C:R:bvlyqmMcduNLHx?V"))
+ "B:a:j:i:h:s:f:p:o:t:T:D:w:n:A:S:C:R:bvlyqmMcduNLHx?V"))
!= EOF)
switch (ch) {
case 'h':
@@ -308,6 +310,9 @@ int main(int argc, char** argv)
case 'n':
numeric = atoi(optarg);
break;
+ case 'o':
+ searchTimelimit = atoi(optarg);
+ break;
case 't':
threadCount = atoi(optarg);
break;
@@ -447,11 +452,12 @@ int main(int argc, char** argv)
for (x = 0; x < numThreads; x++) {
alive = st_alive(threads[x]);
if (alive < 1) {
+ int limit = -1 * (searchTimelimit>timeLimit?searchTimelimit:timeLimit + 40) * 1000 / sampleInterval;
int y;
PRThread *tid;
printf("T%d no heartbeat", st_getThread(threads[x], &tid));
- if (alive <= -4) {
+ if (alive <= limit) {
printf(" -- Dead thread being reaped.\n");
PR_JoinThread(tid);
for (y = x+1; y < numThreads; y++)
diff --git a/ldap/servers/slapd/tools/rsearch/rsearch.h b/ldap/servers/slapd/tools/rsearch/rsearch.h
index 3f797cc04..d62c80d87 100644
--- a/ldap/servers/slapd/tools/rsearch/rsearch.h
+++ b/ldap/servers/slapd/tools/rsearch/rsearch.h
@@ -52,6 +52,7 @@ typedef enum { op_search, op_modify, op_idxmodify, op_add, op_delete, op_compare
extern char *hostname;
extern int port;
extern int numeric;
+extern int searchTimelimit;
/**/ extern int threadCount;
/**/ extern int verbose;
/**/ extern int logging;
diff --git a/ldap/servers/slapd/tools/rsearch/searchthread.c b/ldap/servers/slapd/tools/rsearch/searchthread.c
index cfb16b52a..484304393 100644
--- a/ldap/servers/slapd/tools/rsearch/searchthread.c
+++ b/ldap/servers/slapd/tools/rsearch/searchthread.c
@@ -285,6 +285,7 @@ static int st_search(SearchThread *st)
char filterBuffer[100];
char *pFilter;
struct timeval timeout;
+ struct timeval *timeoutp;
int scope, attrsOnly = 0;
LDAPMessage *result;
int ret;
@@ -312,10 +313,15 @@ static int st_search(SearchThread *st)
if (!attrToReturn)
attrToReturn = nt_get_all(attrTable);
- timeout.tv_sec = 30;
- timeout.tv_usec = 0;
+ if (searchTimelimit <= 0) {
+ timeoutp = NULL;
+ } else {
+ timeout.tv_sec = searchTimelimit;
+ timeout.tv_usec = 0;
+ timeoutp = &timeout;
+ }
ret = ldap_search_st(st->ld, suffix, scope, pFilter, attrToReturn,
- attrsOnly, &timeout, &result);
+ attrsOnly, timeoutp, &result);
if (ret != LDAP_SUCCESS) {
fprintf(stderr, "T%d: failed to search 2, error=0x%02X\n",
st->id, ret);
| 0 |
0935b8af6c8925c7a79a0a22103142ef5f7c5960
|
389ds/389-ds-base
|
Ticket 50396 - Crash in PAM plugin when user does not exist
Description: pam passthru & addn plugin causes crash in bind when
user does not exist. Need to make sure we don't
dereference NULL pointer.
https://pagure.io/389-ds-base/issue/50396
Reviewed by: mreynolds & tbordaz
|
commit 0935b8af6c8925c7a79a0a22103142ef5f7c5960
Author: Mark Reynolds <[email protected]>
Date: Mon May 20 15:06:54 2019 -0400
Ticket 50396 - Crash in PAM plugin when user does not exist
Description: pam passthru & addn plugin causes crash in bind when
user does not exist. Need to make sure we don't
dereference NULL pointer.
https://pagure.io/389-ds-base/issue/50396
Reviewed by: mreynolds & tbordaz
diff --git a/ldap/servers/plugins/pam_passthru/pam_ptpreop.c b/ldap/servers/plugins/pam_passthru/pam_ptpreop.c
index de9448b90..b62c3c6b6 100644
--- a/ldap/servers/plugins/pam_passthru/pam_ptpreop.c
+++ b/ldap/servers/plugins/pam_passthru/pam_ptpreop.c
@@ -436,8 +436,9 @@ pam_passthru_bindpreop(Slapi_PBlock *pb)
* We only handle simple bind requests that include non-NULL binddn and
* credentials. Let the Directory Server itself handle everything else.
*/
- if ((method != LDAP_AUTH_SIMPLE) || (*normbinddn == '\0') ||
- (creds->bv_len == 0)) {
+ if (method != LDAP_AUTH_SIMPLE || normbinddn == NULL ||
+ *normbinddn == '\0' || creds->bv_len == 0)
+ {
slapi_log_err(SLAPI_LOG_PLUGIN, PAM_PASSTHRU_PLUGIN_SUBSYSTEM,
"pam_passthru_bindpreop - Not handled (not simple bind or NULL dn/credentials)\n");
return retcode;
| 0 |
910a7ad017991a7e6807a2a80f5d4f8716b82429
|
389ds/389-ds-base
|
Revise version to 1.3.6.1
|
commit 910a7ad017991a7e6807a2a80f5d4f8716b82429
Author: Mark Reynolds <[email protected]>
Date: Fri Mar 10 13:12:56 2017 -0500
Revise version to 1.3.6.1
diff --git a/VERSION.sh b/VERSION.sh
index 68b1cfda4..c961226d8 100644
--- a/VERSION.sh
+++ b/VERSION.sh
@@ -10,7 +10,7 @@ vendor="389 Project"
# PACKAGE_VERSION is constructed from these
VERSION_MAJOR=1
VERSION_MINOR=3
-VERSION_MAINT=6.2
+VERSION_MAINT=6.1
# NOTE: VERSION_PREREL is automatically set for builds made out of a git tree
VERSION_PREREL=
VERSION_DATE=$(date -u +%Y%m%d)
| 0 |
f757387b7e2c04f03bc7c1b87c78c64b8f12b59a
|
389ds/389-ds-base
|
Bug 614511 - fix coverify Defect Type: Null pointer dereferences issues 11846 - 11891
https://bugzilla.redhat.com/show_bug.cgi?id=614511
Resolves: bug 614511
Bug description: Fix coverify Defect Type: Null pointer dereferences issues 11846 - 11891
description: Catch possible NULL pointer in ruv_covers_ruv() and get_ruvelement_from_berval().
|
commit f757387b7e2c04f03bc7c1b87c78c64b8f12b59a
Author: Endi S. Dewata <[email protected]>
Date: Mon Jul 12 23:11:42 2010 -0500
Bug 614511 - fix coverify Defect Type: Null pointer dereferences issues 11846 - 11891
https://bugzilla.redhat.com/show_bug.cgi?id=614511
Resolves: bug 614511
Bug description: Fix coverify Defect Type: Null pointer dereferences issues 11846 - 11891
description: Catch possible NULL pointer in ruv_covers_ruv() and get_ruvelement_from_berval().
diff --git a/ldap/servers/plugins/replication/repl5_ruv.c b/ldap/servers/plugins/replication/repl5_ruv.c
index f71032a97..9dd512a7b 100644
--- a/ldap/servers/plugins/replication/repl5_ruv.c
+++ b/ldap/servers/plugins/replication/repl5_ruv.c
@@ -1146,16 +1146,8 @@ ruv_covers_ruv(const RUV *covering_ruv, const RUV *covered_ruv)
int cookie;
/* compare replica generations first */
- if (covering_ruv->replGen == NULL)
- {
- if (covered_ruv->replGen)
- return PR_FALSE;
- }
- else
- {
- if (covered_ruv->replGen == NULL)
- return PR_FALSE;
- }
+ if (covering_ruv->replGen == NULL || covered_ruv->replGen == NULL)
+ return PR_FALSE;
if (strcasecmp (covered_ruv->replGen, covering_ruv->replGen))
return PR_FALSE;
@@ -1662,9 +1654,15 @@ get_ruvelement_from_berval(const struct berval *bval)
char ridbuff [RIDSTR_SIZE];
int i;
- if (NULL != bval && NULL != bval->bv_val &&
- bval->bv_len > strlen(prefix_ruvcsn) &&
- strncasecmp(bval->bv_val, prefix_ruvcsn, strlen(prefix_ruvcsn)) == 0)
+ if (NULL == bval || NULL == bval->bv_val ||
+ bval->bv_len <= strlen(prefix_ruvcsn) ||
+ strncasecmp(bval->bv_val, prefix_ruvcsn, strlen(prefix_ruvcsn)) != 0)
+ {
+ slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
+ "get_ruvelement_from_berval: invalid berval\n");
+ goto loser;
+ }
+
{
unsigned int urlbegin = strlen(prefix_ruvcsn);
unsigned int urlend;
| 0 |
a4daf1a0a65f796878b40b8ebc572082a1101f3b
|
389ds/389-ds-base
|
Ticket47426 - Coverity issue with last commit(move compute_idletimeout out of handle_pr_read_ready)
I had added a NULL check trying to avoid a coverity error, but pb->pb_conn can not be
NULL when it gets to this code. Removed NULL check.
https://fedorahosted.org/389/ticket/47426
Reviewed by: ?
|
commit a4daf1a0a65f796878b40b8ebc572082a1101f3b
Author: Mark Reynolds <[email protected]>
Date: Thu Aug 1 15:05:16 2013 -0400
Ticket47426 - Coverity issue with last commit(move compute_idletimeout out of handle_pr_read_ready)
I had added a NULL check trying to avoid a coverity error, but pb->pb_conn can not be
NULL when it gets to this code. Removed NULL check.
https://fedorahosted.org/389/ticket/47426
Reviewed by: ?
diff --git a/ldap/servers/slapd/connection.c b/ldap/servers/slapd/connection.c
index 6431874d2..f5fa51b48 100644
--- a/ldap/servers/slapd/connection.c
+++ b/ldap/servers/slapd/connection.c
@@ -2326,7 +2326,7 @@ connection_threadmain()
in connection_activity when the conn is added to the
work queue, setup_pr_read_pds won't add the connection prfd
to the poll list */
- if(pb->pb_conn && pb->pb_conn->c_opscompleted == 0){
+ if(pb->pb_conn->c_opscompleted == 0){
/*
* We have a new connection, set the anonymous reslimit idletimeout
* if applicable.
| 0 |
01d9def3122b5e707ddfbecba6fce66a9dd41eb7
|
389ds/389-ds-base
|
Issue 51253 - dscreate should LDAPI to bootstrap the config
Description: There are cases where DNS is not setup yet, and trying to
automate the installation fails. Using LDAPI bypasses this
issue and allows for more robust deployment options
relates: https://pagure.io/389-ds-base/issue/51253
Reviewed by: minfrin, firstyear, and tbordaz (Thanks!!!)
|
commit 01d9def3122b5e707ddfbecba6fce66a9dd41eb7
Author: Mark Reynolds <[email protected]>
Date: Sun Aug 30 20:17:28 2020 -0400
Issue 51253 - dscreate should LDAPI to bootstrap the config
Description: There are cases where DNS is not setup yet, and trying to
automate the installation fails. Using LDAPI bypasses this
issue and allows for more robust deployment options
relates: https://pagure.io/389-ds-base/issue/51253
Reviewed by: minfrin, firstyear, and tbordaz (Thanks!!!)
diff --git a/ldap/admin/src/defaults.inf.in b/ldap/admin/src/defaults.inf.in
index 2f630f9c1..e67d65e7d 100644
--- a/ldap/admin/src/defaults.inf.in
+++ b/ldap/admin/src/defaults.inf.in
@@ -38,6 +38,8 @@ local_state_dir = @localstatedir@
run_dir = @localstatedir@/run/dirsrv
# This is the expected location of ldapi.
ldapi = @localstatedir@/run/slapd-{instance_name}.socket
+ldapi_listen = on
+ldapi_autobind = on
pid_file = @localstatedir@/run/dirsrv/slapd-{instance_name}.pid
inst_dir = @serverdir@/slapd-{instance_name}
plugin_dir = @serverplugindir@
diff --git a/ldap/admin/src/scripts/DSCreate.pm.in b/ldap/admin/src/scripts/DSCreate.pm.in
index 6ed2835ff..b28a76939 100644
--- a/ldap/admin/src/scripts/DSCreate.pm.in
+++ b/ldap/admin/src/scripts/DSCreate.pm.in
@@ -956,6 +956,15 @@ sub setDefaults {
if (!defined($inf->{slapd}->{db_home_dir})) {
$inf->{slapd}->{db_home_dir} = $inf->{slapd}->{db_dir};
}
+ if (!defined($inf->{slapd}->{ldapi})) {
+ $inf->{slapd}->{ldapi} = "$localstatedir/run/slapd-$servid.socket";
+ }
+ if (!defined($inf->{slapd}->{ldapi_listen})) {
+ $inf->{slapd}->{ldapi_listen} = "on";
+ }
+ if (!defined($inf->{slapd}->{ldapi_autobind})) {
+ $inf->{slapd}->{ldapi_autobind} = "on";
+ }
if (!defined($inf->{slapd}->{bak_dir})) {
if ("@with_fhs_opt@") {
diff --git a/ldap/admin/src/scripts/DSUtil.pm.in b/ldap/admin/src/scripts/DSUtil.pm.in
index 197aafad6..c994faad3 100644
--- a/ldap/admin/src/scripts/DSUtil.pm.in
+++ b/ldap/admin/src/scripts/DSUtil.pm.in
@@ -964,6 +964,9 @@ sub createInfFromConfig {
$inf->{slapd}->{RootDNPwd} = $ent->getValues('nsslapd-rootpw');
$inf->{slapd}->{ServerPort} = $ent->getValues('nsslapd-port');
$inf->{slapd}->{ServerIdentifier} = $id;
+ $inf->{slapd}->{ldapi} = $ent->getValues('nsslapd-ldapifilepath');
+ $inf->{slapd}->{ldapi_listen} = $ent->getValues('nsslapd-ldapilisten');
+ $inf->{slapd}->{ldapi_autobind} = $ent->getValues('nsslapd-ldapiautobind');
my $suffix = "";
$ent = $conn->search("cn=ldbm database,cn=plugins,cn=config",
diff --git a/ldap/admin/src/scripts/dscreate.map.in b/ldap/admin/src/scripts/dscreate.map.in
index 4c47b08b8..fd6d3e852 100644
--- a/ldap/admin/src/scripts/dscreate.map.in
+++ b/ldap/admin/src/scripts/dscreate.map.in
@@ -39,3 +39,6 @@ db_dir = db_dir
db_home_dir = db_home_dir
run_dir = run_dir
instance_name = ServerIdentifier
+ldapi_enabled = ldapi_listen
+ldapi = ldapi
+ldapi_autobind = ldapi_autobind
diff --git a/ldap/admin/src/scripts/dsupdate.map.in b/ldap/admin/src/scripts/dsupdate.map.in
index f6912b6a2..429b74249 100644
--- a/ldap/admin/src/scripts/dsupdate.map.in
+++ b/ldap/admin/src/scripts/dsupdate.map.in
@@ -35,3 +35,6 @@ config_dir = config_dir
db_dir = db_dir
db_home_dir = db_home_dir
run_dir = run_dir
+ldapi_enabled = ldapi_listen
+ldapi = ldapi
+ldapi_autobind = ldapi_autobind
diff --git a/ldap/ldif/template-dse-minimal.ldif.in b/ldap/ldif/template-dse-minimal.ldif.in
index 0be9c171e..0084e7e0f 100644
--- a/ldap/ldif/template-dse-minimal.ldif.in
+++ b/ldap/ldif/template-dse-minimal.ldif.in
@@ -20,6 +20,10 @@ nsslapd-auditlog: %log_dir%/audit
nsslapd-auditfaillog: %log_dir%/audit
nsslapd-rootdn: %rootdn%
nsslapd-rootpw: %ds_passwd%
+nsslapd-ldapilisten: %ldapi_enabled%
+nsslapd-ldapifilepath: %ldapi%
+nsslapd-ldapiautobind: %ldapi_autobind%
+nsslapd-ldapimaprootdn: %rootdn%
dn: cn=features,cn=config
objectclass: top
diff --git a/ldap/ldif/template-dse.ldif.in b/ldap/ldif/template-dse.ldif.in
index 19abcf841..2cfc98557 100644
--- a/ldap/ldif/template-dse.ldif.in
+++ b/ldap/ldif/template-dse.ldif.in
@@ -20,6 +20,10 @@ nsslapd-auditlog: %log_dir%/audit
nsslapd-auditfaillog: %log_dir%/audit
nsslapd-rootdn: %rootdn%
nsslapd-rootpw: %ds_passwd%
+nsslapd-ldapilisten: %ldapi_enabled%
+nsslapd-ldapifilepath: %ldapi%
+nsslapd-ldapiautobind: %ldapi_autobind%
+nsslapd-ldapimaprootdn: %rootdn%
dn: cn=encryption,cn=config
objectClass: top
diff --git a/src/lib389/lib389/instance/setup.py b/src/lib389/lib389/instance/setup.py
index d11729263..0c0ff2e7f 100644
--- a/src/lib389/lib389/instance/setup.py
+++ b/src/lib389/lib389/instance/setup.py
@@ -732,6 +732,7 @@ class SetupDs(object):
dse += line.replace('%', '{', 1).replace('%', '}', 1)
with open(os.path.join(slapd['config_dir'], 'dse.ldif'), 'w') as file_dse:
+ ldapi_path = os.path.join(slapd['local_state_dir'], "run/slapd-%s.socket" % slapd['instance_name'])
dse_fmt = dse.format(
schema_dir=slapd['schema_dir'],
lock_dir=slapd['lock_dir'],
@@ -748,12 +749,15 @@ class SetupDs(object):
rootdn=slapd['root_dn'],
instance_name=slapd['instance_name'],
ds_passwd=self._secure_password, # We set our own password here, so we can connect and mod.
- # This is because we never know the users input root password as they can validily give
+ # This is because we never know the users input root password as they can validly give
# us a *hashed* input.
ds_suffix=ds_suffix,
config_dir=slapd['config_dir'],
db_dir=slapd['db_dir'],
- db_home_dir=slapd['db_home_dir']
+ db_home_dir=slapd['db_home_dir'],
+ ldapi_enabled="on",
+ ldapi=ldapi_path,
+ ldapi_autobind="on",
)
file_dse.write(dse_fmt)
@@ -843,7 +847,7 @@ class SetupDs(object):
# it's the only stable and guaranteed way to connect to the instance
# at this point.
#
- # Alternately, we could use ldapi instead, which would prevent the need
+ # Use ldapi which would prevent the need
# to configure a temp root pw in the setup phase.
args = {
SER_HOST: "localhost",
@@ -851,7 +855,10 @@ class SetupDs(object):
SER_SERVERID_PROP: slapd['instance_name'],
SER_ROOT_DN: slapd['root_dn'],
SER_ROOT_PW: self._raw_secure_password,
- SER_DEPLOYED_DIR: slapd['prefix']
+ SER_DEPLOYED_DIR: slapd['prefix'],
+ SER_LDAPI_ENABLED: 'on',
+ SER_LDAPI_SOCKET: ldapi_path,
+ SER_LDAPI_AUTOBIND: 'on'
}
ds_instance.allocate(args)
@@ -923,7 +930,7 @@ class SetupDs(object):
ds_instance.config.set('nsslapd-security', 'on')
# Before we create any backends, create any extra default indexes that may be
- # dynamicly provisioned, rather than from template-dse.ldif. Looking at you
+ # dynamically provisioned, rather than from template-dse.ldif. Looking at you
# entryUUID (requires rust enabled).
#
# Indexes defaults to default_index_dn
@@ -968,14 +975,6 @@ class SetupDs(object):
# Unsupported rdn
raise ValueError("Suffix RDN '{}' in '{}' is not supported. Supported RDN's are: 'c', 'cn', 'dc', 'o', and 'ou'".format(suffix_rdn_attr, backend['nsslapd-suffix']))
- # Initialise ldapi socket information. IPA expects this ....
- ldapi_path = os.path.join(slapd['local_state_dir'], "run/slapd-%s.socket" % slapd['instance_name'])
- ds_instance.config.set('nsslapd-ldapifilepath', ldapi_path)
- ds_instance.config.set('nsslapd-ldapilisten', 'on')
- ds_instance.config.set('nsslapd-ldapiautobind', 'on')
- ds_instance.config.set('nsslapd-ldapimaprootdn', slapd['root_dn'])
-
-
# Create all required sasl maps: if we have a single backend ...
# our default maps are really really bad, and we should feel bad.
# they basically only work with a single backend, and they'll break
| 0 |
6e84e093b3f8b424887ea0ee827527e350840720
|
389ds/389-ds-base
|
Ticket 534 - SASL Mapping Fallback
Bug Description: wrong oid for nsslapd-sasl-mapping-fallback
Fix Description: Use the correct oid.
https://fedorahosted.org/389/ticket/534
Reported by: Noriko(Thanks!)
|
commit 6e84e093b3f8b424887ea0ee827527e350840720
Author: Mark Reynolds <[email protected]>
Date: Tue Jan 8 10:13:00 2013 -0500
Ticket 534 - SASL Mapping Fallback
Bug Description: wrong oid for nsslapd-sasl-mapping-fallback
Fix Description: Use the correct oid.
https://fedorahosted.org/389/ticket/534
Reported by: Noriko(Thanks!)
diff --git a/ldap/schema/01core389.ldif b/ldap/schema/01core389.ldif
index 8a245deba..1c9112fc1 100644
--- a/ldap/schema/01core389.ldif
+++ b/ldap/schema/01core389.ldif
@@ -140,7 +140,7 @@ attributeTypes: ( 2.16.840.1.113730.3.1.2136 NAME 'nsds5ReplicaCleanRUVNotified'
attributeTypes: ( 2.16.840.1.113730.3.1.2137 NAME 'nsds5ReplicaAbortCleanRUV' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )
attributeTypes: ( 2.16.840.1.113730.3.1.2111 NAME 'tombstoneNumSubordinates' DESC 'count of immediate subordinates for tombstone entries' EQUALITY integerMatch ORDERING integerOrderingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation X-ORIGIN '389 directory server' )
attributeTypes: ( 2.16.840.1.113730.3.1.2138 NAME 'nsslapd-readonly' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )
-attributeTypes: ( 2.16.840.1.113730.3.1.2142 NAME 'nsslapd-sasl-mapping-fallback' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )
+attributeTypes: ( 2.16.840.1.113730.3.1.2143 NAME 'nsslapd-sasl-mapping-fallback' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )
#
# objectclasses
#
| 0 |
40d1844a21406444a010994e4745027e3fd92133
|
389ds/389-ds-base
|
Add password change extended operation support.
|
commit 40d1844a21406444a010994e4745027e3fd92133
Author: David Boreham <[email protected]>
Date: Fri Jan 28 20:20:04 2005 +0000
Add password change extended operation support.
diff --git a/ldap/servers/slapd/Makefile b/ldap/servers/slapd/Makefile
index 6935ac300..dc342de79 100644
--- a/ldap/servers/slapd/Makefile
+++ b/ldap/servers/slapd/Makefile
@@ -88,7 +88,7 @@ REGULAR_SLAPD_OBJS= abandon.o bind.o \
configdse.o pw_mgmt.o auth.o \
psearch.o conntable.o \
stubs.o protect_db.o fileio.o lite_entries.o \
- getopt_ext.o start_tls_extop.o
+ getopt_ext.o start_tls_extop.o passwd_extop.o
FEDSE_OBJ= fedse.o
FEDSE_SRC= fedse.c
SLAPD_OBJS= $(REGULAR_SLAPD_OBJS) $(FEDSE_OBJ)
diff --git a/ldap/servers/slapd/main.c b/ldap/servers/slapd/main.c
index b52df26d5..346444da3 100644
--- a/ldap/servers/slapd/main.c
+++ b/ldap/servers/slapd/main.c
@@ -1015,12 +1015,17 @@ main( int argc, char **argv)
/* --ugaston: register the start-tls plugin */
#ifndef _WIN32
if ( slapd_security_library_is_initialized() != 0 ) {
+
+
start_tls_register_plugin();
LDAPDebug( LDAP_DEBUG_PLUGIN,
"Start TLS plugin registered.\n",
0, 0, 0 );
}
#endif
+ passwd_modify_register_plugin();
+ LDAPDebug( LDAP_DEBUG_PLUGIN,
+ "Password Modify plugin registered.\n", 0, 0, 0 );
plugin_startall(argc, argv, 1 /* Start Backends */, 1 /* Start Globals */);
if (housekeeping_start((time_t)0, NULL) == NULL) {
@@ -1246,12 +1251,13 @@ process_command_line(int argc, char **argv, char *myname,
{"encrypt",ArgOptional,'E'},
{0,0,0}};
- char *opts_archive2db = "vd:i:a:SD:";
+ char *opts_archive2db = "vd:i:a:n:SD:";
struct opt_ext long_options_archive2db[] = {
{"version",ArgNone,'v'},
{"debug",ArgRequired,'d'},
{"pidfile",ArgRequired,'i'},
{"archive",ArgRequired,'a'},
+ {"backEndInstName",ArgRequired,'n'},
{"allowMultipleProcesses",ArgNone,'S'},
{"instanceDir",ArgRequired,'D'},
{0,0,0}};
@@ -1486,10 +1492,11 @@ process_command_line(int argc, char **argv, char *myname,
case 'w': /* set startup pid file */
start_pid_file = rel2abspath( optarg_ext );
break;
- case 'n': /* which backend to do ldif2db for */
+ case 'n': /* which backend to do ldif2db/bak2db for */
if (slapd_exemode == SLAPD_EXEMODE_LDIF2DB ||
slapd_exemode == SLAPD_EXEMODE_DBTEST ||
- slapd_exemode == SLAPD_EXEMODE_DB2INDEX) {
+ slapd_exemode == SLAPD_EXEMODE_DB2INDEX ||
+ slapd_exemode == SLAPD_EXEMODE_ARCHIVE2DB) {
/* The -n argument will give the name of a backend instance. */
cmd_line_instance_name = optarg_ext;
} else if (slapd_exemode == SLAPD_EXEMODE_DB2LDIF) {
diff --git a/ldap/servers/slapd/modify.c b/ldap/servers/slapd/modify.c
index 56c4de7cc..862377583 100644
--- a/ldap/servers/slapd/modify.c
+++ b/ldap/servers/slapd/modify.c
@@ -90,17 +90,15 @@ do_modify( Slapi_PBlock *pb )
int err;
int pw_change = 0; /* 0= no password change */
int ignored_some_mods = 0;
+ int has_password_mod = 0; /* number of password mods */
char *old_pw = NULL; /* remember the old password */
char *dn;
- LDAPControl **ctrlp = NULL;
LDAPDebug( LDAP_DEBUG_TRACE, "do_modify\n", 0, 0, 0 );
slapi_pblock_get( pb, SLAPI_OPERATION, &operation);
ber = operation->o_ber;
- slapi_pblock_get(pb, SLAPI_REQCONTROLS, &ctrlp);
-
/* count the modify request */
PR_AtomicIncrement(g_get_global_snmp_vars()->ops_tbl.dsModifyEntryOps);
@@ -217,47 +215,45 @@ do_modify( Slapi_PBlock *pb )
/* check for password change */
if ( mod->mod_bvalues != NULL &&
strcasecmp( mod->mod_type, SLAPI_USERPWD_ATTR ) == 0 ){
- if ( (err = get_ldapmessage_controls( pb, ber, NULL )) != 0 ) {
- op_shared_log_error_access (pb, "MOD", dn, "failed to decode LDAP controls");
- send_ldap_result( pb, err, NULL, NULL, 0, NULL );
- goto free_and_return;
- }
- pw_change = op_shared_allow_pw_change (pb, mod, &old_pw);
- if (pw_change == -1)
- {
- ber_bvecfree(mod->mod_bvalues);
- slapi_ch_free((void **)&(mod->mod_type));
- slapi_ch_free((void **)&mod);
- goto free_and_return;
- }
+ has_password_mod++;
}
mod->mod_op |= LDAP_MOD_BVALUES;
slapi_mods_add_ldapmod (&smods, mod);
}
- if ( tag == LBER_ERROR && !ctrlp )
+ /* check for decoding error */
+ if ( tag == LBER_ERROR )
{
op_shared_log_error_access (pb, "MOD", dn, "decoding error");
send_ldap_result( pb, LDAP_PROTOCOL_ERROR, NULL, "decoding error", 0, NULL );
goto free_and_return;
}
- if ( slapi_mods_get_num_mods (&smods) == 0 )
+ /* decode the optional controls - put them in the pblock */
+ if ( (err = get_ldapmessage_controls( pb, ber, NULL )) != 0 )
{
- int lderr;
- char *emsg;
+ op_shared_log_error_access (pb, "MOD", dn, "failed to decode LDAP controls");
+ send_ldap_result( pb, err, NULL, NULL, 0, NULL );
+ goto free_and_return;
+ }
- if ( ignored_some_mods ) {
- lderr = LDAP_UNWILLING_TO_PERFORM;
- emsg = "no modifiable attributes specified";
- } else {
- lderr = LDAP_PROTOCOL_ERROR;
- emsg = "no modifications specified";
+ /* if there are any password mods, see if they are allowed */
+ if (has_password_mod) {
+ /* iterate through the mods looking for password mods */
+ for (mod = slapi_mods_get_first_mod(&smods);
+ mod;
+ mod = slapi_mods_get_next_mod(&smods)) {
+ if ( mod->mod_bvalues != NULL &&
+ strcasecmp( mod->mod_type, SLAPI_USERPWD_ATTR ) == 0 ) {
+ /* assumes controls have already been decoded and placed
+ in the pblock */
+ pw_change = op_shared_allow_pw_change (pb, mod, &old_pw);
+ if (pw_change == -1) {
+ goto free_and_return;
+ }
+ }
}
- op_shared_log_error_access (pb, "MOD", dn, emsg);
- send_ldap_result( pb, lderr, NULL, emsg, 0, NULL );
- goto free_and_return;
}
if (!pb->pb_conn->c_isreplication_session &&
@@ -269,19 +265,23 @@ do_modify( Slapi_PBlock *pb )
goto free_and_return;
}
- /*
- * in LDAPv3 there can be optional control extensions on
- * the end of an LDAPMessage. we need to read them in and
- * pass them to the backend.
- */
- if ( !ctrlp ) {
- if ( (err = get_ldapmessage_controls( pb, ber, NULL )) != 0 )
+ /* see if there were actually any mods to perform */
+ if ( slapi_mods_get_num_mods (&smods) == 0 )
{
- op_shared_log_error_access (pb, "MOD", dn, "failed to decode LDAP controls");
- send_ldap_result( pb, err, NULL, NULL, 0, NULL );
+ int lderr;
+ char *emsg;
+
+ if ( ignored_some_mods ) {
+ lderr = LDAP_UNWILLING_TO_PERFORM;
+ emsg = "no modifiable attributes specified";
+ } else {
+ lderr = LDAP_PROTOCOL_ERROR;
+ emsg = "no modifications specified";
+ }
+ op_shared_log_error_access (pb, "MOD", dn, emsg);
+ send_ldap_result( pb, lderr, NULL, emsg, 0, NULL );
goto free_and_return;
}
- }
#ifdef LDAP_DEBUG
LDAPDebug( LDAP_DEBUG_ARGS, "modifications:\n", 0, 0, 0 );
@@ -441,8 +441,7 @@ static int modify_internal_pb (Slapi_PBlock *pb)
pw_change = op_shared_allow_pw_change (pb, *mod, &old_pw);
if (pw_change == -1)
{
- opresult = LDAP_PARAM_ERROR;
- slapi_pblock_set(pb, SLAPI_PLUGIN_INTOP_RESULT, &opresult);
+ /* The internal result code will already have been set by op_shared_allow_pw_change() */
return 0;
}
}
diff --git a/ldap/servers/slapd/passwd_extop.c b/ldap/servers/slapd/passwd_extop.c
new file mode 100644
index 000000000..c4412746f
--- /dev/null
+++ b/ldap/servers/slapd/passwd_extop.c
@@ -0,0 +1,516 @@
+/** BEGIN COPYRIGHT BLOCK
+ * Copyright 2004 Netscape Communications Corporation.
+ * All rights reserved.
+ * END COPYRIGHT BLOCK **/
+/*
+ * Password Modify - LDAP Extended Operation.
+ * RFC 3062
+ *
+ *
+ * This plugin implements the "Password Modify - LDAP3"
+ * extended operation for LDAP. The plugin function is called by
+ * the server if an LDAP client request contains the OID:
+ * "1.3.6.1.4.1.4203.1.11.1".
+ *
+ */
+
+#include <stdio.h>
+#include <string.h>
+#include <private/pprio.h>
+
+
+#include <prio.h>
+#include <ssl.h>
+#include "slap.h"
+#include "slapi-plugin.h"
+#include "fe.h"
+
+/* Type of connection for this operation;*/
+#define LDAP_EXTOP_PASSMOD_CONN_SECURE
+
+/* Uncomment the following line FOR TESTING: allows non-SSL connections to use the password change extended op */
+/* #undef LDAP_EXTOP_PASSMOD_CONN_SECURE */
+
+/* ber tags for the PasswdModifyRequestValue sequence */
+#define LDAP_EXTOP_PASSMOD_TAG_USERID 0x80U
+#define LDAP_EXTOP_PASSMOD_TAG_OLDPWD 0x81U
+#define LDAP_EXTOP_PASSMOD_TAG_NEWPWD 0x82U
+
+/* OID of the extended operation handled by this plug-in */
+#define EXOP_PASSWD_OID "1.3.6.1.4.1.4203.1.11.1"
+
+
+Slapi_PluginDesc passwdopdesc = { "passwd_modify_plugin", "Netscape", "0.1",
+ "Password Modify extended operation plugin" };
+
+/* Check SLAPI_USERPWD_ATTR attribute of the directory entry
+ * return 0, if the userpassword attribute contains the given pwd value
+ * return -1, if userPassword attribute is absent for given Entry
+ * return LDAP_INVALID_CREDENTIALS,if userPassword attribute and given pwd don't match
+ */
+static int passwd_check_pwd(Slapi_Entry *targetEntry, const char *pwd){
+ int rc = LDAP_SUCCESS;
+ Slapi_Attr *attr = NULL;
+ Slapi_Value cv;
+ Slapi_Value **bvals;
+
+ LDAPDebug( LDAP_DEBUG_TRACE, "=> passwd_check_pwd\n", 0, 0, 0 );
+
+ slapi_value_init_string(&cv,pwd);
+
+ if ( (rc = slapi_entry_attr_find( targetEntry, SLAPI_USERPWD_ATTR, &attr )) == 0 )
+ { /* we have found the userPassword attribute and it has some value */
+ bvals = attr_get_present_values( attr );
+ if ( slapi_pw_find_sv( bvals, &cv ) != 0 )
+ {
+ rc = LDAP_INVALID_CREDENTIALS;
+ }
+ }
+
+ value_done(&cv);
+ LDAPDebug( LDAP_DEBUG_TRACE, "<= passwd_check_pwd: %d\n", rc, 0, 0 );
+
+ /* if the userPassword attribute is absent then rc is -1 */
+ return rc;
+}
+
+
+/* Searches the dn in directory,
+ * If found : fills in slapi_entry structure and returns 0
+ * If NOT found : returns the search result as LDAP_NO_SUCH_OBJECT
+ */
+static int
+passwd_modify_getEntry( const char *dn, Slapi_Entry **e2 ) {
+ int search_result = 0;
+ Slapi_DN sdn;
+ LDAPDebug( LDAP_DEBUG_TRACE, "=> passwd_modify_getEntry\n", 0, 0, 0 );
+ slapi_sdn_init_dn_byref( &sdn, dn );
+ if ((search_result = slapi_search_internal_get_entry( &sdn, NULL, e2,
+ plugin_get_default_component_id())) != LDAP_SUCCESS ){
+ LDAPDebug (LDAP_DEBUG_TRACE, "passwd_modify_getEntry: No such entry-(%s), err (%d)\n",
+ dn, search_result, 0);
+ }
+
+ slapi_sdn_done( &sdn );
+ LDAPDebug( LDAP_DEBUG_TRACE, "<= passwd_modify_getEntry: %d\n", search_result, 0, 0 );
+ return search_result;
+}
+
+
+/* Construct Mods pblock and perform the modify operation
+ * Sets result of operation in SLAPI_PLUGIN_INTOP_RESULT
+ */
+static int passwd_apply_mods(const char *dn, Slapi_Mods *mods)
+{
+ Slapi_PBlock pb;
+ Slapi_Operation *operation= NULL;
+ int ret=0;
+
+ LDAPDebug( LDAP_DEBUG_TRACE, "=> passwd_apply_mods\n", 0, 0, 0 );
+
+ if (mods && (slapi_mods_get_num_mods(mods) > 0))
+ {
+ pblock_init(&pb);
+ slapi_modify_internal_set_pb (&pb, dn,
+ slapi_mods_get_ldapmods_byref(mods),
+ NULL, /* Controls */
+ NULL, /* UniqueID */
+ pw_get_componentID(), /* PluginID */
+ 0); /* Flags */
+
+ /* Plugin operations are INTERNAL by default, bypass it to enforce ACL checks */
+ slapi_pblock_get (&pb, SLAPI_OPERATION, &operation);
+
+ ret =slapi_modify_internal_pb (&pb);
+
+ slapi_pblock_get(&pb, SLAPI_PLUGIN_INTOP_RESULT, &ret);
+
+ if (ret != LDAP_SUCCESS){
+ LDAPDebug(LDAP_DEBUG_TRACE, "WARNING: passwordPolicy modify error %d on entry '%s'\n",
+ ret, dn, 0);
+ }
+
+ pblock_done(&pb);
+ }
+
+ LDAPDebug( LDAP_DEBUG_TRACE, "<= passwd_apply_mods: %d\n", ret, 0, 0 );
+
+ return ret;
+}
+
+
+
+/* Modify the userPassword attribute field of the entry */
+static int passwd_modify_userpassword(Slapi_Entry *targetEntry, const char *newPasswd)
+{
+ char *dn = NULL;
+ int ret = 0;
+ Slapi_Mods smods;
+
+ LDAPDebug( LDAP_DEBUG_TRACE, "=> passwd_modify_userpassword\n", 0, 0, 0 );
+
+ slapi_mods_init (&smods, 0);
+ dn = slapi_entry_get_ndn( targetEntry );
+ slapi_mods_add_string(&smods, LDAP_MOD_REPLACE, SLAPI_USERPWD_ATTR, newPasswd);
+
+
+ ret = passwd_apply_mods(dn, &smods);
+
+ slapi_mods_done(&smods);
+
+ LDAPDebug( LDAP_DEBUG_TRACE, "<= passwd_modify_userpassword: %d\n", ret, 0, 0 );
+
+ return ret;
+}
+
+/* Password Modify Extended operation plugin function */
+int
+passwd_modify_extop( Slapi_PBlock *pb )
+{
+ char *oid = NULL;
+ char *bindDN = NULL;
+ char *dn = NULL;
+ char *oldPasswd = NULL;
+ char *newPasswd = NULL;
+ char *errMesg = NULL;
+ char **reqvals = NULL;
+ int ret=0, rc=0;
+ unsigned long tag=0, len=-1;
+ LDAPControl **ctrlp = NULL; /* unused */
+ Slapi_Operation *operation = NULL; /* unused */
+ struct berval *extop_value = NULL;
+ BerElement *ber = NULL;
+ Slapi_Entry *targetEntry=NULL;
+ Connection *conn = NULL;
+ /* Slapi_DN sdn; */
+
+ LDAPDebug( LDAP_DEBUG_TRACE, "=> passwd_modify_extop\n", 0, 0, 0 );
+ /* Get the pb ready for sending Password Modify Extended Responses back to the client.
+ * The only requirement is to set the LDAP OID of the extended response to the EXOP_PASSWD_OID. */
+
+ if ( slapi_pblock_set( pb, SLAPI_EXT_OP_RET_OID, EXOP_PASSWD_OID ) != 0 ) {
+ errMesg = "Could not set extended response oid.\n";
+ rc = LDAP_OPERATIONS_ERROR;
+ slapi_log_error( SLAPI_LOG_PLUGIN, "passwd_modify_extop",
+ errMesg );
+ goto free_and_return;
+ }
+
+ /* Before going any further, we'll make sure that the right extended operation plugin
+ * has been called: i.e., the OID shipped whithin the extended operation request must
+ * match this very plugin's OID: EXOP_PASSWD_OID. */
+ if ( slapi_pblock_get( pb, SLAPI_EXT_OP_REQ_OID, &oid ) != 0 ) {
+ errMesg = "Could not get OID value from request.\n";
+ rc = LDAP_OPERATIONS_ERROR;
+ slapi_log_error( SLAPI_LOG_PLUGIN, "passwd_modify_extop",
+ errMesg );
+ goto free_and_return;
+ } else {
+ slapi_log_error( SLAPI_LOG_PLUGIN, "passwd_modify_extop",
+ "Received extended operation request with OID %s\n", oid );
+ }
+
+ if ( strcasecmp( oid, EXOP_PASSWD_OID ) != 0) {
+ errMesg = "Request OID does not match Passwd OID.\n";
+ rc = LDAP_OPERATIONS_ERROR;
+ goto free_and_return;
+ } else {
+ slapi_log_error( SLAPI_LOG_PLUGIN, "passwd_modify_extop",
+ "Password Modify extended operation request confirmed.\n" );
+ }
+
+ /* Now , at least we know that the request was indeed a Password Modify one. */
+
+#ifdef LDAP_EXTOP_PASSMOD_CONN_SECURE
+ /* Allow password modify only for SSL/TLS established connections */
+ conn = pb->pb_conn;
+ if ( (conn->c_flags & CONN_FLAG_SSL) != CONN_FLAG_SSL) {
+ errMesg = "Operation requires a secure connection.\n";
+ rc = LDAP_CONFIDENTIALITY_REQUIRED;
+ goto free_and_return;
+ }
+#endif
+
+ /* Get the ber value of the extended operation */
+ slapi_pblock_get(pb, SLAPI_EXT_OP_REQ_VALUE, &extop_value);
+
+ if ((ber = ber_init(extop_value)) == NULL)
+ {
+ errMesg = "PasswdModify Request decode failed.\n";
+ rc = LDAP_PROTOCOL_ERROR;
+ goto free_and_return;
+ }
+
+ /* Format of request to parse
+ *
+ * PasswdModifyRequestValue ::= SEQUENCE {
+ * userIdentity [0] OCTET STRING OPTIONAL
+ * oldPasswd [1] OCTET STRING OPTIONAL
+ * newPasswd [2] OCTET STRING OPTIONAL }
+ */
+ slapi_pblock_get(pb, SLAPI_EXT_OP_REQ_VALUE, &extop_value);
+
+ /* ber parse code */
+ if ( ber_scanf( ber, "{") == LBER_ERROR )
+ {
+ LDAPDebug( LDAP_DEBUG_ANY,
+ "ber_scanf failed :{\n", 0, 0, 0 );
+ errMesg = "ber_scanf failed\n";
+ rc = LDAP_PROTOCOL_ERROR;
+ goto free_and_return;
+ } else {
+ tag = ber_peek_tag( ber, &len);
+ }
+
+
+ /* identify userID field by tags */
+ if (tag == LDAP_EXTOP_PASSMOD_TAG_USERID )
+ {
+ if ( ber_scanf( ber, "a", &dn) == LBER_ERROR )
+ {
+ LDAPDebug( LDAP_DEBUG_ANY,
+ "ber_scanf failed :{\n", 0, 0, 0 );
+ errMesg = "ber_scanf failed at userID parse.\n";
+ rc = LDAP_PROTOCOL_ERROR;
+ goto free_and_return;
+ }
+
+ tag = ber_peek_tag( ber, &len);
+ }
+
+
+ /* identify oldPasswd field by tags */
+ if (tag == LDAP_EXTOP_PASSMOD_TAG_OLDPWD )
+ {
+ if ( ber_scanf( ber, "a", &oldPasswd ) == LBER_ERROR )
+ {
+ LDAPDebug( LDAP_DEBUG_ANY,
+ "ber_scanf failed :{\n", 0, 0, 0 );
+ errMesg = "ber_scanf failed at oldPasswd parse.\n";
+ rc = LDAP_PROTOCOL_ERROR;
+ goto free_and_return;
+ }
+ tag = ber_peek_tag( ber, &len);
+ } else {
+ errMesg = "Current passwd must be supplied by the user.\n";
+ rc = LDAP_PARAM_ERROR;
+ goto free_and_return;
+ }
+
+ /* identify newPasswd field by tags */
+ if (tag == LDAP_EXTOP_PASSMOD_TAG_NEWPWD )
+ {
+ if ( ber_scanf( ber, "a", &newPasswd ) == LBER_ERROR )
+ {
+ LDAPDebug( LDAP_DEBUG_ANY,
+ "ber_scanf failed :{\n", 0, 0, 0 );
+ errMesg = "ber_scanf failed at newPasswd parse.\n";
+ rc = LDAP_PROTOCOL_ERROR;
+ goto free_and_return;
+ }
+ } else {
+ errMesg = "New passwd must be supplied by the user.\n";
+ rc = LDAP_PARAM_ERROR;
+ goto free_and_return;
+ }
+
+ /* Uncomment for debugging, otherwise we don't want to leak the password values into the log... */
+ /* LDAPDebug( LDAP_DEBUG_ARGS, "passwd: dn (%s), oldPasswd (%s) ,newPasswd (%s)\n",
+ dn, oldPasswd, newPasswd); */
+
+
+ if (oldPasswd == NULL || *oldPasswd == '\0') {
+ /* Refuse to handle this operation because current password is not provided */
+ errMesg = "Current passwd must be supplied by the user.\n";
+ rc = LDAP_PARAM_ERROR;
+ goto free_and_return;
+ }
+
+ /* We don't implement password generation, so if the request implies
+ * that they asked us to do that, we must refuse to process it */
+ if (newPasswd == NULL || *newPasswd == '\0') {
+ /* Refuse to handle this operation because we don't allow password generation */
+ errMesg = "New passwd must be supplied by the user.\n";
+ rc = LDAP_PARAM_ERROR;
+ goto free_and_return;
+ }
+
+ /* Get Bind DN */
+ slapi_pblock_get( pb, SLAPI_CONN_DN, &bindDN );
+
+ /* If the connection is bound anonymously, we must refuse to process this operation. */
+ if (bindDN == NULL || *bindDN == '\0') {
+ /* Refuse the operation because they're bound anonymously */
+ errMesg = "Anonymous Binds are not allowed.\n";
+ rc = LDAP_INSUFFICIENT_ACCESS;
+ goto free_and_return;
+ }
+
+ /* Determine the target DN for this operation */
+ /* Did they give us a DN ? */
+ if (dn == NULL || *dn == '\0') {
+ /* Get the DN from the bind identity on this connection */
+ dn = bindDN;
+ LDAPDebug( LDAP_DEBUG_ANY,
+ "Missing userIdentity in request, using the bind DN instead.\n",
+ 0, 0, 0 );
+ }
+
+ slapi_pblock_set( pb, SLAPI_ORIGINAL_TARGET, dn );
+
+ /* Now we have the DN, look for the entry */
+ ret = passwd_modify_getEntry(dn, &targetEntry);
+ /* If we can't find the entry, then that's an error */
+ if (ret) {
+ /* Couldn't find the entry, fail */
+ errMesg = "No such Entry exists.\n" ;
+ rc = LDAP_NO_SUCH_OBJECT ;
+ goto free_and_return;
+ }
+
+ /* First thing to do is to ask access control if the bound identity has
+ rights to modify the userpassword attribute on this entry. If not, then
+ we fail immediately with insufficient access. This means that we don't
+ leak any useful information to the client such as current password
+ wrong, etc.
+ */
+
+ operation_set_target_spec (pb->pb_op, slapi_entry_get_sdn(targetEntry));
+ slapi_pblock_set( pb, SLAPI_REQUESTOR_ISROOT, &pb->pb_op->o_isroot );
+
+ /* In order to perform the access control check , we need to select a backend (even though
+ * we don't actually need it otherwise).
+ */
+ {
+ Slapi_Backend *be = NULL;
+
+ be = slapi_mapping_tree_find_backend_for_sdn(slapi_entry_get_sdn(targetEntry));
+ if (NULL == be) {
+ errMesg = "Failed to find backend for target entry";
+ rc = LDAP_OPERATIONS_ERROR;
+ goto free_and_return;
+ }
+ slapi_pblock_set(pb, SLAPI_BACKEND, be);
+ }
+
+ ret = slapi_access_allowed ( pb, targetEntry, SLAPI_USERPWD_ATTR, NULL, SLAPI_ACL_WRITE );
+ if ( ret != LDAP_SUCCESS ) {
+ errMesg = "Insufficient access rights\n";
+ rc = LDAP_INSUFFICIENT_ACCESS;
+ goto free_and_return;
+ }
+
+ /* Now we have the entry which we want to modify
+ * They gave us a password (old), check it against the target entry
+ * Is the old password valid ?
+ */
+ ret = passwd_check_pwd(targetEntry, oldPasswd);
+ if (ret) {
+ /* No, then we fail this operation */
+ errMesg = "Invalid oldPasswd value.\n";
+ rc = ret;
+ goto free_and_return;
+ }
+
+
+ /* Now we're ready to make actual password change */
+ ret = passwd_modify_userpassword(targetEntry, newPasswd);
+ if (ret != LDAP_SUCCESS) {
+ /* Failed to modify the password, e.g. because insufficient access allowed */
+ errMesg = "Failed to update password\n";
+ rc = ret;
+ goto free_and_return;
+ }
+
+ LDAPDebug( LDAP_DEBUG_TRACE, "<= passwd_modify_extop: %d\n", rc, 0, 0 );
+
+ /* Free anything that we allocated above */
+ free_and_return:
+
+ if ( targetEntry != NULL ){
+ slapi_entry_free (targetEntry);
+ }
+
+ if ( ber != NULL ){
+ ber_free(ber, 1);
+ ber = NULL;
+ }
+
+
+ slapi_log_error( SLAPI_LOG_PLUGIN, "passwd_modify_extop",
+ errMesg );
+ send_ldap_result( pb, rc, NULL, errMesg, 0, NULL );
+
+
+ return( SLAPI_PLUGIN_EXTENDED_SENT_RESULT );
+
+}/* passwd_modify_extop */
+
+
+static char *passwd_oid_list[] = {
+ EXOP_PASSWD_OID,
+ NULL
+};
+
+
+static char *passwd_name_list[] = {
+ "passwd_modify_extop",
+ NULL
+};
+
+
+/* Initialization function */
+int passwd_modify_init( Slapi_PBlock *pb )
+{
+ char **argv;
+ char *oid;
+
+ /* Get the arguments appended to the plugin extendedop directive. The first argument
+ * (after the standard arguments for the directive) should contain the OID of the
+ * extended operation.
+ */
+
+ if ( slapi_pblock_get( pb, SLAPI_PLUGIN_ARGV, &argv ) != 0 ) {
+ slapi_log_error( SLAPI_LOG_PLUGIN, "passwd_modify_init", "Could not get argv\n" );
+ return( -1 );
+ }
+
+ /* Compare the OID specified in the configuration file against the Passwd OID. */
+
+ if ( argv == NULL || strcmp( argv[0], EXOP_PASSWD_OID ) != 0 ) {
+ slapi_log_error( SLAPI_LOG_PLUGIN, "passwd_modify_init",
+ "OID is missing or is not %s\n", EXOP_PASSWD_OID );
+ return( -1 );
+ } else {
+ oid = slapi_ch_strdup( argv[0] );
+ slapi_log_error( SLAPI_LOG_PLUGIN, "passwd_modify_init",
+ "Registering plug-in for Password Modify extended op %s.\n", oid );
+ }
+
+ /* Register the plug-in function as an extended operation
+ * plug-in function that handles the operation identified by
+ * OID 1.3.6.1.4.1.4203.1.11.1 . Also specify the version of the server
+ * plug-in */
+ if ( slapi_pblock_set( pb, SLAPI_PLUGIN_VERSION, SLAPI_PLUGIN_VERSION_01 ) != 0 ||
+ slapi_pblock_set( pb, SLAPI_PLUGIN_DESCRIPTION, (void *)&passwdopdesc ) != 0 ||
+ slapi_pblock_set( pb, SLAPI_PLUGIN_EXT_OP_FN, (void *) passwd_modify_extop ) != 0 ||
+ slapi_pblock_set( pb, SLAPI_PLUGIN_EXT_OP_OIDLIST, passwd_oid_list ) != 0 ||
+ slapi_pblock_set( pb, SLAPI_PLUGIN_EXT_OP_NAMELIST, passwd_name_list ) != 0 ) {
+
+ slapi_log_error( SLAPI_LOG_PLUGIN, "passwd_modify_init",
+ "Failed to set plug-in version, function, and OID.\n" );
+ return( -1 );
+ }
+
+ return( 0 );
+}
+
+int passwd_modify_register_plugin()
+{
+ slapi_register_plugin( "extendedop", 1 /* Enabled */, "passwd_modify_init",
+ passwd_modify_init, "Password Modify extended operation",
+ passwd_oid_list, NULL );
+
+ return 0;
+}
+
| 0 |
04db8690269986272dd477ca8ca880357a487235
|
389ds/389-ds-base
|
Issue 5260 - BUG - OpenLDAP allows multiple names of memberof overlay (#5261)
Bug Description: Openldap allowed multiple names of the memberof overlay
which mean that in some cases we wouldn't migrate the plugin.
Fix Description: Accept both objectclass names.
fixes: https://github.com/389ds/389-ds-base/issues/5260
Author: William Brown <[email protected]>
Review by: @droideck
|
commit 04db8690269986272dd477ca8ca880357a487235
Author: Firstyear <[email protected]>
Date: Wed Apr 13 11:57:39 2022 +1000
Issue 5260 - BUG - OpenLDAP allows multiple names of memberof overlay (#5261)
Bug Description: Openldap allowed multiple names of the memberof overlay
which mean that in some cases we wouldn't migrate the plugin.
Fix Description: Accept both objectclass names.
fixes: https://github.com/389ds/389-ds-base/issues/5260
Author: William Brown <[email protected]>
Review by: @droideck
diff --git a/dirsrvtests/tests/data/openldap_2_389/memberof/openldap_to_389ds-db.ldif b/dirsrvtests/tests/data/openldap_2_389/memberof/openldap_to_389ds-db.ldif
new file mode 100644
index 000000000..e9d670d93
--- /dev/null
+++ b/dirsrvtests/tests/data/openldap_2_389/memberof/openldap_to_389ds-db.ldif
@@ -0,0 +1,73 @@
+# base
+dn: dc=ldapdom,dc=net
+dc: ldapdom
+objectClass: top
+objectClass: domain
+
+dn: ou=UnixUser,dc=ldapdom,dc=net
+ou: People
+objectClass: top
+objectClass: organizationalUnit
+
+dn: ou=UnixGroup,dc=ldapdom,dc=net
+ou: Group
+objectClass: top
+objectClass: organizationalUnit
+
+# users
+dn: uid=testuser1,ou=UnixUser,dc=ldapdom,dc=net
+objectClass: account
+objectClass: posixAccount
+objectClass: top
+objectClass: shadowAccount
+uid: testuser1
+cn: testuser1
+userPassword: {crypt}$6$7syqq.EQ$68iOWF0BTWC24aKE0rJ8cUtPd2Cs7HkruwjEikcJAD5dNNEgMMJ5Jk7w2sC2hYUwN2s65srTQTU83ADt2.t4l0
+loginShell: /bin/bash
+uidNumber: 9000
+gidNumber: 8000
+homeDirectory: /tmp
+
+dn: uid=testuser2,ou=UnixUser,dc=ldapdom,dc=net
+objectClass: account
+objectClass: posixAccount
+objectClass: top
+objectClass: shadowAccount
+uid: testuser2
+cn: testuser2
+userPassword: {crypt}$6$7syqq.EQ$68iOWF0BTWC24aKE0rJ8cUtPd2Cs7HkruwjEikcJAD5dNNEgMMJ5Jk7w2sC2hYUwN2s65srTQTU83ADt2.t4l0
+loginShell: /bin/bash
+uidNumber: 9001
+gidNumber: 8000
+homeDirectory: /tmp
+
+# groups
+dn: cn=group1,ou=UnixGroup,dc=ldapdom,dc=net
+objectClass: groupOfNames
+objectClass: posixGroup
+objectClass: top
+cn: group1
+gidNumber: 8000
+member: uid=testuser1,ou=UnixUser,dc=ldapdom,dc=net
+memberUid: 9000
+member: uid=testuser2,ou=UnixUser,dc=ldapdom,dc=net
+memberUid: 9001
+
+dn: cn=group2,ou=UnixGroup,dc=ldapdom,dc=net
+objectClass: groupOfNames
+objectClass: posixGroup
+objectClass: top
+cn: group2
+gidNumber: 8001
+member: uid=testuser1,ou=UnixUser,dc=ldapdom,dc=net
+memberUid: 9000
+
+dn: cn=group3,ou=UnixGroup,dc=ldapdom,dc=net
+objectClass: groupOfNames
+objectClass: posixGroup
+objectClass: top
+cn: group3
+gidNumber: 8002
+member: uid=testuser2,ou=UnixUser,dc=ldapdom,dc=net
+memberUid: 9001
+
diff --git a/dirsrvtests/tests/data/openldap_2_389/memberof/openldap_to_389ds-slapd.conf b/dirsrvtests/tests/data/openldap_2_389/memberof/openldap_to_389ds-slapd.conf
new file mode 100644
index 000000000..f5b0fb1b6
--- /dev/null
+++ b/dirsrvtests/tests/data/openldap_2_389/memberof/openldap_to_389ds-slapd.conf
@@ -0,0 +1,42 @@
+include /etc/openldap/schema/core.schema
+include /etc/openldap/schema/cosine.schema
+include /etc/openldap/schema/inetorgperson.schema
+include /etc/openldap/schema/rfc2307bis.schema
+include /etc/openldap/schema/yast.schema
+
+access to dn.base=""
+ by * read
+
+access to dn.base="cn=Subschema"
+ by * read
+
+access to attrs=userPassword,userPKCS12
+ by self write
+ by * auth
+
+access to attrs=shadowLastChange
+ by self write
+ by * read
+
+access to *
+ by * read
+
+moduleload back_mdb.la
+moduleload memberof.la
+moduleload refint.la
+moduleload unique.la
+
+database mdb
+suffix "dc=ldapdom,dc=net"
+checkpoint 1024 5
+rootdn "cn=root,dc=ldapdom,dc=net"
+rootpw pass
+directory /tmp/ldap-sssdtest
+index objectClass eq
+
+overlay memberof
+overlay unique
+unique_uri ldap:///?mail?sub?
+overlay refint
+refint_attributes member
+refint_nothing "cn=admin,dc=example,dc=com"
diff --git a/dirsrvtests/tests/data/openldap_2_389/memberof/slapd.d/cn=config.ldif b/dirsrvtests/tests/data/openldap_2_389/memberof/slapd.d/cn=config.ldif
new file mode 100755
index 000000000..cf47b14a3
--- /dev/null
+++ b/dirsrvtests/tests/data/openldap_2_389/memberof/slapd.d/cn=config.ldif
@@ -0,0 +1,43 @@
+# AUTO-GENERATED FILE - DO NOT EDIT!! Use ldapmodify.
+# CRC32 fc127e60
+dn: cn=config
+objectClass: olcGlobal
+cn: config
+olcConfigFile: ./openldap_to_389ds-slapd.conf
+olcConfigDir: slapd.d
+olcAttributeOptions: lang-
+olcAuthzPolicy: none
+olcConcurrency: 0
+olcConnMaxPending: 100
+olcConnMaxPendingAuth: 1000
+olcGentleHUP: FALSE
+olcIdleTimeout: 0
+olcIndexSubstrIfMaxLen: 4
+olcIndexSubstrIfMinLen: 2
+olcIndexSubstrAnyLen: 4
+olcIndexSubstrAnyStep: 2
+olcIndexHash64: FALSE
+olcIndexIntLen: 4
+olcListenerThreads: 1
+olcLocalSSF: 71
+olcLogLevel: 0
+olcMaxFilterDepth: 1000
+olcReadOnly: FALSE
+olcSaslAuxpropsDontUseCopyIgnore: FALSE
+olcSaslSecProps: noplain,noanonymous
+olcSockbufMaxIncoming: 262143
+olcSockbufMaxIncomingAuth: 16777215
+olcThreads: 16
+olcThreadQueues: 1
+olcTLSCRLCheck: none
+olcTLSVerifyClient: never
+olcTLSProtocolMin: 0.0
+olcToolThreads: 1
+olcWriteTimeout: 0
+structuralObjectClass: olcGlobal
+entryUUID: bae01acc-4e5c-103c-8e3b-83bde8bbc3e8
+creatorsName: cn=config
+createTimestamp: 20220412033105Z
+entryCSN: 20220412033105.684579Z#000000#000#000000
+modifiersName: cn=config
+modifyTimestamp: 20220412033105Z
diff --git a/dirsrvtests/tests/data/openldap_2_389/memberof/slapd.d/cn=config/cn=module{0}.ldif b/dirsrvtests/tests/data/openldap_2_389/memberof/slapd.d/cn=config/cn=module{0}.ldif
new file mode 100755
index 000000000..f25ded4a3
--- /dev/null
+++ b/dirsrvtests/tests/data/openldap_2_389/memberof/slapd.d/cn=config/cn=module{0}.ldif
@@ -0,0 +1,16 @@
+# AUTO-GENERATED FILE - DO NOT EDIT!! Use ldapmodify.
+# CRC32 ae81751d
+dn: cn=module{0}
+objectClass: olcModuleList
+cn: module{0}
+olcModuleLoad: {0}back_mdb.la
+olcModuleLoad: {1}memberof.la
+olcModuleLoad: {2}refint.la
+olcModuleLoad: {3}unique.la
+structuralObjectClass: olcModuleList
+entryUUID: bae020f8-4e5c-103c-8e3c-83bde8bbc3e8
+creatorsName: cn=config
+createTimestamp: 20220412033105Z
+entryCSN: 20220412033105.684579Z#000000#000#000000
+modifiersName: cn=config
+modifyTimestamp: 20220412033105Z
diff --git a/dirsrvtests/tests/data/openldap_2_389/memberof/slapd.d/cn=config/cn=schema.ldif b/dirsrvtests/tests/data/openldap_2_389/memberof/slapd.d/cn=config/cn=schema.ldif
new file mode 100755
index 000000000..63bdfa3d8
--- /dev/null
+++ b/dirsrvtests/tests/data/openldap_2_389/memberof/slapd.d/cn=config/cn=schema.ldif
@@ -0,0 +1,893 @@
+# AUTO-GENERATED FILE - DO NOT EDIT!! Use ldapmodify.
+# CRC32 af042693
+dn: cn=schema
+objectClass: olcSchemaConfig
+cn: schema
+olcObjectIdentifier: OLcfg 1.3.6.1.4.1.4203.1.12.2
+olcObjectIdentifier: OLcfgAt OLcfg:3
+olcObjectIdentifier: OLcfgGlAt OLcfgAt:0
+olcObjectIdentifier: OLcfgBkAt OLcfgAt:1
+olcObjectIdentifier: OLcfgDbAt OLcfgAt:2
+olcObjectIdentifier: OLcfgOvAt OLcfgAt:3
+olcObjectIdentifier: OLcfgCtAt OLcfgAt:4
+olcObjectIdentifier: OLcfgOc OLcfg:4
+olcObjectIdentifier: OLcfgGlOc OLcfgOc:0
+olcObjectIdentifier: OLcfgBkOc OLcfgOc:1
+olcObjectIdentifier: OLcfgDbOc OLcfgOc:2
+olcObjectIdentifier: OLcfgOvOc OLcfgOc:3
+olcObjectIdentifier: OLcfgCtOc OLcfgOc:4
+olcObjectIdentifier: OMsyn 1.3.6.1.4.1.1466.115.121.1
+olcObjectIdentifier: OMsBoolean OMsyn:7
+olcObjectIdentifier: OMsDN OMsyn:12
+olcObjectIdentifier: OMsDirectoryString OMsyn:15
+olcObjectIdentifier: OMsIA5String OMsyn:26
+olcObjectIdentifier: OMsInteger OMsyn:27
+olcObjectIdentifier: OMsOID OMsyn:38
+olcObjectIdentifier: OMsOctetString OMsyn:40
+olcObjectIdentifier: olmAttributes 1.3.6.1.4.1.4203.666.1.55
+olcObjectIdentifier: olmSubSystemAttributes olmAttributes:0
+olcObjectIdentifier: olmGenericAttributes olmSubSystemAttributes:0
+olcObjectIdentifier: olmDatabaseAttributes olmSubSystemAttributes:1
+olcObjectIdentifier: olmOverlayAttributes olmSubSystemAttributes:2
+olcObjectIdentifier: olmModuleAttributes olmSubSystemAttributes:3
+olcObjectIdentifier: olmObjectClasses 1.3.6.1.4.1.4203.666.3.16
+olcObjectIdentifier: olmSubSystemObjectClasses olmObjectClasses:0
+olcObjectIdentifier: olmGenericObjectClasses olmSubSystemObjectClasses:0
+olcObjectIdentifier: olmDatabaseObjectClasses olmSubSystemObjectClasses:1
+olcObjectIdentifier: olmOverlayObjectClasses olmSubSystemObjectClasses:2
+olcObjectIdentifier: olmModuleObjectClasses olmSubSystemObjectClasses:3
+olcObjectIdentifier: olmSyncReplAttributes olmOverlayAttributes:1
+olcObjectIdentifier: olmSyncReplObjectClasses olmOverlayObjectClasses:1
+olcObjectIdentifier: olmMDBAttributes olmDatabaseAttributes:1
+olcObjectIdentifier: olmMDBObjectClasses olmDatabaseObjectClasses:1
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.1 DESC 'ACI Item' X-BINARY-TRANS
+ FER-REQUIRED 'TRUE' X-NOT-HUMAN-READABLE 'TRUE' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.2 DESC 'Access Point' X-NOT-HUMA
+ N-READABLE 'TRUE' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.3 DESC 'Attribute Type Descripti
+ on' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.4 DESC 'Audio' X-NOT-HUMAN-READA
+ BLE 'TRUE' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.5 DESC 'Binary' X-NOT-HUMAN-READ
+ ABLE 'TRUE' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.6 DESC 'Bit String' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.7 DESC 'Boolean' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.8 DESC 'Certificate' X-BINARY-TR
+ ANSFER-REQUIRED 'TRUE' X-NOT-HUMAN-READABLE 'TRUE' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.9 DESC 'Certificate List' X-BINA
+ RY-TRANSFER-REQUIRED 'TRUE' X-NOT-HUMAN-READABLE 'TRUE' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.10 DESC 'Certificate Pair' X-BIN
+ ARY-TRANSFER-REQUIRED 'TRUE' X-NOT-HUMAN-READABLE 'TRUE' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.4203.666.11.10.2.1 DESC 'X.509 AttributeCertifi
+ cate' X-BINARY-TRANSFER-REQUIRED 'TRUE' X-NOT-HUMAN-READABLE 'TRUE' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.12 DESC 'Distinguished Name' )
+olcLdapSyntaxes: ( 1.2.36.79672281.1.5.0 DESC 'RDN' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.13 DESC 'Data Quality' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.14 DESC 'Delivery Method' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.15 DESC 'Directory String' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.16 DESC 'DIT Content Rule Descri
+ ption' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.17 DESC 'DIT Structure Rule Desc
+ ription' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.19 DESC 'DSA Quality' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.20 DESC 'DSE Type' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.21 DESC 'Enhanced Guide' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.22 DESC 'Facsimile Telephone Num
+ ber' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.23 DESC 'Fax' X-NOT-HUMAN-READAB
+ LE 'TRUE' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.24 DESC 'Generalized Time' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.25 DESC 'Guide' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.26 DESC 'IA5 String' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.27 DESC 'Integer' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.28 DESC 'JPEG' X-NOT-HUMAN-READA
+ BLE 'TRUE' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.29 DESC 'Master And Shadow Acces
+ s Points' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.30 DESC 'Matching Rule Descripti
+ on' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.31 DESC 'Matching Rule Use Descr
+ iption' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.32 DESC 'Mail Preference' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.33 DESC 'MHS OR Address' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.34 DESC 'Name And Optional UID'
+ )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.35 DESC 'Name Form Description'
+ )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.36 DESC 'Numeric String' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.37 DESC 'Object Class Descriptio
+ n' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.38 DESC 'OID' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.39 DESC 'Other Mailbox' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.40 DESC 'Octet String' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.41 DESC 'Postal Address' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.42 DESC 'Protocol Information' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.43 DESC 'Presentation Address' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.44 DESC 'Printable String' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.11 DESC 'Country String' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.45 DESC 'SubtreeSpecification' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.49 DESC 'Supported Algorithm' X-
+ BINARY-TRANSFER-REQUIRED 'TRUE' X-NOT-HUMAN-READABLE 'TRUE' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.50 DESC 'Telephone Number' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.51 DESC 'Teletex Terminal Identi
+ fier' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.52 DESC 'Telex Number' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.54 DESC 'LDAP Syntax Description
+ ' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.55 DESC 'Modify Rights' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.56 DESC 'LDAP Schema Definition'
+ )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.57 DESC 'LDAP Schema Description
+ ' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.1466.115.121.1.58 DESC 'Substring Assertion' )
+olcLdapSyntaxes: ( 1.3.6.1.1.1.0.0 DESC 'RFC2307 NIS Netgroup Triple' )
+olcLdapSyntaxes: ( 1.3.6.1.1.1.0.1 DESC 'RFC2307 Boot Parameter' )
+olcLdapSyntaxes: ( 1.3.6.1.1.15.1 DESC 'Certificate Exact Assertion' )
+olcLdapSyntaxes: ( 1.3.6.1.1.15.2 DESC 'Certificate Assertion' )
+olcLdapSyntaxes: ( 1.3.6.1.1.15.3 DESC 'Certificate Pair Exact Assertion' )
+olcLdapSyntaxes: ( 1.3.6.1.1.15.4 DESC 'Certificate Pair Assertion' )
+olcLdapSyntaxes: ( 1.3.6.1.1.15.5 DESC 'Certificate List Exact Assertion' )
+olcLdapSyntaxes: ( 1.3.6.1.1.15.6 DESC 'Certificate List Assertion' )
+olcLdapSyntaxes: ( 1.3.6.1.1.15.7 DESC 'Algorithm Identifier' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.4203.666.11.10.2.2 DESC 'AttributeCertificate E
+ xact Assertion' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.4203.666.11.10.2.3 DESC 'AttributeCertificate A
+ ssertion' )
+olcLdapSyntaxes: ( 1.3.6.1.1.16.1 DESC 'UUID' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.4203.666.11.2.1 DESC 'CSN' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.4203.666.11.2.4 DESC 'CSN SID' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.4203.1.1.1 DESC 'OpenLDAP void' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.4203.666.2.7 DESC 'OpenLDAP authz' )
+olcLdapSyntaxes: ( 1.2.840.113549.1.8.1.1 DESC 'PKCS#8 PrivateKeyInfo' )
+olcLdapSyntaxes: ( 1.3.6.1.4.1.4203.666.2.1 DESC 'OpenLDAP Experimental ACI' )
+olcAttributeTypes: ( 2.5.4.0 NAME 'objectClass' DESC 'RFC4512: object classes
+ of the entity' EQUALITY objectIdentifierMatch SYNTAX 1.3.6.1.4.1.1466.115.121
+ .1.38 )
+olcAttributeTypes: ( 2.5.21.9 NAME 'structuralObjectClass' DESC 'RFC4512: stru
+ ctural object class of entry' EQUALITY objectIdentifierMatch SYNTAX 1.3.6.1.4
+ .1.1466.115.121.1.38 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperati
+ on )
+olcAttributeTypes: ( 2.5.18.1 NAME 'createTimestamp' DESC 'RFC4512: time which
+ object was created' EQUALITY generalizedTimeMatch ORDERING generalizedTimeOr
+ deringMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE NO-USER-MODIFIC
+ ATION USAGE directoryOperation )
+olcAttributeTypes: ( 2.5.18.2 NAME 'modifyTimestamp' DESC 'RFC4512: time which
+ object was last modified' EQUALITY generalizedTimeMatch ORDERING generalized
+ TimeOrderingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE NO-USER-M
+ ODIFICATION USAGE directoryOperation )
+olcAttributeTypes: ( 2.5.18.3 NAME 'creatorsName' DESC 'RFC4512: name of creat
+ or' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SING
+ LE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )
+olcAttributeTypes: ( 2.5.18.4 NAME 'modifiersName' DESC 'RFC4512: name of last
+ modifier' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.
+ 12 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )
+olcAttributeTypes: ( 2.5.18.9 NAME 'hasSubordinates' DESC 'X.501: entry has ch
+ ildren' EQUALITY booleanMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALU
+ E NO-USER-MODIFICATION USAGE directoryOperation )
+olcAttributeTypes: ( 2.5.18.10 NAME 'subschemaSubentry' DESC 'RFC4512: name of
+ controlling subschema entry' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.
+ 4.1.1466.115.121.1.12 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperat
+ ion )
+olcAttributeTypes: ( 2.5.18.12 NAME 'collectiveAttributeSubentries' DESC 'RFC3
+ 671: collective attribute subentries' EQUALITY distinguishedNameMatch SYNTAX
+ 1.3.6.1.4.1.1466.115.121.1.12 NO-USER-MODIFICATION USAGE directoryOperation )
+olcAttributeTypes: ( 2.5.18.7 NAME 'collectiveExclusions' DESC 'RFC3671: colle
+ ctive attribute exclusions' EQUALITY objectIdentifierMatch SYNTAX 1.3.6.1.4.1
+ .1466.115.121.1.38 USAGE directoryOperation )
+olcAttributeTypes: ( 1.3.6.1.1.20 NAME 'entryDN' DESC 'DN of the entry' EQUALI
+ TY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE N
+ O-USER-MODIFICATION USAGE directoryOperation )
+olcAttributeTypes: ( 1.3.6.1.1.16.4 NAME 'entryUUID' DESC 'UUID of the entry'
+ EQUALITY UUIDMatch ORDERING UUIDOrderingMatch SYNTAX 1.3.6.1.1.16.1 SINGLE-VA
+ LUE NO-USER-MODIFICATION USAGE directoryOperation )
+olcAttributeTypes: ( 1.3.6.1.4.1.4203.666.1.7 NAME 'entryCSN' DESC 'change seq
+ uence number of the entry content' EQUALITY CSNMatch ORDERING CSNOrderingMatc
+ h SYNTAX 1.3.6.1.4.1.4203.666.11.2.1{64} SINGLE-VALUE NO-USER-MODIFICATION US
+ AGE directoryOperation )
+olcAttributeTypes: ( 1.3.6.1.4.1.4203.666.1.13 NAME 'namingCSN' DESC 'change s
+ equence number of the entry naming (RDN)' EQUALITY CSNMatch ORDERING CSNOrder
+ ingMatch SYNTAX 1.3.6.1.4.1.4203.666.11.2.1{64} SINGLE-VALUE NO-USER-MODIFICA
+ TION USAGE directoryOperation )
+olcAttributeTypes: ( 1.3.6.1.4.1.4203.666.1.23 NAME 'syncreplCookie' DESC 'syn
+ crepl Cookie for shadow copy' EQUALITY octetStringMatch ORDERING octetStringO
+ rderingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 SINGLE-VALUE NO-USER-MODIFI
+ CATION USAGE dSAOperation )
+olcAttributeTypes: ( 1.3.6.1.4.1.4203.666.1.25 NAME 'contextCSN' DESC 'the lar
+ gest committed CSN of a context' EQUALITY CSNMatch ORDERING CSNOrderingMatch
+ SYNTAX 1.3.6.1.4.1.4203.666.11.2.1{64} NO-USER-MODIFICATION USAGE dSAOperatio
+ n )
+olcAttributeTypes: ( 1.3.6.1.4.1.1466.101.120.6 NAME 'altServer' DESC 'RFC4512
+ : alternative servers' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 USAGE dSAOperatio
+ n )
+olcAttributeTypes: ( 1.3.6.1.4.1.1466.101.120.5 NAME 'namingContexts' DESC 'RF
+ C4512: naming contexts' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.14
+ 66.115.121.1.12 USAGE dSAOperation )
+olcAttributeTypes: ( 1.3.6.1.4.1.1466.101.120.13 NAME 'supportedControl' DESC
+ 'RFC4512: supported controls' SYNTAX 1.3.6.1.4.1.1466.115.121.1.38 USAGE dSAO
+ peration )
+olcAttributeTypes: ( 1.3.6.1.4.1.1466.101.120.7 NAME 'supportedExtension' DESC
+ 'RFC4512: supported extended operations' SYNTAX 1.3.6.1.4.1.1466.115.121.1.3
+ 8 USAGE dSAOperation )
+olcAttributeTypes: ( 1.3.6.1.4.1.1466.101.120.15 NAME 'supportedLDAPVersion' D
+ ESC 'RFC4512: supported LDAP versions' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 U
+ SAGE dSAOperation )
+olcAttributeTypes: ( 1.3.6.1.4.1.1466.101.120.14 NAME 'supportedSASLMechanisms
+ ' DESC 'RFC4512: supported SASL mechanisms' SYNTAX 1.3.6.1.4.1.1466.115.121.1
+ .15 USAGE dSAOperation )
+olcAttributeTypes: ( 1.3.6.1.4.1.4203.1.3.5 NAME 'supportedFeatures' DESC 'RFC
+ 4512: features supported by the server' EQUALITY objectIdentifierMatch SYNTAX
+ 1.3.6.1.4.1.1466.115.121.1.38 USAGE dSAOperation )
+olcAttributeTypes: ( 1.3.6.1.4.1.4203.666.1.10 NAME 'monitorContext' DESC 'mon
+ itor context' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115.121
+ .1.12 SINGLE-VALUE NO-USER-MODIFICATION USAGE dSAOperation )
+olcAttributeTypes: ( 1.3.6.1.4.1.4203.1.12.2.1 NAME 'configContext' DESC 'conf
+ ig context' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1
+ .12 SINGLE-VALUE NO-USER-MODIFICATION USAGE dSAOperation )
+olcAttributeTypes: ( 1.3.6.1.1.4 NAME 'vendorName' DESC 'RFC3045: name of impl
+ ementation vendor' EQUALITY caseExactMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.
+ 15 SINGLE-VALUE NO-USER-MODIFICATION USAGE dSAOperation )
+olcAttributeTypes: ( 1.3.6.1.1.5 NAME 'vendorVersion' DESC 'RFC3045: version o
+ f implementation' EQUALITY caseExactMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.1
+ 5 SINGLE-VALUE NO-USER-MODIFICATION USAGE dSAOperation )
+olcAttributeTypes: ( 2.5.18.5 NAME 'administrativeRole' DESC 'RFC3672: adminis
+ trative role' EQUALITY objectIdentifierMatch SYNTAX 1.3.6.1.4.1.1466.115.121.
+ 1.38 USAGE directoryOperation )
+olcAttributeTypes: ( 2.5.18.6 NAME 'subtreeSpecification' DESC 'RFC3672: subtr
+ ee specification' SYNTAX 1.3.6.1.4.1.1466.115.121.1.45 SINGLE-VALUE USAGE dir
+ ectoryOperation )
+olcAttributeTypes: ( 2.5.21.1 NAME 'dITStructureRules' DESC 'RFC4512: DIT stru
+ cture rules' EQUALITY integerFirstComponentMatch SYNTAX 1.3.6.1.4.1.1466.115.
+ 121.1.17 USAGE directoryOperation )
+olcAttributeTypes: ( 2.5.21.2 NAME 'dITContentRules' DESC 'RFC4512: DIT conten
+ t rules' EQUALITY objectIdentifierFirstComponentMatch SYNTAX 1.3.6.1.4.1.1466
+ .115.121.1.16 USAGE directoryOperation )
+olcAttributeTypes: ( 2.5.21.4 NAME 'matchingRules' DESC 'RFC4512: matching rul
+ es' EQUALITY objectIdentifierFirstComponentMatch SYNTAX 1.3.6.1.4.1.1466.115.
+ 121.1.30 USAGE directoryOperation )
+olcAttributeTypes: ( 2.5.21.5 NAME 'attributeTypes' DESC 'RFC4512: attribute t
+ ypes' EQUALITY objectIdentifierFirstComponentMatch SYNTAX 1.3.6.1.4.1.1466.11
+ 5.121.1.3 USAGE directoryOperation )
+olcAttributeTypes: ( 2.5.21.6 NAME 'objectClasses' DESC 'RFC4512: object class
+ es' EQUALITY objectIdentifierFirstComponentMatch SYNTAX 1.3.6.1.4.1.1466.115.
+ 121.1.37 USAGE directoryOperation )
+olcAttributeTypes: ( 2.5.21.7 NAME 'nameForms' DESC 'RFC4512: name forms ' EQU
+ ALITY objectIdentifierFirstComponentMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.3
+ 5 USAGE directoryOperation )
+olcAttributeTypes: ( 2.5.21.8 NAME 'matchingRuleUse' DESC 'RFC4512: matching r
+ ule uses' EQUALITY objectIdentifierFirstComponentMatch SYNTAX 1.3.6.1.4.1.146
+ 6.115.121.1.31 USAGE directoryOperation )
+olcAttributeTypes: ( 1.3.6.1.4.1.1466.101.120.16 NAME 'ldapSyntaxes' DESC 'RFC
+ 4512: LDAP syntaxes' EQUALITY objectIdentifierFirstComponentMatch SYNTAX 1.3.
+ 6.1.4.1.1466.115.121.1.54 USAGE directoryOperation )
+olcAttributeTypes: ( 2.5.4.1 NAME ( 'aliasedObjectName' 'aliasedEntryName' ) D
+ ESC 'RFC4512: name of aliased object' EQUALITY distinguishedNameMatch SYNTAX
+ 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )
+olcAttributeTypes: ( 2.16.840.1.113730.3.1.34 NAME 'ref' DESC 'RFC3296: subord
+ inate referral URL' EQUALITY caseExactMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1
+ .15 USAGE distributedOperation )
+olcAttributeTypes: ( 1.3.6.1.4.1.4203.1.3.1 NAME 'entry' DESC 'OpenLDAP ACL en
+ try pseudo-attribute' SYNTAX 1.3.6.1.4.1.4203.1.1.1 SINGLE-VALUE NO-USER-MODI
+ FICATION USAGE dSAOperation )
+olcAttributeTypes: ( 1.3.6.1.4.1.4203.1.3.2 NAME 'children' DESC 'OpenLDAP ACL
+ children pseudo-attribute' SYNTAX 1.3.6.1.4.1.4203.1.1.1 SINGLE-VALUE NO-USE
+ R-MODIFICATION USAGE dSAOperation )
+olcAttributeTypes: ( 1.3.6.1.4.1.4203.666.1.8 NAME ( 'authzTo' 'saslAuthzTo' )
+ DESC 'proxy authorization targets' EQUALITY authzMatch SYNTAX 1.3.6.1.4.1.42
+ 03.666.2.7 USAGE distributedOperation X-ORDERED 'VALUES' )
+olcAttributeTypes: ( 1.3.6.1.4.1.4203.666.1.9 NAME ( 'authzFrom' 'saslAuthzFro
+ m' ) DESC 'proxy authorization sources' EQUALITY authzMatch SYNTAX 1.3.6.1.4.
+ 1.4203.666.2.7 USAGE distributedOperation X-ORDERED 'VALUES' )
+olcAttributeTypes: ( 1.3.6.1.4.1.1466.101.119.3 NAME 'entryTtl' DESC 'RFC2589:
+ entry time-to-live' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE NO-USE
+ R-MODIFICATION USAGE dSAOperation )
+olcAttributeTypes: ( 1.3.6.1.4.1.1466.101.119.4 NAME 'dynamicSubtrees' DESC 'R
+ FC2589: dynamic subtrees' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 NO-USER-MODIFI
+ CATION USAGE dSAOperation )
+olcAttributeTypes: ( 2.5.4.49 NAME 'distinguishedName' DESC 'RFC4519: common s
+ upertype of DN attributes' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1
+ .1466.115.121.1.12 )
+olcAttributeTypes: ( 2.5.4.41 NAME 'name' DESC 'RFC4519: common supertype of n
+ ame attributes' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYN
+ TAX 1.3.6.1.4.1.1466.115.121.1.15{32768} )
+olcAttributeTypes: ( 2.5.4.3 NAME ( 'cn' 'commonName' ) DESC 'RFC4519: common
+ name(s) for which the entity is known by' SUP name )
+olcAttributeTypes: ( 0.9.2342.19200300.100.1.1 NAME ( 'uid' 'userid' ) DESC 'R
+ FC4519: user identifier' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstrings
+ Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )
+olcAttributeTypes: ( 1.3.6.1.1.1.1.0 NAME 'uidNumber' DESC 'RFC2307: An intege
+ r uniquely identifying a user in an administrative domain' EQUALITY integerMa
+ tch ORDERING integerOrderingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE
+ -VALUE )
+olcAttributeTypes: ( 1.3.6.1.1.1.1.1 NAME 'gidNumber' DESC 'RFC2307: An intege
+ r uniquely identifying a group in an administrative domain' EQUALITY integerM
+ atch ORDERING integerOrderingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGL
+ E-VALUE )
+olcAttributeTypes: ( 2.5.4.35 NAME 'userPassword' DESC 'RFC4519/2307: password
+ of user' EQUALITY octetStringMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.40{128}
+ )
+olcAttributeTypes: ( 1.3.6.1.4.1.250.1.57 NAME 'labeledURI' DESC 'RFC2079: Uni
+ form Resource Identifier with optional label' EQUALITY caseExactMatch SYNTAX
+ 1.3.6.1.4.1.1466.115.121.1.15 )
+olcAttributeTypes: ( 2.5.4.13 NAME 'description' DESC 'RFC4519: descriptive in
+ formation' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1
+ .3.6.1.4.1.1466.115.121.1.15{1024} )
+olcAttributeTypes: ( 2.5.4.34 NAME 'seeAlso' DESC 'RFC4519: DN of related obje
+ ct' SUP distinguishedName )
+olcAttributeTypes: ( 1.3.6.1.4.1.4203.666.1.60 NAME 'pKCS8PrivateKey' DESC 'PK
+ CS#8 PrivateKeyInfo, use ;binary' EQUALITY privateKeyMatch SYNTAX 1.2.840.113
+ 549.1.8.1.1 )
+olcAttributeTypes: ( 1.3.6.1.4.1.42.2.27.8.1.29 NAME 'pwdLastSuccess' DESC 'Th
+ e timestamp of the last successful authentication' EQUALITY generalizedTimeMa
+ tch ORDERING generalizedTimeOrderingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.2
+ 4 SINGLE-VALUE NO-USER-MODIFICATION USAGE directoryOperation )
+olcAttributeTypes: ( OLcfgGlAt:78 NAME 'olcConfigFile' DESC 'File for slapd co
+ nfiguration directives' EQUALITY caseExactMatch SYNTAX OMsDirectoryString SIN
+ GLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:79 NAME 'olcConfigDir' DESC 'Directory for slap
+ d configuration backend' EQUALITY caseExactMatch SYNTAX OMsDirectoryString SI
+ NGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:1 NAME 'olcAccess' DESC 'Access Control List' E
+ QUALITY caseIgnoreMatch SYNTAX OMsDirectoryString X-ORDERED 'VALUES' )
+olcAttributeTypes: ( OLcfgGlAt:86 NAME 'olcAddContentAcl' DESC 'Check ACLs aga
+ inst content of Add ops' EQUALITY booleanMatch SYNTAX OMsBoolean SINGLE-VALUE
+ )
+olcAttributeTypes: ( OLcfgGlAt:2 NAME 'olcAllows' DESC 'Allowed set of depreca
+ ted features' EQUALITY caseIgnoreMatch SYNTAX OMsDirectoryString )
+olcAttributeTypes: ( OLcfgGlAt:3 NAME 'olcArgsFile' DESC 'File for slapd comma
+ nd line options' EQUALITY caseExactMatch SYNTAX OMsDirectoryString SINGLE-VAL
+ UE )
+olcAttributeTypes: ( OLcfgGlAt:5 NAME 'olcAttributeOptions' EQUALITY caseIgnor
+ eMatch SYNTAX OMsDirectoryString )
+olcAttributeTypes: ( OLcfgGlAt:4 NAME 'olcAttributeTypes' DESC 'OpenLDAP attri
+ buteTypes' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX O
+ MsDirectoryString X-ORDERED 'VALUES' )
+olcAttributeTypes: ( OLcfgGlAt:6 NAME 'olcAuthIDRewrite' EQUALITY caseIgnoreMa
+ tch SYNTAX OMsDirectoryString X-ORDERED 'VALUES' )
+olcAttributeTypes: ( OLcfgGlAt:7 NAME 'olcAuthzPolicy' EQUALITY caseIgnoreMatc
+ h SYNTAX OMsDirectoryString SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:8 NAME 'olcAuthzRegexp' EQUALITY caseIgnoreMatc
+ h SYNTAX OMsDirectoryString X-ORDERED 'VALUES' )
+olcAttributeTypes: ( OLcfgGlAt:9 NAME 'olcBackend' DESC 'A type of backend' EQ
+ UALITY caseIgnoreMatch SYNTAX OMsDirectoryString SINGLE-VALUE X-ORDERED 'SIBL
+ INGS' )
+olcAttributeTypes: ( OLcfgGlAt:10 NAME 'olcConcurrency' EQUALITY integerMatch
+ SYNTAX OMsInteger SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:11 NAME 'olcConnMaxPending' EQUALITY integerMat
+ ch SYNTAX OMsInteger SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:12 NAME 'olcConnMaxPendingAuth' EQUALITY intege
+ rMatch SYNTAX OMsInteger SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:13 NAME 'olcDatabase' DESC 'The backend type fo
+ r a database instance' SUP olcBackend SINGLE-VALUE X-ORDERED 'SIBLINGS' )
+olcAttributeTypes: ( OLcfgGlAt:14 NAME 'olcDefaultSearchBase' EQUALITY disting
+ uishedNameMatch SYNTAX OMsDN SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgDbAt:0.21 NAME 'olcDisabled' EQUALITY booleanMatch S
+ YNTAX OMsBoolean SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:15 NAME 'olcDisallows' EQUALITY caseIgnoreMatch
+ SYNTAX OMsDirectoryString )
+olcAttributeTypes: ( OLcfgGlAt:16 NAME 'olcDitContentRules' DESC 'OpenLDAP DIT
+ content rules' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYN
+ TAX OMsDirectoryString X-ORDERED 'VALUES' )
+olcAttributeTypes: ( OLcfgDbAt:0.20 NAME 'olcExtraAttrs' EQUALITY caseIgnoreMa
+ tch SYNTAX OMsDirectoryString )
+olcAttributeTypes: ( OLcfgGlAt:17 NAME 'olcGentleHUP' EQUALITY booleanMatch SY
+ NTAX OMsBoolean SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgDbAt:0.17 NAME 'olcHidden' EQUALITY booleanMatch SYN
+ TAX OMsBoolean SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:18 NAME 'olcIdleTimeout' EQUALITY integerMatch
+ SYNTAX OMsInteger SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:19 NAME 'olcInclude' SUP labeledURI )
+olcAttributeTypes: ( OLcfgGlAt:94 NAME 'olcIndexHash64' EQUALITY booleanMatch
+ SYNTAX OMsBoolean SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:20 NAME 'olcIndexSubstrIfMinLen' EQUALITY integ
+ erMatch SYNTAX OMsInteger SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:21 NAME 'olcIndexSubstrIfMaxLen' EQUALITY integ
+ erMatch SYNTAX OMsInteger SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:22 NAME 'olcIndexSubstrAnyLen' EQUALITY integer
+ Match SYNTAX OMsInteger SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:23 NAME 'olcIndexSubstrAnyStep' EQUALITY intege
+ rMatch SYNTAX OMsInteger SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:84 NAME 'olcIndexIntLen' EQUALITY integerMatch
+ SYNTAX OMsInteger SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgDbAt:0.4 NAME 'olcLastMod' EQUALITY booleanMatch SYN
+ TAX OMsBoolean SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgDbAt:0.22 NAME 'olcLastBind' EQUALITY booleanMatch S
+ YNTAX OMsBoolean SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:85 NAME 'olcLdapSyntaxes' DESC 'OpenLDAP ldapSy
+ ntax' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX OMsDir
+ ectoryString X-ORDERED 'VALUES' )
+olcAttributeTypes: ( OLcfgDbAt:0.5 NAME 'olcLimits' EQUALITY caseIgnoreMatch S
+ YNTAX OMsDirectoryString X-ORDERED 'VALUES' )
+olcAttributeTypes: ( OLcfgGlAt:93 NAME 'olcListenerThreads' EQUALITY integerMa
+ tch SYNTAX OMsInteger SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:26 NAME 'olcLocalSSF' EQUALITY integerMatch SYN
+ TAX OMsInteger SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:27 NAME 'olcLogFile' EQUALITY caseExactMatch SY
+ NTAX OMsDirectoryString SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:28 NAME 'olcLogLevel' EQUALITY caseIgnoreMatch
+ SYNTAX OMsDirectoryString )
+olcAttributeTypes: ( OLcfgDbAt:0.6 NAME 'olcMaxDerefDepth' EQUALITY integerMat
+ ch SYNTAX OMsInteger SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:101 NAME 'olcMaxFilterDepth' EQUALITY integerMa
+ tch SYNTAX OMsInteger SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgDbAt:0.16 NAME ( 'olcMultiProvider' 'olcMirrorMode'
+ ) EQUALITY booleanMatch SYNTAX OMsBoolean SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:30 NAME 'olcModuleLoad' EQUALITY caseIgnoreMatc
+ h SYNTAX OMsDirectoryString X-ORDERED 'VALUES' )
+olcAttributeTypes: ( OLcfgGlAt:31 NAME 'olcModulePath' EQUALITY caseExactMatch
+ SYNTAX OMsDirectoryString SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgDbAt:0.18 NAME 'olcMonitoring' EQUALITY booleanMatch
+ SYNTAX OMsBoolean SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:32 NAME 'olcObjectClasses' DESC 'OpenLDAP objec
+ t classes' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX O
+ MsDirectoryString X-ORDERED 'VALUES' )
+olcAttributeTypes: ( OLcfgGlAt:33 NAME 'olcObjectIdentifier' EQUALITY caseIgno
+ reMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX OMsDirectoryString X-ORDERED
+ 'VALUES' )
+olcAttributeTypes: ( OLcfgGlAt:34 NAME 'olcOverlay' SUP olcDatabase SINGLE-VAL
+ UE X-ORDERED 'SIBLINGS' )
+olcAttributeTypes: ( OLcfgGlAt:35 NAME 'olcPasswordCryptSaltFormat' EQUALITY c
+ aseIgnoreMatch SYNTAX OMsDirectoryString SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:36 NAME 'olcPasswordHash' EQUALITY caseIgnoreMa
+ tch SYNTAX OMsDirectoryString )
+olcAttributeTypes: ( OLcfgGlAt:37 NAME 'olcPidFile' EQUALITY caseExactMatch SY
+ NTAX OMsDirectoryString SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:38 NAME 'olcPlugin' EQUALITY caseIgnoreMatch SY
+ NTAX OMsDirectoryString X-ORDERED 'VALUES' )
+olcAttributeTypes: ( OLcfgGlAt:39 NAME 'olcPluginLogFile' EQUALITY caseExactMa
+ tch SYNTAX OMsDirectoryString SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:40 NAME 'olcReadOnly' EQUALITY booleanMatch SYN
+ TAX OMsBoolean SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:41 NAME 'olcReferral' SUP labeledURI SINGLE-VAL
+ UE )
+olcAttributeTypes: ( OLcfgDbAt:0.7 NAME 'olcReplica' SUP labeledURI EQUALITY c
+ aseIgnoreMatch X-ORDERED 'VALUES' )
+olcAttributeTypes: ( OLcfgGlAt:43 NAME 'olcReplicaArgsFile' SYNTAX OMsDirector
+ yString SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:44 NAME 'olcReplicaPidFile' SYNTAX OMsDirectory
+ String SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:45 NAME 'olcReplicationInterval' SYNTAX OMsInte
+ ger SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:46 NAME 'olcReplogFile' SYNTAX OMsDirectoryStri
+ ng SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:47 NAME 'olcRequires' EQUALITY caseIgnoreMatch
+ SYNTAX OMsDirectoryString )
+olcAttributeTypes: ( OLcfgGlAt:48 NAME 'olcRestrict' EQUALITY caseIgnoreMatch
+ SYNTAX OMsDirectoryString )
+olcAttributeTypes: ( OLcfgGlAt:49 NAME 'olcReverseLookup' EQUALITY booleanMatc
+ h SYNTAX OMsBoolean SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgDbAt:0.8 NAME 'olcRootDN' EQUALITY distinguishedName
+ Match SYNTAX OMsDN SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:51 NAME 'olcRootDSE' EQUALITY caseIgnoreMatch S
+ YNTAX OMsDirectoryString )
+olcAttributeTypes: ( OLcfgDbAt:0.9 NAME 'olcRootPW' EQUALITY octetStringMatch
+ SYNTAX OMsOctetString SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:89 NAME 'olcSaslAuxprops' EQUALITY caseIgnoreMa
+ tch SYNTAX OMsDirectoryString SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:91 NAME 'olcSaslAuxpropsDontUseCopy' EQUALITY c
+ aseIgnoreMatch SYNTAX OMsDirectoryString )
+olcAttributeTypes: ( OLcfgGlAt:92 NAME 'olcSaslAuxpropsDontUseCopyIgnore' EQUA
+ LITY booleanMatch SYNTAX OMsBoolean SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:100 NAME 'olcSaslCBinding' EQUALITY caseIgnoreM
+ atch SYNTAX OMsDirectoryString SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:53 NAME 'olcSaslHost' EQUALITY caseIgnoreMatch
+ SYNTAX OMsDirectoryString SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:54 NAME 'olcSaslRealm' EQUALITY caseExactMatch
+ SYNTAX OMsDirectoryString SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:56 NAME 'olcSaslSecProps' EQUALITY caseExactMat
+ ch SYNTAX OMsDirectoryString SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:58 NAME 'olcSchemaDN' EQUALITY distinguishedNam
+ eMatch SYNTAX OMsDN SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:59 NAME 'olcSecurity' EQUALITY caseIgnoreMatch
+ SYNTAX OMsDirectoryString )
+olcAttributeTypes: ( OLcfgGlAt:81 NAME 'olcServerID' EQUALITY caseIgnoreMatch
+ SYNTAX OMsDirectoryString )
+olcAttributeTypes: ( OLcfgGlAt:60 NAME 'olcSizeLimit' EQUALITY caseExactMatch
+ SYNTAX OMsDirectoryString SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:61 NAME 'olcSockbufMaxIncoming' EQUALITY intege
+ rMatch SYNTAX OMsInteger SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:62 NAME 'olcSockbufMaxIncomingAuth' EQUALITY in
+ tegerMatch SYNTAX OMsInteger SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:83 NAME 'olcSortVals' DESC 'Attributes whose va
+ lues will always be sorted' EQUALITY caseIgnoreMatch SYNTAX OMsDirectoryStrin
+ g )
+olcAttributeTypes: ( OLcfgDbAt:0.15 NAME 'olcSubordinate' EQUALITY caseExactMa
+ tch SYNTAX OMsDirectoryString SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgDbAt:0.10 NAME 'olcSuffix' EQUALITY distinguishedNam
+ eMatch SYNTAX OMsDN )
+olcAttributeTypes: ( OLcfgDbAt:0.19 NAME 'olcSyncUseSubentry' DESC 'Store sync
+ context in a subentry' EQUALITY booleanMatch SYNTAX OMsBoolean SINGLE-VALUE
+ )
+olcAttributeTypes: ( OLcfgDbAt:0.11 NAME 'olcSyncrepl' EQUALITY caseIgnoreMatc
+ h SYNTAX OMsDirectoryString X-ORDERED 'VALUES' )
+olcAttributeTypes: ( OLcfgGlAt:90 NAME 'olcTCPBuffer' DESC 'Custom TCP buffer
+ size' EQUALITY caseExactMatch SYNTAX OMsDirectoryString )
+olcAttributeTypes: ( OLcfgGlAt:66 NAME 'olcThreads' EQUALITY integerMatch SYNT
+ AX OMsInteger SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:95 NAME 'olcThreadQueues' EQUALITY integerMatch
+ SYNTAX OMsInteger SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:67 NAME 'olcTimeLimit' EQUALITY caseExactMatch
+ SYNTAX OMsDirectoryString SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:97 NAME 'olcTLSCACertificate' DESC 'X.509 certi
+ ficate, must use ;binary' EQUALITY certificateExactMatch SYNTAX 1.3.6.1.4.1.1
+ 466.115.121.1.8 SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:68 NAME 'olcTLSCACertificateFile' EQUALITY case
+ ExactMatch SYNTAX OMsDirectoryString SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:69 NAME 'olcTLSCACertificatePath' EQUALITY case
+ ExactMatch SYNTAX OMsDirectoryString SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:98 NAME 'olcTLSCertificate' DESC 'X.509 certifi
+ cate, must use ;binary' EQUALITY certificateExactMatch SYNTAX 1.3.6.1.4.1.146
+ 6.115.121.1.8 SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:70 NAME 'olcTLSCertificateFile' EQUALITY caseEx
+ actMatch SYNTAX OMsDirectoryString SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:99 NAME 'olcTLSCertificateKey' DESC 'X.509 priv
+ ateKey, must use ;binary' EQUALITY privateKeyMatch SYNTAX 1.2.840.113549.1.8.
+ 1.1 SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:71 NAME 'olcTLSCertificateKeyFile' EQUALITY cas
+ eExactMatch SYNTAX OMsDirectoryString SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:72 NAME 'olcTLSCipherSuite' EQUALITY caseExactM
+ atch SYNTAX OMsDirectoryString SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:73 NAME 'olcTLSCRLCheck' EQUALITY caseExactMatc
+ h SYNTAX OMsDirectoryString SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:82 NAME 'olcTLSCRLFile' EQUALITY caseExactMatch
+ SYNTAX OMsDirectoryString SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:74 NAME 'olcTLSRandFile' EQUALITY caseExactMatc
+ h SYNTAX OMsDirectoryString SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:75 NAME 'olcTLSVerifyClient' EQUALITY caseExact
+ Match SYNTAX OMsDirectoryString SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:77 NAME 'olcTLSDHParamFile' EQUALITY caseExactM
+ atch SYNTAX OMsDirectoryString SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:96 NAME 'olcTLSECName' EQUALITY caseExactMatch
+ SYNTAX OMsDirectoryString SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:87 NAME 'olcTLSProtocolMin' EQUALITY caseExactM
+ atch SYNTAX OMsDirectoryString SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgGlAt:80 NAME 'olcToolThreads' EQUALITY integerMatch
+ SYNTAX OMsInteger SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgDbAt:0.12 NAME 'olcUpdateDN' EQUALITY distinguishedN
+ ameMatch SYNTAX OMsDN SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgDbAt:0.13 NAME 'olcUpdateRef' SUP labeledURI EQUALIT
+ Y caseIgnoreMatch )
+olcAttributeTypes: ( OLcfgGlAt:88 NAME 'olcWriteTimeout' EQUALITY integerMatch
+ SYNTAX OMsInteger SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgDbAt:0.1 NAME 'olcDbDirectory' DESC 'Directory for d
+ atabase content' EQUALITY caseIgnoreMatch SYNTAX OMsDirectoryString SINGLE-VA
+ LUE )
+olcAttributeTypes: ( 1.3.6.1.4.1.4203.666.1.55.1 NAME 'monitoredInfo' DESC 'mo
+ nitored info' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTA
+ X 1.3.6.1.4.1.1466.115.121.1.15{32768} NO-USER-MODIFICATION USAGE dSAOperatio
+ n )
+olcAttributeTypes: ( 1.3.6.1.4.1.4203.666.1.55.2 NAME 'managedInfo' DESC 'moni
+ tor managed info' SUP name )
+olcAttributeTypes: ( 1.3.6.1.4.1.4203.666.1.55.3 NAME 'monitorCounter' DESC 'm
+ onitor counter' EQUALITY integerMatch ORDERING integerOrderingMatch SYNTAX 1.
+ 3.6.1.4.1.1466.115.121.1.27 NO-USER-MODIFICATION USAGE dSAOperation )
+olcAttributeTypes: ( 1.3.6.1.4.1.4203.666.1.55.4 NAME 'monitorOpCompleted' DES
+ C 'monitor completed operations' SUP monitorCounter NO-USER-MODIFICATION USAG
+ E dSAOperation )
+olcAttributeTypes: ( 1.3.6.1.4.1.4203.666.1.55.5 NAME 'monitorOpInitiated' DES
+ C 'monitor initiated operations' SUP monitorCounter NO-USER-MODIFICATION USAG
+ E dSAOperation )
+olcAttributeTypes: ( 1.3.6.1.4.1.4203.666.1.55.6 NAME 'monitorConnectionNumber
+ ' DESC 'monitor connection number' SUP monitorCounter NO-USER-MODIFICATION US
+ AGE dSAOperation )
+olcAttributeTypes: ( 1.3.6.1.4.1.4203.666.1.55.7 NAME 'monitorConnectionAuthzD
+ N' DESC 'monitor connection authorization DN' EQUALITY distinguishedNameMatch
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 NO-USER-MODIFICATION USAGE dSAOperation
+ )
+olcAttributeTypes: ( 1.3.6.1.4.1.4203.666.1.55.8 NAME 'monitorConnectionLocalA
+ ddress' DESC 'monitor connection local address' SUP monitoredInfo NO-USER-MOD
+ IFICATION USAGE dSAOperation )
+olcAttributeTypes: ( 1.3.6.1.4.1.4203.666.1.55.9 NAME 'monitorConnectionPeerAd
+ dress' DESC 'monitor connection peer address' SUP monitoredInfo NO-USER-MODIF
+ ICATION USAGE dSAOperation )
+olcAttributeTypes: ( 1.3.6.1.4.1.4203.666.1.55.10 NAME 'monitorTimestamp' DESC
+ 'monitor timestamp' EQUALITY generalizedTimeMatch ORDERING generalizedTimeOr
+ deringMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.24 SINGLE-VALUE NO-USER-MODIFIC
+ ATION USAGE dSAOperation )
+olcAttributeTypes: ( 1.3.6.1.4.1.4203.666.1.55.11 NAME 'monitorOverlay' DESC '
+ name of overlays defined for a given database' SUP monitoredInfo NO-USER-MODI
+ FICATION USAGE dSAOperation )
+olcAttributeTypes: ( 1.3.6.1.4.1.4203.666.1.55.12 NAME 'readOnly' DESC 'read/w
+ rite status of a given database' EQUALITY booleanMatch SYNTAX 1.3.6.1.4.1.146
+ 6.115.121.1.7 SINGLE-VALUE USAGE dSAOperation )
+olcAttributeTypes: ( 1.3.6.1.4.1.4203.666.1.55.13 NAME 'restrictedOperation' D
+ ESC 'name of restricted operation for a given database' SUP managedInfo )
+olcAttributeTypes: ( 1.3.6.1.4.1.4203.666.1.55.14 NAME 'monitorConnectionProto
+ col' DESC 'monitor connection protocol' SUP monitoredInfo NO-USER-MODIFICATIO
+ N USAGE dSAOperation )
+olcAttributeTypes: ( 1.3.6.1.4.1.4203.666.1.55.15 NAME 'monitorConnectionOpsRe
+ ceived' DESC 'monitor number of operations received by the connection' SUP mo
+ nitorCounter NO-USER-MODIFICATION USAGE dSAOperation )
+olcAttributeTypes: ( 1.3.6.1.4.1.4203.666.1.55.16 NAME 'monitorConnectionOpsEx
+ ecuting' DESC 'monitor number of operations in execution within the connectio
+ n' SUP monitorCounter NO-USER-MODIFICATION USAGE dSAOperation )
+olcAttributeTypes: ( 1.3.6.1.4.1.4203.666.1.55.17 NAME 'monitorConnectionOpsPe
+ nding' DESC 'monitor number of pending operations within the connection' SUP
+ monitorCounter NO-USER-MODIFICATION USAGE dSAOperation )
+olcAttributeTypes: ( 1.3.6.1.4.1.4203.666.1.55.18 NAME 'monitorConnectionOpsCo
+ mpleted' DESC 'monitor number of operations completed within the connection'
+ SUP monitorCounter NO-USER-MODIFICATION USAGE dSAOperation )
+olcAttributeTypes: ( 1.3.6.1.4.1.4203.666.1.55.19 NAME 'monitorConnectionGet'
+ DESC 'number of times connection_get() was called so far' SUP monitorCounter
+ NO-USER-MODIFICATION USAGE dSAOperation )
+olcAttributeTypes: ( 1.3.6.1.4.1.4203.666.1.55.20 NAME 'monitorConnectionRead'
+ DESC 'number of times connection_read() was called so far' SUP monitorCounte
+ r NO-USER-MODIFICATION USAGE dSAOperation )
+olcAttributeTypes: ( 1.3.6.1.4.1.4203.666.1.55.21 NAME 'monitorConnectionWrite
+ ' DESC 'number of times connection_write() was called so far' SUP monitorCoun
+ ter NO-USER-MODIFICATION USAGE dSAOperation )
+olcAttributeTypes: ( 1.3.6.1.4.1.4203.666.1.55.22 NAME 'monitorConnectionMask'
+ DESC 'monitor connection mask' SUP monitoredInfo NO-USER-MODIFICATION USAGE
+ dSAOperation )
+olcAttributeTypes: ( 1.3.6.1.4.1.4203.666.1.55.23 NAME 'monitorConnectionListe
+ ner' DESC 'monitor connection listener' SUP monitoredInfo NO-USER-MODIFICATIO
+ N USAGE dSAOperation )
+olcAttributeTypes: ( 1.3.6.1.4.1.4203.666.1.55.24 NAME 'monitorConnectionPeerD
+ omain' DESC 'monitor connection peer domain' SUP monitoredInfo NO-USER-MODIFI
+ CATION USAGE dSAOperation )
+olcAttributeTypes: ( 1.3.6.1.4.1.4203.666.1.55.25 NAME 'monitorConnectionStart
+ Time' DESC 'monitor connection start time' SUP monitorTimestamp SINGLE-VALUE
+ NO-USER-MODIFICATION USAGE dSAOperation )
+olcAttributeTypes: ( 1.3.6.1.4.1.4203.666.1.55.26 NAME 'monitorConnectionActiv
+ ityTime' DESC 'monitor connection activity time' SUP monitorTimestamp SINGLE-
+ VALUE NO-USER-MODIFICATION USAGE dSAOperation )
+olcAttributeTypes: ( 1.3.6.1.4.1.4203.666.1.55.27 NAME 'monitorIsShadow' DESC
+ 'TRUE if the database is shadow' EQUALITY booleanMatch SYNTAX 1.3.6.1.4.1.146
+ 6.115.121.1.7 SINGLE-VALUE USAGE dSAOperation )
+olcAttributeTypes: ( 1.3.6.1.4.1.4203.666.1.55.28 NAME 'monitorUpdateRef' DESC
+ 'update referral for shadow databases' SUP monitoredInfo SINGLE-VALUE USAGE
+ dSAOperation )
+olcAttributeTypes: ( 1.3.6.1.4.1.4203.666.1.55.29 NAME 'monitorRuntimeConfig'
+ DESC 'TRUE if component allows runtime configuration' EQUALITY booleanMatch S
+ YNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALUE USAGE dSAOperation )
+olcAttributeTypes: ( 1.3.6.1.4.1.4203.666.1.55.30 NAME 'monitorSuperiorDN' DES
+ C 'monitor superior DN' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.14
+ 66.115.121.1.12 NO-USER-MODIFICATION USAGE dSAOperation )
+olcAttributeTypes: ( 1.3.6.1.4.1.4203.666.1.55.31 NAME 'monitorConnectionOpsAs
+ ync' DESC 'monitor number of asynchronous operations in execution within the
+ connection' SUP monitorCounter NO-USER-MODIFICATION USAGE dSAOperation )
+olcAttributeTypes: ( olmSyncReplAttributes:1 NAME 'olmSRProviderURIList' DESC
+ 'List of provider URIs for this consumer instance' SUP monitoredInfo NO-USER-
+ MODIFICATION USAGE dSAOperation )
+olcAttributeTypes: ( olmSyncReplAttributes:2 NAME 'olmSRConnection' DESC 'Loca
+ l address:port of connection to provider' SUP monitoredInfo SINGLE-VALUE NO-U
+ SER-MODIFICATION USAGE dSAOperation )
+olcAttributeTypes: ( olmSyncReplAttributes:3 NAME 'olmSRSyncPhase' DESC 'Curre
+ nt syncrepl mode' SUP monitoredInfo SINGLE-VALUE NO-USER-MODIFICATION USAGE d
+ SAOperation )
+olcAttributeTypes: ( olmSyncReplAttributes:4 NAME 'olmSRNextConnect' DESC 'Sch
+ eduled time of next connection attempt' SUP monitorTimestamp SINGLE-VALUE NO-
+ USER-MODIFICATION USAGE dSAOperation )
+olcAttributeTypes: ( olmSyncReplAttributes:5 NAME 'olmSRLastConnect' DESC 'Tim
+ e last connected to provider' SUP monitorTimestamp SINGLE-VALUE NO-USER-MODIF
+ ICATION USAGE dSAOperation )
+olcAttributeTypes: ( olmSyncReplAttributes:6 NAME 'olmSRLastContact' DESC 'Tim
+ e last message received from provider' SUP monitorTimestamp SINGLE-VALUE NO-U
+ SER-MODIFICATION USAGE dSAOperation )
+olcAttributeTypes: ( olmSyncReplAttributes:7 NAME 'olmSRLastCookieRcvd' DESC '
+ Last sync cookie received from provider' SUP monitoredInfo NO-USER-MODIFICATI
+ ON USAGE dSAOperation )
+olcAttributeTypes: ( olmSyncReplAttributes:8 NAME 'olmSRLastCookieSent' DESC '
+ Last sync cookie sent to provider' SUP monitoredInfo NO-USER-MODIFICATION USA
+ GE dSAOperation )
+olcAttributeTypes: ( 1.3.6.1.4.1.4203.666.1.5 NAME 'OpenLDAPaci' DESC 'OpenLDA
+ P access control information (experimental)' EQUALITY OpenLDAPaciMatch SYNTAX
+ 1.3.6.1.4.1.4203.666.2.1 USAGE directoryOperation )
+olcAttributeTypes: ( OLcfgBkAt:12.1 NAME 'olcBkMdbIdlExp' DESC 'Power of 2 use
+ d to set IDL size' EQUALITY integerMatch SYNTAX OMsInteger SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgDbAt:1.2 NAME 'olcDbCheckpoint' DESC 'Database check
+ point interval in kbytes and minutes' EQUALITY caseIgnoreMatch SYNTAX OMsDire
+ ctoryString SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgDbAt:1.4 NAME 'olcDbNoSync' DESC 'Disable synchronou
+ s database writes' EQUALITY booleanMatch SYNTAX OMsBoolean SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgDbAt:12.3 NAME 'olcDbEnvFlags' DESC 'Database enviro
+ nment flags' EQUALITY caseIgnoreMatch SYNTAX OMsDirectoryString )
+olcAttributeTypes: ( OLcfgDbAt:0.2 NAME 'olcDbIndex' DESC 'Attribute index par
+ ameters' EQUALITY caseIgnoreMatch SYNTAX OMsDirectoryString )
+olcAttributeTypes: ( OLcfgDbAt:12.4 NAME 'olcDbMaxEntrySize' DESC 'Maximum siz
+ e of an entry in bytes' EQUALITY integerMatch SYNTAX OMsInteger SINGLE-VALUE
+ )
+olcAttributeTypes: ( OLcfgDbAt:12.1 NAME 'olcDbMaxReaders' DESC 'Maximum numbe
+ r of threads that may access the DB concurrently' EQUALITY integerMatch SYNTA
+ X OMsInteger SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgDbAt:12.2 NAME 'olcDbMaxSize' DESC 'Maximum size of
+ DB in bytes' EQUALITY integerMatch SYNTAX OMsInteger SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgDbAt:0.3 NAME 'olcDbMode' DESC 'Unix permissions of
+ database files' EQUALITY caseIgnoreMatch SYNTAX OMsDirectoryString SINGLE-VAL
+ UE )
+olcAttributeTypes: ( OLcfgDbAt:12.6 NAME 'olcDbMultival' DESC 'Hi/Lo threshold
+ s for splitting multivalued attr out of main blob' EQUALITY caseIgnoreMatch S
+ YNTAX OMsDirectoryString )
+olcAttributeTypes: ( OLcfgDbAt:12.5 NAME 'olcDbRtxnSize' DESC 'Number of entri
+ es to process in one read transaction' EQUALITY integerMatch SYNTAX OMsIntege
+ r SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgDbAt:1.9 NAME 'olcDbSearchStack' DESC 'Depth of sear
+ ch stack in IDLs' EQUALITY integerMatch SYNTAX OMsInteger SINGLE-VALUE )
+olcAttributeTypes: ( 1.2.840.113556.1.2.102 NAME 'memberOf' DESC 'Group that t
+ he entry belongs to' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466.
+ 115.121.1.12 NO-USER-MODIFICATION USAGE dSAOperation X-ORIGIN 'iPlanet Delega
+ ted Administrator' )
+olcAttributeTypes: ( OLcfgOvAt:18.0 NAME 'olcMemberOfDN' DESC 'DN to be used a
+ s modifiersName' EQUALITY distinguishedNameMatch SYNTAX OMsDN SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgOvAt:18.1 NAME 'olcMemberOfDangling' DESC 'Behavior
+ with respect to dangling members, constrained to ignore, drop, error' EQUALIT
+ Y caseIgnoreMatch SYNTAX OMsDirectoryString SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgOvAt:18.2 NAME 'olcMemberOfRefInt' DESC 'Take care o
+ f referential integrity' EQUALITY booleanMatch SYNTAX OMsBoolean SINGLE-VALUE
+ )
+olcAttributeTypes: ( OLcfgOvAt:18.3 NAME 'olcMemberOfGroupOC' DESC 'Group obje
+ ctClass' EQUALITY caseIgnoreMatch SYNTAX OMsDirectoryString SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgOvAt:18.4 NAME 'olcMemberOfMemberAD' DESC 'member at
+ tribute' EQUALITY caseIgnoreMatch SYNTAX OMsDirectoryString SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgOvAt:18.5 NAME 'olcMemberOfMemberOfAD' DESC 'memberO
+ f attribute' EQUALITY caseIgnoreMatch SYNTAX OMsDirectoryString SINGLE-VALUE
+ )
+olcAttributeTypes: ( OLcfgOvAt:18.7 NAME 'olcMemberOfDanglingError' DESC 'Erro
+ r code returned in case of dangling back reference' EQUALITY caseIgnoreMatch
+ SYNTAX OMsDirectoryString SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgOvAt:11.1 NAME 'olcRefintAttribute' DESC 'Attributes
+ for referential integrity' EQUALITY caseIgnoreMatch SYNTAX OMsDirectoryStrin
+ g )
+olcAttributeTypes: ( OLcfgOvAt:11.2 NAME 'olcRefintNothing' DESC 'Replacement
+ DN to supply when needed' EQUALITY distinguishedNameMatch SYNTAX OMsDN SINGLE
+ -VALUE )
+olcAttributeTypes: ( OLcfgOvAt:11.3 NAME 'olcRefintModifiersName' DESC 'The DN
+ to use as modifiersName' EQUALITY distinguishedNameMatch SYNTAX OMsDN SINGLE
+ -VALUE )
+olcAttributeTypes: ( OLcfgOvAt:10.1 NAME 'olcUniqueBase' DESC 'Subtree for uni
+ queness searches' EQUALITY distinguishedNameMatch SYNTAX OMsDN SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgOvAt:10.2 NAME 'olcUniqueIgnore' DESC 'Attributes fo
+ r which uniqueness shall not be enforced' EQUALITY caseIgnoreMatch ORDERING c
+ aseIgnoreOrderingMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX OMsDirectorySt
+ ring )
+olcAttributeTypes: ( OLcfgOvAt:10.3 NAME 'olcUniqueAttribute' DESC 'Attributes
+ for which uniqueness shall be enforced' EQUALITY caseIgnoreMatch ORDERING ca
+ seIgnoreOrderingMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX OMsDirectoryStr
+ ing )
+olcAttributeTypes: ( OLcfgOvAt:10.4 NAME 'olcUniqueStrict' DESC 'Enforce uniqu
+ eness of null values' EQUALITY booleanMatch SYNTAX OMsBoolean SINGLE-VALUE )
+olcAttributeTypes: ( OLcfgOvAt:10.5 NAME 'olcUniqueURI' DESC 'List of keywords
+ and LDAP URIs for a uniqueness domain' EQUALITY caseExactMatch ORDERING case
+ ExactOrderingMatch SUBSTR caseExactSubstringsMatch SYNTAX OMsDirectoryString
+ )
+olcAttributeTypes: ( olmDatabaseAttributes:1 NAME 'olmDbDirectory' DESC 'Path
+ name of the directory where the database environment resides' SUP monitoredIn
+ fo NO-USER-MODIFICATION USAGE dSAOperation )
+olcAttributeTypes: ( olmMDBAttributes:1 NAME 'olmMDBPagesMax' DESC 'Maximum nu
+ mber of pages' SUP monitorCounter NO-USER-MODIFICATION USAGE dSAOperation )
+olcAttributeTypes: ( olmMDBAttributes:2 NAME 'olmMDBPagesUsed' DESC 'Number of
+ pages in use' SUP monitorCounter NO-USER-MODIFICATION USAGE dSAOperation )
+olcAttributeTypes: ( olmMDBAttributes:3 NAME 'olmMDBPagesFree' DESC 'Number of
+ free pages' SUP monitorCounter NO-USER-MODIFICATION USAGE dSAOperation )
+olcAttributeTypes: ( olmMDBAttributes:4 NAME 'olmMDBReadersMax' DESC 'Maximum
+ number of readers' SUP monitorCounter NO-USER-MODIFICATION USAGE dSAOperation
+ )
+olcAttributeTypes: ( olmMDBAttributes:5 NAME 'olmMDBReadersUsed' DESC 'Number
+ of readers in use' SUP monitorCounter NO-USER-MODIFICATION USAGE dSAOperation
+ )
+olcAttributeTypes: ( olmMDBAttributes:6 NAME 'olmMDBEntries' DESC 'Number of e
+ ntries in DB' SUP monitorCounter NO-USER-MODIFICATION USAGE dSAOperation )
+olcObjectClasses: ( 2.5.6.0 NAME 'top' DESC 'top of the superclass chain' ABST
+ RACT MUST objectClass )
+olcObjectClasses: ( 1.3.6.1.4.1.1466.101.120.111 NAME 'extensibleObject' DESC
+ 'RFC4512: extensible object' SUP top AUXILIARY )
+olcObjectClasses: ( 2.5.6.1 NAME 'alias' DESC 'RFC4512: an alias' SUP top STRU
+ CTURAL MUST aliasedObjectName )
+olcObjectClasses: ( 2.16.840.1.113730.3.2.6 NAME 'referral' DESC 'namedref: na
+ med subordinate referral' SUP top STRUCTURAL MUST ref )
+olcObjectClasses: ( 1.3.6.1.4.1.4203.1.4.1 NAME ( 'OpenLDAProotDSE' 'LDAProotD
+ SE' ) DESC 'OpenLDAP Root DSE object' SUP top STRUCTURAL MAY cn )
+olcObjectClasses: ( 2.5.17.0 NAME 'subentry' DESC 'RFC3672: subentry' SUP top
+ STRUCTURAL MUST ( cn $ subtreeSpecification ) )
+olcObjectClasses: ( 2.5.20.1 NAME 'subschema' DESC 'RFC4512: controlling subsc
+ hema (sub)entry' AUXILIARY MAY ( dITStructureRules $ nameForms $ dITContentRu
+ les $ objectClasses $ attributeTypes $ matchingRules $ matchingRuleUse ) )
+olcObjectClasses: ( 2.5.17.2 NAME 'collectiveAttributeSubentry' DESC 'RFC3671:
+ collective attribute subentry' AUXILIARY )
+olcObjectClasses: ( 1.3.6.1.4.1.1466.101.119.2 NAME 'dynamicObject' DESC 'RFC2
+ 589: Dynamic Object' SUP top AUXILIARY )
+olcObjectClasses: ( 1.3.6.1.4.1.4203.666.3.4 NAME 'glue' DESC 'Glue Entry' SUP
+ top STRUCTURAL )
+olcObjectClasses: ( 1.3.6.1.4.1.4203.666.3.5 NAME 'syncConsumerSubentry' DESC
+ 'Persistent Info for SyncRepl Consumer' AUXILIARY MAY syncreplCookie )
+olcObjectClasses: ( 1.3.6.1.4.1.4203.666.3.6 NAME 'syncProviderSubentry' DESC
+ 'Persistent Info for SyncRepl Producer' AUXILIARY MAY contextCSN )
+olcObjectClasses: ( OLcfgGlOc:0 NAME 'olcConfig' DESC 'OpenLDAP configuration
+ object' SUP top ABSTRACT )
+olcObjectClasses: ( OLcfgGlOc:1 NAME 'olcGlobal' DESC 'OpenLDAP Global configu
+ ration options' SUP olcConfig STRUCTURAL MAY ( cn $ olcConfigFile $ olcConfig
+ Dir $ olcAllows $ olcArgsFile $ olcAttributeOptions $ olcAuthIDRewrite $ olcA
+ uthzPolicy $ olcAuthzRegexp $ olcConcurrency $ olcConnMaxPending $ olcConnMax
+ PendingAuth $ olcDisallows $ olcGentleHUP $ olcIdleTimeout $ olcIndexSubstrIf
+ MaxLen $ olcIndexSubstrIfMinLen $ olcIndexSubstrAnyLen $ olcIndexSubstrAnySte
+ p $ olcIndexHash64 $ olcIndexIntLen $ olcListenerThreads $ olcLocalSSF $ olcL
+ ogFile $ olcLogLevel $ olcMaxFilterDepth $ olcPasswordCryptSaltFormat $ olcPa
+ sswordHash $ olcPidFile $ olcPluginLogFile $ olcReadOnly $ olcReferral $ olcR
+ eplogFile $ olcRequires $ olcRestrict $ olcReverseLookup $ olcRootDSE $ olcSa
+ slAuxprops $ olcSaslAuxpropsDontUseCopy $ olcSaslAuxpropsDontUseCopyIgnore $
+ olcSaslCBinding $ olcSaslHost $ olcSaslRealm $ olcSaslSecProps $ olcSecurity
+ $ olcServerID $ olcSizeLimit $ olcSockbufMaxIncoming $ olcSockbufMaxIncomingA
+ uth $ olcTCPBuffer $ olcThreads $ olcThreadQueues $ olcTimeLimit $ olcTLSCACe
+ rtificateFile $ olcTLSCACertificatePath $ olcTLSCertificateFile $ olcTLSCerti
+ ficateKeyFile $ olcTLSCipherSuite $ olcTLSCRLCheck $ olcTLSCACertificate $ ol
+ cTLSCertificate $ olcTLSCertificateKey $ olcTLSRandFile $ olcTLSVerifyClient
+ $ olcTLSDHParamFile $ olcTLSECName $ olcTLSCRLFile $ olcTLSProtocolMin $ olcT
+ oolThreads $ olcWriteTimeout $ olcObjectIdentifier $ olcAttributeTypes $ olcO
+ bjectClasses $ olcDitContentRules $ olcLdapSyntaxes ) )
+olcObjectClasses: ( OLcfgGlOc:2 NAME 'olcSchemaConfig' DESC 'OpenLDAP schema o
+ bject' SUP olcConfig STRUCTURAL MAY ( cn $ olcObjectIdentifier $ olcLdapSynta
+ xes $ olcAttributeTypes $ olcObjectClasses $ olcDitContentRules ) )
+olcObjectClasses: ( OLcfgGlOc:3 NAME 'olcBackendConfig' DESC 'OpenLDAP Backend
+ -specific options' SUP olcConfig STRUCTURAL MUST olcBackend )
+olcObjectClasses: ( OLcfgGlOc:4 NAME 'olcDatabaseConfig' DESC 'OpenLDAP Databa
+ se-specific options' SUP olcConfig STRUCTURAL MUST olcDatabase MAY ( olcDisab
+ led $ olcHidden $ olcSuffix $ olcSubordinate $ olcAccess $ olcAddContentAcl $
+ olcLastMod $ olcLastBind $ olcLimits $ olcMaxDerefDepth $ olcPlugin $ olcRea
+ dOnly $ olcReplica $ olcReplicaArgsFile $ olcReplicaPidFile $ olcReplicationI
+ nterval $ olcReplogFile $ olcRequires $ olcRestrict $ olcRootDN $ olcRootPW $
+ olcSchemaDN $ olcSecurity $ olcSizeLimit $ olcSyncUseSubentry $ olcSyncrepl
+ $ olcTimeLimit $ olcUpdateDN $ olcUpdateRef $ olcMultiProvider $ olcMonitorin
+ g $ olcExtraAttrs ) )
+olcObjectClasses: ( OLcfgGlOc:5 NAME 'olcOverlayConfig' DESC 'OpenLDAP Overlay
+ -specific options' SUP olcConfig STRUCTURAL MUST olcOverlay MAY olcDisabled )
+olcObjectClasses: ( OLcfgGlOc:6 NAME 'olcIncludeFile' DESC 'OpenLDAP configura
+ tion include file' SUP olcConfig STRUCTURAL MUST olcInclude MAY ( cn $ olcRoo
+ tDSE ) )
+olcObjectClasses: ( OLcfgGlOc:7 NAME 'olcFrontendConfig' DESC 'OpenLDAP fronte
+ nd configuration' AUXILIARY MAY ( olcDefaultSearchBase $ olcPasswordHash $ ol
+ cSortVals ) )
+olcObjectClasses: ( OLcfgGlOc:8 NAME 'olcModuleList' DESC 'OpenLDAP dynamic mo
+ dule info' SUP olcConfig STRUCTURAL MAY ( cn $ olcModulePath $ olcModuleLoad
+ ) )
+olcObjectClasses: ( OLcfgDbOc:2.1 NAME 'olcLdifConfig' DESC 'LDIF backend conf
+ iguration' SUP olcDatabaseConfig STRUCTURAL MUST olcDbDirectory )
+olcObjectClasses: ( 1.3.6.1.4.1.4203.666.3.16.1 NAME 'monitor' DESC 'OpenLDAP
+ system monitoring' SUP top STRUCTURAL MUST cn MAY ( description $ seeAlso $ l
+ abeledURI $ monitoredInfo $ managedInfo $ monitorOverlay ) )
+olcObjectClasses: ( 1.3.6.1.4.1.4203.666.3.16.2 NAME 'monitorServer' DESC 'Ser
+ ver monitoring root entry' SUP monitor STRUCTURAL )
+olcObjectClasses: ( 1.3.6.1.4.1.4203.666.3.16.3 NAME 'monitorContainer' DESC '
+ monitor container class' SUP monitor STRUCTURAL )
+olcObjectClasses: ( 1.3.6.1.4.1.4203.666.3.16.4 NAME 'monitorCounterObject' DE
+ SC 'monitor counter class' SUP monitor STRUCTURAL )
+olcObjectClasses: ( 1.3.6.1.4.1.4203.666.3.16.5 NAME 'monitorOperation' DESC '
+ monitor operation class' SUP monitor STRUCTURAL )
+olcObjectClasses: ( 1.3.6.1.4.1.4203.666.3.16.6 NAME 'monitorConnection' DESC
+ 'monitor connection class' SUP monitor STRUCTURAL )
+olcObjectClasses: ( 1.3.6.1.4.1.4203.666.3.16.7 NAME 'managedObject' DESC 'mon
+ itor managed entity class' SUP monitor STRUCTURAL )
+olcObjectClasses: ( 1.3.6.1.4.1.4203.666.3.16.8 NAME 'monitoredObject' DESC 'm
+ onitor monitored entity class' SUP monitor STRUCTURAL )
+olcObjectClasses: ( OLcfgDbOc:4.1 NAME 'olcMonitorConfig' DESC 'Monitor backen
+ d configuration' SUP olcDatabaseConfig STRUCTURAL )
+olcObjectClasses: ( olmSyncReplObjectClasses:1 NAME 'olmSyncReplInstance' SUP
+ monitoredObject STRUCTURAL MAY ( olmSRProviderURIList $ olmSRConnection $ olm
+ SRSyncPhase $ olmSRNextConnect $ olmSRLastConnect $ olmSRLastContact $ olmSRL
+ astCookieRcvd $ olmSRLastCookieSent ) )
+olcObjectClasses: ( OLcfgBkOc:12.1 NAME 'olcMdbBkConfig' DESC 'MDB backend con
+ figuration' SUP olcBackendConfig STRUCTURAL MAY olcBkMdbIdlExp )
+olcObjectClasses: ( OLcfgDbOc:12.1 NAME 'olcMdbConfig' DESC 'MDB database conf
+ iguration' SUP olcDatabaseConfig STRUCTURAL MUST olcDbDirectory MAY ( olcDbCh
+ eckpoint $ olcDbEnvFlags $ olcDbNoSync $ olcDbIndex $ olcDbMaxReaders $ olcDb
+ MaxSize $ olcDbMode $ olcDbSearchStack $ olcDbMaxEntrySize $ olcDbRtxnSize $
+ olcDbMultival ) )
+olcObjectClasses: ( OLcfgOvOc:18.1 NAME ( 'olcMemberOfConfig' 'olcMemberOf' )
+ DESC 'Member-of configuration' SUP olcOverlayConfig STRUCTURAL MAY ( olcMembe
+ rOfDN $ olcMemberOfDangling $ olcMemberOfDanglingError $ olcMemberOfRefInt $
+ olcMemberOfGroupOC $ olcMemberOfMemberAD $ olcMemberOfMemberOfAD ) )
+olcObjectClasses: ( OLcfgOvOc:11.1 NAME 'olcRefintConfig' DESC 'Referential in
+ tegrity configuration' SUP olcOverlayConfig STRUCTURAL MAY ( olcRefintAttribu
+ te $ olcRefintNothing $ olcRefintModifiersName ) )
+olcObjectClasses: ( OLcfgOvOc:10.1 NAME 'olcUniqueConfig' DESC 'Attribute valu
+ e uniqueness configuration' SUP olcOverlayConfig STRUCTURAL MAY ( olcUniqueBa
+ se $ olcUniqueIgnore $ olcUniqueAttribute $ olcUniqueStrict $ olcUniqueURI )
+ )
+olcObjectClasses: ( olmMDBObjectClasses:2 NAME 'olmMDBDatabase' SUP top AUXILI
+ ARY MAY ( olmDbDirectory $ olmMDBPagesMax $ olmMDBPagesUsed $ olmMDBPagesFree
+ $ olmMDBReadersMax $ olmMDBReadersUsed $ olmMDBEntries ) )
+structuralObjectClass: olcSchemaConfig
+entryUUID: bae035d4-4e5c-103c-8e3d-83bde8bbc3e8
+creatorsName: cn=config
+createTimestamp: 20220412033105Z
+entryCSN: 20220412033105.684579Z#000000#000#000000
+modifiersName: cn=config
+modifyTimestamp: 20220412033105Z
diff --git a/dirsrvtests/tests/data/openldap_2_389/memberof/slapd.d/cn=config/cn=schema/cn={0}core.ldif b/dirsrvtests/tests/data/openldap_2_389/memberof/slapd.d/cn=config/cn=schema/cn={0}core.ldif
new file mode 100755
index 000000000..4a571f866
--- /dev/null
+++ b/dirsrvtests/tests/data/openldap_2_389/memberof/slapd.d/cn=config/cn=schema/cn={0}core.ldif
@@ -0,0 +1,244 @@
+# AUTO-GENERATED FILE - DO NOT EDIT!! Use ldapmodify.
+# CRC32 0e84f447
+dn: cn={0}core
+objectClass: olcSchemaConfig
+cn: {0}core
+olcAttributeTypes: {0}( 2.5.4.2 NAME 'knowledgeInformation' DESC 'RFC2256: kno
+ wledge information' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.
+ 1.15{32768} )
+olcAttributeTypes: {1}( 2.5.4.4 NAME ( 'sn' 'surname' ) DESC 'RFC2256: last (f
+ amily) name(s) for which the entity is known by' SUP name )
+olcAttributeTypes: {2}( 2.5.4.5 NAME 'serialNumber' DESC 'RFC2256: serial numb
+ er of the entity' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch S
+ YNTAX 1.3.6.1.4.1.1466.115.121.1.44{64} )
+olcAttributeTypes: {3}( 2.5.4.6 NAME ( 'c' 'countryName' ) DESC 'RFC4519: two-
+ letter ISO-3166 country code' SUP name SYNTAX 1.3.6.1.4.1.1466.115.121.1.11 S
+ INGLE-VALUE )
+olcAttributeTypes: {4}( 2.5.4.7 NAME ( 'l' 'localityName' ) DESC 'RFC2256: loc
+ ality which this object resides in' SUP name )
+olcAttributeTypes: {5}( 2.5.4.8 NAME ( 'st' 'stateOrProvinceName' ) DESC 'RFC2
+ 256: state or province which this object resides in' SUP name )
+olcAttributeTypes: {6}( 2.5.4.9 NAME ( 'street' 'streetAddress' ) DESC 'RFC225
+ 6: street address of this object' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreS
+ ubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} )
+olcAttributeTypes: {7}( 2.5.4.10 NAME ( 'o' 'organizationName' ) DESC 'RFC2256
+ : organization this object belongs to' SUP name )
+olcAttributeTypes: {8}( 2.5.4.11 NAME ( 'ou' 'organizationalUnitName' ) DESC '
+ RFC2256: organizational unit this object belongs to' SUP name )
+olcAttributeTypes: {9}( 2.5.4.12 NAME 'title' DESC 'RFC2256: title associated
+ with the entity' SUP name )
+olcAttributeTypes: {10}( 2.5.4.14 NAME 'searchGuide' DESC 'RFC2256: search gui
+ de, deprecated by enhancedSearchGuide' SYNTAX 1.3.6.1.4.1.1466.115.121.1.25 )
+olcAttributeTypes: {11}( 2.5.4.15 NAME 'businessCategory' DESC 'RFC2256: busin
+ ess category' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTA
+ X 1.3.6.1.4.1.1466.115.121.1.15{128} )
+olcAttributeTypes: {12}( 2.5.4.16 NAME 'postalAddress' DESC 'RFC2256: postal a
+ ddress' EQUALITY caseIgnoreListMatch SUBSTR caseIgnoreListSubstringsMatch SYN
+ TAX 1.3.6.1.4.1.1466.115.121.1.41 )
+olcAttributeTypes: {13}( 2.5.4.17 NAME 'postalCode' DESC 'RFC2256: postal code
+ ' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.
+ 1.1466.115.121.1.15{40} )
+olcAttributeTypes: {14}( 2.5.4.18 NAME 'postOfficeBox' DESC 'RFC2256: Post Off
+ ice Box' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3
+ .6.1.4.1.1466.115.121.1.15{40} )
+olcAttributeTypes: {15}( 2.5.4.19 NAME 'physicalDeliveryOfficeName' DESC 'RFC2
+ 256: Physical Delivery Office Name' EQUALITY caseIgnoreMatch SUBSTR caseIgnor
+ eSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{128} )
+olcAttributeTypes: {16}( 2.5.4.20 NAME 'telephoneNumber' DESC 'RFC2256: Teleph
+ one Number' EQUALITY telephoneNumberMatch SUBSTR telephoneNumberSubstringsMat
+ ch SYNTAX 1.3.6.1.4.1.1466.115.121.1.50{32} )
+olcAttributeTypes: {17}( 2.5.4.21 NAME 'telexNumber' DESC 'RFC2256: Telex Numb
+ er' SYNTAX 1.3.6.1.4.1.1466.115.121.1.52 )
+olcAttributeTypes: {18}( 2.5.4.22 NAME 'teletexTerminalIdentifier' DESC 'RFC22
+ 56: Teletex Terminal Identifier' SYNTAX 1.3.6.1.4.1.1466.115.121.1.51 )
+olcAttributeTypes: {19}( 2.5.4.23 NAME ( 'facsimileTelephoneNumber' 'fax' ) DE
+ SC 'RFC2256: Facsimile (Fax) Telephone Number' SYNTAX 1.3.6.1.4.1.1466.115.12
+ 1.1.22 )
+olcAttributeTypes: {20}( 2.5.4.24 NAME 'x121Address' DESC 'RFC2256: X.121 Addr
+ ess' EQUALITY numericStringMatch SUBSTR numericStringSubstringsMatch SYNTAX 1
+ .3.6.1.4.1.1466.115.121.1.36{15} )
+olcAttributeTypes: {21}( 2.5.4.25 NAME 'internationaliSDNNumber' DESC 'RFC2256
+ : international ISDN number' EQUALITY numericStringMatch SUBSTR numericString
+ SubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.36{16} )
+olcAttributeTypes: {22}( 2.5.4.26 NAME 'registeredAddress' DESC 'RFC2256: regi
+ stered postal address' SUP postalAddress SYNTAX 1.3.6.1.4.1.1466.115.121.1.41
+ )
+olcAttributeTypes: {23}( 2.5.4.27 NAME 'destinationIndicator' DESC 'RFC2256: d
+ estination indicator' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMat
+ ch SYNTAX 1.3.6.1.4.1.1466.115.121.1.44{128} )
+olcAttributeTypes: {24}( 2.5.4.28 NAME 'preferredDeliveryMethod' DESC 'RFC2256
+ : preferred delivery method' SYNTAX 1.3.6.1.4.1.1466.115.121.1.14 SINGLE-VALU
+ E )
+olcAttributeTypes: {25}( 2.5.4.29 NAME 'presentationAddress' DESC 'RFC2256: pr
+ esentation address' EQUALITY presentationAddressMatch SYNTAX 1.3.6.1.4.1.1466
+ .115.121.1.43 SINGLE-VALUE )
+olcAttributeTypes: {26}( 2.5.4.30 NAME 'supportedApplicationContext' DESC 'RFC
+ 2256: supported application context' EQUALITY objectIdentifierMatch SYNTAX 1.
+ 3.6.1.4.1.1466.115.121.1.38 )
+olcAttributeTypes: {27}( 2.5.4.31 NAME 'member' DESC 'RFC2256: member of a gro
+ up' SUP distinguishedName )
+olcAttributeTypes: {28}( 2.5.4.32 NAME 'owner' DESC 'RFC2256: owner (of the ob
+ ject)' SUP distinguishedName )
+olcAttributeTypes: {29}( 2.5.4.33 NAME 'roleOccupant' DESC 'RFC2256: occupant
+ of role' SUP distinguishedName )
+olcAttributeTypes: {30}( 2.5.4.36 NAME 'userCertificate' DESC 'RFC2256: X.509
+ user certificate, use ;binary' EQUALITY certificateExactMatch SYNTAX 1.3.6.1.
+ 4.1.1466.115.121.1.8 )
+olcAttributeTypes: {31}( 2.5.4.37 NAME 'cACertificate' DESC 'RFC2256: X.509 CA
+ certificate, use ;binary' EQUALITY certificateExactMatch SYNTAX 1.3.6.1.4.1.
+ 1466.115.121.1.8 )
+olcAttributeTypes: {32}( 2.5.4.38 NAME 'authorityRevocationList' DESC 'RFC2256
+ : X.509 authority revocation list, use ;binary' SYNTAX 1.3.6.1.4.1.1466.115.1
+ 21.1.9 )
+olcAttributeTypes: {33}( 2.5.4.39 NAME 'certificateRevocationList' DESC 'RFC22
+ 56: X.509 certificate revocation list, use ;binary' SYNTAX 1.3.6.1.4.1.1466.1
+ 15.121.1.9 )
+olcAttributeTypes: {34}( 2.5.4.40 NAME 'crossCertificatePair' DESC 'RFC2256: X
+ .509 cross certificate pair, use ;binary' SYNTAX 1.3.6.1.4.1.1466.115.121.1.1
+ 0 )
+olcAttributeTypes: {35}( 2.5.4.42 NAME ( 'givenName' 'gn' ) DESC 'RFC2256: fir
+ st name(s) for which the entity is known by' SUP name )
+olcAttributeTypes: {36}( 2.5.4.43 NAME 'initials' DESC 'RFC2256: initials of s
+ ome or all of names, but not the surname(s).' SUP name )
+olcAttributeTypes: {37}( 2.5.4.44 NAME 'generationQualifier' DESC 'RFC2256: na
+ me qualifier indicating a generation' SUP name )
+olcAttributeTypes: {38}( 2.5.4.45 NAME 'x500UniqueIdentifier' DESC 'RFC2256: X
+ .500 unique identifier' EQUALITY bitStringMatch SYNTAX 1.3.6.1.4.1.1466.115.1
+ 21.1.6 )
+olcAttributeTypes: {39}( 2.5.4.46 NAME 'dnQualifier' DESC 'RFC2256: DN qualifi
+ er' EQUALITY caseIgnoreMatch ORDERING caseIgnoreOrderingMatch SUBSTR caseIgno
+ reSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.44 )
+olcAttributeTypes: {40}( 2.5.4.47 NAME 'enhancedSearchGuide' DESC 'RFC2256: en
+ hanced search guide' SYNTAX 1.3.6.1.4.1.1466.115.121.1.21 )
+olcAttributeTypes: {41}( 2.5.4.48 NAME 'protocolInformation' DESC 'RFC2256: pr
+ otocol information' EQUALITY protocolInformationMatch SYNTAX 1.3.6.1.4.1.1466
+ .115.121.1.42 )
+olcAttributeTypes: {42}( 2.5.4.50 NAME 'uniqueMember' DESC 'RFC2256: unique me
+ mber of a group' EQUALITY uniqueMemberMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1
+ .34 )
+olcAttributeTypes: {43}( 2.5.4.51 NAME 'houseIdentifier' DESC 'RFC2256: house
+ identifier' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX
+ 1.3.6.1.4.1.1466.115.121.1.15{32768} )
+olcAttributeTypes: {44}( 2.5.4.52 NAME 'supportedAlgorithms' DESC 'RFC2256: su
+ pported algorithms' SYNTAX 1.3.6.1.4.1.1466.115.121.1.49 )
+olcAttributeTypes: {45}( 2.5.4.53 NAME 'deltaRevocationList' DESC 'RFC2256: de
+ lta revocation list; use ;binary' SYNTAX 1.3.6.1.4.1.1466.115.121.1.9 )
+olcAttributeTypes: {46}( 2.5.4.54 NAME 'dmdName' DESC 'RFC2256: name of DMD' S
+ UP name )
+olcAttributeTypes: {47}( 2.5.4.65 NAME 'pseudonym' DESC 'X.520(4th): pseudonym
+ for the object' SUP name )
+olcAttributeTypes: {48}( 0.9.2342.19200300.100.1.3 NAME ( 'mail' 'rfc822Mailbo
+ x' ) DESC 'RFC1274: RFC822 Mailbox' EQUALITY caseIgnoreIA5Match SUBSTR caseIg
+ noreIA5SubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{256} )
+olcAttributeTypes: {49}( 0.9.2342.19200300.100.1.25 NAME ( 'dc' 'domainCompone
+ nt' ) DESC 'RFC1274/2247: domain component' EQUALITY caseIgnoreIA5Match SUBST
+ R caseIgnoreIA5SubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VA
+ LUE )
+olcAttributeTypes: {50}( 0.9.2342.19200300.100.1.37 NAME 'associatedDomain' DE
+ SC 'RFC1274: domain associated with object' EQUALITY caseIgnoreIA5Match SUBST
+ R caseIgnoreIA5SubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
+olcAttributeTypes: {51}( 1.2.840.113549.1.9.1 NAME ( 'email' 'emailAddress' 'p
+ kcs9email' ) DESC 'RFC3280: legacy attribute for email addresses in DNs' EQUA
+ LITY caseIgnoreIA5Match SUBSTR caseIgnoreIA5SubstringsMatch SYNTAX 1.3.6.1.4.
+ 1.1466.115.121.1.26{128} )
+olcObjectClasses: {0}( 2.5.6.2 NAME 'country' DESC 'RFC2256: a country' SUP to
+ p STRUCTURAL MUST c MAY ( searchGuide $ description ) )
+olcObjectClasses: {1}( 2.5.6.3 NAME 'locality' DESC 'RFC2256: a locality' SUP
+ top STRUCTURAL MAY ( street $ seeAlso $ searchGuide $ st $ l $ description )
+ )
+olcObjectClasses: {2}( 2.5.6.4 NAME 'organization' DESC 'RFC2256: an organizat
+ ion' SUP top STRUCTURAL MUST o MAY ( userPassword $ searchGuide $ seeAlso $ b
+ usinessCategory $ x121Address $ registeredAddress $ destinationIndicator $ pr
+ eferredDeliveryMethod $ telexNumber $ teletexTerminalIdentifier $ telephoneNu
+ mber $ internationaliSDNNumber $ facsimileTelephoneNumber $ street $ postOffi
+ ceBox $ postalCode $ postalAddress $ physicalDeliveryOfficeName $ st $ l $ de
+ scription ) )
+olcObjectClasses: {3}( 2.5.6.5 NAME 'organizationalUnit' DESC 'RFC2256: an org
+ anizational unit' SUP top STRUCTURAL MUST ou MAY ( userPassword $ searchGuide
+ $ seeAlso $ businessCategory $ x121Address $ registeredAddress $ destination
+ Indicator $ preferredDeliveryMethod $ telexNumber $ teletexTerminalIdentifier
+ $ telephoneNumber $ internationaliSDNNumber $ facsimileTelephoneNumber $ str
+ eet $ postOfficeBox $ postalCode $ postalAddress $ physicalDeliveryOfficeName
+ $ st $ l $ description ) )
+olcObjectClasses: {4}( 2.5.6.6 NAME 'person' DESC 'RFC2256: a person' SUP top
+ STRUCTURAL MUST ( sn $ cn ) MAY ( userPassword $ telephoneNumber $ seeAlso $
+ description ) )
+olcObjectClasses: {5}( 2.5.6.7 NAME 'organizationalPerson' DESC 'RFC2256: an o
+ rganizational person' SUP person STRUCTURAL MAY ( title $ x121Address $ regis
+ teredAddress $ destinationIndicator $ preferredDeliveryMethod $ telexNumber $
+ teletexTerminalIdentifier $ telephoneNumber $ internationaliSDNNumber $ facs
+ imileTelephoneNumber $ street $ postOfficeBox $ postalCode $ postalAddress $
+ physicalDeliveryOfficeName $ ou $ st $ l ) )
+olcObjectClasses: {6}( 2.5.6.8 NAME 'organizationalRole' DESC 'RFC2256: an org
+ anizational role' SUP top STRUCTURAL MUST cn MAY ( x121Address $ registeredAd
+ dress $ destinationIndicator $ preferredDeliveryMethod $ telexNumber $ telete
+ xTerminalIdentifier $ telephoneNumber $ internationaliSDNNumber $ facsimileTe
+ lephoneNumber $ seeAlso $ roleOccupant $ preferredDeliveryMethod $ street $ p
+ ostOfficeBox $ postalCode $ postalAddress $ physicalDeliveryOfficeName $ ou $
+ st $ l $ description ) )
+olcObjectClasses: {7}( 2.5.6.9 NAME 'groupOfNames' DESC 'RFC2256: a group of n
+ ames (DNs)' SUP top STRUCTURAL MUST ( member $ cn ) MAY ( businessCategory $
+ seeAlso $ owner $ ou $ o $ description ) )
+olcObjectClasses: {8}( 2.5.6.10 NAME 'residentialPerson' DESC 'RFC2256: an res
+ idential person' SUP person STRUCTURAL MUST l MAY ( businessCategory $ x121Ad
+ dress $ registeredAddress $ destinationIndicator $ preferredDeliveryMethod $
+ telexNumber $ teletexTerminalIdentifier $ telephoneNumber $ internationaliSDN
+ Number $ facsimileTelephoneNumber $ preferredDeliveryMethod $ street $ postOf
+ ficeBox $ postalCode $ postalAddress $ physicalDeliveryOfficeName $ st $ l )
+ )
+olcObjectClasses: {9}( 2.5.6.11 NAME 'applicationProcess' DESC 'RFC2256: an ap
+ plication process' SUP top STRUCTURAL MUST cn MAY ( seeAlso $ ou $ l $ descri
+ ption ) )
+olcObjectClasses: {10}( 2.5.6.12 NAME 'applicationEntity' DESC 'RFC2256: an ap
+ plication entity' SUP top STRUCTURAL MUST ( presentationAddress $ cn ) MAY (
+ supportedApplicationContext $ seeAlso $ ou $ o $ l $ description ) )
+olcObjectClasses: {11}( 2.5.6.13 NAME 'dSA' DESC 'RFC2256: a directory system
+ agent (a server)' SUP applicationEntity STRUCTURAL MAY knowledgeInformation )
+olcObjectClasses: {12}( 2.5.6.14 NAME 'device' DESC 'RFC2256: a device' SUP to
+ p STRUCTURAL MUST cn MAY ( serialNumber $ seeAlso $ owner $ ou $ o $ l $ desc
+ ription ) )
+olcObjectClasses: {13}( 2.5.6.15 NAME 'strongAuthenticationUser' DESC 'RFC2256
+ : a strong authentication user' SUP top AUXILIARY MUST userCertificate )
+olcObjectClasses: {14}( 2.5.6.16 NAME 'certificationAuthority' DESC 'RFC2256:
+ a certificate authority' SUP top AUXILIARY MUST ( authorityRevocationList $ c
+ ertificateRevocationList $ cACertificate ) MAY crossCertificatePair )
+olcObjectClasses: {15}( 2.5.6.17 NAME 'groupOfUniqueNames' DESC 'RFC2256: a gr
+ oup of unique names (DN and Unique Identifier)' SUP top STRUCTURAL MUST ( uni
+ queMember $ cn ) MAY ( businessCategory $ seeAlso $ owner $ ou $ o $ descript
+ ion ) )
+olcObjectClasses: {16}( 2.5.6.18 NAME 'userSecurityInformation' DESC 'RFC2256:
+ a user security information' SUP top AUXILIARY MAY supportedAlgorithms )
+olcObjectClasses: {17}( 2.5.6.16.2 NAME 'certificationAuthority-V2' SUP certif
+ icationAuthority AUXILIARY MAY deltaRevocationList )
+olcObjectClasses: {18}( 2.5.6.19 NAME 'cRLDistributionPoint' SUP top STRUCTURA
+ L MUST cn MAY ( certificateRevocationList $ authorityRevocationList $ deltaRe
+ vocationList ) )
+olcObjectClasses: {19}( 2.5.6.20 NAME 'dmd' SUP top STRUCTURAL MUST dmdName MA
+ Y ( userPassword $ searchGuide $ seeAlso $ businessCategory $ x121Address $ r
+ egisteredAddress $ destinationIndicator $ preferredDeliveryMethod $ telexNumb
+ er $ teletexTerminalIdentifier $ telephoneNumber $ internationaliSDNNumber $
+ facsimileTelephoneNumber $ street $ postOfficeBox $ postalCode $ postalAddres
+ s $ physicalDeliveryOfficeName $ st $ l $ description ) )
+olcObjectClasses: {20}( 2.5.6.21 NAME 'pkiUser' DESC 'RFC2587: a PKI user' SUP
+ top AUXILIARY MAY userCertificate )
+olcObjectClasses: {21}( 2.5.6.22 NAME 'pkiCA' DESC 'RFC2587: PKI certificate a
+ uthority' SUP top AUXILIARY MAY ( authorityRevocationList $ certificateRevoca
+ tionList $ cACertificate $ crossCertificatePair ) )
+olcObjectClasses: {22}( 2.5.6.23 NAME 'deltaCRL' DESC 'RFC4523: X.509 delta CR
+ L' SUP top AUXILIARY MAY deltaRevocationList )
+olcObjectClasses: {23}( 1.3.6.1.4.1.250.3.15 NAME 'labeledURIObject' DESC 'RFC
+ 2079: object that contains the URI attribute type' SUP top AUXILIARY MAY labe
+ ledURI )
+olcObjectClasses: {24}( 0.9.2342.19200300.100.4.19 NAME 'simpleSecurityObject'
+ DESC 'RFC1274: simple security object' SUP top AUXILIARY MUST userPassword )
+olcObjectClasses: {25}( 1.3.6.1.4.1.1466.344 NAME 'dcObject' DESC 'RFC2247: do
+ main component object' SUP top AUXILIARY MUST dc )
+olcObjectClasses: {26}( 1.3.6.1.1.3.1 NAME 'uidObject' DESC 'RFC2377: uid obje
+ ct' SUP top AUXILIARY MUST uid )
+structuralObjectClass: olcSchemaConfig
+entryUUID: bae046e6-4e5c-103c-8e3e-83bde8bbc3e8
+creatorsName: cn=config
+createTimestamp: 20220412033105Z
+entryCSN: 20220412033105.684579Z#000000#000#000000
+modifiersName: cn=config
+modifyTimestamp: 20220412033105Z
diff --git a/dirsrvtests/tests/data/openldap_2_389/memberof/slapd.d/cn=config/cn=schema/cn={1}cosine.ldif b/dirsrvtests/tests/data/openldap_2_389/memberof/slapd.d/cn=config/cn=schema/cn={1}cosine.ldif
new file mode 100755
index 000000000..9bff5cfa6
--- /dev/null
+++ b/dirsrvtests/tests/data/openldap_2_389/memberof/slapd.d/cn=config/cn=schema/cn={1}cosine.ldif
@@ -0,0 +1,177 @@
+# AUTO-GENERATED FILE - DO NOT EDIT!! Use ldapmodify.
+# CRC32 d2273202
+dn: cn={1}cosine
+objectClass: olcSchemaConfig
+cn: {1}cosine
+olcAttributeTypes: {0}( 0.9.2342.19200300.100.1.2 NAME 'textEncodedORAddress'
+ EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.
+ 1466.115.121.1.15{256} )
+olcAttributeTypes: {1}( 0.9.2342.19200300.100.1.4 NAME 'info' DESC 'RFC1274: g
+ eneral information' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{2048} )
+olcAttributeTypes: {2}( 0.9.2342.19200300.100.1.5 NAME ( 'drink' 'favouriteDri
+ nk' ) DESC 'RFC1274: favorite drink' EQUALITY caseIgnoreMatch SUBSTR caseIgno
+ reSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )
+olcAttributeTypes: {3}( 0.9.2342.19200300.100.1.6 NAME 'roomNumber' DESC 'RFC1
+ 274: room number' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch S
+ YNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )
+olcAttributeTypes: {4}( 0.9.2342.19200300.100.1.7 NAME 'photo' DESC 'RFC1274:
+ photo (G3 fax)' SYNTAX 1.3.6.1.4.1.1466.115.121.1.23{25000} )
+olcAttributeTypes: {5}( 0.9.2342.19200300.100.1.8 NAME 'userClass' DESC 'RFC12
+ 74: category of user' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMat
+ ch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )
+olcAttributeTypes: {6}( 0.9.2342.19200300.100.1.9 NAME 'host' DESC 'RFC1274: h
+ ost computer' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTA
+ X 1.3.6.1.4.1.1466.115.121.1.15{256} )
+olcAttributeTypes: {7}( 0.9.2342.19200300.100.1.10 NAME 'manager' DESC 'RFC127
+ 4: DN of manager' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115
+ .121.1.12 )
+olcAttributeTypes: {8}( 0.9.2342.19200300.100.1.11 NAME 'documentIdentifier' D
+ ESC 'RFC1274: unique identifier of document' EQUALITY caseIgnoreMatch SUBSTR
+ caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )
+olcAttributeTypes: {9}( 0.9.2342.19200300.100.1.12 NAME 'documentTitle' DESC '
+ RFC1274: title of document' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstri
+ ngsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )
+olcAttributeTypes: {10}( 0.9.2342.19200300.100.1.13 NAME 'documentVersion' DES
+ C 'RFC1274: version of document' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSu
+ bstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )
+olcAttributeTypes: {11}( 0.9.2342.19200300.100.1.14 NAME 'documentAuthor' DESC
+ 'RFC1274: DN of author of document' EQUALITY distinguishedNameMatch SYNTAX 1
+ .3.6.1.4.1.1466.115.121.1.12 )
+olcAttributeTypes: {12}( 0.9.2342.19200300.100.1.15 NAME 'documentLocation' DE
+ SC 'RFC1274: location of document original' EQUALITY caseIgnoreMatch SUBSTR c
+ aseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )
+olcAttributeTypes: {13}( 0.9.2342.19200300.100.1.20 NAME ( 'homePhone' 'homeTe
+ lephoneNumber' ) DESC 'RFC1274: home telephone number' EQUALITY telephoneNumb
+ erMatch SUBSTR telephoneNumberSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121
+ .1.50 )
+olcAttributeTypes: {14}( 0.9.2342.19200300.100.1.21 NAME 'secretary' DESC 'RFC
+ 1274: DN of secretary' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.146
+ 6.115.121.1.12 )
+olcAttributeTypes: {15}( 0.9.2342.19200300.100.1.22 NAME 'otherMailbox' SYNTAX
+ 1.3.6.1.4.1.1466.115.121.1.39 )
+olcAttributeTypes: {16}( 0.9.2342.19200300.100.1.26 NAME 'aRecord' EQUALITY ca
+ seIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
+olcAttributeTypes: {17}( 0.9.2342.19200300.100.1.27 NAME 'mDRecord' EQUALITY c
+ aseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
+olcAttributeTypes: {18}( 0.9.2342.19200300.100.1.28 NAME 'mXRecord' EQUALITY c
+ aseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
+olcAttributeTypes: {19}( 0.9.2342.19200300.100.1.29 NAME 'nSRecord' EQUALITY c
+ aseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
+olcAttributeTypes: {20}( 0.9.2342.19200300.100.1.30 NAME 'sOARecord' EQUALITY
+ caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
+olcAttributeTypes: {21}( 0.9.2342.19200300.100.1.31 NAME 'cNAMERecord' EQUALIT
+ Y caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
+olcAttributeTypes: {22}( 0.9.2342.19200300.100.1.38 NAME 'associatedName' DESC
+ 'RFC1274: DN of entry associated with domain' EQUALITY distinguishedNameMatc
+ h SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 )
+olcAttributeTypes: {23}( 0.9.2342.19200300.100.1.39 NAME 'homePostalAddress' D
+ ESC 'RFC1274: home postal address' EQUALITY caseIgnoreListMatch SUBSTR caseIg
+ noreListSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.41 )
+olcAttributeTypes: {24}( 0.9.2342.19200300.100.1.40 NAME 'personalTitle' DESC
+ 'RFC1274: personal title' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstring
+ sMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )
+olcAttributeTypes: {25}( 0.9.2342.19200300.100.1.41 NAME ( 'mobile' 'mobileTel
+ ephoneNumber' ) DESC 'RFC1274: mobile telephone number' EQUALITY telephoneNum
+ berMatch SUBSTR telephoneNumberSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.12
+ 1.1.50 )
+olcAttributeTypes: {26}( 0.9.2342.19200300.100.1.42 NAME ( 'pager' 'pagerTelep
+ honeNumber' ) DESC 'RFC1274: pager telephone number' EQUALITY telephoneNumber
+ Match SUBSTR telephoneNumberSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1
+ .50 )
+olcAttributeTypes: {27}( 0.9.2342.19200300.100.1.43 NAME ( 'co' 'friendlyCount
+ ryName' ) DESC 'RFC1274: friendly country name' EQUALITY caseIgnoreMatch SUBS
+ TR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
+olcAttributeTypes: {28}( 0.9.2342.19200300.100.1.44 NAME 'uniqueIdentifier' DE
+ SC 'RFC1274: unique identifer' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.14
+ 66.115.121.1.15{256} )
+olcAttributeTypes: {29}( 0.9.2342.19200300.100.1.45 NAME 'organizationalStatus
+ ' DESC 'RFC1274: organizational status' EQUALITY caseIgnoreMatch SUBSTR caseI
+ gnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )
+olcAttributeTypes: {30}( 0.9.2342.19200300.100.1.46 NAME 'janetMailbox' DESC '
+ RFC1274: Janet mailbox' EQUALITY caseIgnoreIA5Match SUBSTR caseIgnoreIA5Subst
+ ringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.26{256} )
+olcAttributeTypes: {31}( 0.9.2342.19200300.100.1.47 NAME 'mailPreferenceOption
+ ' DESC 'RFC1274: mail preference option' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27
+ )
+olcAttributeTypes: {32}( 0.9.2342.19200300.100.1.48 NAME 'buildingName' DESC '
+ RFC1274: name of building' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstrin
+ gsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )
+olcAttributeTypes: {33}( 0.9.2342.19200300.100.1.49 NAME 'dSAQuality' DESC 'RF
+ C1274: DSA Quality' SYNTAX 1.3.6.1.4.1.1466.115.121.1.19 SINGLE-VALUE )
+olcAttributeTypes: {34}( 0.9.2342.19200300.100.1.50 NAME 'singleLevelQuality'
+ DESC 'RFC1274: Single Level Quality' SYNTAX 1.3.6.1.4.1.1466.115.121.1.13 SIN
+ GLE-VALUE )
+olcAttributeTypes: {35}( 0.9.2342.19200300.100.1.51 NAME 'subtreeMinimumQualit
+ y' DESC 'RFC1274: Subtree Minimum Quality' SYNTAX 1.3.6.1.4.1.1466.115.121.1.
+ 13 SINGLE-VALUE )
+olcAttributeTypes: {36}( 0.9.2342.19200300.100.1.52 NAME 'subtreeMaximumQualit
+ y' DESC 'RFC1274: Subtree Maximum Quality' SYNTAX 1.3.6.1.4.1.1466.115.121.1.
+ 13 SINGLE-VALUE )
+olcAttributeTypes: {37}( 0.9.2342.19200300.100.1.53 NAME 'personalSignature' D
+ ESC 'RFC1274: Personal Signature (G3 fax)' SYNTAX 1.3.6.1.4.1.1466.115.121.1.
+ 23 )
+olcAttributeTypes: {38}( 0.9.2342.19200300.100.1.54 NAME 'dITRedirect' DESC 'R
+ FC1274: DIT Redirect' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.1.1466
+ .115.121.1.12 )
+olcAttributeTypes: {39}( 0.9.2342.19200300.100.1.55 NAME 'audio' DESC 'RFC1274
+ : audio (u-law)' SYNTAX 1.3.6.1.4.1.1466.115.121.1.4{25000} )
+olcAttributeTypes: {40}( 0.9.2342.19200300.100.1.56 NAME 'documentPublisher' D
+ ESC 'RFC1274: publisher of document' EQUALITY caseIgnoreMatch SUBSTR caseIgno
+ reSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
+olcObjectClasses: {0}( 0.9.2342.19200300.100.4.4 NAME ( 'pilotPerson' 'newPilo
+ tPerson' ) SUP person STRUCTURAL MAY ( userid $ textEncodedORAddress $ rfc822
+ Mailbox $ favouriteDrink $ roomNumber $ userClass $ homeTelephoneNumber $ hom
+ ePostalAddress $ secretary $ personalTitle $ preferredDeliveryMethod $ busine
+ ssCategory $ janetMailbox $ otherMailbox $ mobileTelephoneNumber $ pagerTelep
+ honeNumber $ organizationalStatus $ mailPreferenceOption $ personalSignature
+ ) )
+olcObjectClasses: {1}( 0.9.2342.19200300.100.4.5 NAME 'account' SUP top STRUCT
+ URAL MUST userid MAY ( description $ seeAlso $ localityName $ organizationNam
+ e $ organizationalUnitName $ host ) )
+olcObjectClasses: {2}( 0.9.2342.19200300.100.4.6 NAME 'document' SUP top STRUC
+ TURAL MUST documentIdentifier MAY ( commonName $ description $ seeAlso $ loca
+ lityName $ organizationName $ organizationalUnitName $ documentTitle $ docume
+ ntVersion $ documentAuthor $ documentLocation $ documentPublisher ) )
+olcObjectClasses: {3}( 0.9.2342.19200300.100.4.7 NAME 'room' SUP top STRUCTURA
+ L MUST commonName MAY ( roomNumber $ description $ seeAlso $ telephoneNumber
+ ) )
+olcObjectClasses: {4}( 0.9.2342.19200300.100.4.9 NAME 'documentSeries' SUP top
+ STRUCTURAL MUST commonName MAY ( description $ seeAlso $ telephonenumber $ l
+ ocalityName $ organizationName $ organizationalUnitName ) )
+olcObjectClasses: {5}( 0.9.2342.19200300.100.4.13 NAME 'domain' SUP top STRUCT
+ URAL MUST domainComponent MAY ( associatedName $ organizationName $ descripti
+ on $ businessCategory $ seeAlso $ searchGuide $ userPassword $ localityName $
+ stateOrProvinceName $ streetAddress $ physicalDeliveryOfficeName $ postalAdd
+ ress $ postalCode $ postOfficeBox $ streetAddress $ facsimileTelephoneNumber
+ $ internationalISDNNumber $ telephoneNumber $ teletexTerminalIdentifier $ tel
+ exNumber $ preferredDeliveryMethod $ destinationIndicator $ registeredAddress
+ $ x121Address ) )
+olcObjectClasses: {6}( 0.9.2342.19200300.100.4.14 NAME 'RFC822localPart' SUP d
+ omain STRUCTURAL MAY ( commonName $ surname $ description $ seeAlso $ telepho
+ neNumber $ physicalDeliveryOfficeName $ postalAddress $ postalCode $ postOffi
+ ceBox $ streetAddress $ facsimileTelephoneNumber $ internationalISDNNumber $
+ telephoneNumber $ teletexTerminalIdentifier $ telexNumber $ preferredDelivery
+ Method $ destinationIndicator $ registeredAddress $ x121Address ) )
+olcObjectClasses: {7}( 0.9.2342.19200300.100.4.15 NAME 'dNSDomain' SUP domain
+ STRUCTURAL MAY ( ARecord $ MDRecord $ MXRecord $ NSRecord $ SOARecord $ CNAME
+ Record ) )
+olcObjectClasses: {8}( 0.9.2342.19200300.100.4.17 NAME 'domainRelatedObject' D
+ ESC 'RFC1274: an object related to an domain' SUP top AUXILIARY MUST associat
+ edDomain )
+olcObjectClasses: {9}( 0.9.2342.19200300.100.4.18 NAME 'friendlyCountry' SUP c
+ ountry STRUCTURAL MUST friendlyCountryName )
+olcObjectClasses: {10}( 0.9.2342.19200300.100.4.20 NAME 'pilotOrganization' SU
+ P ( organization $ organizationalUnit ) STRUCTURAL MAY buildingName )
+olcObjectClasses: {11}( 0.9.2342.19200300.100.4.21 NAME 'pilotDSA' SUP dsa STR
+ UCTURAL MAY dSAQuality )
+olcObjectClasses: {12}( 0.9.2342.19200300.100.4.22 NAME 'qualityLabelledData'
+ SUP top AUXILIARY MUST dsaQuality MAY ( subtreeMinimumQuality $ subtreeMaximu
+ mQuality ) )
+structuralObjectClass: olcSchemaConfig
+entryUUID: bae04f1a-4e5c-103c-8e3f-83bde8bbc3e8
+creatorsName: cn=config
+createTimestamp: 20220412033105Z
+entryCSN: 20220412033105.684579Z#000000#000#000000
+modifiersName: cn=config
+modifyTimestamp: 20220412033105Z
diff --git a/dirsrvtests/tests/data/openldap_2_389/memberof/slapd.d/cn=config/cn=schema/cn={2}inetorgperson.ldif b/dirsrvtests/tests/data/openldap_2_389/memberof/slapd.d/cn=config/cn=schema/cn={2}inetorgperson.ldif
new file mode 100755
index 000000000..8c4664a9d
--- /dev/null
+++ b/dirsrvtests/tests/data/openldap_2_389/memberof/slapd.d/cn=config/cn=schema/cn={2}inetorgperson.ldif
@@ -0,0 +1,48 @@
+# AUTO-GENERATED FILE - DO NOT EDIT!! Use ldapmodify.
+# CRC32 34e31df3
+dn: cn={2}inetorgperson
+objectClass: olcSchemaConfig
+cn: {2}inetorgperson
+olcAttributeTypes: {0}( 2.16.840.1.113730.3.1.1 NAME 'carLicense' DESC 'RFC279
+ 8: vehicle license or registration plate' EQUALITY caseIgnoreMatch SUBSTR cas
+ eIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
+olcAttributeTypes: {1}( 2.16.840.1.113730.3.1.2 NAME 'departmentNumber' DESC '
+ RFC2798: identifies a department within an organization' EQUALITY caseIgnoreM
+ atch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
+olcAttributeTypes: {2}( 2.16.840.1.113730.3.1.241 NAME 'displayName' DESC 'RFC
+ 2798: preferred name to be used when displaying entries' EQUALITY caseIgnoreM
+ atch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SI
+ NGLE-VALUE )
+olcAttributeTypes: {3}( 2.16.840.1.113730.3.1.3 NAME 'employeeNumber' DESC 'RF
+ C2798: numerically identifies an employee within an organization' EQUALITY ca
+ seIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.12
+ 1.1.15 SINGLE-VALUE )
+olcAttributeTypes: {4}( 2.16.840.1.113730.3.1.4 NAME 'employeeType' DESC 'RFC2
+ 798: type of employment for a person' EQUALITY caseIgnoreMatch SUBSTR caseIgn
+ oreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
+olcAttributeTypes: {5}( 0.9.2342.19200300.100.1.60 NAME 'jpegPhoto' DESC 'RFC2
+ 798: a JPEG image' SYNTAX 1.3.6.1.4.1.1466.115.121.1.28 )
+olcAttributeTypes: {6}( 2.16.840.1.113730.3.1.39 NAME 'preferredLanguage' DESC
+ 'RFC2798: preferred written or spoken language for a person' EQUALITY caseIg
+ noreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.
+ 15 SINGLE-VALUE )
+olcAttributeTypes: {7}( 2.16.840.1.113730.3.1.40 NAME 'userSMIMECertificate' D
+ ESC 'RFC2798: PKCS#7 SignedData used to support S/MIME' SYNTAX 1.3.6.1.4.1.14
+ 66.115.121.1.5 )
+olcAttributeTypes: {8}( 2.16.840.1.113730.3.1.216 NAME 'userPKCS12' DESC 'RFC2
+ 798: personal identity information, a PKCS #12 PFX' SYNTAX 1.3.6.1.4.1.1466.1
+ 15.121.1.5 )
+olcObjectClasses: {0}( 2.16.840.1.113730.3.2.2 NAME 'inetOrgPerson' DESC 'RFC2
+ 798: Internet Organizational Person' SUP organizationalPerson STRUCTURAL MAY
+ ( audio $ businessCategory $ carLicense $ departmentNumber $ displayName $ em
+ ployeeNumber $ employeeType $ givenName $ homePhone $ homePostalAddress $ ini
+ tials $ jpegPhoto $ labeledURI $ mail $ manager $ mobile $ o $ pager $ photo
+ $ roomNumber $ secretary $ uid $ userCertificate $ x500uniqueIdentifier $ pre
+ ferredLanguage $ userSMIMECertificate $ userPKCS12 ) )
+structuralObjectClass: olcSchemaConfig
+entryUUID: bae0537a-4e5c-103c-8e40-83bde8bbc3e8
+creatorsName: cn=config
+createTimestamp: 20220412033105Z
+entryCSN: 20220412033105.684579Z#000000#000#000000
+modifiersName: cn=config
+modifyTimestamp: 20220412033105Z
diff --git a/dirsrvtests/tests/data/openldap_2_389/memberof/slapd.d/cn=config/cn=schema/cn={3}rfc2307bis.ldif b/dirsrvtests/tests/data/openldap_2_389/memberof/slapd.d/cn=config/cn=schema/cn={3}rfc2307bis.ldif
new file mode 100755
index 000000000..e839145c1
--- /dev/null
+++ b/dirsrvtests/tests/data/openldap_2_389/memberof/slapd.d/cn=config/cn=schema/cn={3}rfc2307bis.ldif
@@ -0,0 +1,153 @@
+# AUTO-GENERATED FILE - DO NOT EDIT!! Use ldapmodify.
+# CRC32 746f71bc
+dn: cn={3}rfc2307bis
+objectClass: olcSchemaConfig
+cn: {3}rfc2307bis
+olcAttributeTypes: {0}( 1.3.6.1.1.1.1.2 NAME 'gecos' DESC 'The GECOS field; th
+ e common name' EQUALITY caseIgnoreIA5Match SUBSTR caseIgnoreIA5SubstringsMatc
+ h SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
+olcAttributeTypes: {1}( 1.3.6.1.1.1.1.3 NAME 'homeDirectory' DESC 'The absolut
+ e path to the home directory' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1
+ 466.115.121.1.26 SINGLE-VALUE )
+olcAttributeTypes: {2}( 1.3.6.1.1.1.1.4 NAME 'loginShell' DESC 'The path to th
+ e login shell' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.2
+ 6 SINGLE-VALUE )
+olcAttributeTypes: {3}( 1.3.6.1.1.1.1.5 NAME 'shadowLastChange' EQUALITY integ
+ erMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
+olcAttributeTypes: {4}( 1.3.6.1.1.1.1.6 NAME 'shadowMin' EQUALITY integerMatch
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
+olcAttributeTypes: {5}( 1.3.6.1.1.1.1.7 NAME 'shadowMax' EQUALITY integerMatch
+ SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
+olcAttributeTypes: {6}( 1.3.6.1.1.1.1.8 NAME 'shadowWarning' EQUALITY integerM
+ atch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
+olcAttributeTypes: {7}( 1.3.6.1.1.1.1.9 NAME 'shadowInactive' EQUALITY integer
+ Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
+olcAttributeTypes: {8}( 1.3.6.1.1.1.1.10 NAME 'shadowExpire' EQUALITY integerM
+ atch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
+olcAttributeTypes: {9}( 1.3.6.1.1.1.1.11 NAME 'shadowFlag' EQUALITY integerMat
+ ch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
+olcAttributeTypes: {10}( 1.3.6.1.1.1.1.12 NAME 'memberUid' EQUALITY caseExactI
+ A5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
+olcAttributeTypes: {11}( 1.3.6.1.1.1.1.13 NAME 'memberNisNetgroup' EQUALITY ca
+ seExactIA5Match SUBSTR caseExactIA5SubstringsMatch SYNTAX 1.3.6.1.4.1.1466.11
+ 5.121.1.26 )
+olcAttributeTypes: {12}( 1.3.6.1.1.1.1.14 NAME 'nisNetgroupTriple' DESC 'Netgr
+ oup triple' EQUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26
+ )
+olcAttributeTypes: {13}( 1.3.6.1.1.1.1.15 NAME 'ipServicePort' DESC 'Service p
+ ort number' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE
+ -VALUE )
+olcAttributeTypes: {14}( 1.3.6.1.1.1.1.16 NAME 'ipServiceProtocol' DESC 'Servi
+ ce protocol name' SUP name )
+olcAttributeTypes: {15}( 1.3.6.1.1.1.1.17 NAME 'ipProtocolNumber' DESC 'IP pro
+ tocol number' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SING
+ LE-VALUE )
+olcAttributeTypes: {16}( 1.3.6.1.1.1.1.18 NAME 'oncRpcNumber' DESC 'ONC RPC nu
+ mber' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE
+ )
+olcAttributeTypes: {17}( 1.3.6.1.1.1.1.19 NAME 'ipHostNumber' DESC 'IPv4 addre
+ sses as a dotted decimal omitting leading zeros or IPv6 addresses as d
+ efined in RFC2373' SUP name )
+olcAttributeTypes: {18}( 1.3.6.1.1.1.1.20 NAME 'ipNetworkNumber' DESC 'IP netw
+ ork as a dotted decimal, eg. 192.168, omitting leading zeros' SUP name
+ SINGLE-VALUE )
+olcAttributeTypes: {19}( 1.3.6.1.1.1.1.21 NAME 'ipNetmaskNumber' DESC 'IP netm
+ ask as a dotted decimal, eg. 255.255.255.0, omitting leading zeros' EQ
+ UALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
+olcAttributeTypes: {20}( 1.3.6.1.1.1.1.22 NAME 'macAddress' DESC 'MAC address
+ in maximal, colon separated hex notation, eg. 00:00:92:90:ee:e2' EQUAL
+ ITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
+olcAttributeTypes: {21}( 1.3.6.1.1.1.1.23 NAME 'bootParameter' DESC 'rpc.bootp
+ aramd parameter' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1
+ .26 )
+olcAttributeTypes: {22}( 1.3.6.1.1.1.1.24 NAME 'bootFile' DESC 'Boot image nam
+ e' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
+olcAttributeTypes: {23}( 1.3.6.1.1.1.1.26 NAME 'nisMapName' DESC 'Name of a A
+ generic NIS map' SUP name )
+olcAttributeTypes: {24}( 1.3.6.1.1.1.1.27 NAME 'nisMapEntry' DESC 'A generic N
+ IS entry' EQUALITY caseExactIA5Match SUBSTR caseExactIA5SubstringsMatch SYNTA
+ X 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
+olcAttributeTypes: {25}( 1.3.6.1.1.1.1.28 NAME 'nisPublicKey' DESC 'NIS public
+ key' EQUALITY octetStringMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 SINGLE-V
+ ALUE )
+olcAttributeTypes: {26}( 1.3.6.1.1.1.1.29 NAME 'nisSecretKey' DESC 'NIS secret
+ key' EQUALITY octetStringMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.40 SINGLE-V
+ ALUE )
+olcAttributeTypes: {27}( 1.3.6.1.1.1.1.30 NAME 'nisDomain' DESC 'NIS domain' E
+ QUALITY caseIgnoreIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
+olcAttributeTypes: {28}( 1.3.6.1.1.1.1.31 NAME 'automountMapName' DESC 'automo
+ unt Map Name' EQUALITY caseExactIA5Match SUBSTR caseExactIA5SubstringsMatch S
+ YNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
+olcAttributeTypes: {29}( 1.3.6.1.1.1.1.32 NAME 'automountKey' DESC 'Automount
+ Key value' EQUALITY caseExactIA5Match SUBSTR caseExactIA5SubstringsMatch SYNT
+ AX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
+olcAttributeTypes: {30}( 1.3.6.1.1.1.1.33 NAME 'automountInformation' DESC 'Au
+ tomount information' EQUALITY caseExactIA5Match SUBSTR caseExactIA5Substrings
+ Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
+olcObjectClasses: {0}( 1.3.6.1.1.1.2.0 NAME 'posixAccount' DESC 'Abstraction o
+ f an account with POSIX attributes' SUP top AUXILIARY MUST ( cn $ uid $ uidNu
+ mber $ gidNumber $ homeDirectory ) MAY ( userPassword $ loginShell $ gecos $
+ description ) )
+olcObjectClasses: {1}( 1.3.6.1.1.1.2.1 NAME 'shadowAccount' DESC 'Additional a
+ ttributes for shadow passwords' SUP top AUXILIARY MUST uid MAY ( userPassword
+ $ description $ shadowLastChange $ shadowMin $ shadowMax $ shadowWarning $ s
+ hadowInactive $ shadowExpire $ shadowFlag ) )
+olcObjectClasses: {2}( 1.3.6.1.1.1.2.2 NAME 'posixGroup' DESC 'Abstraction of
+ a group of accounts' SUP top AUXILIARY MUST gidNumber MAY ( userPassword $ me
+ mberUid $ description ) )
+olcObjectClasses: {3}( 1.3.6.1.1.1.2.3 NAME 'ipService' DESC 'Abstraction an I
+ nternet Protocol service. Maps an IP port and protocol (such as tcp or
+ udp) to one or more names; the distinguished value of the cn a
+ ttribute denotes the services canonical name' SUP top STRUCTURAL MUST
+ ( cn $ ipServicePort $ ipServiceProtocol ) MAY description )
+olcObjectClasses: {4}( 1.3.6.1.1.1.2.4 NAME 'ipProtocol' DESC 'Abstraction of
+ an IP protocol. Maps a protocol number to one or more names. The disti
+ nguished value of the cn attribute denotes the protocols canonical nam
+ e' SUP top STRUCTURAL MUST ( cn $ ipProtocolNumber ) MAY description )
+olcObjectClasses: {5}( 1.3.6.1.1.1.2.5 NAME 'oncRpc' DESC 'Abstraction of an O
+ pen Network Computing (ONC) [RFC1057] Remote Procedure Call (RPC) bindi
+ ng. This class maps an ONC RPC number to a name. The distinguishe
+ d value of the cn attribute denotes the RPC services canonical name' SU
+ P top STRUCTURAL MUST ( cn $ oncRpcNumber ) MAY description )
+olcObjectClasses: {6}( 1.3.6.1.1.1.2.6 NAME 'ipHost' DESC 'Abstraction of a ho
+ st, an IP device. The distinguished value of the cn attribute denotes
+ the hosts canonical name. Device SHOULD be used as a structural class'
+ SUP top AUXILIARY MUST ( cn $ ipHostNumber ) MAY ( userPassword $ l $ descri
+ ption $ manager ) )
+olcObjectClasses: {7}( 1.3.6.1.1.1.2.7 NAME 'ipNetwork' DESC 'Abstraction of a
+ network. The distinguished value of the cn attribute denotes the netw
+ orks canonical name' SUP top STRUCTURAL MUST ipNetworkNumber MAY ( cn $ ipNet
+ maskNumber $ l $ description $ manager ) )
+olcObjectClasses: {8}( 1.3.6.1.1.1.2.8 NAME 'nisNetgroup' DESC 'Abstraction of
+ a netgroup. May refer to other netgroups' SUP top STRUCTURAL MUST cn MAY ( n
+ isNetgroupTriple $ memberNisNetgroup $ description ) )
+olcObjectClasses: {9}( 1.3.6.1.1.1.2.9 NAME 'nisMap' DESC 'A generic abstracti
+ on of a NIS map' SUP top STRUCTURAL MUST nisMapName MAY description )
+olcObjectClasses: {10}( 1.3.6.1.1.1.2.10 NAME 'nisObject' DESC 'An entry in a
+ NIS map' SUP top STRUCTURAL MUST ( cn $ nisMapEntry $ nisMapName ) MAY descri
+ ption )
+olcObjectClasses: {11}( 1.3.6.1.1.1.2.11 NAME 'ieee802Device' DESC 'A device w
+ ith a MAC address; device SHOULD be used as a structural class' SUP to
+ p AUXILIARY MAY macAddress )
+olcObjectClasses: {12}( 1.3.6.1.1.1.2.12 NAME 'bootableDevice' DESC 'A device
+ with boot parameters; device SHOULD be used as a structural class' SUP
+ top AUXILIARY MAY ( bootFile $ bootParameter ) )
+olcObjectClasses: {13}( 1.3.6.1.1.1.2.14 NAME 'nisKeyObject' DESC 'An object w
+ ith a public and secret key' SUP top AUXILIARY MUST ( cn $ nisPublicKey $ nis
+ SecretKey ) MAY ( uidNumber $ description ) )
+olcObjectClasses: {14}( 1.3.6.1.1.1.2.15 NAME 'nisDomainObject' DESC 'Associat
+ es a NIS domain with a naming context' SUP top AUXILIARY MUST nisDomain )
+olcObjectClasses: {15}( 1.3.6.1.1.1.2.16 NAME 'automountMap' SUP top STRUCTURA
+ L MUST automountMapName MAY description )
+olcObjectClasses: {16}( 1.3.6.1.1.1.2.17 NAME 'automount' DESC 'Automount info
+ rmation' SUP top STRUCTURAL MUST ( automountKey $ automountInformation ) MAY
+ description )
+olcObjectClasses: {17}( 1.3.6.1.4.1.5322.13.1.1 NAME 'namedObject' SUP top STR
+ UCTURAL MAY cn )
+structuralObjectClass: olcSchemaConfig
+entryUUID: bae05988-4e5c-103c-8e41-83bde8bbc3e8
+creatorsName: cn=config
+createTimestamp: 20220412033105Z
+entryCSN: 20220412033105.684579Z#000000#000#000000
+modifiersName: cn=config
+modifyTimestamp: 20220412033105Z
diff --git a/dirsrvtests/tests/data/openldap_2_389/memberof/slapd.d/cn=config/cn=schema/cn={4}yast.ldif b/dirsrvtests/tests/data/openldap_2_389/memberof/slapd.d/cn=config/cn=schema/cn={4}yast.ldif
new file mode 100755
index 000000000..ccc110fc9
--- /dev/null
+++ b/dirsrvtests/tests/data/openldap_2_389/memberof/slapd.d/cn=config/cn=schema/cn={4}yast.ldif
@@ -0,0 +1,107 @@
+# AUTO-GENERATED FILE - DO NOT EDIT!! Use ldapmodify.
+# CRC32 02d5bb23
+dn: cn={4}yast
+objectClass: olcSchemaConfig
+cn: {4}yast
+olcObjectIdentifier: {0}SUSE 1.3.6.1.4.1.7057
+olcObjectIdentifier: {1}SUSE.YaST SUSE:10.1
+olcObjectIdentifier: {2}SUSE.YaST.ModuleConfig SUSE:10.1.2
+olcObjectIdentifier: {3}SUSE.YaST.ModuleConfig.OC SUSE.YaST.ModuleConfig:1
+olcObjectIdentifier: {4}SUSE.YaST.ModuleConfig.Attr SUSE.YaST.ModuleConfig:2
+olcAttributeTypes: {0}( SUSE.YaST.ModuleConfig.Attr:2 NAME 'suseDefaultBase' D
+ ESC 'Base DN where new Objects should be created by default' EQUALITY disting
+ uishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )
+olcAttributeTypes: {1}( SUSE.YaST.ModuleConfig.Attr:3 NAME 'suseNextUniqueId'
+ DESC 'Next unused unique ID, can be used to generate directory wide uniqe IDs
+ ' EQUALITY integerMatch ORDERING integerOrderingMatch SYNTAX 1.3.6.1.4.1.1466
+ .115.121.1.27 SINGLE-VALUE )
+olcAttributeTypes: {2}( SUSE.YaST.ModuleConfig.Attr:4 NAME 'suseMinUniqueId' D
+ ESC 'lower Border for Unique IDs' EQUALITY integerMatch ORDERING integerOrder
+ ingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
+olcAttributeTypes: {3}( SUSE.YaST.ModuleConfig.Attr:5 NAME 'suseMaxUniqueId' D
+ ESC 'upper Border for Unique IDs' EQUALITY integerMatch ORDERING integerOrder
+ ingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
+olcAttributeTypes: {4}( SUSE.YaST.ModuleConfig.Attr:6 NAME 'suseDefaultTemplat
+ e' DESC 'The DN of a template that should be used by default' EQUALITY distin
+ guishedNameMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 SINGLE-VALUE )
+olcAttributeTypes: {5}( SUSE.YaST.ModuleConfig.Attr:7 NAME 'suseSearchFilter'
+ DESC 'Search filter to localize Objects' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
+ SINGLE-VALUE )
+olcAttributeTypes: {6}( SUSE.YaST.ModuleConfig.Attr:11 NAME 'suseDefaultValue'
+ DESC 'an Attribute-Value-Assertions to define defaults for specific Attribut
+ es' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
+olcAttributeTypes: {7}( SUSE.YaST.ModuleConfig.Attr:12 NAME 'suseNamingAttribu
+ te' DESC 'AttributeType that should be used as the RDN' EQUALITY caseIgnoreIA
+ 5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
+olcAttributeTypes: {8}( SUSE.YaST.ModuleConfig.Attr:15 NAME 'suseSecondaryGrou
+ p' DESC 'seconday group DN' EQUALITY distinguishedNameMatch SYNTAX 1.3.6.1.4.
+ 1.1466.115.121.1.12 )
+olcAttributeTypes: {9}( SUSE.YaST.ModuleConfig.Attr:16 NAME 'suseMinPasswordLe
+ ngth' DESC 'minimum Password length for new users' EQUALITY integerMatch ORDE
+ RING integerOrderingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
+olcAttributeTypes: {10}( SUSE.YaST.ModuleConfig.Attr:17 NAME 'suseMaxPasswordL
+ ength' DESC 'maximum Password length for new users' EQUALITY integerMatch ORD
+ ERING integerOrderingMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE
+ )
+olcAttributeTypes: {11}( SUSE.YaST.ModuleConfig.Attr:18 NAME 'susePasswordHash
+ ' DESC 'Hash method to use for new users' EQUALITY caseIgnoreIA5Match SYNTAX
+ 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
+olcAttributeTypes: {12}( SUSE.YaST.ModuleConfig.Attr:19 NAME 'suseSkelDir' DES
+ C '' EQUALITY caseExactIA5Match SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
+olcAttributeTypes: {13}( SUSE.YaST.ModuleConfig.Attr:20 NAME 'susePlugin' DESC
+ 'plugin to use upon user/ group creation' EQUALITY caseIgnoreMatch SYNTAX 1.
+ 3.6.1.4.1.1466.115.121.1.15 )
+olcAttributeTypes: {14}( SUSE.YaST.ModuleConfig.Attr:21 NAME 'suseMapAttribute
+ ' DESC '' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )
+olcAttributeTypes: {15}( SUSE.YaST.ModuleConfig.Attr:22 NAME 'suseImapServer'
+ DESC '' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-
+ VALUE )
+olcAttributeTypes: {16}( SUSE.YaST.ModuleConfig.Attr:23 NAME 'suseImapAdmin' D
+ ESC '' EQUALITY caseIgnoreMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-V
+ ALUE )
+olcAttributeTypes: {17}( SUSE.YaST.ModuleConfig.Attr:24 NAME 'suseImapDefaultQ
+ uota' DESC '' EQUALITY integerMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SING
+ LE-VALUE )
+olcAttributeTypes: {18}( SUSE.YaST.ModuleConfig.Attr:25 NAME 'suseImapUseSsl'
+ DESC '' EQUALITY booleanMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 SINGLE-VALU
+ E )
+olcObjectClasses: {0}( SUSE.YaST.ModuleConfig.OC:2 NAME 'suseModuleConfigurati
+ on' DESC 'Contains configuration of Management Modules' SUP top STRUCTURAL MU
+ ST cn MAY suseDefaultBase )
+olcObjectClasses: {1}( SUSE.YaST.ModuleConfig.OC:3 NAME 'suseUserConfiguration
+ ' DESC 'Configuration of user management tools' SUP suseModuleConfiguration S
+ TRUCTURAL MAY ( suseMinPasswordLength $ suseMaxPasswordLength $ susePasswordH
+ ash $ suseSkelDir $ suseNextUniqueId $ suseMinUniqueId $ suseMaxUniqueId $ su
+ seDefaultTemplate $ suseSearchFilter $ suseMapAttribute ) )
+olcObjectClasses: {2}( SUSE.YaST.ModuleConfig.OC:4 NAME 'suseObjectTemplate' D
+ ESC 'Base Class for Object-Templates' SUP top STRUCTURAL MUST cn MAY ( susePl
+ ugin $ suseDefaultValue $ suseNamingAttribute ) )
+olcObjectClasses: {3}( SUSE.YaST.ModuleConfig.OC:5 NAME 'suseUserTemplate' DES
+ C 'User object template' SUP suseObjectTemplate STRUCTURAL MUST cn MAY suseSe
+ condaryGroup )
+olcObjectClasses: {4}( SUSE.YaST.ModuleConfig.OC:6 NAME 'suseGroupTemplate' DE
+ SC 'Group object template' SUP suseObjectTemplate STRUCTURAL MUST cn )
+olcObjectClasses: {5}( SUSE.YaST.ModuleConfig.OC:7 NAME 'suseGroupConfiguratio
+ n' DESC 'Configuration of user management tools' SUP suseModuleConfiguration
+ STRUCTURAL MAY ( suseNextUniqueId $ suseMinUniqueId $ suseMaxUniqueId $ suseD
+ efaultTemplate $ suseSearchFilter $ suseMapAttribute ) )
+olcObjectClasses: {6}( SUSE.YaST.ModuleConfig.OC:8 NAME 'suseCaConfiguration'
+ DESC 'Configuration of CA management tools' SUP suseModuleConfiguration STRUC
+ TURAL )
+olcObjectClasses: {7}( SUSE.YaST.ModuleConfig.OC:9 NAME 'suseDnsConfiguration'
+ DESC 'Configuration of mail server management tools' SUP suseModuleConfigura
+ tion STRUCTURAL )
+olcObjectClasses: {8}( SUSE.YaST.ModuleConfig.OC:10 NAME 'suseDhcpConfiguratio
+ n' DESC 'Configuration of DHCP server management tools' SUP suseModuleConfigu
+ ration STRUCTURAL )
+olcObjectClasses: {9}( SUSE.YaST.ModuleConfig.OC:11 NAME 'suseMailConfiguratio
+ n' DESC 'Configuration of IMAP user management tools' SUP suseModuleConfigura
+ tion STRUCTURAL MUST ( suseImapServer $ suseImapAdmin $ suseImapDefaultQuota
+ $ suseImapUseSsl ) )
+structuralObjectClass: olcSchemaConfig
+entryUUID: bae05f32-4e5c-103c-8e42-83bde8bbc3e8
+creatorsName: cn=config
+createTimestamp: 20220412033105Z
+entryCSN: 20220412033105.684579Z#000000#000#000000
+modifiersName: cn=config
+modifyTimestamp: 20220412033105Z
diff --git a/dirsrvtests/tests/data/openldap_2_389/memberof/slapd.d/cn=config/olcDatabase={-1}frontend.ldif b/dirsrvtests/tests/data/openldap_2_389/memberof/slapd.d/cn=config/olcDatabase={-1}frontend.ldif
new file mode 100755
index 000000000..b204ddae0
--- /dev/null
+++ b/dirsrvtests/tests/data/openldap_2_389/memberof/slapd.d/cn=config/olcDatabase={-1}frontend.ldif
@@ -0,0 +1,26 @@
+# AUTO-GENERATED FILE - DO NOT EDIT!! Use ldapmodify.
+# CRC32 01978aef
+dn: olcDatabase={-1}frontend
+objectClass: olcDatabaseConfig
+objectClass: olcFrontendConfig
+olcDatabase: {-1}frontend
+olcAccess: {0}to dn.base="" by * read
+olcAccess: {1}to dn.base="cn=subschema" by * read
+olcAccess: {2}to attrs=userPassword,userPKCS12 by self write by * auth
+olcAccess: {3}to attrs=shadowLastChange by self write by * read
+olcAccess: {4}to * by * read
+olcAddContentAcl: FALSE
+olcLastMod: TRUE
+olcLastBind: TRUE
+olcMaxDerefDepth: 0
+olcReadOnly: FALSE
+olcSchemaDN: cn=Subschema
+olcSyncUseSubentry: FALSE
+olcMonitoring: FALSE
+structuralObjectClass: olcDatabaseConfig
+entryUUID: bae062e8-4e5c-103c-8e43-83bde8bbc3e8
+creatorsName: cn=config
+createTimestamp: 20220412033105Z
+entryCSN: 20220412033105.684579Z#000000#000#000000
+modifiersName: cn=config
+modifyTimestamp: 20220412033105Z
diff --git a/dirsrvtests/tests/data/openldap_2_389/memberof/slapd.d/cn=config/olcDatabase={0}config.ldif b/dirsrvtests/tests/data/openldap_2_389/memberof/slapd.d/cn=config/olcDatabase={0}config.ldif
new file mode 100755
index 000000000..927f3e795
--- /dev/null
+++ b/dirsrvtests/tests/data/openldap_2_389/memberof/slapd.d/cn=config/olcDatabase={0}config.ldif
@@ -0,0 +1,21 @@
+# AUTO-GENERATED FILE - DO NOT EDIT!! Use ldapmodify.
+# CRC32 bafe8b21
+dn: olcDatabase={0}config
+objectClass: olcDatabaseConfig
+olcDatabase: {0}config
+olcAccess: {0}to * by * none
+olcAddContentAcl: TRUE
+olcLastMod: TRUE
+olcLastBind: TRUE
+olcMaxDerefDepth: 15
+olcReadOnly: FALSE
+olcRootDN: cn=config
+olcSyncUseSubentry: FALSE
+olcMonitoring: FALSE
+structuralObjectClass: olcDatabaseConfig
+entryUUID: bae06540-4e5c-103c-8e44-83bde8bbc3e8
+creatorsName: cn=config
+createTimestamp: 20220412033105Z
+entryCSN: 20220412033105.684579Z#000000#000#000000
+modifiersName: cn=config
+modifyTimestamp: 20220412033105Z
diff --git a/dirsrvtests/tests/data/openldap_2_389/memberof/slapd.d/cn=config/olcDatabase={1}mdb.ldif b/dirsrvtests/tests/data/openldap_2_389/memberof/slapd.d/cn=config/olcDatabase={1}mdb.ldif
new file mode 100755
index 000000000..77eb2c536
--- /dev/null
+++ b/dirsrvtests/tests/data/openldap_2_389/memberof/slapd.d/cn=config/olcDatabase={1}mdb.ldif
@@ -0,0 +1,33 @@
+# AUTO-GENERATED FILE - DO NOT EDIT!! Use ldapmodify.
+# CRC32 397d9772
+dn: olcDatabase={1}mdb
+objectClass: olcDatabaseConfig
+objectClass: olcMdbConfig
+olcDatabase: {1}mdb
+olcSuffix: dc=ldapdom,dc=net
+olcAddContentAcl: FALSE
+olcLastMod: TRUE
+olcLastBind: TRUE
+olcMaxDerefDepth: 15
+olcReadOnly: FALSE
+olcRootDN: cn=root,dc=ldapdom,dc=net
+olcRootPW:: cGFzcw==
+olcSyncUseSubentry: FALSE
+olcMonitoring: TRUE
+olcDbDirectory: /tmp/ldap-sssdtest
+olcDbCheckpoint: 1024 5
+olcDbNoSync: FALSE
+olcDbIndex: objectClass eq
+olcDbMaxReaders: 0
+olcDbMaxSize: 10485760
+olcDbMode: 0600
+olcDbSearchStack: 16
+olcDbMaxEntrySize: 0
+olcDbRtxnSize: 10000
+structuralObjectClass: olcMdbConfig
+entryUUID: bae06806-4e5c-103c-8e45-83bde8bbc3e8
+creatorsName: cn=config
+createTimestamp: 20220412033105Z
+entryCSN: 20220412033105.684579Z#000000#000#000000
+modifiersName: cn=config
+modifyTimestamp: 20220412033105Z
diff --git a/dirsrvtests/tests/data/openldap_2_389/memberof/slapd.d/cn=config/olcDatabase={1}mdb/olcOverlay={0}memberof.ldif b/dirsrvtests/tests/data/openldap_2_389/memberof/slapd.d/cn=config/olcDatabase={1}mdb/olcOverlay={0}memberof.ldif
new file mode 100755
index 000000000..a5dc9c82c
--- /dev/null
+++ b/dirsrvtests/tests/data/openldap_2_389/memberof/slapd.d/cn=config/olcDatabase={1}mdb/olcOverlay={0}memberof.ldif
@@ -0,0 +1,15 @@
+# AUTO-GENERATED FILE - DO NOT EDIT!! Use ldapmodify.
+# CRC32 f9e64128
+dn: olcOverlay={0}memberof
+objectClass: olcOverlayConfig
+objectClass: olcMemberOfConfig
+olcOverlay: {0}memberof
+olcMemberOfDangling: ignore
+olcMemberOfRefInt: FALSE
+structuralObjectClass: olcMemberOfConfig
+entryUUID: bae06a4a-4e5c-103c-8e46-83bde8bbc3e8
+creatorsName: cn=config
+createTimestamp: 20220412033105Z
+entryCSN: 20220412033105.684579Z#000000#000#000000
+modifiersName: cn=config
+modifyTimestamp: 20220412033105Z
diff --git a/dirsrvtests/tests/data/openldap_2_389/memberof/slapd.d/cn=config/olcDatabase={1}mdb/olcOverlay={1}unique.ldif b/dirsrvtests/tests/data/openldap_2_389/memberof/slapd.d/cn=config/olcDatabase={1}mdb/olcOverlay={1}unique.ldif
new file mode 100755
index 000000000..bbb99bf61
--- /dev/null
+++ b/dirsrvtests/tests/data/openldap_2_389/memberof/slapd.d/cn=config/olcDatabase={1}mdb/olcOverlay={1}unique.ldif
@@ -0,0 +1,14 @@
+# AUTO-GENERATED FILE - DO NOT EDIT!! Use ldapmodify.
+# CRC32 0ab75d66
+dn: olcOverlay={1}unique
+objectClass: olcOverlayConfig
+objectClass: olcUniqueConfig
+olcOverlay: {1}unique
+olcUniqueURI: ldap:///?mail?sub?
+structuralObjectClass: olcUniqueConfig
+entryUUID: bae06c84-4e5c-103c-8e47-83bde8bbc3e8
+creatorsName: cn=config
+createTimestamp: 20220412033105Z
+entryCSN: 20220412033105.684579Z#000000#000#000000
+modifiersName: cn=config
+modifyTimestamp: 20220412033105Z
diff --git a/dirsrvtests/tests/data/openldap_2_389/memberof/slapd.d/cn=config/olcDatabase={1}mdb/olcOverlay={2}refint.ldif b/dirsrvtests/tests/data/openldap_2_389/memberof/slapd.d/cn=config/olcDatabase={1}mdb/olcOverlay={2}refint.ldif
new file mode 100755
index 000000000..7d6f66b44
--- /dev/null
+++ b/dirsrvtests/tests/data/openldap_2_389/memberof/slapd.d/cn=config/olcDatabase={1}mdb/olcOverlay={2}refint.ldif
@@ -0,0 +1,15 @@
+# AUTO-GENERATED FILE - DO NOT EDIT!! Use ldapmodify.
+# CRC32 9d344a40
+dn: olcOverlay={2}refint
+objectClass: olcOverlayConfig
+objectClass: olcRefintConfig
+olcOverlay: {2}refint
+olcRefintAttribute: member
+olcRefintNothing: cn=admin,dc=example,dc=com
+structuralObjectClass: olcRefintConfig
+entryUUID: bae06e5a-4e5c-103c-8e48-83bde8bbc3e8
+creatorsName: cn=config
+createTimestamp: 20220412033105Z
+entryCSN: 20220412033105.684579Z#000000#000#000000
+modifiersName: cn=config
+modifyTimestamp: 20220412033105Z
diff --git a/dirsrvtests/tests/suites/openldap_2_389/migrate_memberof_test.py b/dirsrvtests/tests/suites/openldap_2_389/migrate_memberof_test.py
new file mode 100644
index 000000000..4092bb36d
--- /dev/null
+++ b/dirsrvtests/tests/suites/openldap_2_389/migrate_memberof_test.py
@@ -0,0 +1,64 @@
+# --- BEGIN COPYRIGHT BLOCK ---
+# Copyright (C) 2022 William Brown <[email protected]>
+# All rights reserved.
+#
+# License: GPL (version 3 or any later version).
+# See LICENSE for details.
+# --- END COPYRIGHT BLOCK ---
+#
+import pytest
+import os
+from lib389.topologies import topology_st
+from lib389.password_plugins import PBKDF2Plugin
+from lib389.utils import ds_is_older
+from lib389.migrate.openldap.config import olConfig
+from lib389.migrate.openldap.config import olOverlayType
+from lib389.migrate.plan import Migration
+from lib389.plugins import MemberOfPlugin
+
+pytestmark = pytest.mark.tier1
+
+DATADIR1 = os.path.join(os.path.dirname(__file__), '../../data/openldap_2_389/memberof/')
+
[email protected](ds_is_older('1.4.3'), reason="Not implemented")
+def test_migrate_openldap_memberof(topology_st):
+ """Attempt a migration with memberof configured, and ensure it migrates
+
+ :id: f59f4c6a-7c85-40d1-91ee-dccbc0bd7ef8
+ :setup: Data directory with an openldap config with memberof
+ :steps:
+ 1. Parse the configuration
+ 2. Execute a full migration plan
+ 3. Assert memberof was configured
+
+ :expectedresults:
+ 1. Success
+ 2. Success
+ 3. Success
+ """
+
+ inst = topology_st.standalone
+ config_path = os.path.join(DATADIR1, 'slapd.d')
+ config = olConfig(config_path)
+
+ for overlay in config.databases[0].overlays:
+ print("==================================================")
+ print("%s" % overlay.otype)
+ print("==================================================")
+ assert overlay.otype != olOverlayType.UNKNOWN
+
+ ldifs = {}
+
+ migration = Migration(inst, config.schema, config.databases, ldifs)
+
+ print("==== migration plan ====")
+ print(migration.__unicode__())
+ print("==== end migration plan ====")
+
+ migration.execute_plan()
+ # End test, should suceed with no exceptions.
+
+ memberof = MemberOfPlugin(inst)
+ assert memberof.status()
+
+
diff --git a/src/lib389/lib389/migrate/openldap/config.py b/src/lib389/lib389/migrate/openldap/config.py
index b578c0b2c..0be9544ff 100644
--- a/src/lib389/lib389/migrate/openldap/config.py
+++ b/src/lib389/lib389/migrate/openldap/config.py
@@ -79,7 +79,7 @@ class olOverlay(object):
self.classes = ensure_list_str(self.config[1]['objectClass'])
self.log.debug(f"{self.name} {self.classes}")
- if 'olcMemberOf' in self.classes:
+ if 'olcMemberOf' in self.classes or 'olcMemberOfConfig' in self.classes:
self.otype = olOverlayType.MEMBEROF
#
elif 'olcRefintConfig' in self.classes:
| 0 |
1aaadb8afc9f7a77516d0d62fa3acbb2bbfcfe8a
|
389ds/389-ds-base
|
Issue 4984 - BUG - pid file handling (#4986)
Bug Description: When starting up in a container, if the pid
file location is not writeable, the dscontainer/lib389 tools can't
detect that the pid is running correctly, which causes the start
up to fail. This happened because the pid file location was
incorrectly set due to a previous change.
Fix Description: This forces the pid file path when we know
that we are in container mode, and also causes 389-ds to exit
with an error if we can not write to the pid file location.
fixes: https://github.com/389ds/389-ds-base/issues/4984
Author: William Brown <[email protected]>
Review by: @progier389
|
commit 1aaadb8afc9f7a77516d0d62fa3acbb2bbfcfe8a
Author: Firstyear <[email protected]>
Date: Wed Nov 10 08:29:28 2021 +1000
Issue 4984 - BUG - pid file handling (#4986)
Bug Description: When starting up in a container, if the pid
file location is not writeable, the dscontainer/lib389 tools can't
detect that the pid is running correctly, which causes the start
up to fail. This happened because the pid file location was
incorrectly set due to a previous change.
Fix Description: This forces the pid file path when we know
that we are in container mode, and also causes 389-ds to exit
with an error if we can not write to the pid file location.
fixes: https://github.com/389ds/389-ds-base/issues/4984
Author: William Brown <[email protected]>
Review by: @progier389
diff --git a/ldap/servers/slapd/main.c b/ldap/servers/slapd/main.c
index 52a95f3a0..20702233f 100644
--- a/ldap/servers/slapd/main.c
+++ b/ldap/servers/slapd/main.c
@@ -499,15 +499,22 @@ write_start_pid_file(void)
* admin programs. Please do not make changes here without
* consulting the start/stop code for the admin code.
*/
- if ((start_pid_file != NULL) && (fp = fopen(start_pid_file, "w")) != NULL) {
+ if (start_pid_file == NULL) {
+ return 0;
+ } else if ((fp = fopen(start_pid_file, "w")) != NULL) {
fprintf(fp, "%d\n", getpid());
fclose(fp);
if (chmod(start_pid_file, S_IWUSR | S_IRUSR | S_IRGRP | S_IROTH) != 0) {
+ int rerrno = errno;
+ slapi_log_err(SLAPI_LOG_ERR, "write_start_pid_file", "file (%s) chmod failed (%d)\n", start_pid_file, rerrno);
unlink(start_pid_file);
+ return -2;
} else {
return 0;
}
}
+ int rerrno = errno;
+ slapi_log_err(SLAPI_LOG_ERR, "write_start_pid_file", "file (%s) fopen failed (%d)\n", start_pid_file, rerrno);
return -1;
}
@@ -946,7 +953,12 @@ main(int argc, char **argv)
* This removes the blank stares all round from start-slapd when the server
* fails to start for some reason
*/
- write_start_pid_file();
+ if (write_start_pid_file() != 0) {
+ slapi_log_err(SLAPI_LOG_CRIT, "main",
+ "Shutting down as we are unable to write to the pid file location\n");
+ return_value = 1;
+ goto cleanup;
+ }
/* Make sure we aren't going to run slapd in
* a mode that is going to conflict with other
diff --git a/src/lib389/lib389/__init__.py b/src/lib389/lib389/__init__.py
index 6ef4c3e87..af8121e3f 100644
--- a/src/lib389/lib389/__init__.py
+++ b/src/lib389/lib389/__init__.py
@@ -363,7 +363,7 @@ class DirSrv(SimpleLDAPObject, object):
self.ldclt = Ldclt(self)
self.saslmaps = SaslMappings(self)
- def __init__(self, verbose=False, external_log=None):
+ def __init__(self, verbose=False, external_log=None, containerised=False):
"""
This method does various initialization of DirSrv object:
parameters:
@@ -387,6 +387,9 @@ class DirSrv(SimpleLDAPObject, object):
self.uuid = str(uuid.uuid4())
self.verbose = verbose
self.serverid = None
+ # Are we a container? We get containerised in setup.py during SetupDs, and
+ # in other cases we use the marker to tell us.
+ self._containerised = os.path.exists(DSRC_CONTAINER) or containerised
# If we have an external logger, use it!
self.log = logger
@@ -1129,29 +1132,32 @@ class DirSrv(SimpleLDAPObject, object):
"-D",
self.ds_paths.config_dir,
"-i",
- self.ds_paths.pid_file],
+ self.pid_file()],
self.log.debug("DEBUG: starting with %s" % cmd)
output = subprocess.check_output(*cmd, env=env, stderr=subprocess.STDOUT)
- except subprocess.CalledProcessError:
- self.log.error('Failed to start ns-slapd: "%s"' % output)
+ except subprocess.CalledProcessError as e:
+ self.log.error('Failed to start ns-slapd: "%s"' % e.output.decode())
+ self.log.error(e)
raise ValueError('Failed to start DS')
count = timeout
- pid = pid_from_file(self.ds_paths.pid_file)
+ pid = pid_from_file(self.pid_file())
while (pid is None) and count > 0:
count -= 1
time.sleep(1)
- pid = pid_from_file(self.ds_paths.pid_file)
+ pid = pid_from_file(self.pid_file())
if pid == 0 or pid is None:
+ self.log.error("Unable to find pid (%s) of ns-slapd process" % self.pid_file())
raise ValueError('Failed to start DS')
# Wait
while not pid_exists(pid) and count > 0:
# It looks like DS changes the value in here at some point ...
# It's probably a DS bug, but if we "keep checking" the file, eventually
# we get the main server pid, and it's ready to go.
- pid = pid_from_file(self.ds_paths.pid_file)
+ pid = pid_from_file(self.pid_file())
time.sleep(1)
count -= 1
if not pid_exists(pid):
+ self.log.error("pid (%s) of ns-slapd process does not exist" % pid)
raise ValueError("Failed to start DS")
if post_open:
self.open()
@@ -1185,7 +1191,7 @@ class DirSrv(SimpleLDAPObject, object):
# TODO: Make the pid path in the files things
# TODO: use the status call instead!!!!
count = timeout
- pid = pid_from_file(self.ds_paths.pid_file)
+ pid = pid_from_file(self.pid_file())
if pid == 0 or pid is None:
raise ValueError("Failed to stop DS")
os.kill(pid, signal.SIGTERM)
@@ -1218,8 +1224,8 @@ class DirSrv(SimpleLDAPObject, object):
return False
else:
self.log.debug("systemd status -> False")
- pid = pid_from_file(self.ds_paths.pid_file)
- self.log.debug("pid file %s -> %s" % (self.ds_paths.pid_file, pid))
+ pid = pid_from_file(self.pid_file())
+ self.log.debug("pid file %s -> %s" % (self.pid_file(), pid))
if pid is None:
self.log.debug("No pidfile found for %s", self.serverid)
# No pidfile yet ...
@@ -1705,6 +1711,11 @@ class DirSrv(SimpleLDAPObject, object):
return self.systemd_override
return self.ds_paths.with_systemd
+ def pid_file(self):
+ if self._containerised:
+ return "/data/run/slapd-localhost.pid"
+ return self.ds_paths.pid_file
+
def get_server_tls_subject(self):
""" Get the servers TLS subject line for enrollment purposes.
diff --git a/src/lib389/lib389/instance/setup.py b/src/lib389/lib389/instance/setup.py
index 663dc2bae..cc673aa88 100644
--- a/src/lib389/lib389/instance/setup.py
+++ b/src/lib389/lib389/instance/setup.py
@@ -849,7 +849,7 @@ class SetupDs(object):
# Should I move this import? I think this prevents some recursion
from lib389 import DirSrv
- ds_instance = DirSrv(self.verbose)
+ ds_instance = DirSrv(self.verbose, containerised=self.containerised)
if self.containerised:
ds_instance.systemd_override = general['systemd']
| 0 |
6935548ebccec4086c02b479fc5fff3748e67ca9
|
389ds/389-ds-base
|
Issue 6483 - CI - fix filter_test - test_match_large_valueset
Description:
Fix filter_test::test_match_large_valueset
The suffix and parent parameters to dbgen_users was switched
Relates: https://github.com/389ds/389-ds-base/issues/6483
Reviewed by: spichugi(Thanks!)
|
commit 6935548ebccec4086c02b479fc5fff3748e67ca9
Author: Mark Reynolds <[email protected]>
Date: Wed Jan 8 11:09:28 2025 -0500
Issue 6483 - CI - fix filter_test - test_match_large_valueset
Description:
Fix filter_test::test_match_large_valueset
The suffix and parent parameters to dbgen_users was switched
Relates: https://github.com/389ds/389-ds-base/issues/6483
Reviewed by: spichugi(Thanks!)
diff --git a/dirsrvtests/tests/suites/filter/filter_test.py b/dirsrvtests/tests/suites/filter/filter_test.py
index 471b59594..79d87959b 100644
--- a/dirsrvtests/tests/suites/filter/filter_test.py
+++ b/dirsrvtests/tests/suites/filter/filter_test.py
@@ -1,13 +1,13 @@
# --- BEGIN COPYRIGHT BLOCK ---
-# Copyright (C) 2020 Red Hat, Inc.
+# Copyright (C) 2020-2025 Red Hat, Inc.
# All rights reserved.
#
# License: GPL (version 3 or any later version).
# See LICENSE for details.
# --- END COPYRIGHT BLOCK ---
#
+import ldap
import logging
-
import pytest
import time
from ldap import SCOPE_SUBTREE
@@ -111,6 +111,7 @@ def test_filter_search_original_attrs(topology_st):
log.info('test_filter_search_original_attrs: PASSED')
+
def test_filter_scope_one(topology_st):
"""Test ldapsearch with scope one gives only single entry
@@ -132,6 +133,7 @@ def test_filter_scope_one(topology_st):
log.info('Search should only have one entry')
assert len(results) == 1
+
def test_filter_with_attribute_subtype(topology_st):
"""Adds 2 test entries and Search with
filters including subtype and !
@@ -183,10 +185,12 @@ def test_filter_with_attribute_subtype(topology_st):
entry_en_only.setValues('cn', entry_name_en_only)
entry_en_only.setValues('cn;en', entry_name_en)
- topology_st.standalone.log.info("Try to add Add %s: %r" % (entry_dn_both, entry_both))
+ topology_st.standalone.log.info("Try to add Add %s: %r" % (entry_dn_both,
+ entry_both))
topology_st.standalone.add_s(entry_both)
- topology_st.standalone.log.info("Try to add Add %s: %r" % (entry_dn_en_only, entry_en_only))
+ topology_st.standalone.log.info("Try to add Add %s: %r" % (entry_dn_en_only,
+ entry_en_only))
topology_st.standalone.add_s(entry_en_only)
topology_st.standalone.log.info("\n\n######################### SEARCH ######################\n")
@@ -224,6 +228,7 @@ def test_filter_with_attribute_subtype(topology_st):
log.info('Testcase PASSED')
+
def test_extended_search(topology_st):
"""Test we can search with equality extended matching rule
@@ -305,6 +310,7 @@ def test_extended_search(topology_st):
ents = topology_st.standalone.search_s(SUFFIX, ldap.SCOPE_SUBTREE, myfilter)
assert len(ents) == 1
+
def test_match_large_valueset(topology_st):
"""Test that when returning a big number of entries
and that we need to match the filter from a large valueset
@@ -364,24 +370,27 @@ def test_match_large_valueset(topology_st):
perf_user_rdn = "user1000"
# Step 1. Prepare the backends and tune the groups entrycache
- try:
- be_users = backends.create(properties={'parent': DEFAULT_SUFFIX, 'nsslapd-suffix': users_suffix, 'name': users_backend})
- be_groups = backends.create(properties={'parent': DEFAULT_SUFFIX, 'nsslapd-suffix': groups_suffix, 'name': groups_backend})
-
- # set the entry cache to 200Mb as the 1K groups of 2K users require at least 170Mb
- if get_default_db_lib() == "bdb":
- config_ldbm = DSLdapObject(inst, DN_CONFIG_LDBM)
- config_ldbm.set('nsslapd-cache-autosize', '0')
- be_groups.replace('nsslapd-cachememsize', groups_entrycache)
- except:
- raise
+ backends.create(properties={'parent': DEFAULT_SUFFIX,
+ 'nsslapd-suffix': users_suffix,
+ 'name': users_backend})
+ be_groups = backends.create(properties={'parent': DEFAULT_SUFFIX,
+ 'nsslapd-suffix': groups_suffix,
+ 'name': groups_backend})
+
+ # Set the entry cache to 200Mb as the 1K groups of 2K users require at
+ # least 170Mb
+ if get_default_db_lib() == "bdb":
+ config_ldbm = DSLdapObject(inst, DN_CONFIG_LDBM)
+ config_ldbm.set('nsslapd-cache-autosize', '0')
+ be_groups.replace('nsslapd-cachememsize', groups_entrycache)
# Step 2. Generate a test ldif (10k users entries)
log.info("Generating users LDIF...")
ldif_dir = inst.get_ldif_dir()
users_import_ldif = "%s/%s" % (ldif_dir, users_ldif)
groups_import_ldif = "%s/%s" % (ldif_dir, groups_ldif)
- dbgen_users(inst, users_number, users_import_ldif, suffix=users_suffix, generic=True, parent=users_suffix)
+ dbgen_users(inst, users_number, users_import_ldif, suffix=DEFAULT_SUFFIX,
+ generic=True, parent=users_suffix)
# Generate a test ldif (800 groups with 10k members) that fit in 700Mb entry cache
props = {
@@ -421,13 +430,15 @@ def test_match_large_valueset(topology_st):
# Step 6. Gather the etime from the access log
inst.stop()
access_log = DirsrvAccessLog(inst)
- search_result = access_log.match(".*RESULT err=0 tag=101 nentries=%s.*" % groups_number)
+ search_result = access_log.match(".*RESULT err=0 tag=101 nentries=%s.*" %
+ groups_number)
log.info("Found patterns are %s", search_result[0])
log.info("Found patterns are %s", search_result[1])
etime = float(search_result[1].split('etime=')[1])
log.info("Duration of the search from access log was %f", etime)
assert len(entries) == groups_number
- assert (etime < 5)
+ assert etime < 5
+
def test_filter_not_operator(topology_st, request):
"""Test ldapsearch with scope one gives only single entry
@@ -467,38 +478,47 @@ def test_filter_not_operator(topology_st, request):
'cn': f'bit {user}',
'sn': user.title(),
'manager': f'uid={user},{SUFFIX}',
- 'userpassword': PW_DM,
+ 'userpassword': "password",
'homeDirectory': '/home/' + user,
'uidNumber': '1000',
'gidNumber': '2000',
})
# Adding specific values to the users
log.info('Adding telephonenumber values')
- user = UserAccount(topology_st.standalone, 'uid=user1, ou=people, %s' % DEFAULT_SUFFIX)
+ user = UserAccount(topology_st.standalone,
+ 'uid=user1, ou=people, %s' % DEFAULT_SUFFIX)
user.add('telephonenumber', ['1234', '2345'])
- user = UserAccount(topology_st.standalone, 'uid=user2, ou=people, %s' % DEFAULT_SUFFIX)
+ user = UserAccount(topology_st.standalone,
+ 'uid=user2, ou=people, %s' % DEFAULT_SUFFIX)
user.add('telephonenumber', ['1234', '4567'])
- user = UserAccount(topology_st.standalone, 'uid=user3, ou=people, %s' % DEFAULT_SUFFIX)
+ user = UserAccount(topology_st.standalone,
+ 'uid=user3, ou=people, %s' % DEFAULT_SUFFIX)
user.add('telephonenumber', ['1234', '4567'])
- user = UserAccount(topology_st.standalone, 'uid=user4, ou=people, %s' % DEFAULT_SUFFIX)
+ user = UserAccount(topology_st.standalone,
+ 'uid=user4, ou=people, %s' % DEFAULT_SUFFIX)
user.add('telephonenumber', ['1234'])
- user = UserAccount(topology_st.standalone, 'uid=user5, ou=people, %s' % DEFAULT_SUFFIX)
+ user = UserAccount(topology_st.standalone,
+ 'uid=user5, ou=people, %s' % DEFAULT_SUFFIX)
user.add('telephonenumber', ['2345'])
- user = UserAccount(topology_st.standalone, 'uid=user6, ou=people, %s' % DEFAULT_SUFFIX)
+ user = UserAccount(topology_st.standalone,
+ 'uid=user6, ou=people, %s' % DEFAULT_SUFFIX)
user.add('telephonenumber', ['3456'])
- user = UserAccount(topology_st.standalone, 'uid=user7, ou=people, %s' % DEFAULT_SUFFIX)
+ user = UserAccount(topology_st.standalone,
+ 'uid=user7, ou=people, %s' % DEFAULT_SUFFIX)
user.add('telephonenumber', ['4567'])
- user = UserAccount(topology_st.standalone, 'uid=user8, ou=people, %s' % DEFAULT_SUFFIX)
+ user = UserAccount(topology_st.standalone,
+ 'uid=user8, ou=people, %s' % DEFAULT_SUFFIX)
user.add('telephonenumber', ['1234'])
- user = UserAccount(topology_st.standalone, 'uid=user9, ou=people, %s' % DEFAULT_SUFFIX)
+ user = UserAccount(topology_st.standalone,
+ 'uid=user9, ou=people, %s' % DEFAULT_SUFFIX)
user.add('telephonenumber', ['1234', '4567'])
# Do a first test of filter containing a NOT
@@ -506,7 +526,8 @@ def test_filter_not_operator(topology_st, request):
log.info('Search with filter containing NOT')
log.info('expect user2, user3, user6, user8 and user9')
filter1 = "(|(telephoneNumber=3456)(&(telephoneNumber=1234)(!(|(uid=user1)(uid=user4)))))"
- entries = topology_st.standalone.search_s(DEFAULT_SUFFIX, SCOPE_SUBTREE, filter1)
+ entries = topology_st.standalone.search_s(DEFAULT_SUFFIX, SCOPE_SUBTREE,
+ filter1)
uids = []
for entry in entries:
assert entry.hasAttr('uid')
@@ -521,7 +542,8 @@ def test_filter_not_operator(topology_st, request):
log.info('Search with a second filter containing NOT')
log.info('expect user2, user3, user8 and user9')
filter1 = "(|(&(telephoneNumber=1234)(!(|(uid=user1)(uid=user4)))))"
- entries = topology_st.standalone.search_s(DEFAULT_SUFFIX, SCOPE_SUBTREE, filter1)
+ entries = topology_st.standalone.search_s(DEFAULT_SUFFIX, SCOPE_SUBTREE,
+ filter1)
uids = []
for entry in entries:
assert entry.hasAttr('uid')
@@ -539,7 +561,6 @@ def test_filter_not_operator(topology_st, request):
pass
user.delete()
-
request.addfinalizer(fin)
| 0 |
cad1bbe56e37d6b60f9e802bbb16f515a9d48e53
|
389ds/389-ds-base
|
Issue: 50443 - Create a module in lib389 to Convert a byte sequence to a properly escaped for LDAP
Create a module in lib389 to Convert a byte sequence to a properly escaped for LDAP
Fixes: https://pagure.io/389-ds-base/issue/50443
Author: aborah
Reviewed by: Matus Honek, Simon Pichugin
|
commit cad1bbe56e37d6b60f9e802bbb16f515a9d48e53
Author: Anuj Borah <[email protected]>
Date: Tue Dec 3 15:05:55 2019 +0530
Issue: 50443 - Create a module in lib389 to Convert a byte sequence to a properly escaped for LDAP
Create a module in lib389 to Convert a byte sequence to a properly escaped for LDAP
Fixes: https://pagure.io/389-ds-base/issue/50443
Author: aborah
Reviewed by: Matus Honek, Simon Pichugin
diff --git a/src/lib389/lib389/tests/utils_test.py b/src/lib389/lib389/tests/utils_test.py
index a696eb5c9..8bfe4ab32 100644
--- a/src/lib389/lib389/tests/utils_test.py
+++ b/src/lib389/lib389/tests/utils_test.py
@@ -174,6 +174,19 @@ def test_ds_is_newer_versions(ds_ver, cmp_ver):
assert ds_is_related('newer', ds_ver, cmp_ver)
[email protected]('input, result', [
+ (b'', ''),
+ (b'\x00', '\\00'),
+ (b'\x01\x00', '\\01\\00'),
+ (b'01', '\\30\\31'),
+ (b'101', '\\31\\30\\31'),
+ (b'101x1', '\\31\\30\\31\\78\\31'),
+ (b'0\x82\x05s0\x82\x03[\xa0\x03\x02\x01\x02', '\\30\\82\\05\\73\\30\\82\\03\\5b\\a0\\03\\02\\01\\02'),
+])
+def test_search_filter_escape_bytes(input, result):
+ assert search_filter_escape_bytes(input) == result
+
+
if __name__ == "__main__":
CURRENT_FILE = os.path.realpath(__file__)
pytest.main("-s -v %s" % CURRENT_FILE)
diff --git a/src/lib389/lib389/utils.py b/src/lib389/lib389/utils.py
index b9eacfdea..459a490e6 100644
--- a/src/lib389/lib389/utils.py
+++ b/src/lib389/lib389/utils.py
@@ -1315,3 +1315,15 @@ def convert_bytes(bytes):
pow = math.pow(1024, i)
siz = round(bytes / pow, 2)
return "{} {}".format(siz, size_name[i])
+
+
+def search_filter_escape_bytes(bytes_value):
+ """ Convert a byte sequence to a properly escaped for LDAP (format BACKSLASH HEX HEX) string"""
+ # copied from https://github.com/cannatag/ldap3/blob/master/ldap3/utils/conv.py
+ if str is not bytes:
+ if isinstance(bytes_value, str):
+ bytes_value = bytearray(bytes_value, encoding='utf-8')
+ return ''.join([('\\%02x' % int(b)) for b in bytes_value])
+ else:
+ raise RuntimeError('Running with Python 2 is unsupported')
+
| 0 |
f20e982c68a700b5ba2c41e5b6f3cdeb5fcb5fab
|
389ds/389-ds-base
|
Ticket 50329 - (2nd) Possible Security Issue: DOS due to ioblocktimeout not applying to TLS
Bug Description:
A secure socket is configured in blocking mode. If an event
is detected on a secure socket a worker tries to receive the request.
If handshake occurs during the read, it can hang longer than
ioblocktimeout because it takes into account the socket option
rather than the timeout used for the ssl_Recv
Fix Description:
The fix is specific to secure socket and set this socket option
to do non blocking IO.
https://pagure.io/389-ds-base/issue/50329
Reviewed by: ?
Platforms tested: F28, RHEL7.6
Flag Day: no
Doc impact: no
|
commit f20e982c68a700b5ba2c41e5b6f3cdeb5fcb5fab
Author: Thierry Bordaz <[email protected]>
Date: Wed May 15 17:46:14 2019 +0200
Ticket 50329 - (2nd) Possible Security Issue: DOS due to ioblocktimeout not applying to TLS
Bug Description:
A secure socket is configured in blocking mode. If an event
is detected on a secure socket a worker tries to receive the request.
If handshake occurs during the read, it can hang longer than
ioblocktimeout because it takes into account the socket option
rather than the timeout used for the ssl_Recv
Fix Description:
The fix is specific to secure socket and set this socket option
to do non blocking IO.
https://pagure.io/389-ds-base/issue/50329
Reviewed by: ?
Platforms tested: F28, RHEL7.6
Flag Day: no
Doc impact: no
diff --git a/ldap/servers/slapd/daemon.c b/ldap/servers/slapd/daemon.c
index 2daa21034..519fd2f86 100644
--- a/ldap/servers/slapd/daemon.c
+++ b/ldap/servers/slapd/daemon.c
@@ -3174,7 +3174,7 @@ configure_pr_socket(PRFileDesc **pr_socket, int secure, int local)
if (secure) {
pr_socketoption.option = PR_SockOpt_Nonblocking;
- pr_socketoption.value.non_blocking = 0;
+ pr_socketoption.value.non_blocking = 1;
if (PR_SetSocketOption(*pr_socket, &pr_socketoption) == PR_FAILURE) {
PRErrorCode prerr = PR_GetError();
slapi_log_err(SLAPI_LOG_ERR,
| 0 |
c52cb92624c68c4029813be755872469db12dc62
|
389ds/389-ds-base
|
Ticket 6 - Resource leak in systemd ask pass
Bug Description: In an error case, systemd would set the pin to "", which would
leak the token memory.
Fix Description: strncpy the "" into the token to prevent the leak.
https://pagure.io/svrcore/issue/6
Author: wibrown
Review by: nhosoi (Thanks!)
|
commit c52cb92624c68c4029813be755872469db12dc62
Author: William Brown <[email protected]>
Date: Tue Apr 12 14:37:31 2016 +1000
Ticket 6 - Resource leak in systemd ask pass
Bug Description: In an error case, systemd would set the pin to "", which would
leak the token memory.
Fix Description: strncpy the "" into the token to prevent the leak.
https://pagure.io/svrcore/issue/6
Author: wibrown
Review by: nhosoi (Thanks!)
diff --git a/src/pk11.c b/src/pk11.c
index 30f8deb64..70a64a71a 100644
--- a/src/pk11.c
+++ b/src/pk11.c
@@ -184,7 +184,11 @@ SVRCORE_CreatePk11PinStore(
ctx = PK11_CreateContextBySymKey(store->mech->type, CKA_ENCRYPT,
store->key, store->params);
- if (!ctx) { err = SVRCORE_System_Error; break; }
+ if (!ctx) {
+ err = SVRCORE_System_Error;
+ free(plain);
+ break;
+ }
do {
rv = PK11_CipherOp(ctx, store->crypt, &outLen, store->length,
diff --git a/src/systemd-ask-pass.c b/src/systemd-ask-pass.c
index 171f63e50..61cbbecad 100644
--- a/src/systemd-ask-pass.c
+++ b/src/systemd-ask-pass.c
@@ -246,7 +246,7 @@ getPin(SVRCOREPinObj *obj, const char *tokenName, PRBool retry)
tmp_fd = fopen(tmp_path, "w");
if (tmp_fd == NULL) {
- fprintf(stderr, "SVRCORE systemd:getPin() -> opening ask file FAILED\n",);
+ fprintf(stderr, "SVRCORE systemd:getPin() -> opening ask file FAILED\n");
err = SVRCORE_IOOperationError;
goto out;
}
@@ -366,7 +366,7 @@ getPin(SVRCOREPinObj *obj, const char *tokenName, PRBool retry)
// The response starts with a + to say the value was a success
if (tbuf[0] == '+') {
if (data_size == 1) {
- token = "";
+ strncpy(token, "", PASS_MAX - 1);
} else {
strncpy(token, tbuf + 1, PASS_MAX - 1);
}
| 0 |
c6b96cf13fb257f00f8077e2823e8c2851f5dc39
|
389ds/389-ds-base
|
Bug 613056 - fix coverify Defect Type: Null pointer dereferences issues 11892 - 11939
https://bugzilla.redhat.com/show_bug.cgi?id=613056
Resolves: bug 613056
Bug description: Fix coverify Defect Type: Null pointer dereferences issues 11892 - 11939
description: Catch possible NULL pointer in attr_index_config().
|
commit c6b96cf13fb257f00f8077e2823e8c2851f5dc39
Author: Endi S. Dewata <[email protected]>
Date: Fri Jul 9 20:41:37 2010 -0500
Bug 613056 - fix coverify Defect Type: Null pointer dereferences issues 11892 - 11939
https://bugzilla.redhat.com/show_bug.cgi?id=613056
Resolves: bug 613056
Bug description: Fix coverify Defect Type: Null pointer dereferences issues 11892 - 11939
description: Catch possible NULL pointer in attr_index_config().
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_attr.c b/ldap/servers/slapd/back-ldbm/ldbm_attr.c
index e67c07450..28ccc2e91 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_attr.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_attr.c
@@ -192,6 +192,12 @@ attr_index_config(
index_rules = slapi_str2charray( argv[2], "," );
}
}
+
+ if (!indexes) {
+ LDAPDebug(LDAP_DEBUG_ANY, "attr_index_config: Missing index\n", 0, 0, 0);
+ goto done;
+ }
+
for ( i = 0; attrs[i] != NULL; i++ ) {
int need_compare_fn = 0;
const char *attrsyntax_oid = NULL;
@@ -373,6 +379,7 @@ attr_index_config(
attrinfo_delete(&a);
}
}
+done:
charray_free( attrs );
if ( indexes != NULL ) {
charray_free( indexes );
| 0 |
2738fd00ffd7b9bced16e2e9ce61da80eec51206
|
389ds/389-ds-base
|
Issue 49960 - Core schema contains strings instead of numer oids
Bug Description:
Core schema contains strings instead of numer oids.
Fix Description:
Update schema files with the correct oids.
Relates: https://pagure.io/389-ds-base/issue/49960
Reviewed by: firstyear, mreynolds, spichugi (Thanks!)
|
commit 2738fd00ffd7b9bced16e2e9ce61da80eec51206
Author: Viktor Ashirov <[email protected]>
Date: Tue Sep 25 23:53:44 2018 +0200
Issue 49960 - Core schema contains strings instead of numer oids
Bug Description:
Core schema contains strings instead of numer oids.
Fix Description:
Update schema files with the correct oids.
Relates: https://pagure.io/389-ds-base/issue/49960
Reviewed by: firstyear, mreynolds, spichugi (Thanks!)
diff --git a/ldap/schema/01core389.ldif b/ldap/schema/01core389.ldif
index a595b763e..993fa4a6d 100644
--- a/ldap/schema/01core389.ldif
+++ b/ldap/schema/01core389.ldif
@@ -86,26 +86,26 @@ attributeTypes: ( 2.16.840.1.113730.3.1.2064 NAME 'nsSaslMapRegexString' DESC 'N
attributeTypes: ( 2.16.840.1.113730.3.1.2065 NAME 'nsSaslMapBaseDNTemplate' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )
attributeTypes: ( 2.16.840.1.113730.3.1.2066 NAME 'nsSaslMapFilterTemplate' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )
attributeTypes: ( 2.16.840.1.113730.3.1.2142 NAME 'nsSaslMapPriority' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE X-ORIGIN 'Netscape Directory Server' )
-attributeTypes: ( nsCertfile-oid NAME 'nsCertfile' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsKeyfile-oid NAME 'nsKeyfile' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsSSL2-oid NAME 'nsSSL2' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsSSL3-oid NAME 'nsSSL3' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.309 NAME 'nsCertfile' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.310 NAME 'nsKeyfile' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.311 NAME 'nsSSL2' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.312 NAME 'nsSSL3' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
attributeTypes: ( nsTLS1-oid NAME 'nsTLS1' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
attributeTypes: ( nsTLS10-oid NAME 'nsTLS10' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
attributeTypes: ( nsTLS11-oid NAME 'nsTLS11' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
attributeTypes: ( nsTLS12-oid NAME 'nsTLS12' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
attributeTypes: ( sslVersionMin-oid NAME 'sslVersionMin' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
attributeTypes: ( sslVersionMax-oid NAME 'sslVersionMax' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsSSLClientAuth-oid NAME 'nsSSLClientAuth' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsSSLSessionTimeout-oid NAME 'nsSSLSessionTimeout' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsSSL3SessionTimeout-oid NAME 'nsSSL3SessionTimeout' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsSSL2Ciphers-oid NAME 'nsSSL2Ciphers' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsSSL3Ciphers-oid NAME 'nsSSL3Ciphers' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.313 NAME 'nsSSLClientAuth' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.314 NAME 'nsSSLSessionTimeout' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.315 NAME 'nsSSL3SessionTimeout' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.316 NAME 'nsSSL2Ciphers' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.317 NAME 'nsSSL3Ciphers' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
attributeTypes: ( nsSSLSupportedCiphers-oid NAME 'nsSSLSupportedCiphers' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
attributeTypes: ( allowWeakCipher-oid NAME 'allowWeakCipher' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsSSLToken-oid NAME 'nsSSLToken' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsSSLPersonalitySSL-oid NAME 'nsSSLPersonalitySSL' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsSSLActivation-oid NAME 'nsSSLActivation' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.318 NAME 'nsSSLToken' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.319 NAME 'nsSSLPersonalitySSL' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.320 NAME 'nsSSLActivation' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
attributeTypes: ( CACertExtractFile-oid NAME 'CACertExtractFile' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
attributeTypes: ( nsTLSAllowClientRenegotiation-oid NAME 'nsTLSAllowClientRenegotiation' DESC 'Allow clients to renegotiate open TLS connections using RFC 5746 secure renegotiation' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
attributeTypes: ( ServerKeyExtractFile-oid NAME 'ServerKeyExtractFile' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
@@ -327,8 +327,8 @@ objectClasses: ( 2.16.840.1.113730.3.2.103 NAME 'nsDS5ReplicationAgreement' DESC
objectClasses: ( 2.16.840.1.113730.3.2.39 NAME 'nsslapdConfig' DESC 'Netscape defined objectclass' SUP top MAY ( cn ) X-ORIGIN 'Netscape Directory Server' )
objectClasses: ( 2.16.840.1.113730.3.2.317 NAME 'nsSaslMapping' DESC 'Netscape defined objectclass' SUP top MUST ( cn $ nsSaslMapRegexString $ nsSaslMapBaseDNTemplate $ nsSaslMapFilterTemplate ) MAY ( nsSaslMapPriority ) X-ORIGIN 'Netscape Directory Server' )
objectClasses: ( 2.16.840.1.113730.3.2.43 NAME 'nsSNMP' DESC 'Netscape defined objectclass' SUP top MUST ( cn $ nsSNMPEnabled ) MAY ( nsSNMPOrganization $ nsSNMPLocation $ nsSNMPContact $ nsSNMPDescription $ nsSNMPName $ nsSNMPMasterHost $ nsSNMPMasterPort ) X-ORIGIN 'Netscape Directory Server' )
-objectClasses: ( nsEncryptionConfig-oid NAME 'nsEncryptionConfig' DESC 'Netscape defined objectclass' SUP top MUST ( cn ) MAY ( nsCertfile $ nsKeyfile $ nsSSL2 $ nsSSL3 $ nsTLS1 $ nsTLS10 $ nsTLS11 $ nsTLS12 $ sslVersionMin $ sslVersionMax $ nsSSLSessionTimeout $ nsSSL3SessionTimeout $ nsSSLClientAuth $ nsSSL2Ciphers $ nsSSL3Ciphers $ nsSSLSupportedCiphers $ allowWeakCipher $ CACertExtractFile $ allowWeakDHParam $ nsTLSAllowClientRenegotiation ) X-ORIGIN 'Netscape' )
-objectClasses: ( nsEncryptionModule-oid NAME 'nsEncryptionModule' DESC 'Netscape defined objectclass' SUP top MUST ( cn ) MAY ( nsSSLToken $ nsSSLPersonalityssl $ nsSSLActivation $ ServerKeyExtractFile $ ServerCertExtractFile ) X-ORIGIN 'Netscape' )
+objectClasses: ( 2.16.840.1.113730.3.2.60 NAME 'nsEncryptionConfig' DESC 'Netscape defined objectclass' SUP top MUST ( cn ) MAY ( nsCertfile $ nsKeyfile $ nsSSL2 $ nsSSL3 $ nsTLS1 $ nsTLS10 $ nsTLS11 $ nsTLS12 $ sslVersionMin $ sslVersionMax $ nsSSLSessionTimeout $ nsSSL3SessionTimeout $ nsSSLClientAuth $ nsSSL2Ciphers $ nsSSL3Ciphers $ nsSSLSupportedCiphers $ allowWeakCipher $ CACertExtractFile $ allowWeakDHParam $ nsTLSAllowClientRenegotiation ) X-ORIGIN 'Netscape' )
+objectClasses: ( 2.16.840.1.113730.3.2.61 NAME 'nsEncryptionModule' DESC 'Netscape defined objectclass' SUP top MUST ( cn ) MAY ( nsSSLToken $ nsSSLPersonalityssl $ nsSSLActivation $ ServerKeyExtractFile $ ServerCertExtractFile ) X-ORIGIN 'Netscape' )
objectClasses: ( 2.16.840.1.113730.3.2.327 NAME 'rootDNPluginConfig' DESC 'Netscape defined objectclass' SUP top MUST ( cn ) MAY ( rootdn-open-time $ rootdn-close-time $ rootdn-days-allowed $ rootdn-allow-host $ rootdn-deny-host $ rootdn-allow-ip $ rootdn-deny-ip ) X-ORIGIN 'Netscape' )
objectClasses: ( 2.16.840.1.113730.3.2.328 NAME 'nsSchemaPolicy' DESC 'Netscape defined objectclass' SUP top MAY ( cn $ schemaUpdateObjectclassAccept $ schemaUpdateObjectclassReject $ schemaUpdateAttributeAccept $ schemaUpdateAttributeReject) X-ORIGIN 'Netscape Directory Server' )
objectClasses: ( 2.16.840.1.113730.3.2.332 NAME 'nsChangelogConfig' DESC 'Configuration of the changelog5 object' SUP top MUST ( cn $ nsslapd-changelogdir ) MAY ( nsslapd-changelogmaxage $ nsslapd-changelogtrim-interval $ nsslapd-changelogmaxentries $ nsslapd-changelogsuffix $ nsslapd-changelogcompactdb-interval $ nsslapd-encryptionalgorithm $ nsSymmetricKey ) X-ORIGIN '389 Directory Server' )
diff --git a/ldap/schema/30ns-common.ldif b/ldap/schema/30ns-common.ldif
index 80b8cf6fc..58eeae5b0 100644
--- a/ldap/schema/30ns-common.ldif
+++ b/ldap/schema/30ns-common.ldif
@@ -12,60 +12,60 @@
# Common Netscape schema.
#
dn: cn=schema
-attributeTypes: ( nsServerID-oid NAME 'nsServerID' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsBaseDN-oid NAME 'nsBaseDN' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsBindDN-oid NAME 'nsBindDN' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsBindPassword-oid NAME 'nsBindPassword' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsServerPort-oid NAME 'nsServerPort' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsServerAddress-oid NAME 'nsServerAddress' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsDirectoryInfoRef-oid NAME 'nsDirectoryInfoRef' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsDirectoryURL-oid NAME 'nsDirectoryURL' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsDirectoryFailoverList-oid NAME 'nsDirectoryFailoverList' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsAdminDomainName-oid NAME 'nsAdminDomainName' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsHostLocation-oid NAME 'nsHostLocation' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsHardwarePlatform-oid NAME 'nsHardwarePlatform' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsOsVersion-oid NAME 'nsOsVersion' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsAdminGroupName-oid NAME 'nsAdminGroupName' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsConfigRoot-oid NAME 'nsConfigRoot' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsAdminSIEDN-oid NAME 'nsAdminSIEDN' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsVendor-oid NAME 'nsVendor' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsProductName-oid NAME 'nsProductName' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsNickName-oid NAME 'nsNickName' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsProductVersion-oid NAME 'nsProductVersion' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsBuildNumber-oid NAME 'nsBuildNumber' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsRevisionNumber-oid NAME 'nsRevisionNumber' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsSerialNumber-oid NAME 'nsSerialNumber' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsInstalledLocation-oid NAME 'nsInstalledLocation' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsExpirationDate-oid NAME 'nsExpirationDate' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsBuildSecurity-oid NAME 'nsBuildSecurity' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsServerMigrationClassname-oid NAME 'nsServerMigrationClassname' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsServerCreationClassname-oid NAME 'nsServerCreationClassname' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsLdapSchemaVersion-oid NAME 'nsLdapSchemaVersion' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsSuiteSpotUser-oid NAME 'nsSuiteSpotUser' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsErrorLog-oid NAME 'nsErrorLog' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsPidLog-oid NAME 'nsPidLog' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsAccessLog-oid NAME 'nsAccessLog' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsDefaultAcceptLanguage-oid NAME 'nsDefaultAcceptLanguage' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsServerSecurity-oid NAME 'nsServerSecurity' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsTaskLabel-oid NAME 'nsTaskLabel' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsHelpRef-oid NAME 'nsHelpRef' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsExecRef-oid NAME 'nsExecRef' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsLogSuppress-oid NAME 'nsLogSuppress' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsJarfilename-oid NAME 'nsJarfilename' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
-attributeTypes: ( nsClassname-oid NAME 'nsClassname' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.276 NAME 'nsServerID' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.277 NAME 'nsBaseDN' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.278 NAME 'nsBindDN' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.279 NAME 'nsBindPassword' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.280 NAME 'nsServerPort' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.281 NAME 'nsServerAddress' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.282 NAME 'nsDirectoryInfoRef' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.283 NAME 'nsDirectoryURL' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'Netscape' )
+attributeTypes: ( 1.3.6.1.4.1.42.2.27.10.1.31 NAME 'nsDirectoryFailoverList' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.284 NAME 'nsAdminDomainName' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.285 NAME 'nsHostLocation' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.286 NAME 'nsHardwarePlatform' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.287 NAME 'nsOsVersion' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.288 NAME 'nsAdminGroupName' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.289 NAME 'nsConfigRoot' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
+attributeTypes: ( 1.3.6.1.4.1.42.2.27.10.1.72 NAME 'nsAdminSIEDN' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.290 NAME 'nsVendor' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.291 NAME 'nsProductName' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.292 NAME 'nsNickName' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.293 NAME 'nsProductVersion' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.294 NAME 'nsBuildNumber' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.295 NAME 'nsRevisionNumber' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.296 NAME 'nsSerialNumber' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.297 NAME 'nsInstalledLocation' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.298 NAME 'nsExpirationDate' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.299 NAME 'nsBuildSecurity' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.300 NAME 'nsServerMigrationClassname' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.301 NAME 'nsServerCreationClassname' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.302 NAME 'nsLdapSchemaVersion' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.303 NAME 'nsSuiteSpotUser' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.304 NAME 'nsErrorLog' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.305 NAME 'nsPidLog' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.306 NAME 'nsAccessLog' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.307 NAME 'nsDefaultAcceptLanguage' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.308 NAME 'nsServerSecurity' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.321 NAME 'nsTaskLabel' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.322 NAME 'nsHelpRef' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.323 NAME 'nsExecRef' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.329 NAME 'nsLogSuppress' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.324 NAME 'nsJarfilename' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
+attributeTypes: ( 2.16.840.1.113730.3.1.325 NAME 'nsClassname' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape' )
attributeTypes: ( 2.16.840.1.113730.3.1.2337 NAME 'nsCertSubjectDN' DESC 'An x509 DN from a certificate used to map during a TLS bind process' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN '389 Directory Server Project' )
attributeTypes: ( 2.16.840.1.113730.3.1.2342 NAME 'nsSshPublicKey' DESC 'An nsSshPublicKey record' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN '389 Directory Server Project' )
attributeTypes: ( 2.16.840.1.113730.3.1.2343 NAME 'legalName' DESC 'An individuals legalName' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN '389 Directory Server Project' )
-objectClasses: ( nsAdminDomain-oid NAME 'nsAdminDomain' DESC 'Netscape defined objectclass' SUP organizationalUnit MAY ( nsAdminDomainName ) X-ORIGIN 'Netscape' )
-objectClasses: ( nsHost-oid NAME 'nsHost' DESC 'Netscape defined objectclass' SUP top MUST ( cn ) MAY ( serverHostName $ description $ l $ nsHostLocation $ nsHardwarePlatform $ nsOsVersion ) X-ORIGIN 'Netscape' )
-objectClasses: ( nsAdminGroup-oid NAME 'nsAdminGroup' DESC 'Netscape defined objectclass' SUP top MUST ( cn ) MAY ( nsAdminGroupName $ description $ nsConfigRoot $ nsAdminSIEDN ) X-ORIGIN 'Netscape' )
-objectClasses: ( nsApplication-oid NAME 'nsApplication' DESC 'Netscape defined objectclass' SUP top MUST ( cn ) MAY ( nsVendor $ description $ nsProductName $ nsNickName $ nsProductVersion $ nsBuildNumber $ nsRevisionNumber $ nsSerialNumber $ nsInstalledLocation $ installationTimeStamp $ nsExpirationDate $ nsBuildSecurity $ nsLdapSchemaVersion $ nsServerMigrationClassname $ nsServerCreationClassname ) X-ORIGIN 'Netscape' )
-objectClasses: ( nsResourceRef-oid NAME 'nsResourceRef' DESC 'Netscape defined objectclass' SUP top MUST ( cn ) MAY ( seeAlso ) X-ORIGIN 'Netscape' )
-objectClasses: ( nsTask-oid NAME 'nsTask' DESC 'Netscape defined objectclass' SUP top MUST ( cn ) MAY ( nsTaskLabel $ nsHelpref $ nsExecref $ nsLogSuppress ) X-ORIGIN 'Netscape' )
-objectClasses: ( nsTaskGroup-oid NAME 'nsTaskGroup' DESC 'Netscape defined objectclass' SUP top MUST ( cn ) MAY ( nsTaskLabel ) X-ORIGIN 'Netscape' )
-objectClasses: ( nsAdminObject-oid NAME 'nsAdminObject' DESC 'Netscape defined objectclass' SUP top MUST ( cn ) MAY ( nsJarFilename $ nsClassName ) X-ORIGIN 'Netscape' )
-objectClasses: ( nsConfig-oid NAME 'nsConfig' DESC 'Netscape defined objectclass' SUP top MUST ( cn ) MAY ( description $ nsServerPort $ nsServerAddress $ nsSuiteSpotUser $ nsErrorLog $ nsPidLog $ nsAccessLog $ nsDefaultAcceptLanguage $ nsServerSecurity ) X-ORIGIN 'Netscape' )
-objectClasses: ( nsDirectoryInfo-oid NAME 'nsDirectoryInfo' DESC 'Netscape defined objectclass' SUP top MUST ( cn ) MAY ( nsBindDN $ nsBindPassword $ nsDirectoryURL $ nsDirectoryFailoverList $ nsDirectoryInfoRef ) X-ORIGIN 'Netscape' )
+objectClasses: ( 2.16.840.1.113730.3.2.56 NAME 'nsAdminDomain' DESC 'Netscape defined objectclass' SUP organizationalUnit MAY ( nsAdminDomainName ) X-ORIGIN 'Netscape' )
+objectClasses: ( 2.16.840.1.113730.3.2.57 NAME 'nsHost' DESC 'Netscape defined objectclass' SUP top MUST ( cn ) MAY ( serverHostName $ description $ l $ nsHostLocation $ nsHardwarePlatform $ nsOsVersion ) X-ORIGIN 'Netscape' )
+objectClasses: ( 2.16.840.1.113730.3.2.58 NAME 'nsAdminGroup' DESC 'Netscape defined objectclass' SUP top MUST ( cn ) MAY ( nsAdminGroupName $ description $ nsConfigRoot $ nsAdminSIEDN ) X-ORIGIN 'Netscape' )
+objectClasses: ( 2.16.840.1.113730.3.2.59 NAME 'nsApplication' DESC 'Netscape defined objectclass' SUP top MUST ( cn ) MAY ( nsVendor $ description $ nsProductName $ nsNickName $ nsProductVersion $ nsBuildNumber $ nsRevisionNumber $ nsSerialNumber $ nsInstalledLocation $ installationTimeStamp $ nsExpirationDate $ nsBuildSecurity $ nsLdapSchemaVersion $ nsServerMigrationClassname $ nsServerCreationClassname ) X-ORIGIN 'Netscape' )
+objectClasses: ( 2.16.840.1.113730.3.2.62 NAME 'nsResourceRef' DESC 'Netscape defined objectclass' SUP top MUST ( cn ) MAY ( seeAlso ) X-ORIGIN 'Netscape' )
+objectClasses: ( 2.16.840.1.113730.3.2.63 NAME 'nsTask' DESC 'Netscape defined objectclass' SUP top MUST ( cn ) MAY ( nsTaskLabel $ nsHelpref $ nsExecref $ nsLogSuppress ) X-ORIGIN 'Netscape' )
+objectClasses: ( 2.16.840.1.113730.3.2.64 NAME 'nsTaskGroup' DESC 'Netscape defined objectclass' SUP top MUST ( cn ) MAY ( nsTaskLabel ) X-ORIGIN 'Netscape' )
+objectClasses: ( 2.16.840.1.113730.3.2.65 NAME 'nsAdminObject' DESC 'Netscape defined objectclass' SUP top MUST ( cn ) MAY ( nsJarFilename $ nsClassName ) X-ORIGIN 'Netscape' )
+objectClasses: ( 2.16.840.1.113730.3.2.66 NAME 'nsConfig' DESC 'Netscape defined objectclass' SUP top MUST ( cn ) MAY ( description $ nsServerPort $ nsServerAddress $ nsSuiteSpotUser $ nsErrorLog $ nsPidLog $ nsAccessLog $ nsDefaultAcceptLanguage $ nsServerSecurity ) X-ORIGIN 'Netscape' )
+objectClasses: ( 2.16.840.1.113730.3.2.67 NAME 'nsDirectoryInfo' DESC 'Netscape defined objectclass' SUP top MUST ( cn ) MAY ( nsBindDN $ nsBindPassword $ nsDirectoryURL $ nsDirectoryFailoverList $ nsDirectoryInfoRef ) X-ORIGIN 'Netscape' )
objectClasses: ( 2.16.840.1.113730.3.2.329 NAME 'nsMemberOf' DESC 'Allow memberOf assignment on groups for nesting and users' SUP top AUXILIARY MAY ( memberOf ) X-ORIGIN '389 Directory Server Project' )
objectClasses: ( 2.16.840.1.113730.3.2.331 NAME 'nsAccount' DESC 'A representation of a binding user in a directory server' SUP top AUXILIARY MAY ( userCertificate $ nsCertSubjectDN $ nsSshPublicKey $ userPassword ) X-ORIGIN '389 Directory Server Project' )
objectClasses: ( 2.16.840.1.113730.3.2.333 NAME 'nsPerson' DESC 'A representation of a person in a directory server' SUP top STRUCTURAL MUST ( displayName $ cn ) MAY ( userPassword $ seeAlso $ description $ legalName $ mail $ preferredLanguage ) X-ORIGIN '389 Directory Server Project' )
diff --git a/ldap/schema/50ns-admin.ldif b/ldap/schema/50ns-admin.ldif
index aceaf759a..a553c58cc 100644
--- a/ldap/schema/50ns-admin.ldif
+++ b/ldap/schema/50ns-admin.ldif
@@ -12,34 +12,34 @@
# Schema used by Netscape Administration Services
#
dn: cn=schema
-attributeTypes: ( nsAdminCgiWaitPid-oid NAME 'nsAdminCgiWaitPid' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )
-attributeTypes: ( nsAdminUsers-oid NAME 'nsAdminUsers' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )
-attributeTypes: ( nsAdminAccessHosts-oid NAME 'nsAdminAccessHosts' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )
-attributeTypes: ( nsAdminAccessAddresses-oid NAME 'nsAdminAccessAddresses' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )
-attributeTypes: ( nsAdminOneACLDir-oid NAME 'nsAdminOneACLDir' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )
-attributeTypes: ( nsAdminEnableDSGW-oid NAME 'nsAdminEnableDSGW' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )
-attributeTypes: ( nsAdminEnableEnduser-oid NAME 'nsAdminEnableEnduser' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )
-attributeTypes: ( nsAdminCacheLifetime-oid NAME 'nsAdminCacheLifetime' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )
-attributeTypes: ( nsAdminAccountInfo-oid NAME 'nsAdminAccountInfo' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )
-attributeTypes: ( nsDeleteclassname-oid NAME 'nsDeleteclassname' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )
-attributeTypes: ( nsAdminEndUserHTMLIndex-oid NAME 'nsAdminEndUserHTMLIndex' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )
-attributeTypes: ( nsUniqueAttribute-oid NAME 'nsUniqueAttribute' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )
-attributeTypes: ( nsUserIDFormat-oid NAME 'nsUserIDFormat' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )
-attributeTypes: ( nsUserRDNComponent-oid NAME 'nsUserRDNComponent' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )
-attributeTypes: ( nsGroupRDNComponent-oid NAME 'nsGroupRDNComponent' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )
-attributeTypes: ( nsWellKnownJarfiles-oid NAME 'nsWellKnownJarfiles' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )
-attributeTypes: ( nsNYR-oid NAME 'nsNYR' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )
-attributeTypes: ( nsDefaultObjectClass-oid NAME 'nsDefaultObjectClass' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )
-attributeTypes: ( nsPreference-oid NAME 'nsPreference' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )
-attributeTypes: ( nsDisplayName-oid NAME 'nsDisplayName' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )
-attributeTypes: ( nsViewConfiguration-oid NAME 'nsViewConfiguration' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )
-objectClasses: ( nsAdminServer-oid NAME 'nsAdminServer' DESC 'Netscape defined objectclass' SUP top MUST ( cn $ nsServerID ) MAY ( description ) X-ORIGIN 'Netscape Administration Services' )
-objectClasses: ( nsAdminConfig-oid NAME 'nsAdminConfig' DESC 'Netscape defined objectclass' SUP nsConfig MAY ( nsAdminCgiWaitPid $ nsAdminUsers $ nsAdminAccessHosts $ nsAdminAccessAddresses $ nsAdminOneACLDir $ nsAdminEnableDSGW $ nsAdminEnableEnduser $ nsAdminCacheLifetime ) X-ORIGIN 'Netscape Administration Services' )
-objectClasses: ( nsAdminResourceEditorExtension-oid NAME 'nsAdminResourceEditorExtension' DESC 'Netscape defined objectclass' SUP nsAdminObject MUST ( cn ) MAY ( nsAdminAccountInfo $ nsDeleteclassname ) X-ORIGIN 'Netscape Administration Services' )
-objectClasses: ( nsAdminGlobalParameters-oid NAME 'nsAdminGlobalParameters' DESC 'Netscape defined objectclass' SUP top MUST ( cn ) MAY ( nsAdminEndUserHTMLIndex $ nsNickname ) X-ORIGIN 'Netscape Administration Services' )
-objectClasses: ( nsGlobalParameters-oid NAME 'nsGlobalParameters' DESC 'Netscape defined objectclass' SUP top MUST ( cn ) MAY ( nsUniqueAttribute $ nsUserIDFormat $ nsUserRDNComponent $ nsGroupRDNComponent $ nsWellKnownJarFiles $ nsNYR ) X-ORIGIN 'Netscape Administration Services' )
-objectClasses: ( nsDefaultObjectClasses-oid NAME 'nsDefaultObjectClasses' DESC 'Netscape defined objectclass' SUP top MUST ( cn ) MAY ( nsDefaultObjectClass ) X-ORIGIN 'Netscape Administration Services' )
-objectClasses: ( nsAdminConsoleUser-oid NAME 'nsAdminConsoleUser' DESC 'Netscape defined objectclass' SUP top MUST ( cn ) MAY ( nsPreference ) X-ORIGIN 'Netscape Administration Services' )
-objectClasses: ( nsCustomView-oid NAME 'nsCustomView' DESC 'Netscape defined objectclass' SUP nsAdminObject MAY ( nsDisplayName ) X-ORIGIN 'Netscape Administration Services' )
-objectClasses: ( nsTopologyCustomView-oid NAME 'nsTopologyCustomView' DESC 'Netscape defined objectclass' SUP nsCustomView MUST ( cn ) MAY ( nsViewConfiguration ) X-ORIGIN 'Netscape Administration Services' )
-objectClasses: ( nsTopologyPlugin-oid NAME 'nsTopologyPlugin' DESC 'Netscape defined objectclass' SUP nsAdminObject X-ORIGIN 'Netscape Administration Services' )
+attributeTypes: ( 2.16.840.1.113730.3.1.255 NAME 'nsAdminCgiWaitPid' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )
+attributeTypes: ( 2.16.840.1.113730.3.1.256 NAME 'nsAdminUsers' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )
+attributeTypes: ( 2.16.840.1.113730.3.1.257 NAME 'nsAdminAccessHosts' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )
+attributeTypes: ( 2.16.840.1.113730.3.1.258 NAME 'nsAdminAccessAddresses' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )
+attributeTypes: ( 2.16.840.1.113730.3.1.259 NAME 'nsAdminOneACLDir' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )
+attributeTypes: ( 2.16.840.1.113730.3.1.260 NAME 'nsAdminEnableDSGW' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )
+attributeTypes: ( 2.16.840.1.113730.3.1.261 NAME 'nsAdminEnableEnduser' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )
+attributeTypes: ( 2.16.840.1.113730.3.1.262 NAME 'nsAdminCacheLifetime' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )
+attributeTypes: ( 2.16.840.1.113730.3.1.263 NAME 'nsAdminAccountInfo' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )
+attributeTypes: ( 2.16.840.1.113730.3.1.264 NAME 'nsDeleteclassname' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )
+attributeTypes: ( 2.16.840.1.113730.3.1.265 NAME 'nsAdminEndUserHTMLIndex' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )
+attributeTypes: ( 2.16.840.1.113730.3.1.266 NAME 'nsUniqueAttribute' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )
+attributeTypes: ( 2.16.840.1.113730.3.1.267 NAME 'nsUserIDFormat' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )
+attributeTypes: ( 2.16.840.1.113730.3.1.268 NAME 'nsUserRDNComponent' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )
+attributeTypes: ( 2.16.840.1.113730.3.1.269 NAME 'nsGroupRDNComponent' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )
+attributeTypes: ( 2.16.840.1.113730.3.1.270 NAME 'nsWellKnownJarfiles' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )
+attributeTypes: ( 2.16.840.1.113730.3.1.271 NAME 'nsNYR' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )
+attributeTypes: ( 2.16.840.1.113730.3.1.272 NAME 'nsDefaultObjectClass' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )
+attributeTypes: ( 2.16.840.1.113730.3.1.273 NAME 'nsPreference' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )
+attributeTypes: ( 2.16.840.1.113730.3.1.274 NAME 'nsDisplayName' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )
+attributeTypes: ( 2.16.840.1.113730.3.1.275 NAME 'nsViewConfiguration' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Administration Services' )
+objectClasses: ( 2.16.840.1.113730.3.2.46 NAME 'nsAdminServer' DESC 'Netscape defined objectclass' SUP top MUST ( cn $ nsServerID ) MAY ( description ) X-ORIGIN 'Netscape Administration Services' )
+objectClasses: ( 2.16.840.1.113730.3.2.47 NAME 'nsAdminConfig' DESC 'Netscape defined objectclass' SUP nsConfig MAY ( nsAdminCgiWaitPid $ nsAdminUsers $ nsAdminAccessHosts $ nsAdminAccessAddresses $ nsAdminOneACLDir $ nsAdminEnableDSGW $ nsAdminEnableEnduser $ nsAdminCacheLifetime ) X-ORIGIN 'Netscape Administration Services' )
+objectClasses: ( 2.16.840.1.113730.3.2.48 NAME 'nsAdminResourceEditorExtension' DESC 'Netscape defined objectclass' SUP nsAdminObject MUST ( cn ) MAY ( nsAdminAccountInfo $ nsDeleteclassname ) X-ORIGIN 'Netscape Administration Services' )
+objectClasses: ( 2.16.840.1.113730.3.2.49 NAME 'nsAdminGlobalParameters' DESC 'Netscape defined objectclass' SUP top MUST ( cn ) MAY ( nsAdminEndUserHTMLIndex $ nsNickname ) X-ORIGIN 'Netscape Administration Services' )
+objectClasses: ( 2.16.840.1.113730.3.2.50 NAME 'nsGlobalParameters' DESC 'Netscape defined objectclass' SUP top MUST ( cn ) MAY ( nsUniqueAttribute $ nsUserIDFormat $ nsUserRDNComponent $ nsGroupRDNComponent $ nsWellKnownJarFiles $ nsNYR ) X-ORIGIN 'Netscape Administration Services' )
+objectClasses: ( 2.16.840.1.113730.3.2.51 NAME 'nsDefaultObjectClasses' DESC 'Netscape defined objectclass' SUP top MUST ( cn ) MAY ( nsDefaultObjectClass ) X-ORIGIN 'Netscape Administration Services' )
+objectClasses: ( 2.16.840.1.113730.3.2.52 NAME 'nsAdminConsoleUser' DESC 'Netscape defined objectclass' SUP top MUST ( cn ) MAY ( nsPreference ) X-ORIGIN 'Netscape Administration Services' )
+objectClasses: ( 2.16.840.1.113730.3.2.53 NAME 'nsCustomView' DESC 'Netscape defined objectclass' SUP nsAdminObject MAY ( nsDisplayName ) X-ORIGIN 'Netscape Administration Services' )
+objectClasses: ( 2.16.840.1.113730.3.2.54 NAME 'nsTopologyCustomView' DESC 'Netscape defined objectclass' SUP nsCustomView MUST ( cn ) MAY ( nsViewConfiguration ) X-ORIGIN 'Netscape Administration Services' )
+objectClasses: ( 2.16.840.1.113730.3.2.55 NAME 'nsTopologyPlugin' DESC 'Netscape defined objectclass' SUP nsAdminObject X-ORIGIN 'Netscape Administration Services' )
diff --git a/ldap/schema/50ns-certificate.ldif b/ldap/schema/50ns-certificate.ldif
index e89680a18..42d0f3e70 100644
--- a/ldap/schema/50ns-certificate.ldif
+++ b/ldap/schema/50ns-certificate.ldif
@@ -12,6 +12,6 @@
# Schema for Netscape Certificate Management System
#
dn: cn=schema
-attributeTypes: ( nsCertConfig-oid NAME 'nsCertConfig' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Certificate Management System' )
+attributeTypes: ( 1.3.6.1.4.1.42.2.27.10.1.190 NAME 'nsCertConfig' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Certificate Management System' )
objectClasses: ( 2.16.840.1.113730.3.2.18 NAME 'netscapeCertificateServer' DESC 'Netscape defined objectclass' SUP top MUST ( objectclass ) X-ORIGIN 'Netscape Certificate Management System' )
-objectClasses: ( nsCertificateServer-oid NAME 'nsCertificateServer' DESC 'Netscape defined objectclass' SUP top MUST ( objectclass $ nsServerID ) MAY ( serverHostName $ nsServerPort $ nsCertConfig ) X-ORIGIN 'Netscape Certificate Management System' )
+objectClasses: ( 1.3.6.1.4.1.42.2.27.10.2.32 NAME 'nsCertificateServer' DESC 'Netscape defined objectclass' SUP top MUST ( objectclass $ nsServerID ) MAY ( serverHostName $ nsServerPort $ nsCertConfig ) X-ORIGIN 'Netscape Certificate Management System' )
diff --git a/ldap/schema/50ns-directory.ldif b/ldap/schema/50ns-directory.ldif
index 298d60770..63502482b 100644
--- a/ldap/schema/50ns-directory.ldif
+++ b/ldap/schema/50ns-directory.ldif
@@ -12,7 +12,7 @@
# Additional schema used by Netscape Directory Server 4.x
#
dn: cn=schema
-attributeTypes: ( nsSecureServerPort-oid NAME 'nsSecureServerPort' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )
+attributeTypes: ( 1.3.6.1.4.1.42.2.27.10.1.73 NAME 'nsSecureServerPort' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )
attributeTypes: ( 2.16.840.1.113730.3.1.206 NAME 'filterInfo' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )
attributeTypes: ( 2.16.840.1.113730.3.1.48 NAME 'replicaPort' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )
attributeTypes: ( 2.16.840.1.113730.3.1.49 NAME 'replicaUpdateFailedAt' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Directory Server' )
@@ -83,7 +83,7 @@ attributeTypes: ( 2.16.840.1.113730.3.1.57 NAME 'replicaRoot' DESC 'Netscape def
attributeTypes: ( 2.16.840.1.113730.3.1.58 NAME 'replicaBindDn' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'Netscape Directory Server' )
attributeTypes: ( 2.16.840.1.113730.3.1.69 NAME 'subtreeACI' DESC 'Netscape defined attribute type' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'Netscape Directory Server 1.0' )
objectClasses: ( 2.16.840.1.113730.3.2.23 NAME 'netscapeDirectoryServer' DESC 'Netscape defined objectclass' SUP top MUST ( objectclass ) X-ORIGIN 'Netscape Directory Server' )
-objectClasses: ( nsDirectoryServer-oid NAME 'nsDirectoryServer' DESC 'Netscape defined objectclass' SUP top MUST ( objectclass $ nsServerID ) MAY ( serverHostName $ nsServerPort $ nsSecureServerPort $ nsBindPassword $ nsBindDN $ nsBaseDN ) X-ORIGIN 'Netscape Directory Server' )
+objectClasses: ( 1.3.6.1.4.1.42.2.27.10.2.31 NAME 'nsDirectoryServer' DESC 'Netscape defined objectclass' SUP top MUST ( objectclass $ nsServerID ) MAY ( serverHostName $ nsServerPort $ nsSecureServerPort $ nsBindPassword $ nsBindDN $ nsBaseDN ) X-ORIGIN 'Netscape Directory Server' )
objectClasses: ( 2.16.840.1.113730.3.2.8 NAME 'ntUser' DESC 'Netscape defined objectclass' SUP top MUST ( ntUserDomainId ) MAY ( description $ l $ ou $ seeAlso $ ntUserPriv $ ntUserHomeDir $ ntUserComment $ ntUserFlags $ ntUserScriptPath $ ntUserAuthFlags $ ntUserUsrComment $ ntUserParms $ ntUserWorkstations $ ntUserLastLogon $ ntUserLastLogoff $ ntUserAcctExpires $ ntUserMaxStorage $ ntUserUnitsPerWeek $ ntUserLogonHours $ ntUserBadPwCount $ ntUserNumLogons $ ntUserLogonServer $ ntUserCountryCode $ ntUserCodePage $ ntUserUniqueId $ ntUserPrimaryGroupId $ ntUserProfile $ ntUserHomeDirDrive $ ntUserPasswordExpired $ ntUserCreateNewAccount $ ntUserDeleteAccount $ ntUniqueId $ ntUserNtPassword ) X-ORIGIN 'Netscape NT Synchronization' )
objectClasses: ( 2.16.840.1.113730.3.2.9 NAME 'ntGroup' DESC 'Netscape defined objectclass' SUP top MUST ( ntUserDomainId ) MAY ( description $ l $ ou $ seeAlso $ ntGroupId $ ntGroupAttributes $ ntGroupCreateNewGroup $ ntGroupDeleteGroup $ ntGroupType $ ntUniqueId $ mail ) X-ORIGIN 'Netscape NT Synchronization' )
objectClasses: ( 2.16.840.1.113730.3.2.82 NAME 'nsChangelog4Config' DESC 'Netscape defined objectclass' SUP top MAY ( cn ) X-ORIGIN 'Netscape Directory Server' )
diff --git a/ldap/schema/50ns-mail.ldif b/ldap/schema/50ns-mail.ldif
index 53d766977..3e4783e6c 100644
--- a/ldap/schema/50ns-mail.ldif
+++ b/ldap/schema/50ns-mail.ldif
@@ -18,7 +18,7 @@ attributeTypes: ( 2.16.840.1.113730.3.1.707 NAME ( 'vacationstartdate' ) DESC 'N
attributeTypes: ( 2.16.840.1.113730.3.1.18 NAME ( 'mailHost' ) DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Messaging Server 4.x' )
attributeTypes: ( 2.16.840.1.113730.3.1.33 NAME ( 'mgrpModerator' ) DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'Netscape Messaging Server 4.x' )
attributeTypes: ( 2.16.840.1.113730.3.1.25 NAME ( 'mgrpDeliverTo' ) DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'Netscape Messaging Server 4.x' )
-attributeTypes: ( mgrpApprovePassword-oid NAME ( 'mgrpApprovePassword' ) DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'Netscape Messaging Server 4.x' )
+attributeTypes: ( 1.3.6.1.4.1.42.2.27.10.1.81 NAME ( 'mgrpApprovePassword' ) DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'Netscape Messaging Server 4.x' )
attributeTypes: ( 2.16.840.1.113730.3.1.31 NAME ( 'mailEnhancedUniqueMember' ) DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.12 X-ORIGIN 'Netscape Messaging Server 4.x' )
attributeTypes: ( 2.16.840.1.113730.3.1.781 NAME ( 'mgrpAddHeader' ) DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'Netscape Messaging Server 4.x' )
attributeTypes: ( 2.16.840.1.113730.3.1.22 NAME ( 'mgrpAllowedBroadcaster' ) DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'Netscape Messaging Server 4.x' )
@@ -39,7 +39,7 @@ attributeTypes: ( 2.16.840.1.113730.3.1.520 NAME ( 'nswmExtendedUserPrefs' ) DES
attributeTypes: ( 2.16.840.1.113730.3.1.26 NAME ( 'mgrpErrorsTo' ) DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE X-ORIGIN 'Netscape Messaging Server 4.x' )
attributeTypes: ( 2.16.840.1.113730.3.1.23 NAME ( 'mgrpAllowedDomain' ) DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Messaging Server 4.x' )
attributeTypes: ( 2.16.840.1.113730.3.1.28 NAME ( 'mgrpMsgRejectAction' ) DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Messaging Server 4.x' )
-attributeTypes: ( nsmsgDisallowAccess-oid NAME ( 'nsmsgDisallowAccess' ) DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'Netscape Messaging Server 4.x' )
+attributeTypes: ( 1.3.6.1.4.1.42.2.27.10.1.79 NAME ( 'nsmsgDisallowAccess' ) DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'Netscape Messaging Server 4.x' )
attributeTypes: ( 2.16.840.1.113730.3.1.17 NAME ( 'mailForwardingAddress' ) DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 X-ORIGIN 'Netscape Messaging Server 4.x' )
attributeTypes: ( 2.16.840.1.113730.3.1.32 NAME ( 'mgrpMsgMaxSize' ) DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 SINGLE-VALUE X-ORIGIN 'Netscape Messaging Server 4.x' )
attributeTypes: ( 2.16.840.1.113730.3.1.29 NAME ( 'mgrpMsgRejectText' ) DESC 'Netscape Messaging Server 4.x defined attribute' SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 X-ORIGIN 'Netscape Messaging Server 4.x' )
| 0 |
62072539953d0956e0f2664ef1a3691cf8fbdac0
|
389ds/389-ds-base
|
Ticket 47965 - Fix coverity issues (2014/12/16)
12867 - Uninitialized pointer read
Description:
The third arg for ldap_utf8strtok_r is supposed to be initialized.
https://fedorahosted.org/389/ticket/47965
Reviewed by [email protected] (Thank you, Mark!!)
|
commit 62072539953d0956e0f2664ef1a3691cf8fbdac0
Author: Noriko Hosoi <[email protected]>
Date: Tue Dec 16 11:26:04 2014 -0800
Ticket 47965 - Fix coverity issues (2014/12/16)
12867 - Uninitialized pointer read
Description:
The third arg for ldap_utf8strtok_r is supposed to be initialized.
https://fedorahosted.org/389/ticket/47965
Reviewed by [email protected] (Thank you, Mark!!)
diff --git a/ldap/servers/plugins/acl/acllas.c b/ldap/servers/plugins/acl/acllas.c
index 439c8f174..4738a408f 100644
--- a/ldap/servers/plugins/acl/acllas.c
+++ b/ldap/servers/plugins/acl/acllas.c
@@ -1223,7 +1223,7 @@ DS_LASUserDnAttrEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator,
/* See if we have a parent[2].attr" rule */
if (strstr(attrName, "parent[") != NULL) {
- char *word, *str, *next;
+ char *word, *str, *next = NULL;
numOflevels = 0;
n_currEntryDn = slapi_entry_get_ndn ( lasinfo.resourceEntry );
@@ -1489,7 +1489,7 @@ DS_LASLdapUrlAttrEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator,
/* See if we have a parent[2].attr" rule */
if (strstr(attrName, "parent[") != NULL) {
- char *word, *str, *next;
+ char *word, *str, *next = NULL;
numOflevels = 0;
n_currEntryDn = slapi_entry_get_ndn ( lasinfo.resourceEntry );
@@ -2659,7 +2659,7 @@ DS_LASGroupDnAttrEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator,
/* See if we have a parent[2].attr" rule */
if (strstr(attrName, "parent[") != NULL) {
- char *word, *str, *next;
+ char *word, *str, *next = NULL;
numOflevels = 0;
n_currEntryDn = slapi_entry_get_ndn ( lasinfo.resourceEntry ) ;
diff --git a/ldap/servers/plugins/acl/aclparse.c b/ldap/servers/plugins/acl/aclparse.c
index be86c8bb2..fd262e8dc 100644
--- a/ldap/servers/plugins/acl/aclparse.c
+++ b/ldap/servers/plugins/acl/aclparse.c
@@ -600,7 +600,7 @@ __aclp__sanity_check_acltxt (aci_t *aci_item, char *str)
ACLListHandle_t *handle = NULL;
char *newstr = NULL;
char *word;
- char *next;
+ char *next = NULL;
const char *brkstr = " ;";
int checkversion = 0;
@@ -1367,7 +1367,7 @@ __aclp__get_aci_right (char *str)
{
char *sav_str = slapi_ch_strdup(str);
- char *t, *tt;
+ char *t, *tt = NULL;
int type = 0;
char *delimiter = ",";
char *val = NULL;
diff --git a/ldap/servers/plugins/replication/repl5_replica.c b/ldap/servers/plugins/replication/repl5_replica.c
index 77663f65a..61ae7ec01 100644
--- a/ldap/servers/plugins/replication/repl5_replica.c
+++ b/ldap/servers/plugins/replication/repl5_replica.c
@@ -2046,7 +2046,7 @@ replica_check_for_tasks(Replica *r, Slapi_Entry *e)
char *forcing;
char *csnpart;
char *ridstr;
- char *iter;
+ char *iter = NULL;
int i;
for(i = 0; i < CLEANRIDSIZ && clean_vals[i]; i++){
diff --git a/ldap/servers/plugins/replication/repl_extop.c b/ldap/servers/plugins/replication/repl_extop.c
index 35014a9d4..4fefe9f6b 100644
--- a/ldap/servers/plugins/replication/repl_extop.c
+++ b/ldap/servers/plugins/replication/repl_extop.c
@@ -1463,7 +1463,7 @@ multimaster_extop_abort_cleanruv(Slapi_PBlock *pb)
char *repl_root;
char *payload = NULL;
char *certify_all;
- char *iter;
+ char *iter = NULL;
int rc = LDAP_SUCCESS;
slapi_pblock_get(pb, SLAPI_EXT_OP_REQ_OID, &extop_oid);
@@ -1591,7 +1591,7 @@ multimaster_extop_cleanruv(Slapi_PBlock *pb)
char *force = NULL;
char *extop_oid;
char *repl_root;
- char *iter;
+ char *iter = NULL;
int release_it = 0;
int rid = 0;
int rc = LDAP_OPERATIONS_ERROR;
diff --git a/ldap/servers/plugins/replication/windows_connection.c b/ldap/servers/plugins/replication/windows_connection.c
index c7c7a9823..e78c3679e 100644
--- a/ldap/servers/plugins/replication/windows_connection.c
+++ b/ldap/servers/plugins/replication/windows_connection.c
@@ -595,7 +595,7 @@ windows_LDAPMessage2Entry(Slapi_Entry *e, Repl_Connection *conn,
char *dupa = slapi_ch_strdup(a);
char *newa = NULL; /* dup of 'a' with next range */
char *p, *wp, *pp; /* work pointers */
- char *iter;
+ char *iter = NULL;
int high = 0;
int sizea = strlen(a) + 2;
/* handling subtype(s) */
diff --git a/ldap/servers/plugins/replication/windows_private.c b/ldap/servers/plugins/replication/windows_private.c
index cfa2704b1..9be6c7dd3 100644
--- a/ldap/servers/plugins/replication/windows_private.c
+++ b/ldap/servers/plugins/replication/windows_private.c
@@ -946,7 +946,7 @@ create_subtree_pairs(char **pairs)
subtreePair *spp;
char **ptr;
char *p0, *p1;
- char *saveptr;
+ char *saveptr = NULL;
int cnt;
for (cnt = 0, ptr = pairs; ptr && *ptr; cnt++, ptr++) ;
diff --git a/ldap/servers/plugins/rootdn_access/rootdn_access.c b/ldap/servers/plugins/rootdn_access/rootdn_access.c
index 3045e9fa0..5c530c6f2 100644
--- a/ldap/servers/plugins/rootdn_access/rootdn_access.c
+++ b/ldap/servers/plugins/rootdn_access/rootdn_access.c
@@ -229,7 +229,7 @@ rootdn_load_config(Slapi_PBlock *pb)
Slapi_Entry *e = NULL;
char *openTime = NULL;
char *closeTime = NULL;
- char *token, *iter, *copy;
+ char *token, *iter = NULL, *copy;
char hour[3], min[3];
int result = 0;
int time;
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_attr.c b/ldap/servers/slapd/back-ldbm/ldbm_attr.c
index 13ab07b07..7b3f66413 100644
--- a/ldap/servers/slapd/back-ldbm/ldbm_attr.c
+++ b/ldap/servers/slapd/back-ldbm/ldbm_attr.c
@@ -509,7 +509,7 @@ attr_index_parse_idlistsize(struct attrinfo *ai, const char *strval, struct inde
int rc = 0; /* assume success */
char *mystr = slapi_ch_strdup(strval); /* copy for strtok */
char *values = NULL;
- char *lasts, *val, *ptr;
+ char *lasts = NULL, *val, *ptr;
int seen_limit = 0, seen_type = 0, seen_flags = 0, seen_values = 0;
Slapi_Attr *attr = &ai->ai_sattr;
| 0 |
9ca2e51367d2232ffa44099a8bdc2f1ae8d4c76b
|
389ds/389-ds-base
|
Issue 1802 - Improve ldclt man page (#5928)
Bug Description: ldclt is a complex tool. We should be providing worked examples
to help add context to the many parameters available.
Fix Description: Add a worked example from the addition of a set of users to
using them for a binding load test.
Fixes: https://github.com/389ds/389-ds-base/issues/1802
Author: wibrown
Review by: @progier389 and @jchapma (Thanks!)
Co-authored-by: William Brown <[email protected]>
|
commit 9ca2e51367d2232ffa44099a8bdc2f1ae8d4c76b
Author: Simon Pichugin <[email protected]>
Date: Thu Sep 14 19:03:54 2023 -0700
Issue 1802 - Improve ldclt man page (#5928)
Bug Description: ldclt is a complex tool. We should be providing worked examples
to help add context to the many parameters available.
Fix Description: Add a worked example from the addition of a set of users to
using them for a binding load test.
Fixes: https://github.com/389ds/389-ds-base/issues/1802
Author: wibrown
Review by: @progier389 and @jchapma (Thanks!)
Co-authored-by: William Brown <[email protected]>
diff --git a/man/man1/ldclt.1 b/man/man1/ldclt.1
index c7f3f3109..272da1103 100644
--- a/man/man1/ldclt.1
+++ b/man/man1/ldclt.1
@@ -217,6 +217,49 @@ Execution parameters:
.br
\fBrandomauthidhigh=value\fR high value for random SASL Authid.
.PP
+.SH EXAMPLES
+To populate a database with 1000 user objects create a file template.ldif containing:
+.PP
+.nf
+.RS
+objectClass: top
+objectclass: person
+objectClass: organizationalPerson
+objectClass: inetorgperson
+objectClass: posixAccount
+objectClass: shadowAccount
+sn: user[A]
+cn: user[A]
+givenName: user[A]
+description: description[A]
+userPassword: password[A]
+mail: user[A]@example.com
+uidNumber: 1[A]
+gidNumber: 1[A]
+shadowMin: 0
+shadowMax: 99999
+shadowInactive: 30
+shadowWarning: 7
+homeDirectory: /home/uid[A]
+.RE
+.fi
+.PP
+This can now be loaded to the database using:
+.PP
+.nf
+.RS
+ldclt -h localhost -p 389 -D "cn=Directory Manager" -w password -b "ou=people,dc=example,dc=com" -I 68 -e add,commoncounter -e "object=/tmp/template.ldif,rdn=uid:user[A=INCRNNOLOOP(0;999;4)]"
+.RE
+.fi
+.PP
+Using these created users you can test binding to the accounts with:
+.PP
+.nf
+.RS
+ldclt -h localhost -p 389 -e bindeach,bindonly -D uid=user0XXX,dc=example,dc=com -w password0XXX -e randombinddn,randombinddnlow=0,randombinddnhigh=0999 -e esearch -f "(&(objectClass=posixAccount)(uid=user*)(uidNumber=*)(gidNumber=*))"
+.RE
+.fi
+.PP
.SH AUTHOR
ldclt was written by the 389 Project.
.SH "REPORTING BUGS"
| 0 |
5bbe379e3753b397a13fb0f3a418c90a717a1d7a
|
389ds/389-ds-base
|
Bug 690584 - #10658 linked_attrs_pre_op - fix coverity resource leak issues
https://bugzilla.redhat.com/show_bug.cgi?id=690584
Resolves: bug 690584
Bug Description: #10658 linked_attrs_pre_op - fix coverity resource leak issues
Reviewed by: nkinder (Thanks!)
Branch: master
Fix Description: just get rid of smods - not used here
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
|
commit 5bbe379e3753b397a13fb0f3a418c90a717a1d7a
Author: Rich Megginson <[email protected]>
Date: Fri Mar 25 09:36:47 2011 -0600
Bug 690584 - #10658 linked_attrs_pre_op - fix coverity resource leak issues
https://bugzilla.redhat.com/show_bug.cgi?id=690584
Resolves: bug 690584
Bug Description: #10658 linked_attrs_pre_op - fix coverity resource leak issues
Reviewed by: nkinder (Thanks!)
Branch: master
Fix Description: just get rid of smods - not used here
Platforms tested: RHEL6 x86_64
Flag Day: no
Doc impact: no
diff --git a/ldap/servers/plugins/linkedattrs/linked_attrs.c b/ldap/servers/plugins/linkedattrs/linked_attrs.c
index 5cfef5d38..b69b2cd8c 100644
--- a/ldap/servers/plugins/linkedattrs/linked_attrs.c
+++ b/ldap/servers/plugins/linkedattrs/linked_attrs.c
@@ -1446,8 +1446,7 @@ linked_attrs_pre_op(Slapi_PBlock * pb, int modop)
{
char *dn = 0;
Slapi_Entry *e = 0;
- Slapi_Mods *smods = 0;
- LDAPMod **mods;
+ LDAPMod **mods = NULL;
int free_entry = 0;
char *errstr = NULL;
int ret = 0;
@@ -1488,14 +1487,11 @@ linked_attrs_pre_op(Slapi_PBlock * pb, int modop)
/* Grab the mods. */
slapi_pblock_get(pb, SLAPI_MODIFY_MODS, &mods);
- smods = slapi_mods_new();
- slapi_mods_init_passin(smods, mods);
-
/* Apply the mods to create the resulting entry. */
if (mods && (slapi_entry_apply_mods(e, mods) != LDAP_SUCCESS)) {
/* The mods don't apply cleanly, so we just let this op go
* to let the main server handle it. */
- goto bailmod;
+ goto bail;
}
}
@@ -1509,14 +1505,6 @@ linked_attrs_pre_op(Slapi_PBlock * pb, int modop)
"linked attribute configuration.");
}
}
-
- bailmod:
- /* Clean up smods. */
- if (LDAP_CHANGETYPE_MODIFY == modop) {
- mods = slapi_mods_get_ldapmods_passout(smods);
- slapi_pblock_set(pb, SLAPI_MODIFY_MODS, mods);
- slapi_mods_free(&smods);
- }
}
bail:
| 0 |
9fe1a7ce515333f8024fb708e8d7de97e389f734
|
389ds/389-ds-base
|
Issue 31 - Add status command and SkipNested support for MemberOf
Description:
- Add a generic function for displaying plugin's status.
- Make sure that existing Plugin.status() works properly with py3.
- Add support for configuring memberOfSkipNested attr.
- Add dsconf support and cli tests for memberOfSkipNested attr.
- Define must-have attributes for MemberOf.
https://pagure.io/lib389/issue/31
Author: Ilias95
Review by: wibrown (Thanks, great work!)
|
commit 9fe1a7ce515333f8024fb708e8d7de97e389f734
Author: Ilias Stamatis <[email protected]>
Date: Mon Jun 19 04:00:21 2017 +0300
Issue 31 - Add status command and SkipNested support for MemberOf
Description:
- Add a generic function for displaying plugin's status.
- Make sure that existing Plugin.status() works properly with py3.
- Add support for configuring memberOfSkipNested attr.
- Add dsconf support and cli tests for memberOfSkipNested attr.
- Define must-have attributes for MemberOf.
https://pagure.io/lib389/issue/31
Author: Ilias95
Review by: wibrown (Thanks, great work!)
diff --git a/src/lib389/lib389/cli_conf/plugin.py b/src/lib389/lib389/cli_conf/plugin.py
index 2d02f8775..70b75a0fa 100644
--- a/src/lib389/lib389/cli_conf/plugin.py
+++ b/src/lib389/lib389/cli_conf/plugin.py
@@ -76,6 +76,13 @@ def generic_disable(inst, basedn, log, args):
plugin.disable()
log.info("Disabled %s", plugin.rdn)
+def generic_status(inst, basedn, log, args):
+ plugin = args.plugin_cls(inst)
+ if plugin.status() == True:
+ log.info("%s is enabled", plugin.rdn)
+ else:
+ log.info("%s is disabled", plugin.rdn)
+
def create_parser(subparsers):
plugin_parser = subparsers.add_parser('plugin', help="Manage plugins available on the server")
diff --git a/src/lib389/lib389/cli_conf/plugins/memberof.py b/src/lib389/lib389/cli_conf/plugins/memberof.py
index ceaecadbf..943a20df8 100644
--- a/src/lib389/lib389/cli_conf/plugins/memberof.py
+++ b/src/lib389/lib389/cli_conf/plugins/memberof.py
@@ -9,7 +9,8 @@
import ldap
from lib389.plugins import MemberOfPlugin
-from lib389.cli_conf.plugin import generic_enable, generic_disable, generic_show
+from lib389.cli_conf.plugin import (
+ generic_enable, generic_disable, generic_status, generic_show)
def manage_attr(inst, basedn, log, args):
@@ -75,6 +76,24 @@ def disable_allbackends(inst, basedn, log, args):
plugin.disable_allbackends()
log.info("memberOfAllBackends disabled successfully")
+def display_skipnested(inst, basedn, log, args):
+ plugin = MemberOfPlugin(inst)
+ val = plugin.get_skipnested_formatted()
+ if not val:
+ log.info("memberOfSkipNested is not set")
+ else:
+ log.info(val)
+
+def enable_skipnested(inst, basedn, log, args):
+ plugin = MemberOfPlugin(inst)
+ plugin.enable_skipnested()
+ log.info("memberOfSkipNested set successfully")
+
+def disable_skipnested(inst, basedn, log, args):
+ plugin = MemberOfPlugin(inst)
+ plugin.disable_skipnested()
+ log.info("memberOfSkipNested unset successfully")
+
def manage_autoaddoc(inst, basedn, log, args):
if args.value == "del":
remove_autoaddoc(inst, basedn, log, args)
@@ -185,6 +204,9 @@ def create_parser(subparsers):
disable_parser = subcommands.add_parser('disable', help='disable memberof plugin')
disable_parser.set_defaults(func=generic_disable, plugin_cls=MemberOfPlugin)
+ status_parser = subcommands.add_parser('status', help='display memberof plugin status')
+ status_parser.set_defaults(func=generic_status, plugin_cls=MemberOfPlugin)
+
attr_parser = subcommands.add_parser('attr', help='get or set memberofattr')
attr_parser.set_defaults(func=manage_attr)
attr_parser.add_argument('value', nargs='?', help='The value to set as memberofattr')
@@ -209,6 +231,15 @@ def create_parser(subparsers):
off_allbackends_parser = allbackends_subcommands.add_parser('off', help='disable all backends for memberof')
off_allbackends_parser.set_defaults(func=disable_allbackends)
+ skipnested_parser = subcommands.add_parser('skipnested', help='get or manage memberofskipnested')
+ skipnested_parser.set_defaults(func=display_skipnested)
+ # argparse doesn't support optional subparsers in python2!
+ skipnested_subcommands = skipnested_parser.add_subparsers(help='action')
+ on_skipnested_parser = skipnested_subcommands.add_parser('on', help='skip nested groups for memberof')
+ on_skipnested_parser.set_defaults(func=enable_skipnested)
+ off_skipnested_parser = skipnested_subcommands.add_parser('off', help="don't skip nested groups for memberof")
+ off_skipnested_parser.set_defaults(func=disable_skipnested)
+
autoaddoc_parser = subcommands.add_parser('autoaddoc', help='get or set memberofautoaddoc')
autoaddoc_parser.set_defaults(func=manage_autoaddoc)
autoaddoc_parser.add_argument('value', nargs='?', choices=['nsmemberof', 'inetuser', 'inetadmin', 'del'],
diff --git a/src/lib389/lib389/plugins.py b/src/lib389/lib389/plugins.py
index bde4c92ac..57e983ea3 100644
--- a/src/lib389/lib389/plugins.py
+++ b/src/lib389/lib389/plugins.py
@@ -8,10 +8,11 @@
import ldap
import copy
+
from lib389.properties import *
from lib389._constants import *
-
from lib389._mapped_object import DSLdapObjects, DSLdapObject
+from lib389.utils import ensure_str
class Plugin(DSLdapObject):
_plugin_properties = {
@@ -42,9 +43,7 @@ class Plugin(DSLdapObject):
self.set('nsslapd-pluginEnabled', 'off')
def status(self):
- if self.get_attr_val('nsslapd-pluginEnabled') == 'on':
- return True
- return False
+ return ensure_str(self.get_attr_val('nsslapd-pluginEnabled')) == 'on'
def create(self, rdn=None, properties=None, basedn=None):
# When we create plugins, we don't want people to have to consider all
@@ -167,7 +166,8 @@ class MemberOfPlugin(Plugin):
def __init__(self, instance, dn="cn=MemberOf Plugin,cn=plugins,cn=config", batch=False):
super(MemberOfPlugin, self).__init__(instance, dn, batch)
- self._create_objectclasses = ['top', 'nsSlapdPlugin', 'extensibleObject']
+ self._create_objectclasses.extend(['extensibleObject'])
+ self._must_attributes.extend(['memberOfGroupAttr', 'memberOfAttr'])
def get_attr(self):
return self.get_attr_val('memberofattr')
@@ -202,6 +202,18 @@ class MemberOfPlugin(Plugin):
def disable_allbackends(self):
self.set('memberofallbackends', 'off')
+ def get_skipnested(self):
+ return self.get_attr_val('memberofskipnested')
+
+ def get_skipnested_formatted(self):
+ return self.display_attr('memberofskipnested')
+
+ def enable_skipnested(self):
+ self.set('memberofskipnested', 'on')
+
+ def disable_skipnested(self):
+ self.set('memberofskipnested', 'off')
+
def get_autoaddoc(self):
return self.get_attr_val('memberofautoaddoc')
diff --git a/src/lib389/lib389/tests/cli/conf_plugins/memberof_test.py b/src/lib389/lib389/tests/cli/conf_plugins/memberof_test.py
index 4c8296ab9..e05b629b1 100644
--- a/src/lib389/lib389/tests/cli/conf_plugins/memberof_test.py
+++ b/src/lib389/lib389/tests/cli/conf_plugins/memberof_test.py
@@ -24,7 +24,7 @@ def topology(request):
# At the moment memberof plugin needs to be enabled in order to perform
# syntax checking. Additionally, we have to restart the server in order
- # for the action of enabling the pluging to take effect.
+ # for the action of enabling the plugin to take effect.
plugin.enable()
topology.standalone.restart()
topology.logcap.flush()
@@ -153,6 +153,35 @@ def test_disable_all_backends(topology):
assert topology.logcap.contains(": off")
topology.logcap.flush()
+def test_get_skipnested_when_not_set(topology):
+ args = FakeArgs()
+
+ memberof_cli.display_skipnested(topology.standalone, None, topology.logcap.log, args)
+ assert topology.logcap.contains("memberOfSkipNested is not set")
+ topology.logcap.flush()
+
+def test_set_skipnested(topology):
+ args = FakeArgs()
+
+ memberof_cli.enable_skipnested(topology.standalone, None, topology.logcap.log, args)
+ assert topology.logcap.contains("set successfully")
+ topology.logcap.flush()
+
+ memberof_cli.display_skipnested(topology.standalone, None, topology.logcap.log, args)
+ assert topology.logcap.contains(": on")
+ topology.logcap.flush()
+
+def test_unset_skipnested(topology):
+ args = FakeArgs()
+
+ memberof_cli.disable_skipnested(topology.standalone, None, topology.logcap.log, args)
+ assert topology.logcap.contains("unset successfully")
+ topology.logcap.flush()
+
+ memberof_cli.display_skipnested(topology.standalone, None, topology.logcap.log, args)
+ assert topology.logcap.contains(": off")
+ topology.logcap.flush()
+
def test_set_autoaddoc(topology):
args = FakeArgs()
| 0 |
1a47871230d6cd088e08b8af42072e2560b423ec
|
389ds/389-ds-base
|
609256 - Selinux: pwdhash fails if called via Admin Server CGI
https://bugzilla.redhat.com/show_bug.cgi?id=609256
Description by [email protected]:
Our CGIs are very restricted in what they can access/run. Most of
the CGIs are self contained programs (they may use libraries, which
is fine). In this case, it looks like pwdhash-bin is called from
the SELinux context used by CGIs (httpd_dirsrvadmin_script_t). The
pwdhash-bin program then tries to load libslapd.so.0, which is labeled
as dirsrv_lib_t. This should be allowed by our SELinux policy since
we call this macro with the httpd_dirsrvadmin_script_t contex. What
seems to be the issue here is that libslapd.so.0 is a symlink, not a
regular file. SELinux considers this to be a class of "lnk_file",
as can be seen in the raw AVC from /var/log/audit/audit. We need to
expand the dirsrv_exec_lib macro to cover link_file.
|
commit 1a47871230d6cd088e08b8af42072e2560b423ec
Author: Noriko Hosoi <[email protected]>
Date: Tue Jun 29 12:11:46 2010 -0700
609256 - Selinux: pwdhash fails if called via Admin Server CGI
https://bugzilla.redhat.com/show_bug.cgi?id=609256
Description by [email protected]:
Our CGIs are very restricted in what they can access/run. Most of
the CGIs are self contained programs (they may use libraries, which
is fine). In this case, it looks like pwdhash-bin is called from
the SELinux context used by CGIs (httpd_dirsrvadmin_script_t). The
pwdhash-bin program then tries to load libslapd.so.0, which is labeled
as dirsrv_lib_t. This should be allowed by our SELinux policy since
we call this macro with the httpd_dirsrvadmin_script_t contex. What
seems to be the issue here is that libslapd.so.0 is a symlink, not a
regular file. SELinux considers this to be a class of "lnk_file",
as can be seen in the raw AVC from /var/log/audit/audit. We need to
expand the dirsrv_exec_lib macro to cover link_file.
diff --git a/selinux/dirsrv.if b/selinux/dirsrv.if
index 56eda43de..ed88fb221 100644
--- a/selinux/dirsrv.if
+++ b/selinux/dirsrv.if
@@ -189,6 +189,7 @@ interface(`dirsrv_exec_lib',`
allow $1 dirsrv_lib_t:dir search_dir_perms;
allow $1 dirsrv_lib_t:file exec_file_perms;
+ allow $1 dirsrv_lib_t:link_file exec_file_perms;
# Not all platforms include ioctl in exec_file_perms
allow $1 dirsrv_lib_t:file ioctl;
')
| 0 |
df3a512763bb798e5dd486ee0a946386495b4c52
|
389ds/389-ds-base
|
Description: (#4325)
Automated tests to verify that
- db2ldif exits properly when the ldif file path provided cannot be accessed
- a usefull error message is displayed as output when the ldif file cannot be accessed
Relates: https://github.com/389ds/389-ds-base/issues/4241
Relates: https://github.com/389ds/389-ds-base/issues/4278
Reviewed by: Bsimonova, Firstyear. Thanks !
|
commit df3a512763bb798e5dd486ee0a946386495b4c52
Author: sgouvern <[email protected]>
Date: Mon Sep 28 02:09:18 2020 +0200
Description: (#4325)
Automated tests to verify that
- db2ldif exits properly when the ldif file path provided cannot be accessed
- a usefull error message is displayed as output when the ldif file cannot be accessed
Relates: https://github.com/389ds/389-ds-base/issues/4241
Relates: https://github.com/389ds/389-ds-base/issues/4278
Reviewed by: Bsimonova, Firstyear. Thanks !
diff --git a/dirsrvtests/tests/suites/export/export_test.py b/dirsrvtests/tests/suites/export/export_test.py
new file mode 100644
index 000000000..5efa03e56
--- /dev/null
+++ b/dirsrvtests/tests/suites/export/export_test.py
@@ -0,0 +1,155 @@
+# --- BEGIN COPYRIGHT BLOCK ---
+# Copyright (C) 2020 Red Hat, Inc.
+# All rights reserved.
+#
+# License: GPL (version 3 or any later version).
+# See LICENSE for details.
+# --- END COPYRIGHT BLOCK ---
+
+
+import os
+import pytest
+import subprocess
+
+from lib389.topologies import topology_st as topo
+from lib389._constants import DEFAULT_SUFFIX, DEFAULT_BENAME
+from lib389.utils import *
+from lib389.paths import Paths
+from lib389.cli_base import FakeArgs
+from lib389.cli_ctl.dbtasks import dbtasks_db2ldif
+
+pytestmark = pytest.mark.tier1
+
+def run_db2ldif_and_clear_logs(topology, instance, backend, ldif, output_msg, encrypt=False, repl=False):
+ args = FakeArgs()
+ args.instance = instance.serverid
+ args.backend = backend
+ args.encrypted = encrypt
+ args.replication = repl
+ args.ldif = ldif
+
+ dbtasks_db2ldif(instance, topology.logcap.log, args)
+
+ log.info('checking output msg')
+ if not topology.logcap.contains(output_msg):
+ log.error('The output message is not the expected one')
+ assert False
+
+ log.info('Clear the log')
+ topology.logcap.flush()
+
+
[email protected]
[email protected]
[email protected](ds_is_older("1.3.10", "1.4.2"), reason="Not implemented")
+def test_dbtasks_db2ldif_with_non_accessible_ldif_file_path(topo):
+ """Export with dsctl db2ldif, giving a ldif file path which can't be accessed by the user (dirsrv by default)
+
+ :id: ca91eda7-27b1-4750-a013-531a63d3f5b0
+ :setup: Standalone Instance - entries imported in the db
+ :steps:
+ 1. Stop the server
+ 2. Launch db2ldif with an non accessible ldif file path
+ 3. Catch the reported error code
+ 4. check the error reported in the errors log
+ :expected results:
+ 1. Operation successful
+ 2. Operation properly fails, without crashing
+ 3. An error code different from 139 (segmentation fault) should be reported
+ 4. 'ERR - bdb_db2ldif - db2ldif: userRoot: can't open file' should be reported
+ """
+ export_ldif = '/tmp/nonexistent/export.ldif'
+
+ log.info("Stopping the instance...")
+ topo.standalone.stop()
+
+ log.info("Performing an offline export to a non accessible ldif file path - should fail properly")
+ expected_output="db2ldif failed"
+ run_db2ldif_and_clear_logs(topo, topo.standalone, DEFAULT_BENAME, export_ldif, expected_output)
+
+ log.info("parsing the errors log to search for the error reported")
+ if ds_is_newer("1.3.10"):
+ search_str = str(topo.standalone.ds_error_log.match(r".*ERR - bdb_db2ldif - db2ldif: userRoot: can't open*"))[1:-1]
+ else:
+ search_str = str(topo.standalone.ds_error_log.match(r".*ERR - ldbm_back_ldbm2ldif - db2ldif: can't open*"))[1:-1]
+
+ assert len(search_str) > 0
+ log.info("error string : %s" % search_str)
+
+ log.info("Restarting the instance...")
+ topo.standalone.start()
+
[email protected]
[email protected]
[email protected](ds_is_older("1.4.3.8"), reason="bz1806978 not fixed")
+def test_db2ldif_cli_with_non_accessible_ldif_file_path(topo):
+ """Export with ns-slapd db2ldif, giving a ldif file path which can't be accessed by the user (dirsrv by default)
+
+ :id: ca91eda7-27b1-4750-a013-531a63d3f5b0
+ :setup: Standalone Instance - entries imported in the db
+ :steps:
+ 1. Stop the server
+ 2. Launch db2ldif with an non accessible ldif file path
+ 3. Catch the reported error code
+ 4. check the error reported in the errors log
+ :expected results:
+ 1. Operation successful
+ 2. Operation properly fails, without crashing
+ 3. An error code different from 139 (segmentation fault) should be reported
+ 4. 'ERR - bdb_db2ldif - db2ldif: userRoot: can't open file' should be reported
+ """
+ export_ldif = '/tmp/nonexistent/export.ldif'
+ db2ldif_cmd = os.path.join(topo.standalone.ds_paths.sbin_dir, 'db2ldif')
+
+ log.info("Stopping the instance...")
+ topo.standalone.stop()
+
+ log.info("Performing an offline export to a non accessible ldif file path - should fail properly")
+ try:
+ subprocess.check_call([db2ldif_cmd, '-Z', topo.standalone.serverid, '-s', DEFAULT_SUFFIX, '-a', export_ldif])
+ except subprocess.CalledProcessError as e:
+ if format(e.returncode) == '139':
+ log.error('db2ldif had a Segmentation fault (core dumped)')
+ assert False
+ else:
+ log.info('db2ldif failed properly: error ({})'.format(e.returncode))
+ assert True
+
+ log.info("parsing the errors log to search for the error reported")
+ search_str = str(topo.standalone.ds_error_log.match(r".*ERR - bdb_db2ldif - db2ldif: userRoot: can't open*"))[1:-1]
+ assert len(search_str) > 0
+ log.info("error string : %s" % search_str)
+
+ log.info("Restarting the instance...")
+ topo.standalone.start()
+
[email protected]
[email protected](reason="bug 1860291")
[email protected](ds_is_older("1.3.10", "1.4.2"), reason="Not implemented")
+def test_dbtasks_db2ldif_with_non_accessible_ldif_file_path_output(topo):
+ """Export with db2ldif, giving a ldif file path which can't be accessed by the user (dirsrv by default)
+
+ :id: fcc63387-e650-40a7-b643-baa68c190037
+ :setup: Standalone Instance - entries imported in the db
+ :steps:
+ 1. Stop the server
+ 2. Launch db2ldif with a non accessible ldif file path
+ 3. check the error reported in the command output
+ :expected results:
+ 1. Operation successful
+ 2. Operation properly fails
+ 3. An clear error message is reported as output of the cli
+ """
+ export_ldif = '/tmp/nonexistent/export.ldif'
+
+ log.info("Stopping the instance...")
+ topo.standalone.stop()
+
+ log.info("Performing an offline export to a non accessible ldif file path - should fail and output a clear error message")
+ expected_output="No such file or directory"
+ run_db2ldif_and_clear_logs(topo, topo.standalone, DEFAULT_BENAME, export_ldif, expected_output)
+ # This test will possibly have to be updated with the error message reported after bz1860291 fix
+
+ log.info("Restarting the instance...")
+ topo.standalone.start()
+
| 0 |
2fa04088931450237ad6580fd5fc5903878bdbb0
|
389ds/389-ds-base
|
Issue 49640 - Cleanup plugin bootstrap logging
Bug Description: We add PBKDF2_SHA256 password storage schema two times. During:
1. the dse.ldif parsing;
2. the bootstrap plugin operation.
It causes the error to appear during the startup.
Fix Description: Make plugin_setup() function report the error to TRACE log level
if the plugin already exists. We will report the error in ERR log level during
the config bootstrap anyway (code path for the 1st option from bug description).
For 2nd option, report the error to TRACE if it is 'already exist' issue
and to ERR if it is any other case.
Make the plugin_setup returns more consistent.
https://pagure.io/389-ds-base/issue/49640
Reviewed by: mreynolds, mhonek (Thanks!)
|
commit 2fa04088931450237ad6580fd5fc5903878bdbb0
Author: Simon Pichugin <[email protected]>
Date: Sun Jul 1 19:19:06 2018 +0200
Issue 49640 - Cleanup plugin bootstrap logging
Bug Description: We add PBKDF2_SHA256 password storage schema two times. During:
1. the dse.ldif parsing;
2. the bootstrap plugin operation.
It causes the error to appear during the startup.
Fix Description: Make plugin_setup() function report the error to TRACE log level
if the plugin already exists. We will report the error in ERR log level during
the config bootstrap anyway (code path for the 1st option from bug description).
For 2nd option, report the error to TRACE if it is 'already exist' issue
and to ERR if it is any other case.
Make the plugin_setup returns more consistent.
https://pagure.io/389-ds-base/issue/49640
Reviewed by: mreynolds, mhonek (Thanks!)
diff --git a/ldap/servers/slapd/config.c b/ldap/servers/slapd/config.c
index 9b3b5a64e..7e1618e79 100644
--- a/ldap/servers/slapd/config.c
+++ b/ldap/servers/slapd/config.c
@@ -526,10 +526,18 @@ slapd_bootstrap_config(const char *configdir)
if (e == NULL) {
continue;
}
- if (plugin_setup(e, 0, 0, 1, returntext) != 0) {
- slapi_log_err(SLAPI_LOG_TRACE, "slapd_bootstrap_config", "Application of plugin failed, maybe already there?\n");
- } else {
+ rc = plugin_setup(e, 0, 0, 1, returntext);
+ if (rc == 0) {
slapi_log_err(SLAPI_LOG_TRACE, "slapd_bootstrap_config", "Application of plugin SUCCESS\n");
+ } else if (rc == 1) {
+ /* It means that the plugin entry already exists */
+ slapi_log_err(SLAPI_LOG_TRACE, "slapd_bootstrap_config",
+ "The plugin entry [%s] in the configfile %s was invalid. %s\n",
+ slapi_entry_get_dn(e), configfile, returntext);
+ } else {
+ slapi_log_err(SLAPI_LOG_ERR, "slapd_bootstrap_config",
+ "The plugin entry [%s] in the configfile %s was invalid. %s\n",
+ slapi_entry_get_dn(e), configfile, returntext);
}
slapi_entry_free(e);
}
diff --git a/ldap/servers/slapd/plugin.c b/ldap/servers/slapd/plugin.c
index 2db3c7fcd..9e1c1b479 100644
--- a/ldap/servers/slapd/plugin.c
+++ b/ldap/servers/slapd/plugin.c
@@ -2786,12 +2786,12 @@ plugin_setup(Slapi_Entry *plugin_entry, struct slapi_componentid *group, slapi_p
}
if ((existname = plugin_exists(slapi_entry_get_sdn_const(plugin_entry))) != NULL) {
- slapi_log_err(SLAPI_LOG_ERR, "plugin_setup", "The plugin named %s already exists, "
- "or is already setup.\n",
+ slapi_log_err(SLAPI_LOG_TRACE, "plugin_setup", "The plugin named %s already exists, "
+ "or is already setup.\n",
existname);
PR_snprintf(returntext, SLAPI_DSE_RETURNTEXT_SIZE,
"the plugin named %s already exists, or is already setup.", existname);
- return -1;
+ return 1;
}
/*
@@ -3016,7 +3016,9 @@ plugin_setup(Slapi_Entry *plugin_entry, struct slapi_componentid *group, slapi_p
}
if (!status) {
- status = plugin_add_descriptive_attributes(plugin_entry, plugin);
+ if (plugin_add_descriptive_attributes(plugin_entry, plugin) != 0) {
+ status = -1;
+ }
}
slapi_ch_free((void **)&value);
| 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.