Re: [ldapext] parsing LDIF: leading spaces

neil.wilson@unboundid.com Wed, 30 September 2015 14:18 UTC

Return-Path: <neil.wilson@unboundid.com>
X-Original-To: ldapext@ietfa.amsl.com
Delivered-To: ldapext@ietfa.amsl.com
Received: from localhost (ietfa.amsl.com [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 262E81A8783 for <ldapext@ietfa.amsl.com>; Wed, 30 Sep 2015 07:18:34 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.701
X-Spam-Level:
X-Spam-Status: No, score=-1.701 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, MIME_8BIT_HEADER=0.3, SPF_PASS=-0.001] 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 viuQ4sosn1JY for <ldapext@ietfa.amsl.com>; Wed, 30 Sep 2015 07:18:33 -0700 (PDT)
Received: from mail-ob0-x22c.google.com (mail-ob0-x22c.google.com [IPv6:2607:f8b0:4003:c01::22c]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id D00C41A879A for <ldapext@ietf.org>; Wed, 30 Sep 2015 07:18:32 -0700 (PDT)
Received: by obbda8 with SMTP id da8so32506420obb.1 for <ldapext@ietf.org>; Wed, 30 Sep 2015 07:18:32 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=unboundid.com; s=google; h=date:from:to:message-id:in-reply-to:references:subject:mime-version :content-type:content-transfer-encoding; bh=TNER1NRu+X2tZne7lyOfociqmO6yx5RafwpDYu4JDtc=; b=DOnn1eJ5FVz7kxfhGxVtNzR3ScsE31vAotkpGCtomuHIlgQfCfAwqtqrlo2qInxMCN UHQRxbbX7AXvXiE05EFIOzJ1pxUP6WG9Gz9g7fpmKzzRBhaQ5o7+M4I+iAie3fRAIiWY dd0brHxtqiXOFrwU+QHtRvZqBugEbcIOskSWs=
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:date:from:to:message-id:in-reply-to:references :subject:mime-version:content-type:content-transfer-encoding; bh=TNER1NRu+X2tZne7lyOfociqmO6yx5RafwpDYu4JDtc=; b=fUj2JTvi1whW89OuXQpeXT48uWK5g8CYSbccxfiQeJSkzBWDC+EnHWu8A4FgB2i9Ko Yyy8qjWHvjnrFbWQXwjGPZDbdbScBJ/Bt+zCfTapHfcTkY0zeWXnzZFRN0vuAo2BNKwt mnM+yXSId19aovIdtB9i7gltjV1QCzokrySsWdIUULtugil41TEMVrTDpskCKdpGPoBn YZt512WRe4qX1Qda64SpvOS0jcicmesjayHY8+07JGvsXQjX64tO3DVy2IQ8exfB78BL nCByL8mbBPFbaVkUIf5f6vEFUdwt+4hoa90sBoIwFvXQ001WH5CmAw/CDaq8so6/xTw1 8eFg==
X-Gm-Message-State: ALoCoQnIkfjUYIWTgu74ETKQJGmUA+g1OizhC8ynH9Rd7UFQCGuCKxUF1F24VeS8YE8F7ih4MkEk
X-Received: by 10.60.59.34 with SMTP id w2mr2405934oeq.81.1443622712102; Wed, 30 Sep 2015 07:18:32 -0700 (PDT)
Received: from [10.11.18.97] (rrcs-71-42-224-86.sw.biz.rr.com. [71.42.224.86]) by smtp.gmail.com with ESMTPSA id np9sm305518obb.14.2015.09.30.07.18.31 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 30 Sep 2015 07:18:31 -0700 (PDT)
Date: Wed, 30 Sep 2015 09:18:30 -0500
From: neil.wilson@unboundid.com
To: ldapext <ldapext@ietf.org>, =?UTF-8?Q?Michael_Str=C3=B6der?= <michael@stroeder.com>
Message-ID: <826cca7f-5573-469c-ae1b-28109e4dd736.maildroid@localhost>
In-Reply-To: <560BB797.9040405@stroeder.com>
References: <560BB797.9040405@stroeder.com>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
Archived-At: <http://mailarchive.ietf.org/arch/msg/ldapext/Tjjj_FrqZp5RwnWzXAnKLdgFNSM>
Subject: Re: [ldapext] parsing LDIF: leading spaces
X-BeenThere: ldapext@ietf.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: LDAP Extension Working Group <ldapext.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/ldapext>, <mailto:ldapext-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/ldapext/>
List-Post: <mailto:ldapext@ietf.org>
List-Help: <mailto:ldapext-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/ldapext>, <mailto:ldapext-request@ietf.org?subject=subscribe>
X-List-Received-Date: Wed, 30 Sep 2015 14:18:34 -0000

>From RFC 2849, item 4 under Notes on LDIF Syntax:  "Any value that ... begins with a character other than those defined as "SAFE-INIT-CHAR", above, MUST be base-64 encoded."  Since SAFE-INIT-CHAR excludes SPACE, any value that starts with SPACE MUST be base-64 encoded.


-----Original Message-----
From: "Michael Ströder" <michael@stroeder.com>
To: ldapext <ldapext@ietf.org>
Sent: Wed, 30 Sep 2015 5:21 AM
Subject: [ldapext] parsing LDIF: leading spaces

HI!

How does implementors here parse LDIF with *leading* spaces in value-spec
defined in RFC 2849?

value-spec               = ":" (    FILL 0*1(SAFE-STRING) /
                                ":" FILL (BASE64-STRING) /
                                "<" FILL url)
                           ; See notes 7 and 8, below
[..]
FILL                     = *SPACE

Since [1] and even its pre-predecessor [2] says that this means zero or more
occurences of SPACE the following gets ambigous:

foo:  bar
foo: bar
foo:bar

One could read RFC 2849 that all these result in the same attribute value
'bar'. But does that meet the expectations or would this cause interop issues?

Before somebody claims that values with leading spaces must be base64-encoded:

from RFC 2849:

      8)  Values or distinguished names that end with SPACE SHOULD be
          base-64 encoded.

This is only a SHOULD and AFAICS it says nothing about leading spaces.

[1] https://tools.ietf.org/html/rfc5234#section-3.6
[2] https://tools.ietf.org/html/rfc2234#section-3.6

Ciao, Michael.