mirror of
https://github.com/samba-team/samba.git
synced 2025-08-26 01:49:31 +03:00
CVE-2023-4154 py_security: allow idx argument to descriptor.[s|d]acl_add()
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15424
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
(cherry picked from commit 9ea06aaf9f
)
This commit is contained in:
committed by
Jule Anger
parent
d038ac36c1
commit
ebd421306e
@ -175,12 +175,13 @@ static PyObject *py_descriptor_sacl_add(PyObject *self, PyObject *args)
|
||||
NTSTATUS status;
|
||||
struct security_ace *ace;
|
||||
PyObject *py_ace;
|
||||
Py_ssize_t idx = -1;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "O", &py_ace))
|
||||
if (!PyArg_ParseTuple(args, "O|n", &py_ace, &idx))
|
||||
return NULL;
|
||||
|
||||
ace = pytalloc_get_ptr(py_ace);
|
||||
status = security_descriptor_sacl_add(desc, ace);
|
||||
status = security_descriptor_sacl_insert(desc, ace, idx);
|
||||
PyErr_NTSTATUS_IS_ERR_RAISE(status);
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
@ -191,13 +192,14 @@ static PyObject *py_descriptor_dacl_add(PyObject *self, PyObject *args)
|
||||
NTSTATUS status;
|
||||
struct security_ace *ace;
|
||||
PyObject *py_ace;
|
||||
Py_ssize_t idx = -1;
|
||||
|
||||
if (!PyArg_ParseTuple(args, "O", &py_ace))
|
||||
if (!PyArg_ParseTuple(args, "O|n", &py_ace, &idx))
|
||||
return NULL;
|
||||
|
||||
ace = pytalloc_get_ptr(py_ace);
|
||||
|
||||
status = security_descriptor_dacl_add(desc, ace);
|
||||
status = security_descriptor_dacl_insert(desc, ace, idx);
|
||||
PyErr_NTSTATUS_IS_ERR_RAISE(status);
|
||||
Py_RETURN_NONE;
|
||||
}
|
||||
|
Reference in New Issue
Block a user