Re: [netmod] escapes - WAS: [Netconf] [Technical Errata Reported] RFC6536 (3862)

Ladislav Lhotka <lhotka@nic.cz> Fri, 10 January 2014 15:16 UTC

Return-Path: <lhotka@nic.cz>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 4C0D11AE087 for <netmod@ietfa.amsl.com>; Fri, 10 Jan 2014 07:16:46 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -0.996
X-Spam-Level:
X-Spam-Status: No, score=-0.996 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HOST_EQ_CZ=0.904] autolearn=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lOFq-kG-fPDB for <netmod@ietfa.amsl.com>; Fri, 10 Jan 2014 07:16:44 -0800 (PST)
Received: from trail.lhotka.name (nat-5.bravonet.cz [77.48.224.5]) by ietfa.amsl.com (Postfix) with ESMTP id 9E9391AE06F for <netmod@ietf.org>; Fri, 10 Jan 2014 07:16:43 -0800 (PST)
Received: from localhost (localhost [127.0.0.1]) by trail.lhotka.name (Postfix) with ESMTP id C74D85405AF; Fri, 10 Jan 2014 16:16:32 +0100 (CET)
Received: from trail.lhotka.name ([127.0.0.1]) by localhost (trail.lhotka.name [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id DMNgfBPDP2Au; Fri, 10 Jan 2014 16:16:26 +0100 (CET)
Received: from localhost (unknown [172.29.2.201]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by trail.lhotka.name (Postfix) with ESMTPSA id 7CE4F540210; Fri, 10 Jan 2014 16:16:22 +0100 (CET)
From: Ladislav Lhotka <lhotka@nic.cz>
To: Jernej Tuljak <jernej.tuljak@mg-soft.si>
In-Reply-To: <52D00B5C.9070909@mg-soft.com>
References: <20140110133233.926097FC394@rfc-editor.org> <20140110.144038.1958728126349068530.mbj@tail-f.com> <52CFFC73.3010002@mg-soft.com> <44569F32-FD79-473A-90AF-71542E8D1714@nic.cz> <52D00B5C.9070909@mg-soft.com>
User-Agent: Notmuch/0.17~rc2+11~g2de8ce9 (http://notmuchmail.org) Emacs/24.3.50.2 (x86_64-apple-darwin13.0.0)
Date: Fri, 10 Jan 2014 16:16:21 +0100
Message-ID: <m2r48f7tq2.fsf@nic.cz>
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Cc: netmod@ietf.org
Subject: Re: [netmod] escapes - WAS: [Netconf] [Technical Errata Reported] RFC6536 (3862)
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: NETMOD WG list <netmod.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netmod>, <mailto:netmod-request@ietf.org?subject=unsubscribe>
List-Archive: <http://www.ietf.org/mail-archive/web/netmod/>
List-Post: <mailto:netmod@ietf.org>
List-Help: <mailto:netmod-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netmod>, <mailto:netmod-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 10 Jan 2014 15:16:46 -0000

Jernej Tuljak <jernej.tuljak@mg-soft.si> writes:

> I've read that section a couple of times now and I now agree with Martin 
> that "\*" is currently equivalent to '\*'. My reading would probably be 
> correct if there was no second comma in the text I quoted. Oh, well...
>
>     Within a double-quoted string (enclosed within " "), a backslash
>     character may introduce a special character, which depends on the
>     character that immediately follows the backslash:
>
> would be better, no?

IMO, current wording permits three defensible interpretations:

1. "\*" == '\*'
2. "\*" == '*'
3. "\*' is an error

So this should be clarified.

As I wrote, I'd prefer #3 because it would be the same as the behaviour of "\" in regex patterns.

Lada

>
> Jernej
>
> Dne 10.1.2014 15:31, piše Ladislav Lhotka:
>> On 10 Jan 2014, at 14:58, Jernej Tuljak <jernej.tuljak@mg-soft.si> wrote:
>>
>>> If this is true, then it is RFC6020 that needs a clarification on this. Namely, that the "special character" which follows a backslash need not be special and that it does not represent an escape sequence in such a case.
>>>
>>>    Within a double-quoted string (enclosed within " "), a backslash
>>>    character introduces a special character, which depends on the
>>>    character that immediately follows the backslash:
>>>
>>>     \n      new line
>>>     \t      a tab character
>>>     \"      a double quote
>>>     \\      a single backslash
>>>
>>> My reading is that a backslash starts a YANG escape sequence and may therefore be removed during string dequoting. A "\*" ends up as *, which is not equivalent to '\*’.
>> In XSD regular expressions, which are also used by YANG, it is an error if a backslash plus something is not defined as an escape sequence. So I think YANG should behave the same for double-quoted string, i.e. a backslash followed by something else than the four characters listed above should be flagged as an error (“illegal escape”).
>>
>> Lada
>>
>>> Please move this discussion over to NETMOD it that's the case.
>>>
>>> Jernej
>>>
>>> Dne 10.1.2014 14:40, piše Martin Bjorklund:
>>>> Hi,
>>>>
>>>> This errata should be rejected.  "\*" is equvalent to '\*'.  \* in a
>>>> double quoted string is not an escape sequence, which means that the
>>>> characters are interpreted literally, i.e. the two characters \
>>>> followed by *.
>>>>
>>>> The same goes for errata 3863.
>>>>
>>>> /martin
>>>>
>>>> RFC Errata System <rfc-editor@rfc-editor.org> wrote:
>>>>> The following errata report has been submitted for RFC6536,
>>>>> "Network Configuration Protocol (NETCONF) Access Control Model".
>>>>>
>>>>> --------------------------------------
>>>>> You may review the report below and at:
>>>>> http://www.rfc-editor.org/errata_search.php?rfc=6536&eid=3862
>>>>>
>>>>> --------------------------------------
>>>>> Type: Technical
>>>>> Reported by: Jernej Tuljak <jernej.tuljak@mg-soft.com>
>>>>>
>>>>> Section: 3.5.2.
>>>>>
>>>>> Original Text
>>>>> -------------
>>>>>       typedef matchall-string-type {
>>>>>         type string {
>>>>>           pattern "\*";
>>>>>         }
>>>>>         description
>>>>>           "The string containing a single asterisk '*' is used
>>>>>            to conceptually represent all possible values
>>>>>            for the particular leaf using this data type.";
>>>>>       }
>>>>>
>>>>> Corrected Text
>>>>> --------------
>>>>>       typedef matchall-string-type {
>>>>>         type string {
>>>>>           pattern '\*';
>>>>>         }
>>>>>         description
>>>>>           "The string containing a single asterisk '*' is used
>>>>>            to conceptually represent all possible values
>>>>>            for the particular leaf using this data type.";
>>>>>       }
>>>>>
>>>>> Notes
>>>>> -----
>>>>> As per RFC6020, Section 6.1.3., a backslash within a double-quoted
>>>>> string introduces a special character. The only valid escape sequences
>>>>> inside a double-quoted YANG string are: \n, \t, \" and \. As \* is not
>>>>> a valid escape sequence, a single quoted string should be used to
>>>>> specify the offending pattern statement's argument. The quotes could
>>>>> also be omitted.
>>>>>
>>>>> Instructions:
>>>>> -------------
>>>>> This errata is currently posted as "Reported". If necessary, please
>>>>> use "Reply All" to discuss whether it should be verified or
>>>>> rejected. When a decision is reached, the verifying party (IESG)
>>>>> can log in to change the status and edit the report, if necessary.
>>>>>
>>>>> --------------------------------------
>>>>> RFC6536 (draft-ietf-netconf-access-control-07)
>>>>> --------------------------------------
>>>>> Title : Network Configuration Protocol (NETCONF) Access Control Model
>>>>> Publication Date    : March 2012
>>>>> Author(s)           : A. Bierman, M. Bjorklund
>>>>> Category            : PROPOSED STANDARD
>>>>> Source              : Network Configuration
>>>>> Area                : Operations and Management
>>>>> Stream              : IETF
>>>>> Verifying Party     : IESG
>>>>>
>>> _______________________________________________
>>> Netconf mailing list
>>> Netconf@ietf.org
>>> https://www.ietf.org/mailman/listinfo/netconf
>> --
>> Ladislav Lhotka, CZ.NIC Labs
>> PGP Key ID: E74E8C0C
>>
>>
>>
>>
>> _______________________________________________
>> netmod mailing list
>> netmod@ietf.org
>> https://www.ietf.org/mailman/listinfo/netmod
>

-- 
Ladislav Lhotka, CZ.NIC Labs
PGP Key ID: E74E8C0C