[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20190429001114.GA555@mit.edu>
Date: Sun, 28 Apr 2019 20:11:14 -0400
From: "Theodore Ts'o" <tytso@....edu>
To: Eric Biggers <ebiggers@...nel.org>
Cc: linux-ext4@...r.kernel.org
Subject: Re: [PATCH] debugfs: avoid ambiguity when printing filenames
On Mon, Apr 22, 2019 at 01:27:15PM -0700, Eric Biggers wrote:
> From: Eric Biggers <ebiggers@...gle.com>
>
> The way debugfs escapes filenames is ambiguous because a sequence like
> M-A can mean either the byte 'A' + 128 == 0xc1 or the three bytes
> {'M', '-', 'A'}. Similarly, ^A can mean either the byte
> 'A' ^ 0x40 == 0x01 or the two bytes {'^', 'A'}.
>
> Fix this and simplify the code by switching to a simpler strategy where
> all bytes < 32, all bytes >= 127, and backslash are encoded with C-style
> hex escape sequences. E.g., the byte 0xc1 will now be encoded as \xc1
> rather than M-A as it was before, while a filename consisting of the
> three bytes {'M', '-', 'A'} will continue to be shown as M-A.
>
> I want to fix this mainly because I want to use debugfs to retrieve raw
> encrypted filenames for ciphertext verification tests. But this doesn't
> work if the returned filenames are ambiguous.
>
> Fixes: 68a1de3df340 ("debugfs: pretty print encrypted filenames in the ls command")
> Signed-off-by: Eric Biggers <ebiggers@...gle.com>
Thanks, applied.
- Ted
Powered by blists - more mailing lists