From: Ralph Boehme Date: Mon, 14 Dec 2020 10:25:12 +0000 (+0100) Subject: pysmbd: use SMB_VFS_SYS_ACL_SET_FD() in set_sys_acl_conn() X-Git-Tag: samba-4.14.0rc1~208 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1af5892a9851389b9eba978c4c70cc67392dce0e;p=thirdparty%2Fsamba.git pysmbd: use SMB_VFS_SYS_ACL_SET_FD() in set_sys_acl_conn() Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/pysmbd.c b/source3/smbd/pysmbd.c index 8631390b29e..3e791327577 100644 --- a/source3/smbd/pysmbd.c +++ b/source3/smbd/pysmbd.c @@ -130,8 +130,8 @@ static int set_sys_acl_conn(const char *fname, { int ret; struct smb_filename *smb_fname = NULL; - TALLOC_CTX *frame = talloc_stackframe(); + NTSTATUS status; smb_fname = synthetic_smb_fname_split(frame, fname, @@ -141,7 +141,14 @@ static int set_sys_acl_conn(const char *fname, return -1; } - ret = SMB_VFS_SYS_ACL_SET_FILE( conn, smb_fname, acltype, theacl); + status = openat_pathref_fsp(conn->cwd_fsp, smb_fname); + if (!NT_STATUS_IS_OK(status)) { + TALLOC_FREE(frame); + errno = map_errno_from_nt_status(status); + return -1; + } + + ret = SMB_VFS_SYS_ACL_SET_FD(smb_fname->fsp, acltype, theacl); TALLOC_FREE(frame); return ret;