]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
winbind:varlink: Install connection closed handler
authorSamuel Cabrero <scabrero@samba.org>
Wed, 8 Feb 2023 14:57:37 +0000 (15:57 +0100)
committerAndreas Schneider <asn@cryptomilk.org>
Thu, 20 Feb 2025 08:07:32 +0000 (08:07 +0000)
If the connection is closed by the client the ongoing tevent_req must be
cancelled, otherwise winbindd receives a SIGBUS when trying to write in
the closed stream.

  [2023/02/08 12:56:41.308393,  0] ../../lib/util/fault.c:173(smb_panic_log)
    ===============================================================
  [2023/02/08 12:56:41.308438,  0] ../../lib/util/fault.c:174(smb_panic_log)
    INTERNAL ERROR: Signal 7: Bus error in pid 24407 (4.19.0pre1-DEVELOPERBUILD)
  [2023/02/08 12:56:41.308451,  0] ../../lib/util/fault.c:178(smb_panic_log)
    If you are running a recent Samba version, and if you think this problem is not yet fixed in the latest versions, please consider reporting this bug, see https://wiki.samba.org/index.php/Bug_Reporting
  [2023/02/08 12:56:41.308463,  0] ../../lib/util/fault.c:183(smb_panic_log)
    ===============================================================
  [2023/02/08 12:56:41.308473,  0] ../../lib/util/fault.c:184(smb_panic_log)
    PANIC (pid 24407): Signal 7: Bus error in 4.19.0pre1-DEVELOPERBUILD

