]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
pysmbd: make use of create_conn_struct_tos()
authorStefan Metzmacher <metze@samba.org>
Thu, 24 May 2018 14:16:19 +0000 (16:16 +0200)
committerStefan Metzmacher <metze@samba.org>
Thu, 14 Jun 2018 18:52:21 +0000 (20:52 +0200)
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/pysmbd.c

index 638a673764074aeb17f04874f3d2d6ca80a7260e..ee918e1d727be5536a234293de085c6c595549f3 100644 (file)
@@ -37,15 +37,9 @@ extern const struct generic_mapping file_generic_mapping;
 #undef  DBGC_CLASS
 #define DBGC_CLASS DBGC_ACLS
 
-static int conn_free_wrapper(connection_struct *conn)
-{
-       conn_free(conn);
-       return 0;
-};
-
 static connection_struct *get_conn_tos(const char *service)
 {
-       connection_struct *conn;
+       struct conn_struct_tos *c = NULL;
        int snum = -1;
        NTSTATUS status;
 
@@ -62,15 +56,17 @@ static connection_struct *get_conn_tos(const char *service)
                }
        }
 
-       status = create_conn_struct(talloc_tos(), NULL, NULL, &conn, snum, "/",
-                                           NULL);
+       status = create_conn_struct_tos(NULL,
+                                       snum,
+                                       "/",
+                                       NULL,
+                                       &c);
        PyErr_NTSTATUS_IS_ERR_RAISE(status);
 
        /* Ignore read-only and share restrictions */
-       conn->read_only = false;
-       conn->share_access = SEC_RIGHTS_FILE_ALL;
-       talloc_set_destructor(conn, conn_free_wrapper);
-       return conn;
+       c->conn->read_only = false;
+       c->conn->share_access = SEC_RIGHTS_FILE_ALL;
+       return c->conn;
 }
 
 static int set_sys_acl_conn(const char *fname,