ZFS Diff Prints Carriage Returns
I've ran into a situation where some end users have put carriage returns in their filenames! I know, absolutely horrid practice, but, users are users. Unfortunately this makes the output of zfs diff commands not very parse friendly since zfs diff is outputting carriage returns as part of the output in stream_bytes() in libzfs_diff.c
I'd be forever grateful if someone could do a quick patch to output carriage returns found in file names as an octal code instead of actually outputting a carriage return.
Updated by Yuri Pankov over 5 years ago
Wonder if Joshua already fixed this in #4448:
altair:root:~# touch /diff/$(echo "a\rb") altair:root:~# ll /diff/ total 1 b 8 -rw-r--r-- 1 root 0 Feb 25 11:13 a altair:root:~# zfs snapshot data/diff@now altair:root:~# echo "123" > /diff/a^Mb altair:root:~# zfs diff data/diff@now M /diff/a\015b altair:root:~#