Backtrace:

  #0  0x00007f0e76853997 in wait4 () from /lib64/libc.so.6
  #1  0x00007f0e767c591b in do_system () from /lib64/libc.so.6
  #2  0x00007f0e7785ce43 in smb_panic_s3 (why=0x7ffe41b4e110 "Signal 7: Bus error")
      at ../../source3/lib/util.c:698
  #3  0x00007f0e76ce59f1 in smb_panic (why=0x7ffe41b4e110 "Signal 7: Bus error")
      at ../../lib/util/fault.c:198
  #4  0x00007f0e76ce54d0 in fault_report (sig=7) at ../../lib/util/fault.c:82
  #5  0x00007f0e76ce54e5 in sig_fault (sig=7) at ../../lib/util/fault.c:93
  #6  <signal handler called>
  #7  varlink_stream_write (stream=0x656d614e72657375, message=<optimized out>) at ../lib/stream.c:303
  #8  0x00007f0e76c5aa35 in varlink_call_reply (call=0x561c51aafe60, parameters=<optimized out>, flags=1)
      at ../lib/service.c:651
  #9  0x0000561c506a7e5b in membership_reply (call=0x561c51aafe60,
      username=0x561c51aaa860 "AFOREST+buser1", groupname=0x561c51acae58 "AFOREST+bgroup453",
      continues=true) at ../../source3/winbindd/winbindd_varlink_getmemberships.c:36
  #10 0x0000561c506a9793 in memberships_by_user_getgrgid_done (req=0x0)
      at ../../source3/winbindd/winbindd_varlink_getmemberships.c:481
  #11 0x00007f0e780cb413 in _tevent_req_notify_callback (req=0x561c51ab2d30,
      location=0x561c5075b870 "../../source3/winbindd/winbindd_getgrgid.c:110")
      at ../../lib/tevent/tevent_req.c:151
  #12 0x00007f0e780cb577 in tevent_req_finish (req=0x561c51ab2d30, state=TEVENT_REQ_DONE,
      location=0x561c5075b870 "../../source3/winbindd/winbindd_getgrgid.c:110")
      at ../../lib/tevent/tevent_req.c:203
  #13 0x00007f0e780cb5a3 in _tevent_req_done (req=0x561c51ab2d30,
      location=0x561c5075b870 "../../source3/winbindd/winbindd_getgrgid.c:110")
      at ../../lib/tevent/tevent_req.c:209
  #14 0x0000561c50713770 in winbindd_getgrgid_done (subreq=0x0)
      at ../../source3/winbindd/winbindd_getgrgid.c:110
  #15 0x00007f0e780cb413 in _tevent_req_notify_callback (req=0x561c51a98c50,
      location=0x561c507559b0 "../../source3/winbindd/wb_getgrsid.c:201")
      at ../../lib/tevent/tevent_req.c:151
  #16 0x00007f0e780cb577 in tevent_req_finish (req=0x561c51a98c50, state=TEVENT_REQ_DONE,
      location=0x561c507559b0 "../../source3/winbindd/wb_getgrsid.c:201")
      at ../../lib/tevent/tevent_req.c:203
  #17 0x00007f0e780cb5a3 in _tevent_req_done (req=0x561c51a98c50,
      location=0x561c507559b0 "../../source3/winbindd/wb_getgrsid.c:201")
      at ../../lib/tevent/tevent_req.c:209
  #18 0x0000561c50708d22 in wb_getgrsid_got_members (subreq=0x0)
      at ../../source3/winbindd/wb_getgrsid.c:201
  #19 0x00007f0e780cb413 in _tevent_req_notify_callback (req=0x561c51aa9e80,
      location=0x561c50755310 "../../source3/winbindd/wb_group_members.c:463")
      at ../../lib/tevent/tevent_req.c:151
  #20 0x00007f0e780cb577 in tevent_req_finish (req=0x561c51aa9e80, state=TEVENT_REQ_DONE,
      location=0x561c50755310 "../../source3/winbindd/wb_group_members.c:463")
      at ../../lib/tevent/tevent_req.c:203
  #21 0x00007f0e780cb5a3 in _tevent_req_done (req=0x561c51aa9e80,
      location=0x561c50755310 "../../source3/winbindd/wb_group_members.c:463")
      at ../../lib/tevent/tevent_req.c:209
  #22 0x0000561c507082a6 in wb_group_members_done (subreq=0x0)
      at ../../source3/winbindd/wb_group_members.c:463
  #23 0x00007f0e780cb413 in _tevent_req_notify_callback (req=0x561c51ab1e00,
      location=0x561c50754f18 "../../source3/winbindd/wb_group_members.c:252")
      at ../../lib/tevent/tevent_req.c:151
  #24 0x00007f0e780cb577 in tevent_req_finish (req=0x561c51ab1e00, state=TEVENT_REQ_DONE,
      location=0x561c50754f18 "../../source3/winbindd/wb_group_members.c:252")
      at ../../lib/tevent/tevent_req.c:203
  #25 0x00007f0e780cb5a3 in _tevent_req_done (req=0x561c51ab1e00,
      location=0x561c50754f18 "../../source3/winbindd/wb_group_members.c:252")
      at ../../lib/tevent/tevent_req.c:209
  #26 0x0000561c50707903 in wb_groups_members_done (subreq=0x0)
      at ../../source3/winbindd/wb_group_members.c:252
  #27 0x00007f0e780cb413 in _tevent_req_notify_callback (req=0x561c51aafad0,
      location=0x561c50754bf0 "../../source3/winbindd/wb_group_members.c:102")
      at ../../lib/tevent/tevent_req.c:151
  #28 0x00007f0e780cb577 in tevent_req_finish (req=0x561c51aafad0, state=TEVENT_REQ_DONE,
      location=0x561c50754bf0 "../../source3/winbindd/wb_group_members.c:102")
      at ../../lib/tevent/tevent_req.c:203
  #29 0x00007f0e780cb5a3 in _tevent_req_done (req=0x561c51aafad0,
      location=0x561c50754bf0 "../../source3/winbindd/wb_group_members.c:102")
      at ../../lib/tevent/tevent_req.c:209
  #30 0x0000561c5070732e in wb_lookupgroupmem_done (subreq=0x0)
      at ../../source3/winbindd/wb_group_members.c:102
  #31 0x00007f0e780cb413 in _tevent_req_notify_callback (req=0x561c51ab66a0,
      location=0x7f0e77bc5f18 "librpc/gen_ndr/ndr_winbind_c.c:2888") at ../../lib/tevent/tevent_req.c:151
  #32 0x00007f0e780cb577 in tevent_req_finish (req=0x561c51ab66a0, state=TEVENT_REQ_DONE,
      location=0x7f0e77bc5f18 "librpc/gen_ndr/ndr_winbind_c.c:2888") at ../../lib/tevent/tevent_req.c:203
  #33 0x00007f0e780cb5a3 in _tevent_req_done (req=0x561c51ab66a0,
      location=0x7f0e77bc5f18 "librpc/gen_ndr/ndr_winbind_c.c:2888") at ../../lib/tevent/tevent_req.c:209
  #34 0x00007f0e77bba4a7 in dcerpc_wbint_LookupGroupMembers_done (subreq=0x0)
      at librpc/gen_ndr/ndr_winbind_c.c:2888
  #35 0x00007f0e780cb413 in _tevent_req_notify_callback (req=0x561c51aa1dc0,
      location=0x7f0e77bc5d28 "librpc/gen_ndr/ndr_winbind_c.c:2773") at ../../lib/tevent/tevent_req.c:151
  #36 0x00007f0e780cb577 in tevent_req_finish (req=0x561c51aa1dc0, state=TEVENT_REQ_DONE,
      location=0x7f0e77bc5d28 "librpc/gen_ndr/ndr_winbind_c.c:2773") at ../../lib/tevent/tevent_req.c:203
  #37 0x00007f0e780cb5a3 in _tevent_req_done (req=0x561c51aa1dc0,
      location=0x7f0e77bc5d28 "librpc/gen_ndr/ndr_winbind_c.c:2773") at ../../lib/tevent/tevent_req.c:209
  #38 0x00007f0e77bba0ef in dcerpc_wbint_LookupGroupMembers_r_done (subreq=0x0)
      at librpc/gen_ndr/ndr_winbind_c.c:2773
  #39 0x00007f0e780cb413 in _tevent_req_notify_callback (req=0x561c51ab51f0,
      location=0x7f0e7810b4d0 "../../librpc/rpc/binding_handle.c:520") at ../../lib/tevent/tevent_req.c:151
  #40 0x00007f0e780cb577 in tevent_req_finish (req=0x561c51ab51f0, state=TEVENT_REQ_DONE,
      location=0x7f0e7810b4d0 "../../librpc/rpc/binding_handle.c:520") at ../../lib/tevent/tevent_req.c:203
  #41 0x00007f0e780cb5a3 in _tevent_req_done (req=0x561c51ab51f0,
      location=0x7f0e7810b4d0 "../../librpc/rpc/binding_handle.c:520") at ../../lib/tevent/tevent_req.c:209
  #42 0x00007f0e780f6bec in dcerpc_binding_handle_call_done (subreq=0x0)
      at ../../librpc/rpc/binding_handle.c:520
  #43 0x00007f0e780cb413 in _tevent_req_notify_callback (req=0x561c51aaacf0,
      location=0x7f0e7810b090 "../../librpc/rpc/binding_handle.c:203") at ../../lib/tevent/tevent_req.c:151
  #44 0x00007f0e780cb577 in tevent_req_finish (req=0x561c51aaacf0, state=TEVENT_REQ_DONE,
      location=0x7f0e7810b090 "../../librpc/rpc/binding_handle.c:203") at ../../lib/tevent/tevent_req.c:203
  #45 0x00007f0e780cb5a3 in _tevent_req_done (req=0x561c51aaacf0,
      location=0x7f0e7810b090 "../../librpc/rpc/binding_handle.c:203") at ../../lib/tevent/tevent_req.c:209
  #46 0x00007f0e780f60d2 in dcerpc_binding_handle_raw_call_done (subreq=0x0)
      at ../../librpc/rpc/binding_handle.c:203
  #47 0x00007f0e780cb413 in _tevent_req_notify_callback (req=0x561c51ab78b0,
      location=0x561c50745ef0 "../../source3/winbindd/winbindd_dual_ndr.c:209")
      at ../../lib/tevent/tevent_req.c:151
  #48 0x00007f0e780cb577 in tevent_req_finish (req=0x561c51ab78b0, state=TEVENT_REQ_DONE,
      location=0x561c50745ef0 "../../source3/winbindd/winbindd_dual_ndr.c:209")
      at ../../lib/tevent/tevent_req.c:203
  #49 0x00007f0e780cb5a3 in _tevent_req_done (req=0x561c51ab78b0,
      location=0x561c50745ef0 "../../source3/winbindd/winbindd_dual_ndr.c:209")
      at ../../lib/tevent/tevent_req.c:209
  #50 0x0000561c506e7782 in wbint_bh_raw_call_domain_done (subreq=0x0)
      at ../../source3/winbindd/winbindd_dual_ndr.c:209
  #51 0x00007f0e780cb413 in _tevent_req_notify_callback (req=0x561c51a98750,
      location=0x561c50743390 "../../source3/winbindd/winbindd_dual.c:745")
      at ../../lib/tevent/tevent_req.c:151
  #52 0x00007f0e780cb577 in tevent_req_finish (req=0x561c51a98750, state=TEVENT_REQ_DONE,
      location=0x561c50743390 "../../source3/winbindd/winbindd_dual.c:745")
      at ../../lib/tevent/tevent_req.c:203
  #53 0x00007f0e780cb5a3 in _tevent_req_done (req=0x561c51a98750,
      location=0x561c50743390 "../../source3/winbindd/winbindd_dual.c:745")
      at ../../lib/tevent/tevent_req.c:209
  #54 0x0000561c506e30d3 in wb_domain_request_done (subreq=0x0)
      at ../../source3/winbindd/winbindd_dual.c:745
  #55 0x00007f0e780cb413 in _tevent_req_notify_callback (req=0x561c51ab1a90,
      location=0x561c507429f8 "../../source3/winbindd/winbindd_dual.c:306")
      at ../../lib/tevent/tevent_req.c:151
  #56 0x00007f0e780cb577 in tevent_req_finish (req=0x561c51ab1a90, state=TEVENT_REQ_DONE,
      location=0x561c507429f8 "../../source3/winbindd/winbindd_dual.c:306")
      at ../../lib/tevent/tevent_req.c:203
  #57 0x00007f0e780cb5a3 in _tevent_req_done (req=0x561c51ab1a90,
      location=0x561c507429f8 "../../source3/winbindd/winbindd_dual.c:306")
      at ../../lib/tevent/tevent_req.c:209
  #58 0x0000561c506e1f8d in wb_child_request_done (subreq=0x561c51ab3ca0)
      at ../../source3/winbindd/winbindd_dual.c:306
  #59 0x00007f0e780cb413 in _tevent_req_notify_callback (req=0x561c51ab3ca0,
      location=0x561c50723d98 "../../nsswitch/wb_reqtrans.c:432") at ../../lib/tevent/tevent_req.c:151
  #60 0x00007f0e780cb577 in tevent_req_finish (req=0x561c51ab3ca0, state=TEVENT_REQ_DONE,
      location=0x561c50723d98 "../../nsswitch/wb_reqtrans.c:432") at ../../lib/tevent/tevent_req.c:203
  #61 0x00007f0e780cb5a3 in _tevent_req_done (req=0x561c51ab3ca0,
      location=0x561c50723d98 "../../nsswitch/wb_reqtrans.c:432") at ../../lib/tevent/tevent_req.c:209
  #62 0x0000561c50696101 in wb_simple_trans_read_done (subreq=0x0) at ../../nsswitch/wb_reqtrans.c:432
  #63 0x00007f0e780cb413 in _tevent_req_notify_callback (req=0x561c51ab6a20,
      location=0x561c50723a20 "../../nsswitch/wb_reqtrans.c:275") at ../../lib/tevent/tevent_req.c:151
  #64 0x00007f0e780cb577 in tevent_req_finish (req=0x561c51ab6a20, state=TEVENT_REQ_DONE,
      location=0x561c50723a20 "../../nsswitch/wb_reqtrans.c:275") at ../../lib/tevent/tevent_req.c:203
  #65 0x00007f0e780cb5a3 in _tevent_req_done (req=0x561c51ab6a20,
      location=0x561c50723a20 "../../nsswitch/wb_reqtrans.c:275") at ../../lib/tevent/tevent_req.c:209
  #66 0x0000561c50695adf in wb_resp_read_done (subreq=0x0) at ../../nsswitch/wb_reqtrans.c:275
  #67 0x00007f0e780cb413 in _tevent_req_notify_callback (req=0x561c51ab6d70,
      location=0x7f0e7786fec8 "../../lib/async_req/async_sock.c:568") at ../../lib/tevent/tevent_req.c:151
  #68 0x00007f0e780cb577 in tevent_req_finish (req=0x561c51ab6d70, state=TEVENT_REQ_DONE,
      location=0x7f0e7786fec8 "../../lib/async_req/async_sock.c:568") at ../../lib/tevent/tevent_req.c:203
  #69 0x00007f0e780cb5a3 in _tevent_req_done (req=0x561c51ab6d70,
      location=0x7f0e7786fec8 "../../lib/async_req/async_sock.c:568") at ../../lib/tevent/tevent_req.c:209
  #70 0x00007f0e778255eb in read_packet_handler (ev=0x561c51a86670, fde=0x561c51b982a0, flags=1,
      private_data=0x561c51ab6d70) at ../../lib/async_req/async_sock.c:568
  #71 0x00007f0e780c9651 in tevent_common_invoke_fd_handler (fde=0x561c51b982a0, flags=1, removed=0x0)
      at ../../lib/tevent/tevent_fd.c:142
  #72 0x00007f0e780d448c in epoll_event_loop (epoll_ev=0x561c51a96380, tvalp=0x7ffe41b4f6f0)
      at ../../lib/tevent/tevent_epoll.c:737
  #73 0x00007f0e780d4aec in epoll_event_loop_once (ev=0x561c51a86670,
      location=0x561c50726a70 "../../source3/winbindd/winbindd.c:1734")
      at ../../lib/tevent/tevent_epoll.c:938
  #74 0x00007f0e780d1408 in std_event_loop_once (ev=0x561c51a86670,
      location=0x561c50726a70 "../../source3/winbindd/winbindd.c:1734")
      at ../../lib/tevent/tevent_standard.c:110
  #75 0x00007f0e780c8239 in _tevent_loop_once (ev=0x561c51a86670,
      location=0x561c50726a70 "../../source3/winbindd/winbindd.c:1734") at ../../lib/tevent/tevent.c:823
  #76 0x0000561c5069c4a3 in main (argc=1, argv=0x7ffe41b4fb28) at ../../source3/winbindd/winbindd.c:1734

