mirror of
https://github.com/samba-team/samba.git
synced 2025-08-21 09:49:28 +03:00
s3: torture: cmd_sys_acl_get_file(), 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:
committed by
Ralph Boehme
parent
b62d90f91f
commit
a8e49253d7
@ -1838,6 +1838,8 @@ static NTSTATUS cmd_sys_acl_get_file(struct vfs_state *vfs, TALLOC_CTX *mem_ctx,
|
||||
char *acl_text;
|
||||
int type;
|
||||
struct smb_filename *smb_fname = NULL;
|
||||
struct smb_filename *pathref_fname = NULL;
|
||||
NTSTATUS status;
|
||||
|
||||
if (argc != 3) {
|
||||
printf("Usage: sys_acl_get_file <path> <type>\n");
|
||||
@ -1851,15 +1853,33 @@ static NTSTATUS cmd_sys_acl_get_file(struct vfs_state *vfs, TALLOC_CTX *mem_ctx,
|
||||
return NT_STATUS_NO_MEMORY;
|
||||
}
|
||||
type = atoi(argv[2]);
|
||||
acl = SMB_VFS_SYS_ACL_GET_FILE(vfs->conn, smb_fname,
|
||||
|
||||
status = synthetic_pathref(mem_ctx,
|
||||
vfs->conn->cwd_fsp,
|
||||
smb_fname->base_name,
|
||||
NULL,
|
||||
NULL,
|
||||
smb_fname->twrp,
|
||||
smb_fname->flags,
|
||||
&pathref_fname);
|
||||
if (!NT_STATUS_IS_OK(status)) {
|
||||
TALLOC_FREE(smb_fname);
|
||||
return status;
|
||||
}
|
||||
|
||||
acl = SMB_VFS_SYS_ACL_GET_FD(pathref_fname->fsp,
|
||||
type, talloc_tos());
|
||||
if (!acl) {
|
||||
printf("sys_acl_get_file failed (%s)\n", strerror(errno));
|
||||
printf("sys_acl_get_fd failed (%s)\n", strerror(errno));
|
||||
TALLOC_FREE(smb_fname);
|
||||
TALLOC_FREE(pathref_fname);
|
||||
return NT_STATUS_UNSUCCESSFUL;
|
||||
}
|
||||
acl_text = sys_acl_to_text(acl, NULL);
|
||||
printf("%s", acl_text);
|
||||
TALLOC_FREE(acl);
|
||||
TALLOC_FREE(smb_fname);
|
||||
TALLOC_FREE(pathref_fname);
|
||||
SAFE_FREE(acl_text);
|
||||
return NT_STATUS_OK;
|
||||
}
|
||||
|
Reference in New Issue
Block a user