1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

pygensec: insist on proper AuthContext in start_server

Fixes another segfault.

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
This commit is contained in:
Douglas Bagnall 2018-05-03 10:26:26 +12:00 committed by Andrew Bartlett
parent bdb4132617
commit ec1e56989b
2 changed files with 9 additions and 2 deletions

View File

@ -1,6 +1,5 @@
samba.tests.segfault.samba.tests.segfault.SegfaultTests.test_auth_user_session
samba.tests.segfault.samba.tests.segfault.SegfaultTests.test_encrypt_netr_crypt_password
samba.tests.segfault.samba.tests.segfault.SegfaultTests.test_gensec_start_server
samba.tests.segfault.samba.tests.segfault.SegfaultTests.test_hive_open_ldb
samba.tests.segfault.samba.tests.segfault.SegfaultTests.test_net_replicate_chunk_1
samba.tests.segfault.samba.tests.segfault.SegfaultTests.test_net_replicate_init__1

View File

@ -176,7 +176,15 @@ static PyObject *py_gensec_start_server(PyTypeObject *type, PyObject *args, PyOb
}
if (py_auth_context != Py_None) {
auth_context = pytalloc_get_type(py_auth_context, struct auth4_context);
bool ok = py_check_dcerpc_type(py_auth_context,
"samba.auth",
"AuthContext");
if (!ok) {
return NULL;
}
auth_context = pytalloc_get_type(py_auth_context,
struct auth4_context);
if (!auth_context) {
PyErr_Format(PyExc_TypeError,
"Expected auth.AuthContext for auth_context argument, got %s",