[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20170131033422.nvrye3qnmqrc7kpj@thunk.org>
Date: Mon, 30 Jan 2017 22:34:22 -0500
From: Theodore Ts'o <tytso@....edu>
To: Samuel Voss <samuel.voss@...kwellcollins.com>
Cc: linux-ext4@...r.kernel.org,
Clayton Shotwell <clayton.shotwell@...kwellcollins.com>
Subject: Re: debugfs: ls -p can print invalid characters
On Wed, Dec 21, 2016 at 01:11:45PM -0600, Samuel Voss wrote:
> From: Clayton Shotwell <clayton.shotwell@...kwellcollins.com>
>
> The recent modification to the "ls -p" function can print out characters
> that the other ls functions do not print out. Adding a slight change to
> use the same print function for all of the ls options.
>
> Signed-off-by: Clayton Shotwell <clayton.shotwell@...kwellcollins.com>
> Signed-off-by: Samuel Voss <samuel.voss@...kwellcollins.com>
This was deliberate. The "-p" option for debugfs's ls command is
intended for used when piping to a shell script, and the use of '/' is
because it is _rare_ for that character to show up file names.
If I were doing it all over again (ls -p has been around for a very
long time), I'd use the just-added print_c_string() function in which
encodes special characters using C strings (e.g., \001\000\n\t, etc.)
and then use an unencoded "RS" ASCII character (\036) as the record
separator between each field. But since there are existing
shell/perl/python scripts and other programs out there depending on
the output of debugfs's ls -p, I don't want to change the output at
this point.
Cheers,
- Ted
Powered by blists - more mailing lists