Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zfs diff outputs ambigous octal escapes #3417

Closed
dasjoe opened this issue May 15, 2015 · 0 comments
Closed

zfs diff outputs ambigous octal escapes #3417

dasjoe opened this issue May 15, 2015 · 0 comments

Comments

@dasjoe
Copy link
Contributor

dasjoe commented May 15, 2015

To reproduce create some files where digits follow an escaped character, like digits 123 here:

root@sbooblehat:/zfs_test# ll
total 35
drwxr-xr-x  2 root root  6 May 15 23:06 ./
drwxr-xr-x 22 root root 24 May 15 23:03 ../
-rw-r--r--  1 root root  0 May 15 23:04 a file with spaces and umlauts like äü
-rw-r--r--  1 root root  0 May 15 23:04 a file with ß
-rw-r--r--  1 root root  0 May 15 23:03 äöü
-rw-r--r--  1 root root  0 May 15 23:06 digits 123
root@sbooblehat:/zfs_test# echo -e "$(zfs diff sbooblehat-rpool/ROOT/vivid/zfs_test@1 sbooblehat-rpool/ROOT/vivid/zfs_test@2)"
M   /zfs_test/
+   /zfs_test/\303\244\303\266\303\274
+   /zfs_test/a file with spaces and umlauts like \303\244\303\274
+   /zfs_test/a file with \303\237
+   /zfs_test/digits�23

As a workaround I prepend the escaped values with 0:

root@sbooblehat:/zfs_test# zfs diff sbooblehat-rpool/ROOT/vivid/zfs_test@1 sbooblehat-rpool/ROOT/vivid/zfs_test@2 | echo -e "$(sed 's/\\\([0-9]\{3\}\)/\\0\1/g')"
M   /zfs_test/
+   /zfs_test/äöü
+   /zfs_test/a file with spaces and umlauts like äü
+   /zfs_test/a file with ß
+   /zfs_test/digits 123
dasjoe added a commit to dasjoe/zfs that referenced this issue May 15, 2015
dasjoe added a commit to dasjoe/zfs that referenced this issue May 24, 2015
Prefixing an octal value with a leading zero is the standard way
to disambiguate it.  This change only impacts the `zfs diff` output
and is therefore very limited in scope.

Signed-off-by: Hajo M<C3><B6>ller <dasjoe@gmail.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes openzfs#3417
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant