Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp4033272ybh; Tue, 6 Aug 2019 05:20:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqyO7E56KFj5LI5Z+FE03JNIZ8jh2FYfVZ/ZaaT1gujPG87Mdxx2ATsiVnxhwhKAbXxZmG9+ X-Received: by 2002:aa7:8641:: with SMTP id a1mr3381830pfo.177.1565094018741; Tue, 06 Aug 2019 05:20:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565094018; cv=none; d=google.com; s=arc-20160816; b=MWFz2af3aKeSprQyJOgb07SHVXlo9DI3NslVPkieGSzqGAo5H6qd8oKEBPW4esP6Xg 1dIQ1CcKrCNYQ3sJFNZNSBh2LDEMWBYvfbbHs1Pn1uQ9C/uq4A4MEYyb16jy3T4BYRhQ J3GABoYepDjJwonstdFKvDA9u3E6w5lfGbOtCVu7tBTDLYDlYs60miYJY37Gu7/dDZbg G3L9mfUXgTjRzgGQm2gOi2FmgAp4Uz9rNHp/uCDq8Q03hCrtsYMWSlD6o5G6ztVV9sX3 iwnR/Qv5P4vQUiep1vnRZp5vo7wdNUiJZiVul8A7VyqOBP/OjZwpt+eYwFGeQxvoG9lm b6Mg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:organization:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=EaPv0DKPvxj27eLJztpDjJ90L5N5He+A/b02DiJyfNA=; b=iO7LpeXDnZwi12I+oyNlgkM8nMd9rtwulQEpJe36+OZQ8d6bYnU4Gs2JEe4VD3jhkO h9qIsHxxrY4yhLybvS1sbpzIPkMlyq8EKB8RVbPUxpKvf+bWsSi7Ze0X2f66cukOotJS ZaEw9ImnsOcZ7GUgqW3WzzVf07jw0Y3XGwThhjK3OWXpzMHQ+GRUld2BNUpoMDr1eutd GwBN9KN2qtbpJjVJLgClTkm++fNR9fQjAh7qa0xY55EmFzEFYIEaIfkKjOOz8/6XkV49 Pw3rdT/+DosKvJFxMzQlWv89/ugRG+fTSmSD6Aa5OsqtANSKyjWHcNLK8ou6320AXDWV fJHA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d25si47398040pge.301.2019.08.06.05.19.54; Tue, 06 Aug 2019 05:20:18 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-nfs-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726783AbfHFMTf (ORCPT + 99 others); Tue, 6 Aug 2019 08:19:35 -0400 Received: from mga07.intel.com ([134.134.136.100]:22593 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726877AbfHFMTe (ORCPT ); Tue, 6 Aug 2019 08:19:34 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Aug 2019 05:19:34 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.64,353,1559545200"; d="scan'208";a="176618250" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.145]) by orsmga003.jf.intel.com with ESMTP; 06 Aug 2019 05:19:33 -0700 Received: from andy by smile with local (Exim 4.92) (envelope-from ) id 1huyR9-0007i3-Lh; Tue, 06 Aug 2019 15:19:31 +0300 Date: Tue, 6 Aug 2019 15:19:31 +0300 From: Andy Shevchenko To: "J. Bruce Fields" Cc: linux-nfs@vger.kernel.org Subject: Re: [PATCH 08/16] nfsd: escape high characters in binary data Message-ID: <20190806121931.GA29578@smile.fi.intel.com> References: <1561042275-12723-1-git-send-email-bfields@redhat.com> <1561042275-12723-9-git-send-email-bfields@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1561042275-12723-9-git-send-email-bfields@redhat.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org On Thu, Jun 20, 2019 at 10:51:07AM -0400, J. Bruce Fields wrote: > From: "J. Bruce Fields" > > I'm exposing some information about NFS clients in pseudofiles. I > expect to eventually have simple tools to help read those pseudofiles. > > But it's also helpful if the raw files are human-readable to the extent > possible. It aids debugging and makes them usable on systems that don't > have the latest nfs-utils. > > A minor challenge there is opaque client-generated protocol objects like > state owners and client identifiers. Some clients generate those to > include handy information in plain ascii. But they may also include > arbitrary byte sequences. > > I think the simplest approach is to limit to isprint(c) && isascii(c) > and escape everything else. > > That means you can just cat the file and get something that looks OK. > Also, I'm trying to keep these files legal YAML, which requires them to > UTF-8, and this is a simple way to guarantee that. Two questions: - why can't be original function extended to cover this case (using additional flags, maybe)? - where are the test cases? -- With Best Regards, Andy Shevchenko