From 927290b384bc4f4fd53a1f93d4d27ccc71dd6135 Mon Sep 17 00:00:00 2001 From: Ralph Boehme Date: Fri, 21 Nov 2014 14:56:08 +0100 Subject: [PATCH] vfs_streams_xattr: check stream type Only allow access to the stream type "$DATA". vfs_streams_depot does this too and it fixes the failing test "smb2.streams.names". Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison Autobuild-User(master): Jeremy Allison Autobuild-Date(master): Sat Nov 22 01:07:54 CET 2014 on sn-devel-104 --- source3/modules/vfs_streams_xattr.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/source3/modules/vfs_streams_xattr.c b/source3/modules/vfs_streams_xattr.c index f65ccc87ed8..f0ab7321e07 100644 --- a/source3/modules/vfs_streams_xattr.c +++ b/source3/modules/vfs_streams_xattr.c @@ -114,6 +114,12 @@ static NTSTATUS streams_xattr_get_name(vfs_handle_struct *handle, stype = strchr_m(stream_name + 1, ':'); + if (stype) { + if (strcasecmp_m(stype, ":$DATA") != 0) { + return NT_STATUS_INVALID_PARAMETER; + } + } + *xattr_name = talloc_asprintf(ctx, "%s%s", config->prefix, stream_name + 1); -- 2.11.4.GIT