From: Björn Baumbach Date: Tue, 2 Jun 2020 13:33:36 +0000 (+0200) Subject: pysmbd: make sure that session unix info is filled X-Git-Tag: ldb-2.2.0~172 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=72d69eef136d135788942cbdef3775ddd74e241f;p=thirdparty%2Fsamba.git pysmbd: make sure that session unix info is filled Bug: https://bugzilla.samba.org/show_bug.cgi?id=14400 Signed-off-by: Björn Baumbach Reviewed-by: Ralph Boehme Autobuild-User(master): Ralph Böhme Autobuild-Date(master): Fri Jun 5 11:54:06 UTC 2020 on sn-devel-184 --- diff --git a/source3/smbd/pysmbd.c b/source3/smbd/pysmbd.c index 7f671cf6eeb..dd4a70ca256 100644 --- a/source3/smbd/pysmbd.c +++ b/source3/smbd/pysmbd.c @@ -73,6 +73,21 @@ static connection_struct *get_conn_tos( } } + /* + * Make sure that session unix info is filled, + * which is required by vfs operations. + */ + if (session_info->unix_info == NULL) { + PyErr_SetString(PyExc_RuntimeError, + "Session unix info not initialized"); + return NULL; + } + if (session_info->unix_info->unix_name == NULL) { + PyErr_SetString(PyExc_RuntimeError, + "Session unix info not available"); + return NULL; + } + status = create_conn_struct_tos(NULL, snum, "/",