Skip to content

Commit

Permalink
Issue 6227 - dsconf schema does not show inChain matching rule
Browse files Browse the repository at this point in the history
Bug description:
	The registered inChain MR does defined any matching rule
	syntax (mr_syntax).
	When dsconf reads the matching rules (read_schema_dse)
	it only reports those which have OID and SYNTAX.
	As a consequence InChain was not reported.

Fix description:
	The syntax defines that assersion syntax that is
	distinguished name. Add this syntax to the register
	struct

relates: 389ds#6227

Reviewed by:
  • Loading branch information
tbordaz committed Jun 17, 2024
1 parent 4e3dc9e commit acb9a03
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
21 changes: 21 additions & 0 deletions dirsrvtests/tests/suites/filter/inchain_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -812,6 +812,27 @@ def test_invalid_assertion(topo):
memberof = topo.standalone.search_s(DEFAULT_SUFFIX, SCOPE_SUBTREE, "(member:%s:=%s)" % (INCHAIN_OID, user))
assert len(memberof) == 0

def test_check_dsconf_matchingrule(topo):
"""Test that the matching rule 'inchain' is listed by dsconf
:id: b8dd4049-ccec-4316-bc9c-5aa5c5afcfbd
:setup: Standalone Instance
:steps:
1. run 'dsconf instance schema matchingrules list'
2. Checks that the output contains inchaineMatch matching rule
:expectedresults:
1. Success
2. Success
"""
dsconf_cmd= ['/usr/sbin/dsconf', topo.standalone.serverid, 'schema', 'matchingrules', 'list']
# Set referral
log.info("Use dsconf to check defined matching rules")
log.info(f'Command used: %{dsconf_cmd}')
proc = subprocess.Popen(dsconf_cmd, stdout=subprocess.PIPE)
out, _ = proc.communicate()
log.info('output message : %s' % out[0])
assert '1.2.840.113556.1.4.1941 NAME \'inchainMatch\'' in out.decode('utf-8')

if __name__ == "__main__":
CURRENT_FILE = os.path.realpath(__file__)
pytest.main("-s -v %s" % CURRENT_FILE)
4 changes: 2 additions & 2 deletions ldap/servers/plugins/syntaxes/inchain.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ static char *names[] = {"inchain", "inchain", LDAP_MATCHING_RULE_IN_CHAIN_OID, 0
static Slapi_PluginDesc pdesc = {"inchain-matching-rule", VENDOR, DS_PACKAGE_VERSION,
"inchain matching rule plugin"};

static const char *inchainMatch_names[] = {"inchainMatch", "1.2.840.113556.1.4.1941", NULL};
static const char *inchainMatch_names[] = {"inchainMatch", LDAP_MATCHING_RULE_IN_CHAIN_OID, NULL};

static struct mr_plugin_def mr_plugin_table[] = {
{
Expand All @@ -64,7 +64,7 @@ static struct mr_plugin_def mr_plugin_table[] = {
"the AVA comparisons evaluate to Undefined and the remaining AVA "
"comparisons return TRUE then the distinguishedNameMatch rule "
"evaluates to Undefined.",
NULL,
DN_SYNTAX_OID,
0,
NULL /* dn only for now */
}, /* matching rule desc */
Expand Down

0 comments on commit acb9a03

Please sign in to comment.