summaryrefslogtreecommitdiff
path: root/source3
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2021-06-22 19:10:37 -0700
committerRalph Boehme <slow@samba.org>2021-06-25 15:53:31 +0000
commitd2b78728514a68df29efc483ede90cd804880685 (patch)
tree8750c2bacf00386ef82709733fd1908ce68ac321 /source3
parent6e6f532c5fc7daad019d717302abe72f6fc97de0 (diff)
downloadsamba-d2b78728514a68df29efc483ede90cd804880685.tar.gz
s3: VFS: fake_acls: In fake_acls_stat() - if we have a pathref fsp, use it.
We will add a pathref open for the case where we don't next. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
Diffstat (limited to 'source3')
-rw-r--r--source3/modules/vfs_fake_acls.c28
1 files changed, 26 insertions, 2 deletions
diff --git a/source3/modules/vfs_fake_acls.c b/source3/modules/vfs_fake_acls.c
index 4d1211a0649..c675479cea7 100644
--- a/source3/modules/vfs_fake_acls.c
+++ b/source3/modules/vfs_fake_acls.c
@@ -118,14 +118,38 @@ static int fake_acls_stat(vfs_handle_struct *handle,
struct smb_filename smb_fname_base = {
.base_name = smb_fname->base_name
};
+ struct files_struct *fsp = NULL;
+
+ if (smb_fname->fsp != NULL) {
+ fsp = smb_fname->fsp;
+ if (fsp->base_fsp != NULL) {
+ /*
+ * This is a stream pathname. Use
+ * the base_fsp to get the xattr.
+ */
+ fsp = fsp->base_fsp;
+ }
+ }
- ret = fake_acls_uid(handle, &smb_fname_base,
+ if (fsp != NULL) {
+ ret = fake_acls_fuid(handle,
+ fsp,
+ &smb_fname->st.st_ex_uid);
+ } else {
+ ret = fake_acls_uid(handle, &smb_fname_base,
&smb_fname->st.st_ex_uid);
+ }
if (ret != 0) {
return ret;
}
- ret = fake_acls_gid(handle, &smb_fname_base,
+ if (fsp != NULL) {
+ ret = fake_acls_fgid(handle,
+ fsp,
+ &smb_fname->st.st_ex_gid);
+ } else {
+ ret = fake_acls_gid(handle, &smb_fname_base,
&smb_fname->st.st_ex_gid);
+ }
if (ret != 0) {
return ret;
}