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

Sorting of included schemas results in bad configuration #125

Open
atombaby opened this issue Aug 22, 2022 · 0 comments
Open

Sorting of included schemas results in bad configuration #125

atombaby opened this issue Aug 22, 2022 · 0 comments
Labels
Bug Something isn't working Help Wanted Assistance is required to resolve this issue

Comments

@atombaby
Copy link

πŸ—£οΈ Foreword

Thank for taking the time to fill this bug report fully. Without it we may not be able to fix the bug, and the issue may be closed without resolution.

πŸ‘» Brief Description

Sorting of schemas results in missing attributes

πŸ₯ž Cookbook version

6.0.3

πŸ‘©β€πŸ³ Chef-Infra Version

17.10.3

🎩 Platform details

Ubuntu Bionic 18.04

Steps To Reproduce

  • add ldap-autofs to list of packages installed by cookbook
  • create list of schemas containing autofs.schema, ex:
node.default['openldap']['schemas'] = %w(
 core.schema
 cosine.schema
 inetorgperson.schema
 nis.schema
 autofs.schema
)
  • note that "autofs" is last as it depends on schema attributes from core (and maybe nis?)
  • converging will fail- the slapd service will not start.
  • systemctl status slapd doesn't contain useful messages- slaptest does:
vagrant@default-ubuntu-1804:~$ sudo slaptest -f /etc/ldap/slapd.conf -v
6303e2b4 /etc/ldap/schema/autofs.schema: line 26 objectclass: AttributeType not found: "ou"
slaptest: bad configuration file!

πŸš“ Expected behavior

A running slapd service with the autofs schema loaded.

I would expect that the ordering of the schema names in the attribute node[openldap][schemas] would be honored in the generated slapd configuration file.

βž• Additional context

When slapd processes the config file, each include line is processed in order (see include in the "Global Configuration Options" of the slapd.conf manpage). When sorted lexically, the schema for autofs is loaded first, but slapd doesn't have a definition for ou (available in the core schema) so fails.

This seems to occur in the template generating slapd.conf at line 22

I believe- given the algorithm for loading include files- that it's improper to sort this lexically and that the ordering of the array should be maintained in the output of this template.

@damacus damacus added Bug Something isn't working Help Wanted Assistance is required to resolve this issue labels Oct 24, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Help Wanted Assistance is required to resolve this issue
Projects
None yet
Development

No branches or pull requests

2 participants