Signed-off-by: Samuel Cabrero <scabrero@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
source3/winbindd/winbindd_varlink_getgrouprecord.c
source3/winbindd/winbindd_varlink_getmemberships.c
source3/winbindd/winbindd_varlink_getuserrecord.c

index 49970c7e443a82745dd0be4591d904ae35e0b4da..abb98ece5d1008185072e0e061246ee69811dc0c 100644 (file)
@@ -309,6 +309,13 @@ out:
        TALLOC_FREE(s);
 }
 
+static void group_enumerate_conn_closed(VarlinkCall *call, void *userdata)
+{
+       struct group_enum_state *s =
+               talloc_get_type_abort(userdata, struct group_enum_state);
+       TALLOC_FREE(s);
+}
+
 NTSTATUS wb_vl_group_enumerate(TALLOC_CTX *mem_ctx,
                               struct tevent_context *ev_ctx,
                               VarlinkCall *call,
@@ -374,6 +381,10 @@ NTSTATUS wb_vl_group_enumerate(TALLOC_CTX *mem_ctx,
        }
        tevent_req_set_callback(req, group_enum_setgrent_done, s);
 
+       varlink_call_set_connection_closed_callback(call,
+                                                   group_enumerate_conn_closed,
+                                                   s);
+
        return NT_STATUS_OK;
 fail:
        TALLOC_FREE(s);
@@ -443,6 +454,13 @@ out:
        TALLOC_FREE(s);
 }
 
