s3: smbd: VFS: fake_acl module called get_full_smb_filename() with a stream path...
authorJeremy Allison <jra@samba.org>
Tue, 5 May 2015 02:56:39 +0000 (19:56 -0700)
committerRalph Böhme <slow@samba.org>
Tue, 5 May 2015 12:01:25 +0000 (14:01 +0200)
Ensure when pulling XATTR values, we don't allow a stream filename.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11249

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/modules/vfs_fake_acls.c

index f3c2ebbdba381e5ccd6e624ea316adbe6ab9a212..3887e86746e252742ff3dc538fa477f16f3e0f88 100644 (file)
@@ -115,8 +115,16 @@ static int fake_acls_stat(vfs_handle_struct *handle,
        if (ret == 0) {
                TALLOC_CTX *frame = talloc_stackframe();
                char *path;
+               struct smb_filename smb_fname_base = {
+                       .base_name = smb_fname->base_name
+               };
                NTSTATUS status;
-               status = get_full_smb_filename(frame, smb_fname, &path);
+               /*
+                * As we're calling getxattr directly here
+                * we need to use only the base_name, not
+                * the full name containing any stream name.
+                */
+               status = get_full_smb_filename(frame, &smb_fname_base, &path);
                if (!NT_STATUS_IS_OK(status)) {
                        errno = map_errno_from_nt_status(status);
                        TALLOC_FREE(frame);
@@ -148,8 +156,16 @@ static int fake_acls_lstat(vfs_handle_struct *handle,
        if (ret == 0) {
                TALLOC_CTX *frame = talloc_stackframe();
                char *path;
+               struct smb_filename smb_fname_base = {
+                       .base_name = smb_fname->base_name
+               };
                NTSTATUS status;
-               status = get_full_smb_filename(frame, smb_fname, &path);
+               /*
+                * As we're calling getxattr directly here
+                * we need to use only the base_name, not
+                * the full name containing any stream name.
+                */
+               status = get_full_smb_filename(frame, &smb_fname_base, &path);
                if (!NT_STATUS_IS_OK(status)) {
                        errno = map_errno_from_nt_status(status);
                        TALLOC_FREE(frame);