1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

smbd: use real dirfsp for SMB_VFS_UNLINKAT() in py_smbd_unlink()

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Ralph Boehme 2021-01-22 14:54:18 +01:00 committed by Jeremy Allison
parent e5262e2804
commit 0f3db9b6b5

View File

@ -648,10 +648,13 @@ static PyObject *py_smbd_unlink(PyObject *self, PyObject *args, PyObject *kwargs
connection_struct *conn;
int ret;
struct smb_filename *smb_fname = NULL;
struct smb_filename *parent_fname = NULL;
struct smb_filename *at_fname = NULL;
PyObject *py_session = Py_None;
struct auth_session_info *session_info = NULL;
char *fname, *service = NULL;
TALLOC_CTX *frame;
NTSTATUS status;
frame = talloc_stackframe();
@ -694,9 +697,19 @@ static PyObject *py_smbd_unlink(PyObject *self, PyObject *args, PyObject *kwargs
return PyErr_NoMemory();
}
status = parent_pathref(frame,
conn->cwd_fsp,
smb_fname,
&parent_fname,
&at_fname);
if (!NT_STATUS_IS_OK(status)) {
TALLOC_FREE(frame);
return PyErr_NoMemory();
}
ret = SMB_VFS_UNLINKAT(conn,
conn->cwd_fsp,
smb_fname,
parent_fname->fsp,
at_fname,
0);
if (ret != 0) {
TALLOC_FREE(frame);