1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-26 21:57:41 +03:00

s3: smbd: VFS: fake_acl module called get_full_smb_filename() with a stream path, then used the result to call XATTR functions directly.

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>
This commit is contained in:
Jeremy Allison 2015-05-04 19:56:39 -07:00 committed by Ralph Böhme
parent ccb4f791fd
commit 0f23bf228c

View 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);