+static void group_by_gid_conn_closed(VarlinkCall *call, void *userdata)
+{
+       struct group_by_gid_state *s =
+               talloc_get_type_abort(userdata, struct group_by_gid_state);
+       TALLOC_FREE(s);
+}
+
 NTSTATUS wb_vl_group_by_gid(TALLOC_CTX *mem_ctx,
                            struct tevent_context *ev_ctx,
                            VarlinkCall *call,
@@ -496,6 +514,10 @@ NTSTATUS wb_vl_group_by_gid(TALLOC_CTX *mem_ctx,
        }
        tevent_req_set_callback(req, group_by_gid_getgrgid_done, s);
 
+       varlink_call_set_connection_closed_callback(call,
+                                                   group_by_gid_conn_closed,
+                                                   s);
+
        return NT_STATUS_OK;
 fail:
        TALLOC_FREE(s);
@@ -566,6 +588,13 @@ out:
        TALLOC_FREE(s);
 }
 
+static void group_by_name_conn_closed(VarlinkCall *call, void *userdata)
+{
+       struct group_by_name_state *s =
+               talloc_get_type_abort(userdata, struct group_by_name_state);
+       TALLOC_FREE(s);
+}
+
 NTSTATUS wb_vl_group_by_name(TALLOC_CTX *mem_ctx,
                             struct tevent_context *ev_ctx,
                             VarlinkCall *call,
@@ -619,6 +648,10 @@ NTSTATUS wb_vl_group_by_name(TALLOC_CTX *mem_ctx,
        }
        tevent_req_set_callback(req, group_by_name_getgrnam_done, s);
 
+       varlink_call_set_connection_closed_callback(call,
+                                                   group_by_name_conn_closed,
+                                                   s);
+
        return NT_STATUS_OK;
 fail:
        TALLOC_FREE(s);
@@ -742,6 +775,13 @@ out:
        TALLOC_FREE(s);
 }
 
