From: Ralph Boehme Date: Mon, 25 Jan 2021 14:51:05 +0000 (+0100) Subject: pysmbd: use parent_pathref() in py_smbd_mkdir() X-Git-Tag: tevent-0.11.0~1908 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2995e0d57c6ad4d84232e0bbb66d3de2bee6c379;p=thirdparty%2Fsamba.git pysmbd: use parent_pathref() in py_smbd_mkdir() Signed-off-by: Ralph Boehme Reviewed-by: Jeremy Allison --- diff --git a/source3/smbd/pysmbd.c b/source3/smbd/pysmbd.c index 042e31b79d6..fdc8cd7e022 100644 --- a/source3/smbd/pysmbd.c +++ b/source3/smbd/pysmbd.c @@ -1031,7 +1031,6 @@ static PyObject *py_smbd_mkdir(PyObject *self, PyObject *args, PyObject *kwargs) NTSTATUS status; int ret; mode_t saved_umask; - bool ok; if (!PyArg_ParseTupleAndKeywords(args, kwargs, @@ -1080,21 +1079,11 @@ static PyObject *py_smbd_mkdir(PyObject *self, PyObject *args, PyObject *kwargs) return NULL; } - ok = parent_smb_fname(frame, - smb_fname, - &parent_fname, - &base_name); - if (!ok) { - TALLOC_FREE(frame); - return NULL; - } - - ret = vfs_stat(conn, parent_fname); - if (ret == -1) { - TALLOC_FREE(frame); - return NULL; - } - status = openat_pathref_fsp(conn->cwd_fsp, parent_fname); + status = parent_pathref(talloc_tos(), + conn->cwd_fsp, + smb_fname, + &parent_fname, + &base_name); if (!NT_STATUS_IS_OK(status)) { TALLOC_FREE(frame); return NULL;