Bug 49930 - Openldap syntax evaluation of attribute preferredDeliveryMethod broken
Openldap syntax evaluation of attribute preferredDeliveryMethod broken
Status: CLOSED FIXED
Product: UCS
Classification: Unclassified
Component: LDAP
UCS 4.4
Other Linux
: P5 enhancement (vote)
: UCS 4.4-1-errata
Assigned To: Julia Bremer
Arvid Requate
https://bugs.openldap.org/show_bug.cg...
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2019-07-29 11:24 CEST by Julia Bremer
Modified: 2020-04-06 13:00 CEST (History)
3 users (show)

See Also:
What kind of report is it?: Bug Report
What type of bug is this?: 3: Simply Wrong: The implementation doesn't match the docu
Who will be affected by this bug?: 1: Will affect a very few installed domains
How will those affected feel about the bug?: 1: Nuisance – not a big deal but noticeable
User Pain: 0.017
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
syntax patch (782 bytes, patch)
2019-07-29 11:24 CEST, Julia Bremer
Details | Diff
patch for DeliveryMethodValidate (1.40 KB, patch)
2019-07-29 17:24 CEST, Julia Bremer
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Julia Bremer univentionstaff 2019-07-29 11:24:23 CEST
Created attachment 10136 [details]
syntax patch

The Attribute preferredDeliveryMethod is an ordered set of values, which are separated by "$" Symbols.

The syntax is described here:
https://tools.ietf.org/html/rfc4517#page-8

Every set of values returns a syntax error, even if the syntax is correct according to the syntax description.
This is due to an error in servers/slapd/schema_init.c deliveryMethodValidate
Comment 1 Julia Bremer univentionstaff 2019-07-29 17:24:03 CEST
Created attachment 10137 [details]
patch for DeliveryMethodValidate
Comment 2 Julia Bremer univentionstaff 2019-07-29 17:25:06 CEST
Successful build
Package: openldap
Version: 2.4.45+dfsg-1~bpo9+1A~4.4.0.201907291444
Branch: ucs_4.4-0
Scope: errata4.4-1

Build with attached patch
Comment 3 Florian Best univentionstaff 2019-07-29 17:32:01 CEST
Can you give some more information in this bug report?:
* Did you write that patch yourself or is it part of e.g. a newer debian release, openldap, etc.?
* Is there an upstream bug report?
Comment 4 Julia Bremer univentionstaff 2019-07-29 18:39:57 CEST
* I created this patch
* There is no upstream bug report yet, but I am planning one creating one.

Further details:
The syntax of preferredDeliveryMethod is a list of specified strings, separated by ' $ '.

If only one value is set, e.g "physical" the syntax check works and returns valid.
As soon as one specifies more e.g "telephone $ videotex" 
(which should work since this is an official example for the syntax)

ldap_modify: Invalid syntax (21)
	additional info: preferredDeliveryMethod: value #0 invalid per syntax

is returned.

This is due to a trivial error in the function deliveryMethodValidate, which 
causes the syntax check to analyse the string backwards after the first space character.
The attached patch fixes this.
Comment 5 Florian Best univentionstaff 2019-07-30 08:54:36 CEST
Cool, thanks!
Comment 6 Arvid Requate univentionstaff 2019-08-05 21:25:05 CEST
Verified:
* Package cherry picked from errata4.3-1 to errata4.4-1
* Patches merged from 4.3-0-0-ucs/2.4.45+dfsg-1~bpo9+1-errata4.3-1
* New patch Ok: 99_preferredDeliveryMethod_syntax.patch
* Patch applied during built
  (documented in /usr/share/doc/slapd/changelog.Debian.gz)
* Functional test with example from RFC: Ok
* Advisory: Ok
Comment 7 Erik Damrose univentionstaff 2019-08-07 15:44:35 CEST
<http://errata.software-univention.de/ucs/4.4/208.html>
Comment 8 Mathieu Simon 2019-08-08 14:34:14 CEST
Hi Julia

Thanks for that fix, when you have proposed the patch upstream, could you reference the OpenLDAP ITS issue number here?

This would allow cross-referencing the bug between up- and downstream.

Regards
Mathieu