+static void group_by_name_gid_conn_closed(VarlinkCall *call, void *userdata)
+{
+       struct group_by_name_gid_state *s =
+               talloc_get_type_abort(userdata, struct group_by_name_gid_state);
+       TALLOC_FREE(s);
+}
+
 NTSTATUS wb_vl_group_by_name_and_gid(TALLOC_CTX *mem_ctx,
                                     struct tevent_context *ev_ctx,
                                     VarlinkCall *call,
@@ -804,6 +844,11 @@ NTSTATUS wb_vl_group_by_name_and_gid(TALLOC_CTX *mem_ctx,
        }
        tevent_req_set_callback(req, group_by_name_gid_getgrnamgid_done, s);
 
+       varlink_call_set_connection_closed_callback(
+               call,
+               group_by_name_gid_conn_closed,
+               s);
+
        return NT_STATUS_OK;
 fail:
        TALLOC_FREE(s);
index 13ca838ef7a181312a8f017e76492ba7fc269994..eade8c34db2d320a1b85d05eb5dfc65cfcfbc6ba 100644 (file)
@@ -316,6 +316,13 @@ out:
        TALLOC_FREE(s);
 }
 
+static void memberships_enumerate_conn_closed(VarlinkCall *call, void *userdata)
+{
+       struct memberships_enum_state *s =
+               talloc_get_type_abort(userdata, struct memberships_enum_state);
+       TALLOC_FREE(s);
+}
+
 NTSTATUS wb_vl_memberships_enumerate(TALLOC_CTX *mem_ctx,
                                     struct tevent_context *ev_ctx,
                                     VarlinkCall *call,
@@ -390,6 +397,11 @@ NTSTATUS wb_vl_memberships_enumerate(TALLOC_CTX *mem_ctx,
        }
        tevent_req_set_callback(req, membership_enum_setgrent_done, s);
 
+       varlink_call_set_connection_closed_callback(
+               call,
+               memberships_enumerate_conn_closed,
+               s);
+
        return NT_STATUS_OK;
 fail:
        TALLOC_FREE(s);
@@ -550,6 +562,14 @@ out:
        TALLOC_FREE(s);
 }
 
