mirror of
https://github.com/samba-team/samba.git
synced 2024-12-24 21:34:56 +03:00
s3: VFS: vxfs: Change use of SMB_VFS_SYS_ACL_GET_FILE() -> SMB_VFS_SYS_ACL_GET_FD().
Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
This commit is contained in:
parent
7e8849032f
commit
b62d90f91f
@ -398,24 +398,20 @@ static bool vxfs_compare_acls(char *e_buf, char *n_buf, int n_count,
|
|||||||
* 6. Else need to set New ACL
|
* 6. Else need to set New ACL
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static bool vxfs_compare(connection_struct *conn,
|
static bool vxfs_compare(struct files_struct *fsp,
|
||||||
const struct smb_filename *smb_fname,
|
|
||||||
SMB_ACL_T the_acl,
|
SMB_ACL_T the_acl,
|
||||||
SMB_ACL_TYPE_T the_acl_type)
|
SMB_ACL_TYPE_T the_acl_type)
|
||||||
{
|
{
|
||||||
char *name = smb_fname->base_name;
|
|
||||||
SMB_ACL_T existing_acl = NULL;
|
SMB_ACL_T existing_acl = NULL;
|
||||||
bool ret = false;
|
bool ret = false;
|
||||||
int i, count = 0;
|
int i, count = 0;
|
||||||
TALLOC_CTX *mem_ctx = talloc_tos();
|
TALLOC_CTX *mem_ctx = talloc_tos();
|
||||||
char *existing_buf = NULL, *new_buf = NULL, *compact_buf = NULL;
|
char *existing_buf = NULL, *new_buf = NULL, *compact_buf = NULL;
|
||||||
struct smb_filename *smb_fname = NULL;
|
|
||||||
int status;
|
int status;
|
||||||
|
|
||||||
DEBUG(10, ("vfs_vxfs: Getting existing ACL for %s\n", name));
|
DEBUG(10, ("vfs_vxfs: Getting existing ACL for %s\n", fsp_str_dbg(fsp)));
|
||||||
|
|
||||||
existing_acl = SMB_VFS_SYS_ACL_GET_FILE(conn, smb_fname, the_acl_type,
|
existing_acl = SMB_VFS_SYS_ACL_GET_FD(fsp, the_acl_type, mem_ctx);
|
||||||
mem_ctx);
|
|
||||||
if (existing_acl == NULL) {
|
if (existing_acl == NULL) {
|
||||||
DEBUG(10, ("vfs_vxfs: Failed to get ACL\n"));
|
DEBUG(10, ("vfs_vxfs: Failed to get ACL\n"));
|
||||||
goto out;
|
goto out;
|
||||||
@ -429,7 +425,7 @@ static bool vxfs_compare(connection_struct *conn,
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
status = SMB_VFS_STAT(conn, smb_fname);
|
status = SMB_VFS_FSTAT(fsp, &fsp->fsp_name->st);
|
||||||
if (status == -1) {
|
if (status == -1) {
|
||||||
DEBUG(10, ("vfs_vxfs: stat failed!\n"));
|
DEBUG(10, ("vfs_vxfs: stat failed!\n"));
|
||||||
goto out;
|
goto out;
|
||||||
@ -437,14 +433,14 @@ static bool vxfs_compare(connection_struct *conn,
|
|||||||
|
|
||||||
DEBUG(10, ("vfs_vxfs: Sorting existing ACL\n"));
|
DEBUG(10, ("vfs_vxfs: Sorting existing ACL\n"));
|
||||||
existing_buf = vxfs_sort_acl(existing_acl, mem_ctx,
|
existing_buf = vxfs_sort_acl(existing_acl, mem_ctx,
|
||||||
smb_fname->st.st_ex_uid,
|
fsp->fsp_name->st.st_ex_uid,
|
||||||
smb_fname->st.st_ex_gid);
|
fsp->fsp_name->st.st_ex_gid);
|
||||||
if (!existing_buf)
|
if (!existing_buf)
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
DEBUG(10, ("vfs_vxfs: Sorting new ACL\n"));
|
DEBUG(10, ("vfs_vxfs: Sorting new ACL\n"));
|
||||||
new_buf = vxfs_sort_acl(the_acl, mem_ctx, smb_fname->st.st_ex_uid,
|
new_buf = vxfs_sort_acl(the_acl, mem_ctx, fsp->fsp_name->st.st_ex_uid,
|
||||||
smb_fname->st.st_ex_gid);
|
fsp->fsp_name->st.st_ex_gid);
|
||||||
if (!new_buf) {
|
if (!new_buf) {
|
||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
@ -491,8 +487,7 @@ static int vxfs_sys_acl_set_fd(vfs_handle_struct *handle,
|
|||||||
SMB_ACL_T theacl)
|
SMB_ACL_T theacl)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (vxfs_compare(fsp->conn, fsp->fsp_name, theacl,
|
if (vxfs_compare(fsp, theacl, type)) {
|
||||||
type)) {
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user