1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

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>
This commit is contained in:
Ralph Boehme 2015-05-09 15:02:03 +02:00 committed by Ralph Böhme
parent eba12122cc
commit fb9a64ea37

View File

@ -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) {