Bug 34406 - Missing ordering of LDAP schema
Missing ordering of LDAP schema
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: LDAP
UCS 3.2
All Linux
: P5 normal (vote)
: UCS 3.2-1-errata
Assigned To: Philipp Hahn
Arvid Requate
:
Depends on:
Blocks: 34349 34533 35929
  Show dependency treegraph
 
Reported: 2014-03-26 19:13 CET by Philipp Hahn
Modified: 2014-09-15 12:33 CEST (History)
2 users (show)

See Also:
What kind of report is it?: ---
What type of bug is this?: ---
Who will be affected by this bug?: ---
How will those affected feel about the bug?: ---
User Pain:
Enterprise Customer affected?:
School Customer affected?:
ISV affected?:
Waiting Support:
Flags outvoted (downgraded) after PO Review:
Ticket number:
Bug group (optional):
Max CVSS v3 score:


Attachments
Stable local-schema include file hhhorder (1.40 KB, patch)
2014-03-26 19:13 CET, Philipp Hahn
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Philipp Hahn univentionstaff 2014-03-26 19:13:55 CET
Created attachment 5839 [details]
Stable local-schema include file hhhorder

ucs-3.2-1/management/univention-ldap/conffiles/etc/ldap/slapd.conf.d/25univention-ldap-server_local-schema just uses listdir(), which returns the files in any order. As LDAP attributes must be defined before there use and objectClasses also have an ordering constraint, this sometimes breaks the LDAP server, when dependent schema are included in the wrong order.

1. Use sorted(listdir(...)) to at least get a stable order
2. Allow schema files to start with two digits, which allows ordering. This prefix is ignored when checking for already included schema files.
3. Anchor schema RegExp and escape special characters
4. Convert "useless use of cat" into Python stdin=open(...)
5. Just read lines form stdout instead of first reading whole file.
6. Just parse templates once (instead of for each schema file)
7. Remove duplicate import os.path
Comment 1 Stefan Gohmann univentionstaff 2014-04-11 08:27:59 CEST
(In reply to Philipp Hahn from comment #0)
> 1. Use sorted(listdir(...)) to at least get a stable order

As discussed, we need the sort part for Bug #34349.
Comment 2 Philipp Hahn univentionstaff 2014-04-11 08:56:27 CEST
r49270 univention-ldap: addresses 1 and 7, the other issues will be clones into a new bug.
r49271: 2014-04-11-univention-ldap.yaml
Comment 3 Philipp Hahn univentionstaff 2014-04-11 09:04:37 CEST
Cleanup-part cloned to Bug #34533
Comment 4 Philipp Hahn univentionstaff 2014-04-14 21:56:58 CEST
r49344 | Bug #34406 LDAP: Sort schema files by name 3.2-0
  The sorting has also been applied to UCS-3.2.
  The errata.yaml file has been update to ship the binary packages for both UCS-3.2-0 and UCS-3.2-1, as there are currently no other differences between those two releases.
Comment 5 Arvid Requate univentionstaff 2014-05-06 18:34:23 CEST
* Ok, the files are now included in a sorted order.
* Advisory Ok
Comment 6 Moritz Muehlenhoff univentionstaff 2014-05-07 15:25:10 CEST
http://errata.univention.de/ucs/3.2/103.html