From: Noel Power Date: Mon, 24 May 2021 22:52:44 +0000 (-0700) Subject: s3/smbd: pysmbd: SMB_VFS_SYS_ACL_GET_FILE -> SMB_VFS_SYS_ACL_GET_FD X-Git-Tag: tevent-0.11.0~596 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5c9f8f693cf4826b563090d21f8885cef9fc3b7f;p=thirdparty%2Fsamba.git s3/smbd: pysmbd: SMB_VFS_SYS_ACL_GET_FILE -> SMB_VFS_SYS_ACL_GET_FD Signed-off-by: Noel Power Reviewed-by: Jeremy Allison Reviewed-by: Ralph Boehme --- diff --git a/source3/smbd/pysmbd.c b/source3/smbd/pysmbd.c index ecbdd7a29e8..ac1ed4d1ba1 100644 --- a/source3/smbd/pysmbd.c +++ b/source3/smbd/pysmbd.c @@ -972,6 +972,8 @@ static PyObject *py_smbd_get_sys_acl(PyObject *self, PyObject *args, PyObject *k connection_struct *conn; char *service = NULL; struct smb_filename *smb_fname = NULL; + NTSTATUS status; + int ret; if (!PyArg_ParseTupleAndKeywords(args, kwargs, "siO|z", discard_const_p(char *, kwnames), @@ -1012,7 +1014,20 @@ static PyObject *py_smbd_get_sys_acl(PyObject *self, PyObject *args, PyObject *k TALLOC_FREE(frame); return NULL; } - acl = SMB_VFS_SYS_ACL_GET_FILE( conn, smb_fname, acl_type, frame); + ret = vfs_stat(conn, smb_fname); + if (ret == -1) { + TALLOC_FREE(frame); + return PyErr_SetFromErrno(PyExc_OSError); + } + + status = openat_pathref_fsp(conn->cwd_fsp, smb_fname); + if (!NT_STATUS_IS_OK(status)) { + TALLOC_FREE(frame); + PyErr_SetNTSTATUS(status); + return NULL; + } + + acl = SMB_VFS_SYS_ACL_GET_FD(smb_fname->fsp, acl_type, frame); if (!acl) { TALLOC_FREE(frame); return PyErr_SetFromErrno(PyExc_OSError);