Issue 8251 - slapd fails schema parsing with double quotes in DESC
Summary: slapd fails schema parsing with double quotes in DESC
Status: VERIFIED FIXED
Alias: None
Product: OpenLDAP
Classification: Unclassified
Component: slapd (show other issues)
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: OpenLDAP project
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-09-22 07:14 UTC by Michael Ströder
Modified: 2015-09-22 21:06 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Michael Ströder 2015-09-22 07:14:47 UTC
Full_Name: Michael Str.der
Version: RE24 branch
OS: openSUSE Linux
URL: 
Submission from: (NULL) (79.223.42.239)


Current re24 branch does not accept the following schema description with double
quote in DESC anymore (which works with 2.4.42):

attributetype ( 1.3.6.1.4.1.412.100.2.2.119 NAME 'dlmNameFormat' 
     DESC 'The System object and its derivatives are Top 
           Level Objects of CIM. They provide the scope for 
           numerous components. Having unique System keys is 
           required. A heuristic can be defined in individual 
           System subclasses to attempt to always generate the 
           same System Name Key. The NameFormat property 
           identifies how the System name was generated, using 
           the subclass" heuristic.' 
     SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{64} SINGLE-VALUE 
     EQUALITY caseIgnoreMatch ) 

Starting slapd outputs this message:

5600fed2 /home/michael/ftp/Linux/Networking/LDAP/OpenLDAP/schema/cim_core-2.5.schema:
line 136: unterminated quoted string "subclass heuristic.'      SYNTAX
1.3.6.1.4.1.1466.115.121.1.15{64} SINGLE-VALUE      EQUALITY caseIgnoreMatch )
"
Comment 1 Michael Ströder 2015-09-22 07:17:13 UTC
Maybe a regression caused by fix for ITS#8233?

Comment 2 Howard Chu 2015-09-22 07:27:14 UTC
michael@stroeder.com wrote:
> Maybe a regression caused by fix for ITS#8233?

I don't consider this a regression, the error message is correct.

-- 
   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/

Comment 3 Michael Ströder 2015-09-22 08:09:09 UTC
hyc@symas.com wrote:
> michael@stroeder.com wrote:
>> Maybe a regression caused by fix for ITS#8233?
> 
> I don't consider this a regression, the error message is correct.

So you don't consider this to be a bug at all?

Questions:

Is the attribute type desciption syntactically incorrect?
I don't think so because the double quote is correctly enclosed in single quotes.

Isn't it admirable that 2.4.43 will also parse correct attribute type
desciptions just like 2.4.42 did?

Ciao, Michael.


Comment 4 Kurt Zeilenga 2015-09-22 17:25:20 UTC
> On Sep 22, 2015, at 12:14 AM, michael@stroeder.com wrote:
> 
> Current re24 branch does not accept the following schema description with double
> quote in DESC anymore (which works with 2.4.42)


And it shouldn’t,  per RFC 4512.

— Kurt
Comment 5 Michael Ströder 2015-09-22 17:37:34 UTC
Kurt Zeilenga wrote:
> 
>> On Sep 22, 2015, at 12:14 AM, michael@stroeder.com wrote:
>>
>> Current re24 branch does not accept the following schema description with double
>> quote in DESC anymore (which works with 2.4.42)
> 
> And it shouldn’t,  per RFC 4512.

Please be more verbose.

Assuming I'm not mis-reading [1] it allows double quotes in qdstring (enclosed
in single quotes).

[1] https://tools.ietf.org/html/rfc4512#section-4.1

Note that this is not a schema file I've created and which I could change.
This is the CIM schema provided as is since years.

Ciao, Michael.

Comment 6 Kurt Zeilenga 2015-09-22 17:52:13 UTC
> On Sep 22, 2015, at 10:37 AM, michael@stroeder.com wrote:
> 
> Kurt Zeilenga wrote:
>> 
>>> On Sep 22, 2015, at 12:14 AM, michael@stroeder.com wrote:
>>> 
>>> Current re24 branch does not accept the following schema description with double
>>> quote in DESC anymore (which works with 2.4.42)
>> 
>> And it shouldn’t,  per RFC 4512.
> 
> Please be more verbose.
> 
> Assuming I'm not mis-reading [1] it allows double quotes in qdstring (enclosed
> in single quotes).

You are misreading [1]. the dstring production does not allow the ‘ or “ to appear in it.
Instead, \27 is to be used for “ and either \5C or \5c is to be used for ‘.

— Kurt
Comment 7 Kurt Zeilenga 2015-09-22 17:58:45 UTC
Actually I misread it… my bad.

I was reading QS as “ for some reason…. must need more caffeine.

Yes, so DESC ‘“‘ is a legal qdstring.

Sorry for the confusion…

— Kurt
Comment 8 Michael Ströder 2015-09-22 18:02:04 UTC
Kurt Zeilenga wrote:
> 
>> On Sep 22, 2015, at 10:37 AM, michael@stroeder.com wrote:
>>
>> Kurt Zeilenga wrote:
>>>
>>>> On Sep 22, 2015, at 12:14 AM, michael@stroeder.com wrote:
>>>>
>>>> Current re24 branch does not accept the following schema description with double
>>>> quote in DESC anymore (which works with 2.4.42)
>>>
>>> And it shouldn’t,  per RFC 4512.
>>
>> Please be more verbose.
>>
>> Assuming I'm not mis-reading [1] it allows double quotes in qdstring (enclosed
>> in single quotes).
> 
> You are misreading [1]. the dstring production does not allow the ‘ or “ to appear in it.
> Instead, \27 is to be used for “ and either \5C or \5c is to be used for ‘.

