vfs_streams_xattr: check stream type
authorRalph Boehme <slow@samba.org>
Fri, 21 Nov 2014 13:56:08 +0000 (14:56 +0100)
committerJeremy Allison <jra@samba.org>
Sat, 22 Nov 2014 00:07:54 +0000 (01:07 +0100)
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 <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Nov 22 01:07:54 CET 2014 on sn-devel-104

source3/modules/vfs_streams_xattr.c

index f65ccc87ed81dab9ca480f85e27b5cc92e4987b8..f0ab7321e077a57fc6884707f6d4314220a37de7 100644 (file)
@@ -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);