]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
pysmbd: make sure that session unix info is filled
authorBjörn Baumbach <bb@sernet.de>
Tue, 2 Jun 2020 13:33:36 +0000 (15:33 +0200)
committerRalph Boehme <slow@samba.org>
Fri, 5 Jun 2020 11:54:06 +0000 (11:54 +0000)
Bug: https://bugzilla.samba.org/show_bug.cgi?id=14400

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Fri Jun  5 11:54:06 UTC 2020 on sn-devel-184

source3/smbd/pysmbd.c

index 7f671cf6eeb239b020e532ec9b10c1d91ea335f7..dd4a70ca256992d75101871e72db9289161a885b 100644 (file)
@@ -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,
                                        "/",