+static void memberships_by_user_conn_closed(VarlinkCall *call, void *userdata)
+{
+       struct memberships_by_user_state *s =
+               talloc_get_type_abort(userdata,
+                                     struct memberships_by_user_state);
+       TALLOC_FREE(s);
+}
+
 NTSTATUS wb_vl_memberships_by_user(TALLOC_CTX *mem_ctx,
                                   struct tevent_context *ev_ctx,
                                   VarlinkCall *call,
@@ -624,6 +644,11 @@ NTSTATUS wb_vl_memberships_by_user(TALLOC_CTX *mem_ctx,
        }
        tevent_req_set_callback(req, memberships_by_user_getgroups_done, s);
 
+       varlink_call_set_connection_closed_callback(
+               call,
+               memberships_by_user_conn_closed,
+               s);
+
        return NT_STATUS_OK;
 fail:
        TALLOC_FREE(s);
@@ -705,6 +730,14 @@ out:
        TALLOC_FREE(s);
 }
 
+static void memberships_by_group_conn_closed(VarlinkCall *call, void *userdata)
+{
+       struct memberships_by_group_state *s =
+               talloc_get_type_abort(userdata,
+                                     struct memberships_by_group_state);
+       TALLOC_FREE(s);
+}
+
 NTSTATUS wb_vl_memberships_by_group(TALLOC_CTX *mem_ctx,
                                    struct tevent_context *ev_ctx,
                                    VarlinkCall *call,
@@ -780,6 +813,11 @@ NTSTATUS wb_vl_memberships_by_group(TALLOC_CTX *mem_ctx,
        }
        tevent_req_set_callback(req, memberships_by_group_getgrnam_done, s);
 
+       varlink_call_set_connection_closed_callback(
+               call,
+               memberships_by_group_conn_closed,
+               s);
+
        return NT_STATUS_OK;
 fail:
        TALLOC_FREE(s);
@@ -879,6 +917,13 @@ out:
        TALLOC_FREE(s);
 }
 