You're talking about QQ (single quote '  mentioned in comment as %x27) and QS
(back-slash mentioned in comment as %x5C).

AFAICS the double quote is %x22 and is included in QUTF1.

Ciao, Michael.

Comment 9 Howard Chu 2015-09-22 18:15:04 UTC
Please use plaintext email only. This thread is mostly unreadable due to the 
multiple escapes and other garbage.

michael@stroeder.com wrote:
> You're talking about QQ (single quote '  mentioned in comment as %x27) an=
> d QS
> (back-slash mentioned in comment as %x5C).
>
> AFAICS the double quote is %x22 and is included in QUTF1.

Yes, DQUOTE is included in QUTF1 but that is not the issue here. The 
slapd.conf(5) syntax says explicitly that double quote is used to enclose 
arguments containing white space. Single quote has no significance to the 
slapd.conf parser. Arguments containing double quote that are meant to be 
taken literally must escape the quote with a backslash.

-- 
   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/

Comment 10 Michael Ströder 2015-09-22 19:33:35 UTC
Howard Chu wrote:
> Please use plaintext email only. This thread is mostly unreadable due to the
> multiple escapes and other garbage.
> 
> michael@stroeder.com wrote:
>> You're talking about QQ (single quote '  mentioned in comment as %x27) an=
>> d QS
>> (back-slash mentioned in comment as %x5C).
>>
>> AFAICS the double quote is %x22 and is included in QUTF1.
> 
> Yes, DQUOTE is included in QUTF1 but that is not the issue here. The
> slapd.conf(5) syntax says explicitly that double quote is used to enclose
> arguments containing white space. Single quote has no significance to the
> slapd.conf parser. Arguments containing double quote that are meant to be
> taken literally must escape the quote with a backslash.

But then I would expect slapd to remove the backslash(es) used for quoting:

In slapd.conf:

---------------------------------- snip ----------------------------------
attributetype ( 1.3.6.1.4.1.5427.1.389.42.3
      DESC 'Test attribute type with \"double quotes\" in DESC'
      SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 )
---------------------------------- snip ----------------------------------

Returned via LDAP in subschema subentry (as LDIF):

attributeTypes: ( 1.3.6.1.4.1.5427.1.389.42.3 DESC 'Test attribute type with
  \"double quotes\" in DESC' EQUALITY booleanMatch SYNTAX 1.3.6.1.4.1.1466.1

Ciao, Michael.

Comment 11 Howard Chu 2015-09-22 20:05:33 UTC
Michael Ströder wrote:
> Howard Chu wrote:
>> Please use plaintext email only. This thread is mostly unreadable due to the
>> multiple escapes and other garbage.
>>
>> michael@stroeder.com wrote:
>>> You're talking about QQ (single quote '  mentioned in comment as %x27) an=
>>> d QS
>>> (back-slash mentioned in comment as %x5C).
>>>
>>> AFAICS the double quote is %x22 and is included in QUTF1.
>>
>> Yes, DQUOTE is included in QUTF1 but that is not the issue here. The
>> slapd.conf(5) syntax says explicitly that double quote is used to enclose
>> arguments containing white space. Single quote has no significance to the
>> slapd.conf parser. Arguments containing double quote that are meant to be
>> taken literally must escape the quote with a backslash.
>
> But then I would expect slapd to remove the backslash(es) used for quoting:

Good point. OK, there's some more work needed in here somewhere.
>
> In slapd.conf:
>
> ---------------------------------- snip ----------------------------------
> attributetype ( 1.3.6.1.4.1.5427.1.389.42.3
>        DESC 'Test attribute type with \"double quotes\" in DESC'
>        SYNTAX 1.3.6.1.4.1.1466.115.121.1.7 )
> ---------------------------------- snip ----------------------------------
>
> Returned via LDAP in subschema subentry (as LDIF):
>
> attributeTypes: ( 1.3.6.1.4.1.5427.1.389.42.3 DESC 'Test attribute type with
>    \"double quotes\" in DESC' EQUALITY booleanMatch SYNTAX 1.3.6.1.4.1.1466.1
>
> Ciao, Michael.
>


-- 
   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/

Comment 12 OpenLDAP project 2015-09-22 20:44:33 UTC
fixed
Comment 13 Howard Chu 2015-09-22 20:44:33 UTC
changed notes
changed state Open to Closed
Comment 14 Howard Chu 2015-09-22 21:06:41 UTC
Howard Chu wrote:
> Michael Ströder wrote:
>> But then I would expect slapd to remove the backslash(es) used for quoting:
>
> Good point. OK, there's some more work needed in here somewhere.

Fixed. Closing this ITS. If you have any other problems regarding this, 
followup to ITS#8233. We don't open new ITSs for unreleased code.

-- 
   -- Howard Chu
   CTO, Symas Corp.           http://www.symas.com
   Director, Highland Sun     http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP  http://www.openldap.org/project/