Re: [netmod] [Technical Errata Reported] RFC6020 (4911)

Robert Wilton <rwilton@cisco.com> Wed, 18 January 2017 14:54 UTC

Return-Path: <rwilton@cisco.com>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id EB52A129856 for <netmod@ietfa.amsl.com>; Wed, 18 Jan 2017 06:54:19 -0800 (PST)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -17.721
X-Spam-Level:
X-Spam-Status: No, score=-17.721 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-3.199, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5] autolearn=ham autolearn_force=no
Authentication-Results: ietfa.amsl.com (amavisd-new); dkim=pass (1024-bit key) header.d=cisco.com
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 LUw-mGzWcsXy for <netmod@ietfa.amsl.com>; Wed, 18 Jan 2017 06:54:18 -0800 (PST)
Received: from aer-iport-4.cisco.com (aer-iport-4.cisco.com [173.38.203.54]) (using TLSv1.2 with cipher DHE-RSA-SEED-SHA (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id 72D0012943B for <netmod@ietf.org>; Wed, 18 Jan 2017 06:54:17 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=cisco.com; i=@cisco.com; l=4320; q=dns/txt; s=iport; t=1484751257; x=1485960857; h=subject:to:references:cc:from:message-id:date: mime-version:in-reply-to:content-transfer-encoding; bh=qxdZgZJbQW8b2wAHz8th8pftkKBMxmYxUx38bPNNmd8=; b=jd5DI33g6kDMDK1ngMsNGukKepdKWSuTG6fW1fXK31cEB3TRF1jkcXl0 s0+cuaPRdlMIT0aI9Qm6Ng3uEujoWixdU08K0DsE//XzkdWFHgD4Dcwon FWo6BkNmKJSE9d4pJEr7PRPNObZkvaHHfa3+StM4yLLmLNs8EwVsf4z5s o=;
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: A0BlAQArgX9Y/xbLJq1DGhkBAQEBAQEBAQEBAQcBAQEBAYM5AQEBAQF+A4EGjVlykHAflSyCCx8LhS5KAoI4GAECAQEBAQEBAWMohGoBAQQBATY2CxALGC4nMAYNBgIBAReIaA4tsUmKJgEBAQEBAQEBAQEBAQEBAQEBAQEBAR2GS4IFCIJhgTyBUIEwhXEFiH4Rh16KVIkxiDGKL4Y+inSHex84EIEFEggVFTqENw0PgWA+NQEThjKCOwEBAQ
X-IronPort-AV: E=Sophos;i="5.33,249,1477958400"; d="scan'208";a="651749757"
Received: from aer-iport-nat.cisco.com (HELO aer-core-1.cisco.com) ([173.38.203.22]) by aer-iport-4.cisco.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 18 Jan 2017 14:54:15 +0000
Received: from [10.63.23.107] (dhcp-ensft1-uk-vla370-10-63-23-107.cisco.com [10.63.23.107]) by aer-core-1.cisco.com (8.14.5/8.14.5) with ESMTP id v0IEsE38008015; Wed, 18 Jan 2017 14:54:14 GMT
To: Ladislav Lhotka <lhotka@nic.cz>
References: <20170118114858.62A63B80FFD@rfc-editor.org> <20170118.145532.995038902796253716.mbj@tail-f.com> <69B83F1A-1FBC-44E9-B499-054966616C11@nic.cz>
From: Robert Wilton <rwilton@cisco.com>
Message-ID: <f0bf53a2-0312-a2fa-e1be-821193c5c22a@cisco.com>
Date: Wed, 18 Jan 2017 14:54:14 +0000
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0
MIME-Version: 1.0
In-Reply-To: <69B83F1A-1FBC-44E9-B499-054966616C11@nic.cz>
Content-Type: text/plain; charset="windows-1252"; format="flowed"
Content-Transfer-Encoding: 7bit
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/EMt0CEqtr8dqUK1ZY-khIBefDQE>
Cc: joel jaeggli <joelja@bogus.com>, netmod@ietf.org
Subject: Re: [netmod] [Technical Errata Reported] RFC6020 (4911)
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.17
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: <https://mailarchive.ietf.org/arch/browse/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: Wed, 18 Jan 2017 14:54:20 -0000

Hi Lada,

I don't feel strongly, but basically agree with Martin.

The YANG 1.0 spec is ambiguous, YANG 1.1 has fixed that.  I guess that 
most pragmatic YANG 1.0 implementations would treat a backslash followed 
by something other than n,t,", or / as just a backslash character.

This issue seems to only come up in the context of pattern statements.

The best pragmatic answer that I've seen to this is from rfc6087bis 
section 5.11.2: "Patterns and Ranges" which states that implementations 
SHOULD use single quotes rather than double quotes for patterns and 
hence carefully side steps the issue.

This is the solution that we used to fix the issue in our proprietary 
modules, and also the one that I recommended to OpenConfig for their 
models (but I don't know whether they will implement this).

Rob


On 18/01/2017 14:24, Ladislav Lhotka wrote:
>> On 18 Jan 2017, at 14:55, Martin Bjorklund <mbj@tail-f.com> wrote:
>>
>> RFC Errata System <rfc-editor@rfc-editor.org> wrote:
>>> The following errata report has been submitted for RFC6020,
>>> "YANG - A Data Modeling Language for the Network Configuration
>>> Protocol (NETCONF)".
>>>
>>> --------------------------------------
>>> You may review the report below and at:
>>> http://www.rfc-editor.org/errata_search.php?rfc=6020&eid=4911
>>>
>>> --------------------------------------
>>> Type: Technical
>>> Reported by: Ladislav Lhotka <lhotka@nic.cz>
>>>
>>> Section: 6.1.3
>>>
>>> Original Text
>>> -------------
>>> 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
>>>
>>>
>>> Corrected Text
>>> --------------
>>> 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
>>>
>>> The backslash MUST NOT be followed by any other character.
>>>
>>> Notes
>>> -----
>>> The text doesn't state whether other characters may follow the
>>> backslash, and if yes, what it means. Existing implementations have
>>> used three approaches:
>>>
>>> 1. report an error if another character follows the backslash
>>> 2. keep only the character following the backslash, i.e., for example,
>>> "\x" is the same as "x".
>>> 3. keep both the backslash and the character following it.
>>>
>>> This ambiguity is undesirable and YANG 1.1 [RFC 7950] explicitly
>>> adopted option #1. However, many modules are still being written using
>>> YANG version 1.0, so it is important to clarify this issue in RFC 6020
>>> as well.
>> I don't think this errata should be accepted.  As stated, the spec is
>> unclear, and YANG 1.1 has fixed this problem.  But it is not clear
>> that the original intention when RFC 6020 was written was #1.
>> Accepting this errata now would make existing implementations and
>> modules invalid.
> The problem is that the spec is clearly ambiguous and it is impossible to decide whether such a module is valid or not and, if it is, what the other backslash-escaped characters mean. Existing implementations can already reject such modules - the fact that pyang (and probably other tail-f tools) adopted one interpretation doesn't mean that everybody does the same.
>
>> The solution moving forward is to use YANG 1.1.
>>
> YANG 1.0 modules continue to be written, and I think it is important to stop this problem from spreading further. I think tools should at least issue a warning because otherwise future upgrades to YANG 1.1 may become a nightmare - modules will suddenly break in unexpected places.
>
> If this erratum is rejected, what is the basis for accepting erratum #4909 that started this discussion?
>
> Lada
>
>> /martin
> --
> Ladislav Lhotka, CZ.NIC Labs
> PGP Key ID: 0xB8F92B08A9F76C67
>
>
>
>
>
> _______________________________________________
> netmod mailing list
> netmod@ietf.org
> https://www.ietf.org/mailman/listinfo/netmod
> .
>