+static void membership_check_conn_closed(VarlinkCall *call, void *userdata)
+{
+       struct membership_check_state *s =
+               talloc_get_type_abort(userdata, struct membership_check_state);
+       TALLOC_FREE(s);
+}
+
 NTSTATUS wb_vl_membership_check(TALLOC_CTX *mem_ctx,
                                struct tevent_context *ev_ctx,
                                VarlinkCall *call,
@@ -962,6 +1007,11 @@ NTSTATUS wb_vl_membership_check(TALLOC_CTX *mem_ctx,
        }
        tevent_req_set_callback(req, membership_check_getgrnam_done, s);
 
+       varlink_call_set_connection_closed_callback(
+               call,
+               membership_check_conn_closed,
+               s);
+
        return NT_STATUS_OK;
 fail:
        TALLOC_FREE(s);
index 5ac4adb64b8405f24eddb3a58e91af0709b02a2b..bc6f7781eb7510948f7de7ac6905cff9997b153a 100644 (file)
@@ -283,6 +283,13 @@ out:
        TALLOC_FREE(s);
 }
 
+static void user_enum_conn_closed(VarlinkCall *call, void *userdata)
+{
+       struct user_enum_state *s =
+               talloc_get_type_abort(userdata, struct user_enum_state);
+       TALLOC_FREE(s);
+}
+
 NTSTATUS wb_vl_user_enumerate(TALLOC_CTX *mem_ctx,
                              struct tevent_context *ev_ctx,
                              VarlinkCall *call,
@@ -348,6 +355,10 @@ NTSTATUS wb_vl_user_enumerate(TALLOC_CTX *mem_ctx,
        }
        tevent_req_set_callback(req, user_enum_setpwent_done, s);
 
+       varlink_call_set_connection_closed_callback(call,
+                                                   user_enum_conn_closed,
+                                                   s);
+
        return NT_STATUS_OK;
 fail:
        TALLOC_FREE(s);
@@ -415,6 +426,13 @@ out:
        TALLOC_FREE(s);
 }
 
