mirror of
https://git.kernel.org/pub/scm/fs/ext2/e2fsprogs.git
synced 2024-11-24 02:25:03 +08:00
9033a31e26
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:
|
||
---|---|---|
.. | ||
Android.bp | ||
debug_cmds.ct | ||
debugfs.8.in | ||
debugfs.c | ||
debugfs.h | ||
do_journal.c | ||
dump.c | ||
extent_cmds.ct | ||
extent_inode.c | ||
filefrag.c | ||
htree.c | ||
icheck.c | ||
journal.c | ||
journal.h | ||
logdump.c | ||
ls.c | ||
lsdel.c | ||
Makefile.in | ||
ncheck.c | ||
quota.c | ||
ro_debug_cmds.ct | ||
set_fields.c | ||
unused.c | ||
util.c | ||
xattrs.c | ||
zap.c |