Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit of 1024 characters for nsMatchingRule #55

Closed
389-ds-bot opened this issue Sep 12, 2020 · 10 comments
Closed

Limit of 1024 characters for nsMatchingRule #55

389-ds-bot opened this issue Sep 12, 2020 · 10 comments
Labels
closed: fixed Migration flag - Issue
Milestone

Comments

@389-ds-bot
Copy link

Cloned from Pagure issue: https://pagure.io/389-ds-base/issue/55


https://bugzilla.redhat.com/show_bug.cgi?id=697081

Specify multiple nsMatchingRule values for an index:

nsMatchingRule: value
...
nsMatchingRule: valueN

Some of the values will be silently lost if the total length of the string of
values exceeds 1024 bytes.

There should be no limit.
@389-ds-bot 389-ds-bot added the closed: fixed Migration flag - Issue label Sep 12, 2020
@389-ds-bot 389-ds-bot added this to the 1.2.10.rc1 milestone Sep 12, 2020
@389-ds-bot
Copy link
Author

Comment from mreynolds (@mreynolds389) at 2012-01-21 00:49:45

The buffer can be increased, but not easily set to unlimited. Are you really using OIDs that are longer 1024 characters? Just curious, as I've never seen an OID even close to this length.

Thanks,
Mark

@389-ds-bot
Copy link
Author

Comment from nhosoi (@nhosoi) at 2012-01-21 01:02:49

Replying to [comment:6 mreynolds389]:

The buffer can be increased, but not easily set to unlimited. Are you really using OIDs that are longer 1024 characters? Just curious, as I've never seen an OID even close to this length.

You could dynamically allocate a necessary sized buffer tmpMatchingRulesStr instead of using an static array on the stack? (and free it when it's done?)

@389-ds-bot
Copy link
Author

Comment from rmeggins (@richm) at 2012-01-21 01:09:49

Replying to [comment:6 mreynolds389]:

The buffer can be increased, but not easily set to unlimited. Are you really using OIDs that are longer 1024 characters? Just curious, as I've never seen an OID even close to this length.

Thanks,
Mark

It's not just a single OID - the nsMatchingRule attribute value can be used to specify multiple different indexes - I ran into this issue when doing matching rule index testing e.g. try to specify a matching rule index for every supported language * each type of index (eq, substring, etc.)

@389-ds-bot
Copy link
Author

Comment from rmeggins (@richm) at 2012-01-27 22:37:52

static int ldbm_index_parse_entry(ldbm_instance *inst, Slapi_Entry *e,
if (NULL == attrValue->bv_val || strlen(attrValue->bv_val) == 0) {
already have the len in attrValue->bv_len - no need to do a strlen()

ldbm_instance_index_config_modify_callback
After checking for a valid config, I think you can just pass the entryAfter to attr_index_config - this will in effect replace the current index with the index config from entryAfter

ldbm_instance_config_add_index_entry
looks like the code is copying the Slapi_Entry to a string, then passing the string to ldbm_config_add_dse_entry()? Do we need another api that we can use to just pass in the Slapi_Entry instead of converting it to a string?

@389-ds-bot
Copy link
Author

Comment from rmeggins (@richm) at 2012-02-02 01:04:15

one minor comment:

281	                for (j = slapi_attr_first_value(attr, &sval); j != -1;j = slapi_attr_next_value(attr, j, &sval), mr_count++); 

should use slapi_attr_get_numvalues() instead. Otherwise, looks good.

@389-ds-bot
Copy link
Author

@389-ds-bot
Copy link
Author

Comment from mreynolds (@mreynolds389) at 2012-02-02 01:43:16

Made the change, and pushed.

Thanks for the review Rich!

[mareynol@localhost slapd]$ git merge ticket55
Updating e72f4b2..094709a
Fast-forward
ldap/servers/slapd/back-ldbm/instance.c | 131 +++--
ldap/servers/slapd/back-ldbm/ldbm_attr.c | 324 ++++++-----
ldap/servers/slapd/back-ldbm/ldbm_config.h | 3 +-
ldap/servers/slapd/back-ldbm/ldbm_index_config.c | 681 ++++------------------
ldap/servers/slapd/back-ldbm/ldif2ldbm.c | 39 +-
ldap/servers/slapd/back-ldbm/proto-back-ldbm.h | 2 +-
6 files changed, 396 insertions(+), 784 deletions(-)
[mareynol@localhost slapd]$ git push origin master
Counting objects: 23, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (12/12), done.
Writing objects: 100% (12/12), 4.94 KiB, done.
Total 12 (delta 10), reused 0 (delta 0)
To ssh://git.fedorahosted.org/git/389/ds.git
e72f4b2..094709a master -> master

@389-ds-bot
Copy link
Author

Comment from rmeggins (@richm) at 2012-02-02 08:53:59

commit changeset:2a0b622d1cce006712b10b278f78e78a68044548/389-ds-base
Author: Rich Megginson richm@redhat.com
Date: Wed Feb 1 19:50:00 2012 -0700
Fix Description: ENTRYRDN was changed to ENTRYDN - fixed

@389-ds-bot
Copy link
Author

Comment from nkinder (@nkinder) at 2012-08-28 04:14:26

Added initial screened field value.

@389-ds-bot
Copy link
Author

Comment from rmeggins (@richm) at 2017-02-11 22:52:39

Metadata Update from @richm:

  • Issue assigned to mreynolds389
  • Issue set to the milestone: 1.2.10.rc1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed: fixed Migration flag - Issue
Projects
None yet
Development

No branches or pull requests

1 participant