+static void user_by_uid_conn_closed(VarlinkCall *call, void *userdata)
+{
+       struct user_by_uid_state *s =
+               talloc_get_type_abort(userdata, struct user_by_uid_state);
+       TALLOC_FREE(s);
+}
+
 NTSTATUS wb_vl_user_by_uid(TALLOC_CTX *mem_ctx,
                           struct tevent_context *ev_ctx,
                           VarlinkCall *call,
@@ -468,6 +486,10 @@ NTSTATUS wb_vl_user_by_uid(TALLOC_CTX *mem_ctx,
        }
        tevent_req_set_callback(req, user_by_uid_getpwuid_done, s);
 
+       varlink_call_set_connection_closed_callback(call,
+                                                   user_by_uid_conn_closed,
+                                                   s);
+
        return NT_STATUS_OK;
 fail:
        TALLOC_FREE(s);
@@ -534,6 +556,13 @@ out:
        TALLOC_FREE(s);
 }
 
+static void user_by_name_conn_closed(VarlinkCall *call, void *userdata)
+{
+       struct user_by_name_state *s =
+               talloc_get_type_abort(userdata, struct user_by_name_state);
+       TALLOC_FREE(s);
+}
+
 NTSTATUS wb_vl_user_by_name(TALLOC_CTX *mem_ctx,
                            struct tevent_context *ev_ctx,
                            VarlinkCall *call,
@@ -587,6 +616,10 @@ NTSTATUS wb_vl_user_by_name(TALLOC_CTX *mem_ctx,
        }
        tevent_req_set_callback(req, user_by_name_getpwnam_done, s);
 
+       varlink_call_set_connection_closed_callback(call,
+                                                   user_by_name_conn_closed,
+                                                   s);
+
        return NT_STATUS_OK;
 fail:
        TALLOC_FREE(s);
@@ -707,6 +740,13 @@ out:
        TALLOC_FREE(s);
 }
 
+static void user_by_name_uid_conn_closed(VarlinkCall *call, void *userdata)
+{
+       struct user_by_name_uid_state *s =
+               talloc_get_type_abort(userdata, struct user_by_name_uid_state);
+       TALLOC_FREE(s);
+}
+
 NTSTATUS wb_vl_user_by_name_and_uid(TALLOC_CTX *mem_ctx,
                                    struct tevent_context *ev_ctx,
                                    VarlinkCall *call,
@@ -769,6 +809,11 @@ NTSTATUS wb_vl_user_by_name_and_uid(TALLOC_CTX *mem_ctx,
        }
        tevent_req_set_callback(req, user_by_name_uid_getpwnamuid_done, s);
 
+       varlink_call_set_connection_closed_callback(
+               call,
+               user_by_name_uid_conn_closed,
+               s);
+
        return NT_STATUS_OK;
 fail:
        TALLOC_FREE(s);