From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 3F74860B51 for ; Thu, 17 Feb 2022 10:48:20 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 2E4781D90D for ; Thu, 17 Feb 2022 10:47:50 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id 84F211D904 for ; Thu, 17 Feb 2022 10:47:49 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 5A6A34611E for ; Thu, 17 Feb 2022 10:47:49 +0100 (CET) Date: Thu, 17 Feb 2022 10:47:48 +0100 From: Wolfgang Bumiller To: Fabian Ebner Cc: pbs-devel@lists.proxmox.com Message-ID: <20220217094748.wz5seu4deorzzyoy@olga.proxmox.com> References: <20220216133917.101133-1-w.bumiller@proxmox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SPAM-LEVEL: Spam detection results: 0 AWL 0.387 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record T_SCC_BODY_TEXT_LINE -0.01 - Subject: Re: [pbs-devel] [RFC proxmox] support quoted strings in property strings X-BeenThere: pbs-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox Backup Server development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 17 Feb 2022 09:48:20 -0000 On Thu, Feb 17, 2022 at 09:58:03AM +0100, Fabian Ebner wrote: > Am 16.02.22 um 14:39 schrieb Wolfgang Bumiller: > > This allows free form text to exist within property strings, > > quoted, like: > > key="A value with \"quotes, also commas",key2=value2 > > or also: > > "the value for a default_key",key2=value2 > > > > And drop ';' as a key=value separator since those are meant > > for arrays inside property strings... > > > > Isn't that backwards-incompatible? Technically yes, but currently we aren't using it, it's not compatible with pve and it's also not documented, so chances are nobody manually wrote this in a config file yet. In pve we for instance have features: mount=ext4;ntfs;foo in containers and cpu: flags=+FOO;-BAR in VMs and it was initially meant to work the same in pbs... I really do prefer "breaking" this ASAP. > > +/// Iterate over the `key=value` pairs of a property string. > > +/// > > +/// Note, that the `key` may be optional when the schema defines a "default" key. > > Nit: But the iterator does not use the schema. Shouldn't the comment > here rather just describe the behavior of the iterator? It doesn't, but it's meant specifically for property strings and the iterator is not exposed to the public right now. Iow. it's currently a parser-internal detail. (A reason to keep it internal is also that the de-quoting happening is very limited (on purpose), and exposing it might give people the idea of adding things like `\xXY` or `\U0ABC` support to the string parser, too. But if someone needs that, I'd rather look for an existing parse/quote crate first before adding more custom code... ;-) ) (In fact... it may even be nicer code-wise if the default key was itself stored in the iterator... not sure... but I have some serde De/Serializer WIP/POC code for property strings to avoid the serde_json::Value intermediate step for those (particularly for the *verify* case))