From: Volker Lendecke Date: Thu, 10 Mar 2022 18:30:28 +0000 (+0100) Subject: smbd: get_acl_group_bits() needs a fsp, not a name X-Git-Tag: tevent-0.12.0~461 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0e4cc565e67fb4d95fc82a75c604db2bedbada29;p=thirdparty%2Fsamba.git smbd: get_acl_group_bits() needs a fsp, not a name Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme --- diff --git a/source3/smbd/dosmode.c b/source3/smbd/dosmode.c index 43bb48d38c5..ad0ce63b4e8 100644 --- a/source3/smbd/dosmode.c +++ b/source3/smbd/dosmode.c @@ -939,8 +939,8 @@ int file_set_dosmode(connection_struct *conn, unixmode = smb_fname->st.st_ex_mode; if (smb_fname->fsp != NULL) { - get_acl_group_bits(conn, smb_fname, - &smb_fname->st.st_ex_mode); + get_acl_group_bits( + conn, smb_fname->fsp, &smb_fname->st.st_ex_mode); } if (S_ISDIR(smb_fname->st.st_ex_mode)) diff --git a/source3/smbd/posix_acls.c b/source3/smbd/posix_acls.c index da3566c1cd9..62e399ba2fb 100644 --- a/source3/smbd/posix_acls.c +++ b/source3/smbd/posix_acls.c @@ -3835,16 +3835,16 @@ NTSTATUS set_nt_acl(files_struct *fsp, uint32_t security_info_sent, const struct the mask bits, not the real group bits, for a file with an ACL. ****************************************************************************/ -int get_acl_group_bits( connection_struct *conn, - const struct smb_filename *smb_fname, - mode_t *mode ) +int get_acl_group_bits(connection_struct *conn, + struct files_struct *fsp, + mode_t *mode ) { int entry_id = SMB_ACL_FIRST_ENTRY; SMB_ACL_ENTRY_T entry; SMB_ACL_T posix_acl; int result = -1; - posix_acl = SMB_VFS_SYS_ACL_GET_FD(smb_fname->fsp, + posix_acl = SMB_VFS_SYS_ACL_GET_FD(fsp, SMB_ACL_TYPE_ACCESS, talloc_tos()); if (posix_acl == (SMB_ACL_T)NULL) diff --git a/source3/smbd/proto.h b/source3/smbd/proto.h index 1b7e2015cac..88ab4ccf73c 100644 --- a/source3/smbd/proto.h +++ b/source3/smbd/proto.h @@ -856,9 +856,9 @@ NTSTATUS posix_fget_nt_acl(struct files_struct *fsp, uint32_t security_info, struct security_descriptor **ppdesc); NTSTATUS try_chown(files_struct *fsp, uid_t uid, gid_t gid); NTSTATUS set_nt_acl(files_struct *fsp, uint32_t security_info_sent, const struct security_descriptor *psd); -int get_acl_group_bits( connection_struct *conn, - const struct smb_filename *smb_fname, - mode_t *mode); +int get_acl_group_bits(connection_struct *conn, + struct files_struct *fsp, + mode_t *mode); int inherit_access_posix_acl(connection_struct *conn, struct files_struct *inherit_from_dirfsp, const struct smb_filename *smb_fname,