diff options
author | Ralph Boehme <slow@samba.org> | 2015-05-09 15:02:03 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2015-08-17 18:09:40 +0200 |
commit | fe55c9494b415a22e7de88c0190f9c3fccc2b1ea (patch) | |
tree | de0ab7a1384a25f655030a3b8adffa3e2758d713 | |
parent | 977be7b8e242edeccbecb54e9873ffd6b8151e63 (diff) | |
download | samba-fe55c9494b415a22e7de88c0190f9c3fccc2b1ea.tar.gz |
vfs_streams_xattr: stream names may contain colons
With vfs_fruit option "fruit:encoding = native" we're already converting
stream names that contain illegal NTFS characters from their on-the-wire
Unicode Private Range encoding to their native ASCII representation.
As as result the name of xattrs storing the streams (via
vfs_streams_xattr) may contain a colon, so we have to use strrchr_m()
instead of strchr_m() for matching the stream type suffix.
Bug: https://bugzilla.samba.org/show_bug.cgi?id=11278
Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit fb9a64ea37dd4b0cd754fe6d421417a4c8ccbc57)
-rw-r--r-- | source3/modules/vfs_streams_xattr.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/source3/modules/vfs_streams_xattr.c b/source3/modules/vfs_streams_xattr.c index d149fc83a7a..92bd1c9bce7 100644 --- a/source3/modules/vfs_streams_xattr.c +++ b/source3/modules/vfs_streams_xattr.c @@ -112,7 +112,21 @@ static NTSTATUS streams_xattr_get_name(vfs_handle_struct *handle, SMB_VFS_HANDLE_GET_DATA(handle, config, struct streams_xattr_config, return NT_STATUS_UNSUCCESSFUL); - stype = strchr_m(stream_name + 1, ':'); + /* + * With vfs_fruit option "fruit:encoding = native" we're + * already converting stream names that contain illegal NTFS + * characters from their on-the-wire Unicode Private Range + * encoding to their native ASCII representation. + * + * As as result the name of xattrs storing the streams (via + * vfs_streams_xattr) may contain a colon, so we have to use + * strrchr_m() instead of strchr_m() for matching the stream + * type suffix. + * + * In check_path_syntax() we've already ensured the streamname + * we got from the client is valid. + */ + stype = strrchr_m(stream_name + 1, ':'); if (stype) { if (strcasecmp_m(stype, ":$DATA") != 0) { |