Snapper escapes multi-byte strings prior to sending them in DBus requests and responses. Samba's vfs_snapper module doesn't do the same, causing problems when dealing with multi-byte share paths. This is easily reproducible with the following procedure: - Create a multi-byte share path (e.g. /srv/日本国). - Create a snapper config for the share path. - allow access to the snapper config + snapper -c $config set-config SYNC_ACL=yes + snapper -c $config ALLOW_USERS='$windows_user' - Define the share in smb.conf, with "vfs objects = snapper" configured. - connect to the share from a Windows client. - create a test file on the share, with some data. - request a snapshot locally + snapper -c $config create - modify the test file - request previous file versions for the test file in Windows Explorer + Samba will log a message: "config for base /srv/日本国 not found"
What escaping mechanism does snapper use ?
The snapper documentation describes it as: Strings are UTF-8. Other characters (e.g. in filenames) must be encoded hexadecimal as "\x?" or "\x??". As a consequence "\" must be encoded as "\\".
Created attachment 10638 [details] master based patchset Unit test patch to follow. @Justin, it'd be great if you could give this a spin in your own environment.
(In reply to Justin Maggard from comment #2) BTW, I discussed the nonsensical "\x?" token with Arvin (Snapper maintainer). He agreed that it should be treated as an error, given that only characters above 0x7F are encoded (will always be two-char "\x??").
Created attachment 10639 [details] unit test - do not push
Comment on attachment 10638 [details] master based patchset Patchset looks good to me, and works great in my environment as well. Thanks!
(In reply to Justin Maggard from comment #6) Thanks for the feedback. I've sent the patch to the samba-technical mailing list for review. Will attach a 4.2 based patch once upstream.
Created attachment 10649 [details] patchset for 4.2, cherry picked from master
Comment on attachment 10649 [details] patchset for 4.2, cherry picked from master LGTM.
Re-assigning to Karolin for inclusion in 4.2.0.
Thanks a bunch for the review Jeremy - much appreciated!
Pushed to autobuild-v4-2-test.
Pushed to v4-2-test. Closing out bug report. Thanks!