From 1566766f38e3cdf84d45285c709236eedcfaa167 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Thu, 24 May 2018 16:16:19 +0200 Subject: [PATCH] pysmbd: make use of create_conn_struct_tos() Signed-off-by: Stefan Metzmacher Reviewed-by: Jeremy Allison --- source3/smbd/pysmbd.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/source3/smbd/pysmbd.c b/source3/smbd/pysmbd.c index 638a6737640..ee918e1d727 100644 --- a/source3/smbd/pysmbd.c +++ b/source3/smbd/pysmbd.c @@ -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, -- 2.34.1