The branch, master has been updated
       via  38e5b3d6a24 winbind:varlink: Always reply with the requested 
username
       via  0cc22fdd8d2 winbind:varlink: Print varlink replies
       via  f7a537531d6 winbind:varlink: Initialize variables
       via  11591ba5449 winbind: Add a check for "winbind varlink service"
       via  2f26ccdaac2 s3/utils: Add a check for "winbind varlink service"
       via  f79bdd17d6f winbind:varlink: Set the disposition field in user 
records
       via  8a626923e48 winbind:varlink: Check memory allocation when creating 
the records
       via  0653b4b1c95 pytests/varlink: Add varlink tests
       via  5185d3eb376 bootstrap: Install libvarlink and python3-varlink for 
selftests
       via  949acb6a9b1 winbind:varlink: Avoid recursion
       via  218e218de9d winbind:varlink: Improve membership enumeration 
continue flag handling
       via  e61e6ecd3d3 winbind:varlink: Install connection closed handler
       via  32d2a783b0c winbind:varlink: Implement membership by group and user 
names
       via  3ce570c7b5b winbind:varlink: Implement memberships by group name
       via  ad215705aad winbind:varlink: Implement memberships by user
       via  6f437ae49d5 winbind:varlink: Implement memberships enumeration
       via  68e590c7139 winbind:varlink: Implement get group record by name and 
gid
       via  e8813b2d620 winbind:varlink: Implement get group record by name
       via  b841911f735 winbind:varlink: Implement get group record by gid
       via  9144e091219 winbind:varlink: Implement group record enumeration
       via  4c3910fa86d winbind:varlink: Implement get user record by name and 
uid
       via  d42c485b843 winbind:varlink: Implement get user record by name
       via  946a800c219 winbind:varlink: Implement get user record by uid
       via  6369e052474 winbind:varlink: Implement user record enumeration
       via  d40f5591bc1 winbind:varlink: Add a function to craft a 
winbindd_cli_state structure
       via  e59f2c513fa winbind:varlink: Add io.systemd.UserDatabase interface
       via  b52ccab3b33 winbind:varlink: Create varlink socket directory
       via  776eea8090c winbind:varlink: Add varlink service
       via  e1f448e1259 winbind: Add "winbind varlink service" smb.conf option
       via  7996e03b7da wscript: Add --with-systemd-userdb option
       via  849f9596f91 winbind: Fix running in interactive mode
      from  7f3222d0042 ctdb-scripts: Fix CTDB_BASE to allow event scripts to 
run standalone

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 38e5b3d6a24f9b32b3736ac3dfa224c3c4569a5e
Author: Samuel Cabrero <scabr...@samba.org>
Date:   Fri Feb 7 16:10:47 2025 +0100

    winbind:varlink: Always reply with the requested username
    
    The service io.systemd.Multiplexer will drop responses if the username in 
the
    response does not match the requested name. This happens when the requested
    username is an UPN and the response is a down-level user name (DOMAIN\user).
    
    Signed-off-by: Samuel Cabrero <scabr...@samba.org>
    Reviewed-by: Andreas Schneider <a...@samba.org>
    
    Autobuild-User(master): Andreas Schneider <a...@cryptomilk.org>
    Autobuild-Date(master): Thu Feb 20 09:05:46 UTC 2025 on atb-devel-224

commit 0cc22fdd8d25d51b48f26355b906b385b9b8b729
Author: Samuel Cabrero <scabr...@samba.org>
Date:   Fri Feb 7 15:18:45 2025 +0100

    winbind:varlink: Print varlink replies
    
    Signed-off-by: Samuel Cabrero <scabr...@samba.org>
    Reviewed-by: Andreas Schneider <a...@samba.org>

commit f7a537531d63a47a8045cd917a4de5942089bf94
Author: Samuel Cabrero <scabr...@samba.org>
Date:   Thu Feb 6 15:31:47 2025 +0100

    winbind:varlink: Initialize variables
    
    Signed-off-by: Samuel Cabrero <scabr...@samba.org>
    Reviewed-by: Andreas Schneider <a...@samba.org>

commit 11591ba54496be67eb095776311dbbe3a72910e7
Author: Samuel Cabrero <scabr...@samba.org>
Date:   Thu Feb 6 15:18:26 2025 +0100

    winbind: Add a check for "winbind varlink service"
    
    Print a warning in winbindd startup if the option is enabled
    but samba was built without systemd's userdb support.
    
    Signed-off-by: Samuel Cabrero <scabr...@samba.org>
    Reviewed-by: Andreas Schneider <a...@samba.org>

commit 2f26ccdaac260d3832fe227805d79d13b2d4ef92
Author: Samuel Cabrero <scabr...@samba.org>
Date:   Thu Feb 6 14:41:57 2025 +0100

    s3/utils: Add a check for "winbind varlink service"
    
    Warn when the option is enabled but samba was built without systemd's userdb
    support.
    
    Signed-off-by: Samuel Cabrero <scabr...@samba.org>
    Reviewed-by: Andreas Schneider <a...@samba.org>

commit f79bdd17d6fc93d202b8b079d11114fc1b3cba80
Author: Samuel Cabrero <scabr...@samba.org>
Date:   Mon Feb 3 14:53:59 2025 +0100

    winbind:varlink: Set the disposition field in user records
    
    Set the disposition field in the user record, otherwise systemd could 
derive it
    from the uid based on its configured ranges.
    
    Signed-off-by: Samuel Cabrero <scabr...@samba.org>
    Reviewed-by: Andreas Schneider <a...@samba.org>

commit 8a626923e4884c9478322e61d31d056c6d2c1803
Author: Samuel Cabrero <scabr...@samba.org>
Date:   Mon Feb 3 14:15:07 2025 +0100

    winbind:varlink: Check memory allocation when creating the records
    
    Signed-off-by: Samuel Cabrero <scabr...@samba.org>
    Reviewed-by: Andreas Schneider <a...@samba.org>

commit 0653b4b1c95d197525c41faaff021e088b18edd1
Author: Samuel Cabrero <scabr...@samba.org>
Date:   Tue Feb 21 18:02:26 2023 +0100

    pytests/varlink: Add varlink tests
    
    Signed-off-by: Samuel Cabrero <scabr...@samba.org>
    Reviewed-by: Andreas Schneider <a...@samba.org>

commit 5185d3eb3760425aa7787f4fd303b6fe0451a625
Author: Samuel Cabrero <scabr...@samba.org>
Date:   Tue Jan 21 12:14:45 2025 +0100

    bootstrap: Install libvarlink and python3-varlink for selftests
    
    Signed-off-by: Samuel Cabrero <scabr...@samba.org>
    Reviewed-by: Andreas Schneider <a...@samba.org>

commit 949acb6a9b15578d554e605bfd90c22c4bc3fbec
Author: Samuel Cabrero <scabr...@samba.org>
Date:   Wed Apr 17 11:58:24 2024 +0200

    winbind:varlink: Avoid recursion
    
    Avoid recursion while dispatching a call. This is similar to the 
_NO_WINBINDD
    environment variable that nss_winbind uses, but on the server side.
    
    Signed-off-by: Samuel Cabrero <scabr...@samba.org>
    Reviewed-by: Andreas Schneider <a...@samba.org>

commit 218e218de9df2c20ac409524e34ece276c9d42ea
Author: Samuel Cabrero <scabr...@samba.org>
Date:   Thu Feb 9 14:26:04 2023 +0100

    winbind:varlink: Improve membership enumeration continue flag handling
    
    Signed-off-by: Samuel Cabrero <scabr...@samba.org>
    Reviewed-by: Andreas Schneider <a...@samba.org>

commit e61e6ecd3d30d6baef667197aa64f22246ba112a
Author: Samuel Cabrero <scabr...@samba.org>
Date:   Wed Feb 8 15:57:37 2023 +0100

    winbind:varlink: Install connection closed handler
    
    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 <scabr...@samba.org>
    Reviewed-by: Andreas Schneider <a...@samba.org>

commit 32d2a783b0c9b060d3f2f330e98c62b7b165aee3
Author: Samuel Cabrero <scabr...@samba.org>
Date:   Mon Feb 6 19:06:43 2023 +0100

    winbind:varlink: Implement membership by group and user names
    
    $> varlink call -m 
unix:/run/systemd/userdb/org.samba.winbind/io.systemd.UserDatabase.GetMemberships
 "{\"service\":\"org.samba.winbind\",\"groupName\":\"AFOREST+domain 
users\",\"userName\":\"AFOREST+user1\"}"
    {
      "groupName": "AFOREST+domain users",
      "userName": "AFOREST+user1"
    }
    
    Signed-off-by: Samuel Cabrero <scabr...@samba.org>
    Reviewed-by: Andreas Schneider <a...@samba.org>

commit 3ce570c7b5b346476f0526d0a53016fbca27912d
Author: Samuel Cabrero <scabr...@samba.org>
Date:   Mon Feb 6 19:03:03 2023 +0100

    winbind:varlink: Implement memberships by group name
    
    $> userdbctl -s org.samba.winbind users-in-group "AFOREST+domain users"
    Enabled services: org.samba.winbind
    USER                  GROUP
    AFOREST+administrator AFOREST+domain users
    AFOREST+krbtgt        AFOREST+domain users
    AFOREST+user1         AFOREST+domain users
    
    3 memberships listed.
    
    $> SYSTEMD_LOG_LEVEL=7 getent -sgroup:systemd group "AFOREST+domain users"
    varlink: Setting state idle-client
    /run/systemd/userdb/org.samba.winbind: Sending message: 
{"method":"io.systemd.UserDatabase.GetGroupRecord","parameters":{"groupName":"AFOREST+domain
 users","service":"org.samba.winbind"}}
    /run/systemd/userdb/org.samba.winbind: Changing state idle-client → 
awaiting-reply
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"parameters":{"incomplete":false,"record":{"gid":20513,"groupName":"AFOREST+domain
 
users","members":["AFOREST+administrator","AFOREST+user1","AFOREST+krbtgt"],"service":"org.samba.winbind"}}}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply → 
processing-reply
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
idle-client
    varlink: Setting state idle-client
    /run/systemd/userdb/org.samba.winbind: Sending message: 
{"method":"io.systemd.UserDatabase.GetMemberships","parameters":{"groupName":"AFOREST+domain
 users","service":"org.samba.winbind"},"more":true}
    /run/systemd/userdb/org.samba.winbind: Changing state idle-client → 
awaiting-reply-more
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"continues":true,"parameters":{"groupName":"AFOREST+domain 
users","userName":"AFOREST+administrator"}}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply-more → 
processing-reply
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
awaiting-reply-more
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"continues":true,"parameters":{"groupName":"AFOREST+domain 
users","userName":"AFOREST+user1"}}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply-more → 
processing-reply
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
awaiting-reply-more
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"parameters":{"groupName":"AFOREST+domain users","userName":"AFOREST+krbtgt"}}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply-more → 
processing-reply
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
idle-client
    AFOREST+domain 
users:x:20513:AFOREST+administrator,AFOREST+user1,AFOREST+krbtgt
    
    Signed-off-by: Samuel Cabrero <scabr...@samba.org>
    Reviewed-by: Andreas Schneider <a...@samba.org>

commit ad215705aad9facb824aff08b72cc06ae8c1b0a8
Author: Samuel Cabrero <scabr...@samba.org>
Date:   Mon Feb 6 18:58:25 2023 +0100

    winbind:varlink: Implement memberships by user
    
    $> userdbctl -s org.samba.winbind groups-of-user AFOREST+user1
    Enabled services: org.samba.winbind
    USER          GROUP
    AFOREST+user1 AFOREST+domain users
    AFOREST+user1 AFOREST+user1
    
    2 memberships listed.
    
    $> SYSTEMD_LOG_LEVEL=7 getent -sinitgroups:systemd initgroups 
"AFOREST+domain users"
    varlink: Setting state idle-client
    /run/systemd/userdb/org.samba.winbind: Sending message: 
{"method":"io.systemd.UserDatabase.GetMemberships","parameters":{"userName":"AFOREST+domain
 users","service":"org.samba.winbind"},"more":true}
    /run/systemd/userdb/org.samba.winbind: Changing state idle-client → 
awaiting-reply-more
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"continues":true,"parameters":{"groupName":"AFOREST+domain 
users","userName":"AFOREST+domain users"}}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply-more → 
processing-reply
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
awaiting-reply-more
    Failed to connect to /run/systemd/userdb/io.systemd.Multiplexer: No such 
file or directory
    Unable to connect to /run/systemd/userdb/io.systemd.Multiplexer: No such 
file or directory
    varlink: Setting state idle-client
    /run/systemd/userdb/org.samba.winbind: Sending message: 
{"method":"io.systemd.UserDatabase.GetGroupRecord","parameters":{"groupName":"AFOREST+domain
 users","service":"org.samba.winbind"}}
    /run/systemd/userdb/org.samba.winbind: Changing state idle-client → 
awaiting-reply
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"parameters":{"incomplete":false,"record":{"gid":20513,"groupName":"AFOREST+domain
 
users","members":["AFOREST+administrator","AFOREST+user1","AFOREST+krbtgt"],"service":"org.samba.winbind"}}}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply → 
processing-reply
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
idle-client
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"parameters":{"groupName":"AFOREST+domain users","userName":"AFOREST+domain 
users"}}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply-more → 
processing-reply
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
idle-client
    Failed to connect to /run/systemd/userdb/io.systemd.Multiplexer: No such 
file or directory
    Unable to connect to /run/systemd/userdb/io.systemd.Multiplexer: No such 
file or directory
    varlink: Setting state idle-client
    /run/systemd/userdb/org.samba.winbind: Sending message: 
{"method":"io.systemd.UserDatabase.GetGroupRecord","parameters":{"groupName":"AFOREST+domain
 users","service":"org.samba.winbind"}}
    /run/systemd/userdb/org.samba.winbind: Changing state idle-client → 
awaiting-reply
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"parameters":{"incomplete":false,"record":{"gid":20513,"groupName":"AFOREST+domain
 
users","members":["AFOREST+administrator","AFOREST+user1","AFOREST+krbtgt"],"service":"org.samba.winbind"}}}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply → 
processing-reply
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
idle-client
    AFOREST+domain users  20513 20513
    
    Signed-off-by: Samuel Cabrero <scabr...@samba.org>
    Reviewed-by: Andreas Schneider <a...@samba.org>

commit 6f437ae49d5561947a8d63f25ed7faa1e4e51441
Author: Samuel Cabrero <scabr...@samba.org>
Date:   Mon Feb 6 18:49:07 2023 +0100

    winbind:varlink: Implement memberships enumeration
    
    $> varlink call -m 
unix:/run/systemd/userdb/org.samba.winbind/io.systemd.UserDatabase.GetMemberships
 "{\"service\":\"org.samba.winbind\"}"
    {
      "groupName": "AFOREST+schema admins",
      "userName": "AFOREST+administrator"
    }
    {
      "groupName": "AFOREST+enterprise admins",
      "userName": "AFOREST+administrator"
    }
    {
      "groupName": "AFOREST+domain admins",
      "userName": "AFOREST+administrator"
    }
    {
      "groupName": "AFOREST+domain users",
      "userName": "AFOREST+administrator"
    }
    {
      "groupName": "AFOREST+domain users",
      "userName": "AFOREST+user1"
    }
    {
      "groupName": "AFOREST+domain users",
      "userName": "AFOREST+krbtgt"
    }
    {
      "groupName": "AFOREST+domain guests",
      "userName": "AFOREST+guest"
    }
    {
      "groupName": "AFOREST+group policy creator owners",
      "userName": "AFOREST+administrator"
    }
    {
      "groupName": "AFOREST+denied rodc password replication group",
      "userName": "AFOREST+krbtgt"
    }
    
    Signed-off-by: Samuel Cabrero <scabr...@samba.org>
    Reviewed-by: Andreas Schneider <a...@samba.org>

commit 68e590c71395b531e47dcae98565910121145d5f
Author: Samuel Cabrero <scabr...@samba.org>
Date:   Mon Feb 6 18:39:46 2023 +0100

    winbind:varlink: Implement get group record by name and gid
    
    $> varlink call -m 
unix:/run/systemd/userdb/org.samba.winbind/io.systemd.UserDatabase.GetGroupRecord
 
"{\"service\":\"org.samba.winbind\",\"gid\":20513,\"groupName\":\"AFOREST+domain
 users\"}"
    {
      "incomplete": false,
      "record": {
        "gid": 20513,
        "groupName": "AFOREST+domain users",
        "members": [
          "AFOREST+administrator",
          "AFOREST+user1",
          "AFOREST+krbtgt"
        ],
        "service": "org.samba.winbind"
      }
    }
    
    Signed-off-by: Samuel Cabrero <scabr...@samba.org>
    Reviewed-by: Andreas Schneider <a...@samba.org>

commit e8813b2d620b9a1896037a479d42249d70bec0a9
Author: Samuel Cabrero <scabr...@samba.org>
Date:   Mon Feb 6 18:35:29 2023 +0100

    winbind:varlink: Implement get group record by name
    
    $> userdbctl -s org.samba.winbind group "AFOREST+domain users"
    Enabled services: org.samba.winbind
      Group name: AFOREST+domain users
     Disposition: regular
             GID: 20513
         Service: org.samba.winbind
    
    $> SYSTEMD_LOG_LEVEL=7 getent -sgroup:systemd group "AFOREST+domain users"
    varlink: Setting state idle-client
    /run/systemd/userdb/org.samba.winbind: Sending message: 
{"method":"io.systemd.UserDatabase.GetGroupRecord","parameters":{"groupName":"AFOREST+domain
 users","service":"org.samba.winbind"}}
    /run/systemd/userdb/org.samba.winbind: Changing state idle-client → 
awaiting-reply
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"parameters":{"incomplete":false,"record":{"gid":20513,"groupName":"AFOREST+domain
 
users","members":["AFOREST+administrator","AFOREST+user1","AFOREST+krbtgt"],"service":"org.samba.winbind"}}}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply → 
processing-reply
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
idle-client
    varlink: Setting state idle-client
    /run/systemd/userdb/org.samba.winbind: Sending message: 
{"method":"io.systemd.UserDatabase.GetMemberships","parameters":{"groupName":"AFOREST+domain
 users","service":"org.samba.winbind"},"more":true}
    /run/systemd/userdb/org.samba.winbind: Changing state idle-client → 
awaiting-reply-more
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"error":"io.systemd.UserDatabase.NoRecordFound"}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply-more → 
processing-reply
    Got lookup error: io.systemd.UserDatabase.NoRecordFound
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
idle-client
    AFOREST+domain 
users:x:20513:AFOREST+administrator,AFOREST+user1,AFOREST+krbtgt
    
    Signed-off-by: Samuel Cabrero <scabr...@samba.org>
    Reviewed-by: Andreas Schneider <a...@samba.org>

commit b841911f73555209a3b41ba829caff0997ba4045
Author: Samuel Cabrero <scabr...@samba.org>
Date:   Mon Feb 6 18:34:04 2023 +0100

    winbind:varlink: Implement get group record by gid
    
    $> userdbctl -s org.samba.winbind group 20513
    Enabled services: org.samba.winbind
      Group name: AFOREST+domain users
     Disposition: regular
             GID: 20513
         Service: org.samba.winbind
    
    $> SYSTEMD_LOG_LEVEL=7 getent -sgroup:systemd group 20513
    varlink: Setting state idle-client
    /run/systemd/userdb/org.samba.winbind: Sending message: 
{"method":"io.systemd.UserDatabase.GetGroupRecord","parameters":{"gid":20513,"service":"org.samba.winbind"}}
    /run/systemd/userdb/org.samba.winbind: Changing state idle-client → 
awaiting-reply
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"parameters":{"incomplete":false,"record":{"gid":20513,"groupName":"AFOREST+domain
 
users","members":["AFOREST+administrator","AFOREST+user1","AFOREST+krbtgt"],"service":"org.samba.winbind"}}}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply → 
processing-reply
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
idle-client
    varlink: Setting state idle-client
    /run/systemd/userdb/org.samba.winbind: Sending message: 
{"method":"io.systemd.UserDatabase.GetMemberships","parameters":{"groupName":"AFOREST+domain
 users","service":"org.samba.winbind"},"more":true}
    /run/systemd/userdb/org.samba.winbind: Changing state idle-client → 
awaiting-reply-more
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"error":"io.systemd.UserDatabase.NoRecordFound"}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply-more → 
processing-reply
    Got lookup error: io.systemd.UserDatabase.NoRecordFound
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
idle-client
    AFOREST+domain 
users:x:20513:AFOREST+administrator,AFOREST+user1,AFOREST+krbtgt
    
    Signed-off-by: Samuel Cabrero <scabr...@samba.org>
    Reviewed-by: Andreas Schneider <a...@samba.org>

commit 9144e091219b176260f5a5fd8d411682109f74e8
Author: Samuel Cabrero <scabr...@samba.org>
Date:   Mon Feb 6 18:32:21 2023 +0100

    winbind:varlink: Implement group record enumeration
    
    $> userdbctl -s org.samba.winbind group
       NAME                                            DISPOSITION        GID 
DESCRIPTION
       ...
       AFOREST+enterprise read-only domain controllers regular          20498 -
       AFOREST+domain admins                           regular          20512 -
       AFOREST+domain users                            regular          20513 -
       AFOREST+domain guests                           regular          20514 -
       AFOREST+domain computers                        regular          20515 -
       AFOREST+domain controllers                      regular          20516 -
       AFOREST+cert publishers                         regular          20517 -
       AFOREST+schema admins                           regular          20518 -
       AFOREST+enterprise admins                       regular          20519 -
       AFOREST+group policy creator owners             regular          20520 -
       AFOREST+read-only domain controllers            regular          20521 -
       AFOREST+cloneable domain controllers            regular          20522 -
       AFOREST+protected users                         regular          20525 -
       AFOREST+ras and ias servers                     regular          20553 -
       AFOREST+allowed rodc password replication group regular          20571 -
       AFOREST+denied rodc password replication group  regular          20572 -
       AFOREST+winrmremotewmiusers__                   regular          21000 -
       AFOREST+dnsadmins                               regular          21102 -
       AFOREST+dnsupdateproxy                          regular          21103 -
       ...
    
    $> SYSTEMD_LOG_LEVEL=7 getent -sgroup:systemd group
    varlink: Setting state idle-client
    /run/systemd/userdb/org.samba.winbind: Sending message: 
{"method":"io.systemd.UserDatabase.GetGroupRecord","parameters":{"service":"org.samba.winbind"},"more":true}
    /run/systemd/userdb/org.samba.winbind: Changing state idle-client → 
awaiting-reply-more
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"continues":true,"parameters":{"incomplete":false,"record":{"gid":21000,"groupName":"AFOREST+winrmremotewmiusers__","service":"org.samba.winbind"}}}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply-more → 
processing-reply
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
awaiting-reply-more
    varlink: Setting state idle-client
    /run/systemd/userdb/org.samba.winbind: Sending message: 
{"method":"io.systemd.UserDatabase.GetMemberships","parameters":{"groupName":"AFOREST+winrmremotewmiusers__","service":"org.samba.winbind"},"more":true}
    /run/systemd/userdb/org.samba.winbind: Changing state idle-client → 
awaiting-reply-more
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"error":"io.systemd.UserDatabase.NoRecordFound"}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply-more → 
processing-reply
    Got lookup error: io.systemd.UserDatabase.NoRecordFound
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
idle-client
    AFOREST+winrmremotewmiusers__:x:21000:
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"continues":true,"parameters":{"incomplete":false,"record":{"gid":20515,"groupName":"AFOREST+domain
 computers","service":"org.samba.winbind"}}}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply-more → 
processing-reply
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
awaiting-reply-more
    varlink: Setting state idle-client
    /run/systemd/userdb/org.samba.winbind: Sending message: 
{"method":"io.systemd.UserDatabase.GetMemberships","parameters":{"groupName":"AFOREST+domain
 computers","service":"org.samba.winbind"},"more":true}
    /run/systemd/userdb/org.samba.winbind: Changing state idle-client → 
awaiting-reply-more
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"error":"io.systemd.UserDatabase.NoRecordFound"}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply-more → 
processing-reply
    Got lookup error: io.systemd.UserDatabase.NoRecordFound
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
idle-client
    AFOREST+domain computers:x:20515:
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"continues":true,"parameters":{"incomplete":false,"record":{"gid":20516,"groupName":"AFOREST+domain
 controllers","service":"org.samba.winbind"}}}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply-more → 
processing-reply
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
awaiting-reply-more
    varlink: Setting state idle-client
    /run/systemd/userdb/org.samba.winbind: Sending message: 
{"method":"io.systemd.UserDatabase.GetMemberships","parameters":{"groupName":"AFOREST+domain
 controllers","service":"org.samba.winbind"},"more":true}
    /run/systemd/userdb/org.samba.winbind: Changing state idle-client → 
awaiting-reply-more
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"error":"io.systemd.UserDatabase.NoRecordFound"}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply-more → 
processing-reply
    Got lookup error: io.systemd.UserDatabase.NoRecordFound
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
idle-client
    AFOREST+domain controllers:x:20516:
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"continues":true,"parameters":{"incomplete":false,"record":{"gid":20518,"groupName":"AFOREST+schema
 admins","members":["AFOREST+administrator"],"service":"org.samba.winbind"}}}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply-more → 
processing-reply
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
awaiting-reply-more
    varlink: Setting state idle-client
    /run/systemd/userdb/org.samba.winbind: Sending message: 
{"method":"io.systemd.UserDatabase.GetMemberships","parameters":{"groupName":"AFOREST+schema
 admins","service":"org.samba.winbind"},"more":true}
    /run/systemd/userdb/org.samba.winbind: Changing state idle-client → 
awaiting-reply-more
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"error":"io.systemd.UserDatabase.NoRecordFound"}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply-more → 
processing-reply
    Got lookup error: io.systemd.UserDatabase.NoRecordFound
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
idle-client
    AFOREST+schema admins:x:20518:AFOREST+administrator
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"continues":true,"parameters":{"incomplete":false,"record":{"gid":20519,"groupName":"AFOREST+enterprise
 admins","members":["AFOREST+administrator"],"service":"org.samba.winbind"}}}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply-more → 
processing-reply
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
awaiting-reply-more
    varlink: Setting state idle-client
    /run/systemd/userdb/org.samba.winbind: Sending message: 
{"method":"io.systemd.UserDatabase.GetMemberships","parameters":{"groupName":"AFOREST+enterprise
 admins","service":"org.samba.winbind"},"more":true}
    /run/systemd/userdb/org.samba.winbind: Changing state idle-client → 
awaiting-reply-more
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"error":"io.systemd.UserDatabase.NoRecordFound"}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply-more → 
processing-reply
    Got lookup error: io.systemd.UserDatabase.NoRecordFound
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
idle-client
    AFOREST+enterprise admins:x:20519:AFOREST+administrator
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"continues":true,"parameters":{"incomplete":false,"record":{"gid":20517,"groupName":"AFOREST+cert
 publishers","service":"org.samba.winbind"}}}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply-more → 
processing-reply
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
awaiting-reply-more
    varlink: Setting state idle-client
    /run/systemd/userdb/org.samba.winbind: Sending message: 
{"method":"io.systemd.UserDatabase.GetMemberships","parameters":{"groupName":"AFOREST+cert
 publishers","service":"org.samba.winbind"},"more":true}
    /run/systemd/userdb/org.samba.winbind: Changing state idle-client → 
awaiting-reply-more
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"error":"io.systemd.UserDatabase.NoRecordFound"}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply-more → 
processing-reply
    Got lookup error: io.systemd.UserDatabase.NoRecordFound
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
idle-client
    AFOREST+cert publishers:x:20517:
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"continues":true,"parameters":{"incomplete":false,"record":{"gid":20512,"groupName":"AFOREST+domain
 admins","members":["AFOREST+administrator"],"service":"org.samba.winbind"}}}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply-more → 
processing-reply
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
awaiting-reply-more
    varlink: Setting state idle-client
    /run/systemd/userdb/org.samba.winbind: Sending message: 
{"method":"io.systemd.UserDatabase.GetMemberships","parameters":{"groupName":"AFOREST+domain
 admins","service":"org.samba.winbind"},"more":true}
    /run/systemd/userdb/org.samba.winbind: Changing state idle-client → 
awaiting-reply-more
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"error":"io.systemd.UserDatabase.NoRecordFound"}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply-more → 
processing-reply
    Got lookup error: io.systemd.UserDatabase.NoRecordFound
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
idle-client
    AFOREST+domain admins:x:20512:AFOREST+administrator
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"continues":true,"parameters":{"incomplete":false,"record":{"gid":20513,"groupName":"AFOREST+domain
 
users","members":["AFOREST+user1","AFOREST+administrator","AFOREST+krbtgt"],"service":"org.samba.winbind"}}}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply-more → 
processing-reply
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
awaiting-reply-more
    varlink: Setting state idle-client
    /run/systemd/userdb/org.samba.winbind: Sending message: 
{"method":"io.systemd.UserDatabase.GetMemberships","parameters":{"groupName":"AFOREST+domain
 users","service":"org.samba.winbind"},"more":true}
    /run/systemd/userdb/org.samba.winbind: Changing state idle-client → 
awaiting-reply-more
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"error":"io.systemd.UserDatabase.NoRecordFound"}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply-more → 
processing-reply
    Got lookup error: io.systemd.UserDatabase.NoRecordFound
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
idle-client
    AFOREST+domain 
users:x:20513:AFOREST+user1,AFOREST+administrator,AFOREST+krbtgt
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"continues":true,"parameters":{"incomplete":false,"record":{"gid":20514,"groupName":"AFOREST+domain
 guests","members":["AFOREST+guest"],"service":"org.samba.winbind"}}}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply-more → 
processing-reply
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
awaiting-reply-more
    varlink: Setting state idle-client
    /run/systemd/userdb/org.samba.winbind: Sending message: 
{"method":"io.systemd.UserDatabase.GetMemberships","parameters":{"groupName":"AFOREST+domain
 guests","service":"org.samba.winbind"},"more":true}
    /run/systemd/userdb/org.samba.winbind: Changing state idle-client → 
awaiting-reply-more
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"error":"io.systemd.UserDatabase.NoRecordFound"}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply-more → 
processing-reply
    Got lookup error: io.systemd.UserDatabase.NoRecordFound
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
idle-client
    AFOREST+domain guests:x:20514:AFOREST+guest
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"continues":true,"parameters":{"incomplete":false,"record":{"gid":20520,"groupName":"AFOREST+group
 policy creator 
owners","members":["AFOREST+administrator"],"service":"org.samba.winbind"}}}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply-more → 
processing-reply
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
awaiting-reply-more
    varlink: Setting state idle-client
    /run/systemd/userdb/org.samba.winbind: Sending message: 
{"method":"io.systemd.UserDatabase.GetMemberships","parameters":{"groupName":"AFOREST+group
 policy creator owners","service":"org.samba.winbind"},"more":true}
    /run/systemd/userdb/org.samba.winbind: Changing state idle-client → 
awaiting-reply-more
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"error":"io.systemd.UserDatabase.NoRecordFound"}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply-more → 
processing-reply
    Got lookup error: io.systemd.UserDatabase.NoRecordFound
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
idle-client
    AFOREST+group policy creator owners:x:20520:AFOREST+administrator
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"continues":true,"parameters":{"incomplete":false,"record":{"gid":20553,"groupName":"AFOREST+ras
 and ias servers","service":"org.samba.winbind"}}}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply-more → 
processing-reply
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
awaiting-reply-more
    varlink: Setting state idle-client
    /run/systemd/userdb/org.samba.winbind: Sending message: 
{"method":"io.systemd.UserDatabase.GetMemberships","parameters":{"groupName":"AFOREST+ras
 and ias servers","service":"org.samba.winbind"},"more":true}
    /run/systemd/userdb/org.samba.winbind: Changing state idle-client → 
awaiting-reply-more
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"error":"io.systemd.UserDatabase.NoRecordFound"}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply-more → 
processing-reply
    Got lookup error: io.systemd.UserDatabase.NoRecordFound
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
idle-client
    AFOREST+ras and ias servers:x:20553:
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"continues":true,"parameters":{"incomplete":false,"record":{"gid":20571,"groupName":"AFOREST+allowed
 rodc password replication group","service":"org.samba.winbind"}}}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply-more → 
processing-reply
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
awaiting-reply-more
    varlink: Setting state idle-client
    /run/systemd/userdb/org.samba.winbind: Sending message: 
{"method":"io.systemd.UserDatabase.GetMemberships","parameters":{"groupName":"AFOREST+allowed
 rodc password replication group","service":"org.samba.winbind"},"more":true}
    /run/systemd/userdb/org.samba.winbind: Changing state idle-client → 
awaiting-reply-more
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"error":"io.systemd.UserDatabase.NoRecordFound"}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply-more → 
processing-reply
    Got lookup error: io.systemd.UserDatabase.NoRecordFound
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
idle-client
    AFOREST+allowed rodc password replication group:x:20571:
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"continues":true,"parameters":{"incomplete":false,"record":{"gid":20572,"groupName":"AFOREST+denied
 rodc password replication 
group","members":["AFOREST+krbtgt"],"service":"org.samba.winbind"}}}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply-more → 
processing-reply
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
awaiting-reply-more
    varlink: Setting state idle-client
    /run/systemd/userdb/org.samba.winbind: Sending message: 
{"method":"io.systemd.UserDatabase.GetMemberships","parameters":{"groupName":"AFOREST+denied
 rodc password replication group","service":"org.samba.winbind"},"more":true}
    /run/systemd/userdb/org.samba.winbind: Changing state idle-client → 
awaiting-reply-more
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"error":"io.systemd.UserDatabase.NoRecordFound"}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply-more → 
processing-reply
    Got lookup error: io.systemd.UserDatabase.NoRecordFound
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
idle-client
    AFOREST+denied rodc password replication group:x:20572:AFOREST+krbtgt
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"continues":true,"parameters":{"incomplete":false,"record":{"gid":20521,"groupName":"AFOREST+read-only
 domain controllers","service":"org.samba.winbind"}}}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply-more → 
processing-reply
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
awaiting-reply-more
    varlink: Setting state idle-client
    /run/systemd/userdb/org.samba.winbind: Sending message: 
{"method":"io.systemd.UserDatabase.GetMemberships","parameters":{"groupName":"AFOREST+read-only
 domain controllers","service":"org.samba.winbind"},"more":true}
    /run/systemd/userdb/org.samba.winbind: Changing state idle-client → 
awaiting-reply-more
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"error":"io.systemd.UserDatabase.NoRecordFound"}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply-more → 
processing-reply
    Got lookup error: io.systemd.UserDatabase.NoRecordFound
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
idle-client
    AFOREST+read-only domain controllers:x:20521:
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"continues":true,"parameters":{"incomplete":false,"record":{"gid":20498,"groupName":"AFOREST+enterprise
 read-only domain controllers","service":"org.samba.winbind"}}}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply-more → 
processing-reply
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
awaiting-reply-more
    varlink: Setting state idle-client
    /run/systemd/userdb/org.samba.winbind: Sending message: 
{"method":"io.systemd.UserDatabase.GetMemberships","parameters":{"groupName":"AFOREST+enterprise
 read-only domain controllers","service":"org.samba.winbind"},"more":true}
    /run/systemd/userdb/org.samba.winbind: Changing state idle-client → 
awaiting-reply-more
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"error":"io.systemd.UserDatabase.NoRecordFound"}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply-more → 
processing-reply
    Got lookup error: io.systemd.UserDatabase.NoRecordFound
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
idle-client
    AFOREST+enterprise read-only domain controllers:x:20498:
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"continues":true,"parameters":{"incomplete":false,"record":{"gid":20522,"groupName":"AFOREST+cloneable
 domain controllers","service":"org.samba.winbind"}}}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply-more → 
processing-reply
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
awaiting-reply-more
    varlink: Setting state idle-client
    /run/systemd/userdb/org.samba.winbind: Sending message: 
{"method":"io.systemd.UserDatabase.GetMemberships","parameters":{"groupName":"AFOREST+cloneable
 domain controllers","service":"org.samba.winbind"},"more":true}
    /run/systemd/userdb/org.samba.winbind: Changing state idle-client → 
awaiting-reply-more
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"error":"io.systemd.UserDatabase.NoRecordFound"}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply-more → 
processing-reply
    Got lookup error: io.systemd.UserDatabase.NoRecordFound
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
idle-client
    AFOREST+cloneable domain controllers:x:20522:
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"continues":true,"parameters":{"incomplete":false,"record":{"gid":20525,"groupName":"AFOREST+protected
 users","service":"org.samba.winbind"}}}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply-more → 
processing-reply
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
awaiting-reply-more
    varlink: Setting state idle-client
    /run/systemd/userdb/org.samba.winbind: Sending message: 
{"method":"io.systemd.UserDatabase.GetMemberships","parameters":{"groupName":"AFOREST+protected
 users","service":"org.samba.winbind"},"more":true}
    /run/systemd/userdb/org.samba.winbind: Changing state idle-client → 
awaiting-reply-more
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"error":"io.systemd.UserDatabase.NoRecordFound"}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply-more → 
processing-reply
    Got lookup error: io.systemd.UserDatabase.NoRecordFound
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
idle-client
    AFOREST+protected users:x:20525:
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"continues":true,"parameters":{"incomplete":false,"record":{"gid":21102,"groupName":"AFOREST+dnsadmins","service":"org.samba.winbind"}}}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply-more → 
processing-reply
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
awaiting-reply-more
    varlink: Setting state idle-client
    /run/systemd/userdb/org.samba.winbind: Sending message: 
{"method":"io.systemd.UserDatabase.GetMemberships","parameters":{"groupName":"AFOREST+dnsadmins","service":"org.samba.winbind"},"more":true}
    /run/systemd/userdb/org.samba.winbind: Changing state idle-client → 
awaiting-reply-more
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"error":"io.systemd.UserDatabase.NoRecordFound"}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply-more → 
processing-reply
    Got lookup error: io.systemd.UserDatabase.NoRecordFound
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
idle-client
    AFOREST+dnsadmins:x:21102:
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"parameters":{"incomplete":false,"record":{"gid":21103,"groupName":"AFOREST+dnsupdateproxy","service":"org.samba.winbind"}}}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply-more → 
processing-reply
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
idle-client
    varlink: Setting state idle-client
    /run/systemd/userdb/org.samba.winbind: Sending message: 
{"method":"io.systemd.UserDatabase.GetMemberships","parameters":{"groupName":"AFOREST+dnsupdateproxy","service":"org.samba.winbind"},"more":true}
    /run/systemd/userdb/org.samba.winbind: Changing state idle-client → 
awaiting-reply-more
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"error":"io.systemd.UserDatabase.NoRecordFound"}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply-more → 
processing-reply
    Got lookup error: io.systemd.UserDatabase.NoRecordFound
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
idle-client
    AFOREST+dnsupdateproxy:x:21103:
    varlink: Setting state idle-client
    /run/systemd/userdb/org.samba.winbind: Sending message: 
{"method":"io.systemd.UserDatabase.GetMemberships","parameters":{"service":"org.samba.winbind"},"more":true}
    /run/systemd/userdb/org.samba.winbind: Changing state idle-client → 
awaiting-reply-more
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"error":"io.systemd.UserDatabase.NoRecordFound"}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply-more → 
processing-reply
    Got lookup error: io.systemd.UserDatabase.NoRecordFound
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
idle-client
    
    Signed-off-by: Samuel Cabrero <scabr...@samba.org>
    Reviewed-by: Andreas Schneider <a...@samba.org>

commit 4c3910fa86d80a730f0ed9d1a7dcdadc7cc3a09a
Author: Samuel Cabrero <scabr...@samba.org>
Date:   Mon Feb 6 18:24:15 2023 +0100

    winbind:varlink: Implement get user record by name and uid
    
    $> varlink call 
unix:/run/systemd/userdb/org.samba.winbind/io.systemd.UserDatabase.GetUserRecord
 
"{\"service\":\"org.samba.winbind\",\"userName\":\"AFOREST+user1\",\"uid\":21105}"
    {
      "incomplete": false,
      "record": {
        "gid": 20513,
        "homeDirectory": "/home/AFOREST/user1",
        "service": "org.samba.winbind",
        "shell": "/bin/bash",
        "uid": 21105,
        "userName": "AFOREST+user1"
      }
    }
    
    Signed-off-by: Samuel Cabrero <scabr...@samba.org>
    Reviewed-by: Andreas Schneider <a...@samba.org>

commit d42c485b8431cce292e4794b6ed5a6d34c81f0ba
Author: Samuel Cabrero <scabr...@samba.org>
Date:   Mon Feb 6 18:22:30 2023 +0100

    winbind:varlink: Implement get user record by name
    
    $> userdbctl -s org.samba.winbind user AFOREST+user1
    Enabled services: org.samba.winbind
       User name: AFOREST+user1
     Disposition: regular
        Login OK: yes
     Password OK: no (none set)
             UID: 21105
             GID: 20513 (unresolvable: No such process)
       Directory: /home/AFOREST/user1
         Storage: classic
           Shell: /bin/bash
       Passwords: none
         Service: org.samba.winbind
    
    $> SYSTEMD_LOG_LEVEL=7 getent -spasswd:systemd passwd AFOREST+user1
    varlink: Setting state idle-client
    /run/systemd/userdb/org.samba.winbind: Sending message: 
{"method":"io.systemd.UserDatabase.GetUserRecord","parameters":{"userName":"AFOREST+user1","service":"org.samba.winbind"}}
    /run/systemd/userdb/org.samba.winbind: Changing state idle-client → 
awaiting-reply
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"parameters":{"incomplete":false,"record":{"gid":20513,"homeDirectory":"/home/AFOREST/user1","service":"org.samba.winbind","shell":"/bin/bash","uid":21105,"userName":"AFOREST+user1"}}}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply → 
processing-reply
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
idle-client
    AFOREST+user1:x:21105:20513:AFOREST+user1:/home/AFOREST/user1:/bin/bash
    
    Signed-off-by: Samuel Cabrero <scabr...@samba.org>
    Reviewed-by: Andreas Schneider <a...@samba.org>

commit 946a800c2198b57bd033d6efdbec05be18386239
Author: Samuel Cabrero <scabr...@samba.org>
Date:   Mon Feb 6 18:20:32 2023 +0100

    winbind:varlink: Implement get user record by uid
    
    $> userdbctl -s org.samba.winbind user 21105
    Enabled services: org.samba.winbind
       User name: AFOREST+user1
     Disposition: regular
        Login OK: yes
     Password OK: no (none set)
             UID: 21105
             GID: 20513 (unresolvable: No such process)
       Directory: /home/AFOREST/user1
         Storage: classic
           Shell: /bin/bash
       Passwords: none
         Service: org.samba.winbind
    
    $> SYSTEMD_LOG_LEVEL=7 getent -spasswd:systemd passwd 21105
    varlink: Setting state idle-client
    /run/systemd/userdb/org.samba.winbind: Sending message: 
{"method":"io.systemd.UserDatabase.GetUserRecord","parameters":{"uid":21105,"service":"org.samba.winbind"}}
    /run/systemd/userdb/org.samba.winbind: Changing state idle-client → 
awaiting-reply
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"parameters":{"incomplete":false,"record":{"gid":20513,"homeDirectory":"/home/AFOREST/user1","service":"org.samba.winbind","shell":"/bin/bash","uid":21105,"userName":"AFOREST+user1"}}}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply → 
processing-reply
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
idle-client
    AFOREST+user1:x:21105:20513:AFOREST+user1:/home/AFOREST/user1:/bin/bash
    
    Signed-off-by: Samuel Cabrero <scabr...@samba.org>
    Reviewed-by: Andreas Schneider <a...@samba.org>

commit 6369e0524746f553fb3b2f3fd8f9ffcc2e0d5c4c
Author: Samuel Cabrero <scabr...@samba.org>
Date:   Mon Feb 6 18:17:52 2023 +0100

    winbind:varlink: Implement user record enumeration
    
    $> userdbctl -s org.samba.winbind
    Enabled services: org.samba.winbind
       NAME                           DISPOSITION        UID   GID REALNAME     
                HOME                        SHELL
       ...
       AFOREST+administrator          regular          20500 20513 -            
                /home/AFOREST/administrator /bin/bash
       AFOREST+guest                  regular          20501 20513 -            
                /home/AFOREST/guest         /bin/bash
       AFOREST+krbtgt                 regular          20502 20513 -            
                /home/AFOREST/krbtgt        /bin/bash
       AFOREST+user1                  regular          21105 20513 -            
                /home/AFOREST/user1         /bin/bash
       ...
    
    $> SYSTEMD_LOG_LEVEL=7 getent -spasswd:systemd passwd
    varlink: Setting state idle-client
    /run/systemd/userdb/org.samba.winbind: Sending message: 
{"method":"io.systemd.UserDatabase.GetUserRecord","parameters":{"service":"org.samba.winbind"},"more":true}
    /run/systemd/userdb/org.samba.winbind: Changing state idle-client → 
awaiting-reply-more
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"continues":true,"parameters":{"incomplete":false,"record":{"gid":20513,"homeDirectory":"/home/AFOREST/administrator","service":"org.samba.winbind","shell":"/bin/bash","uid":20500,"userName":"AFOREST+administrator"}}}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply-more → 
processing-reply
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
awaiting-reply-more
    
AFOREST+administrator:x:20500:20513:AFOREST+administrator:/home/AFOREST/administrator:/bin/bash
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"continues":true,"parameters":{"incomplete":false,"record":{"gid":20513,"homeDirectory":"/home/AFOREST/guest","service":"org.samba.winbind","shell":"/bin/bash","uid":20501,"userName":"AFOREST+guest"}}}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply-more → 
processing-reply
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
awaiting-reply-more
    AFOREST+guest:x:20501:20513:AFOREST+guest:/home/AFOREST/guest:/bin/bash
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"continues":true,"parameters":{"incomplete":false,"record":{"gid":20513,"homeDirectory":"/home/AFOREST/krbtgt","service":"org.samba.winbind","shell":"/bin/bash","uid":20502,"userName":"AFOREST+krbtgt"}}}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply-more → 
processing-reply
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
awaiting-reply-more
    AFOREST+krbtgt:x:20502:20513:AFOREST+krbtgt:/home/AFOREST/krbtgt:/bin/bash
    /run/systemd/userdb/org.samba.winbind: New incoming message: 
{"parameters":{"incomplete":false,"record":{"gid":20513,"homeDirectory":"/home/AFOREST/user1","service":"org.samba.winbind","shell":"/bin/bash","uid":21105,"userName":"AFOREST+user1"}}}
    /run/systemd/userdb/org.samba.winbind: Changing state awaiting-reply-more → 
processing-reply
    /run/systemd/userdb/org.samba.winbind: Changing state processing-reply → 
idle-client
    AFOREST+user1:x:21105:20513:AFOREST+user1:/home/AFOREST/user1:/bin/bash
    
    $> ./bin/varlink-tool call 
unix:/run/systemd/userdb/org.samba.winbind/io.systemd.UserDatabase.GetUserRecord
 "{\"service\":\"org.samba.winbind\"}" -m
    ...
    
    Signed-off-by: Samuel Cabrero <scabr...@samba.org>
    Reviewed-by: Andreas Schneider <a...@samba.org>

commit d40f5591bc19c0b3b3e37af005d6055d92e70174
Author: Samuel Cabrero <scabr...@samba.org>
Date:   Mon Feb 6 18:11:33 2023 +0100

    winbind:varlink: Add a function to craft a winbindd_cli_state structure
    
    Signed-off-by: Samuel Cabrero <scabr...@samba.org>
    Reviewed-by: Andreas Schneider <a...@samba.org>

commit e59f2c513fa810a3980690d52e6a860826a4d6cf
Author: Samuel Cabrero <scabr...@samba.org>
Date:   Wed Feb 1 17:02:38 2023 +0100

    winbind:varlink: Add io.systemd.UserDatabase interface
    
    $> varlink info unix:/run/systemd/userdb/org.samba.winbind
    Vendor: Samba
    Product: Winbind
    Version: 1
    URL: https://samba.org
    Interfaces:
      io.systemd.UserDatabase
      org.varlink.service
    
    TODO libvarlink bug handling camel case interface names:
    https://github.com/varlink/libvarlink/pull/58
    
    $> varlink help 
unix:/run/systemd/userdb/org.samba.winbind/io.systemd.UserDatabase
    interface io.systemd.UserDatabase
    
    method GetUserRecord(
      uid: ?int,
      userName: ?string,
      service: string
    ) -> (record: object, incomplete: bool)
    
    method GetGroupRecord(
      gid: ?int,
      groupName: ?string,
      service: string
    ) -> (record: object, incomplete: bool)
    
    method GetMemberships(
      userName: ?string,
      groupName: ?string,
      service: string
    ) -> (userName: string, groupName: string)
    
    error NoRecordFound ()
    
    error BadService ()
    
    error ServiceNotAvailable ()
    
    error ConflictingRecordFound ()
    
    error EnumerationNotSupported ()
    
    Signed-off-by: Samuel Cabrero <scabr...@samba.org>
    Reviewed-by: Andreas Schneider <a...@samba.org>

commit b52ccab3b3372ae8e2ddaa4d143d47ac2b3c7841
Author: Samuel Cabrero <scabr...@samba.org>
Date:   Thu Feb 2 09:56:05 2023 +0100

    winbind:varlink: Create varlink socket directory
    
    Signed-off-by: Samuel Cabrero <scabr...@samba.org>
    Reviewed-by: Andreas Schneider <a...@samba.org>

commit 776eea8090c9edfdf68e64fd840523a98fadbe64
Author: Samuel Cabrero <scabr...@samba.org>
Date:   Wed Feb 1 17:01:21 2023 +0100

    winbind:varlink: Add varlink service
    
    $> userdbctl services
    SERVICE           LISTENING
    org.samba.winbind yes
    
    1 services listed.
    
    $> varlink info unix:/run/systemd/userdb/org.samba.winbind
    Vendor: Samba
    Product: Winbind
    Version: 1
    URL: https://samba.org
    Interfaces:
      org.varlink.service
    
    Signed-off-by: Samuel Cabrero <scabr...@samba.org>
    Reviewed-by: Andreas Schneider <a...@samba.org>

commit e1f448e1259af53e265466863a9f1b38cbda226e
Author: Samuel Cabrero <scabr...@samba.org>
Date:   Wed Feb 8 10:29:48 2023 +0100

    winbind: Add "winbind varlink service" smb.conf option
    
    Signed-off-by: Samuel Cabrero <scabr...@samba.org>
    Reviewed-by: Andreas Schneider <a...@samba.org>

commit 7996e03b7dae54996f46b359a790dc75ee7d83cd
Author: Samuel Cabrero <scabr...@samba.org>
Date:   Tue Jan 21 12:12:55 2025 +0100

    wscript: Add --with-systemd-userdb option
    
    Signed-off-by: Samuel Cabrero <scabr...@samba.org>
    Reviewed-by: Andreas Schneider <a...@samba.org>

commit 849f9596f91d363c517a867fe94922c099491f45
Author: Samuel Cabrero <scabr...@samba.org>
Date:   Fri Jan 26 12:21:59 2024 +0100

    winbind: Fix running in interactive mode
    
    Signed-off-by: Samuel Cabrero <scabr...@samba.org>
    Reviewed-by: Andreas Schneider <a...@samba.org>

-----------------------------------------------------------------------

Summary of changes:
 .gitlab-ci-main.yml                                |    2 +-
 bootstrap/config.py                                |    8 +
 bootstrap/generated-dists/fedora41/bootstrap.sh    |    2 +
 bootstrap/generated-dists/fedora41/packages.yml    |    2 +
 bootstrap/generated-dists/opensuse155/bootstrap.sh |    1 +
 bootstrap/generated-dists/opensuse155/packages.yml |    1 +
 bootstrap/generated-dists/rocky8/bootstrap.sh      |    1 +
 bootstrap/generated-dists/rocky8/packages.yml      |    1 +
 bootstrap/sha1sum.txt                              |    2 +-
 .../smbdotconf/winbind/winbindvarlinkservice.xml   |   28 +
 python/samba/tests/varlink/base.py                 |   89 ++
 python/samba/tests/varlink/getgrouprecord.py       |   61 ++
 python/samba/tests/varlink/getmemberships.py       |   89 ++
 python/samba/tests/varlink/getuserrecord.py        |   59 ++
 script/autobuild.py                                |    2 +-
 selftest/target/Samba4.pm                          |    7 +
 source3/utils/testparm.c                           |   10 +
 source3/winbindd/winbindd.c                        |   31 +-
 source3/winbindd/winbindd_varlink.c                |  587 +++++++++++
 source3/winbindd/winbindd_varlink.h                |  133 +++
 source3/winbindd/winbindd_varlink_getgrouprecord.c |  902 ++++++++++++++++
 source3/winbindd/winbindd_varlink_getmemberships.c | 1072 ++++++++++++++++++++
 source3/winbindd/winbindd_varlink_getuserrecord.c  |  862 ++++++++++++++++
 source3/winbindd/wscript_build                     |   11 +
 source3/wscript                                    |   10 +
 source4/selftest/tests.py                          |    5 +
 wscript                                            |    5 +
 27 files changed, 3970 insertions(+), 13 deletions(-)
 create mode 100644 docs-xml/smbdotconf/winbind/winbindvarlinkservice.xml
 create mode 100644 python/samba/tests/varlink/base.py
 create mode 100644 python/samba/tests/varlink/getgrouprecord.py
 create mode 100644 python/samba/tests/varlink/getmemberships.py
 create mode 100644 python/samba/tests/varlink/getuserrecord.py
 create mode 100644 source3/winbindd/winbindd_varlink.c
 create mode 100644 source3/winbindd/winbindd_varlink.h
 create mode 100644 source3/winbindd/winbindd_varlink_getgrouprecord.c
 create mode 100644 source3/winbindd/winbindd_varlink_getmemberships.c
 create mode 100644 source3/winbindd/winbindd_varlink_getuserrecord.c


Changeset truncated at 500 lines:

diff --git a/.gitlab-ci-main.yml b/.gitlab-ci-main.yml
index 6a27d035928..23be1ef6d7e 100644
--- a/.gitlab-ci-main.yml
+++ b/.gitlab-ci-main.yml
@@ -47,7 +47,7 @@ variables:
   # Set this to the contents of bootstrap/sha1sum.txt
   # which is generated by bootstrap/template.py --render
   #
-  SAMBA_CI_CONTAINER_TAG: a234da56a3f4ea96265e6c8a308051be3478ab22
+  SAMBA_CI_CONTAINER_TAG: fb63148d63beac20259d0c61ece2c608d2d1d2a1
   #
   # We use the ubuntu2204 image as default as
   # it matches what we have on atb-devel-224
diff --git a/bootstrap/config.py b/bootstrap/config.py
index f65b6b3dab7..d9e39b19045 100644
--- a/bootstrap/config.py
+++ b/bootstrap/config.py
@@ -178,6 +178,10 @@ PKGS = [
     # spotlight
     ('libtracker-sparql-2.0-dev', 'tracker-devel'),
 
+    # systemd userdb
+    ('', 'libvarlink-devel'),
+    ('', 'python3-varlink'),
+
     # misc
     # @ means group for rpm, use fedora as rpm default
     ('build-essential', '@development-tools'),
@@ -534,6 +538,7 @@ RPM_DISTS = {
             'ShellCheck': '',
             'shfmt': '',
             'codespell': '',
+            'libvarlink-devel': '', # not available
         }
     },
     'centos9s': {
@@ -553,6 +558,8 @@ RPM_DISTS = {
             'codespell': '',
             'libcephfs-devel': '',  # not available anymore
             'curl': '',  # Use installed curl-minimal
+            'libvarlink-devel': '', # not available
+            'python3-varlink': '', # not available
         }
     },
     'fedora41': {
@@ -598,6 +605,7 @@ RPM_DISTS = {
             'mold': '',
             'shfmt': '',
             'yum-utils': '',
+            'libvarlink-devel': '', # not available
         }
     }
 }
diff --git a/bootstrap/generated-dists/fedora41/bootstrap.sh 
b/bootstrap/generated-dists/fedora41/bootstrap.sh
index 22d2fa89745..ae7e1a5d891 100755
--- a/bootstrap/generated-dists/fedora41/bootstrap.sh
+++ b/bootstrap/generated-dists/fedora41/bootstrap.sh
@@ -69,6 +69,7 @@ dnf install -y \
     libunwind-devel \
     liburing-devel \
     libuuid-devel \
+    libvarlink-devel \
     libxslt \
     lmdb \
     lmdb-devel \
@@ -103,6 +104,7 @@ dnf install -y \
     python3-pyasn1 \
     python3-requests \
     python3-setproctitle \
+    python3-varlink \
     quota-devel \
     readline-devel \
     redhat-lsb \
diff --git a/bootstrap/generated-dists/fedora41/packages.yml 
b/bootstrap/generated-dists/fedora41/packages.yml
index 532ac877fdd..427b236d394 100644
--- a/bootstrap/generated-dists/fedora41/packages.yml
+++ b/bootstrap/generated-dists/fedora41/packages.yml
@@ -58,6 +58,7 @@ packages:
   - libunwind-devel
   - liburing-devel
   - libuuid-devel
+  - libvarlink-devel
   - libxslt
   - lmdb
   - lmdb-devel
@@ -92,6 +93,7 @@ packages:
   - python3-pyasn1
   - python3-requests
   - python3-setproctitle
+  - python3-varlink
   - quota-devel
   - readline-devel
   - redhat-lsb
diff --git a/bootstrap/generated-dists/opensuse155/bootstrap.sh 
b/bootstrap/generated-dists/opensuse155/bootstrap.sh
index e81cc18ccfb..f94b52bb244 100755
--- a/bootstrap/generated-dists/opensuse155/bootstrap.sh
+++ b/bootstrap/generated-dists/opensuse155/bootstrap.sh
@@ -98,6 +98,7 @@ zypper --non-interactive install \
     python3-requests \
     python3-semanage \
     python3-setproctitle \
+    python3-varlink \
     readline-devel \
     rng-tools \
     rpcgen \
diff --git a/bootstrap/generated-dists/opensuse155/packages.yml 
b/bootstrap/generated-dists/opensuse155/packages.yml
index b709cc45e23..866d4d376b0 100644
--- a/bootstrap/generated-dists/opensuse155/packages.yml
+++ b/bootstrap/generated-dists/opensuse155/packages.yml
@@ -86,6 +86,7 @@ packages:
   - python3-requests
   - python3-semanage
   - python3-setproctitle
+  - python3-varlink
   - readline-devel
   - rng-tools
   - rpcgen
diff --git a/bootstrap/generated-dists/rocky8/bootstrap.sh 
b/bootstrap/generated-dists/rocky8/bootstrap.sh
index e8f632581d7..9faf66829e2 100755
--- a/bootstrap/generated-dists/rocky8/bootstrap.sh
+++ b/bootstrap/generated-dists/rocky8/bootstrap.sh
@@ -111,6 +111,7 @@ yum install -y \
     python3-pyasn1 \
     python3-requests \
     python3-setproctitle \
+    python3-varlink \
     quota-devel \
     readline-devel \
     redhat-lsb \
diff --git a/bootstrap/generated-dists/rocky8/packages.yml 
b/bootstrap/generated-dists/rocky8/packages.yml
index cd91a67f11a..7b7ed9e6967 100644
--- a/bootstrap/generated-dists/rocky8/packages.yml
+++ b/bootstrap/generated-dists/rocky8/packages.yml
@@ -87,6 +87,7 @@ packages:
   - python3-pyasn1
   - python3-requests
   - python3-setproctitle
+  - python3-varlink
   - quota-devel
   - readline-devel
   - redhat-lsb
diff --git a/bootstrap/sha1sum.txt b/bootstrap/sha1sum.txt
index d011893c3ae..b4da7b234d0 100644
--- a/bootstrap/sha1sum.txt
+++ b/bootstrap/sha1sum.txt
@@ -1 +1 @@
-a234da56a3f4ea96265e6c8a308051be3478ab22
+fb63148d63beac20259d0c61ece2c608d2d1d2a1
diff --git a/docs-xml/smbdotconf/winbind/winbindvarlinkservice.xml 
b/docs-xml/smbdotconf/winbind/winbindvarlinkservice.xml
new file mode 100644
index 00000000000..de8349501f9
--- /dev/null
+++ b/docs-xml/smbdotconf/winbind/winbindvarlinkservice.xml
@@ -0,0 +1,28 @@
+<samba:parameter name="winbind varlink service"
+                 context="G"
+                 type="boolean"
+                 xmlns:samba="http://www.samba.org/samba/DTD/samba-doc";>
+<description>
+<para>This setting controls whether 
<citerefentry><refentrytitle>winbind</refentrytitle>
+<manvolnum>8</manvolnum></citerefentry> will listen for User/Group record 
lookup
+from <citerefentry><refentrytitle>nss-systemd</refentrytitle>
+<manvolnum>8</manvolnum></citerefentry> via Varlink, offering an alternative
+to nss_winbind.</para>
+
+<para>For more information about User/Group record lookup via Varlink see
+https://systemd.io/USER_GROUP_API/ and <citerefentry><refentrytitle>nss-systemd
+</refentrytitle><manvolnum>8</manvolnum></citerefentry> manpage.</para>
+
+<para><warning><para><citerefentry><refentrytitle>Systemd</refentrytitle>
+<manvolnum>1</manvolnum></citerefentry> versions prior 253 consider the default
+<smbconfoption name="winbind separator"/> '\' an unsafe character in the
+GetMemberhips reply. To workaround the issue it is recommended to set it to '+'
+for example.</para></warning></para>
+
+<para><warning><para>This setting has no effect in platforms or distributions 
without
+<citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum>
+</citerefentry>.</para></warning></para>
+</description>
+
+<value type="default">no</value>
+</samba:parameter>
diff --git a/python/samba/tests/varlink/base.py 
b/python/samba/tests/varlink/base.py
new file mode 100644
index 00000000000..3e313ec3fdc
--- /dev/null
+++ b/python/samba/tests/varlink/base.py
@@ -0,0 +1,89 @@
+# Unix SMB/CIFS implementation.
+#
+# Copyright (C) Samuel Cabrero <scabr...@samba.org> 2023
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+""" Winbind varlink service tests, base class """
+
+from samba.tests.samba_tool.base import SambaToolCmdTest
+from samba.auth import system_session
+from samba.samdb import SamDB
+from samba.credentials import Credentials
+import os, pwd, grp
+import varlink
+import samba
+import subprocess
+
+class VarlinkTestCase(SambaToolCmdTest):
+
+    def setUp(self):
+        super().setUp()
+        sdir = samba.tests.env_get_var_value("SELFTEST_WINBINDD_SOCKET_DIR")
+        uri = "unix:" + os.path.join(sdir, "org.samba.selftest")
+        self.cli = varlink.Client.new_with_address(uri)
+        self.assertIsNotNone(self.cli)
+
+        self.lp = samba.tests.env_loadparm()
+        self.domain = samba.tests.env_get_var_value("DOMAIN")
+        self.winbind_separator = self.lp.get('winbind separator')
+        self.varlink_service = self.lp.get('winbind varlink : service name')
+
+        self.bindir = os.path.normpath(os.getenv("BINDIR", "./bin"))
+        self.netcmd = os.path.join(self.bindir, "net")
+
+        self.ldb = SamDB(
+            session_info=system_session(),
+            credentials=Credentials(),
+            lp=self.lp)
+
+        self.users = []
+        self.groups = []
+        members = []
+        for i in range(0, 3):
+            username = "vl_test_user_%d" % i
+            groupname = "vl_test_group_%d" % i
+
+            subprocess.Popen([self.netcmd, "cache", "del", "NAME2SID/%s\\%s"
+                              % (self.domain, username.upper())], 
stdout=subprocess.PIPE)
+            self.runsubcmd("user", "create", username, self.random_password())
+
+            subprocess.Popen([self.netcmd, "cache", "del", "NAME2SID/%s\\%s"
+                              % (self.domain, groupname.upper())], 
stdout=subprocess.PIPE)
+            self.runsubcmd("group", "create", groupname)
+
+            members.append(username)
+            for m in members:
+                self.runsubcmd("group", "addmembers", groupname, m)
+
+            grent = grp.getgrnam(groupname)
+            self.groups.append({"groupname": groupname,
+                                "gid": grent.gr_gid,
+                                "members": members.copy()})
+
+            pwent = pwd.getpwnam(username)
+            self.users.append({"username": username,
+                   "uid": pwent.pw_uid,
+                   "gid": pwent.pw_gid,
+                   "shell": pwent.pw_shell,
+                   "dir": pwent.pw_dir})
+
+    def tearDown(self):
+        for group in self.groups:
+            self.runsubcmd("group", "delete", group["groupname"])
+
+        for user in self.users:
+            self.runsubcmd("user", "delete", user["username"])
+
+        super().tearDown()
diff --git a/python/samba/tests/varlink/getgrouprecord.py 
b/python/samba/tests/varlink/getgrouprecord.py
new file mode 100644
index 00000000000..127464b2902
--- /dev/null
+++ b/python/samba/tests/varlink/getgrouprecord.py
@@ -0,0 +1,61 @@
+# Unix SMB/CIFS implementation.
+#
+# Copyright (C) Samuel Cabrero <scabr...@samba.org> 2024
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+""" Winbind varlink service tests """
+
+import sys
+import os
+
+sys.path.insert(0, "bin/python")
+os.environ["PYTHONUNBUFFERED"] = "1"
+
+from samba.tests.varlink.base import VarlinkTestCase
+
+
+class VarlinkGetUserRecordTests(VarlinkTestCase):
+    def setUp(self):
+        super().setUp()
+
+    def tearDown(self):
+        super().tearDown()
+
+    def testGetGroupRecord(self):
+        for group in self.groups:
+            with self.cli.open("io.systemd.UserDatabase", namespaced=True) as 
conn:
+                full_groupname = "%s%s%s" % (self.domain,
+                                             self.winbind_separator,
+                                             group["groupname"])
+                full_members_names = []
+                for m in group["members"]:
+                    full_members_names.append("%s%s%s" % (self.domain,
+                                              self.winbind_separator,
+                                              m))
+                r = conn.GetGroupRecord(service=self.varlink_service,
+                                        groupName=full_groupname)
+                self.assertIsNotNone(r)
+                self.assertFalse(r.incomplete)
+                self.assertIsNotNone(r.record)
+                self.assertEqual(r.record["service"], self.varlink_service)
+                self.assertEqual(r.record["groupName"], full_groupname)
+                self.assertEqual(r.record["gid"], group["gid"])
+                self.assertEqual(sorted(r.record["members"]),
+                                 sorted(full_members_names))
+
+
+if __name__ == "__main__":
+    import unittest
+    unittest.main()
diff --git a/python/samba/tests/varlink/getmemberships.py 
b/python/samba/tests/varlink/getmemberships.py
new file mode 100644
index 00000000000..0308ccce368
--- /dev/null
+++ b/python/samba/tests/varlink/getmemberships.py
@@ -0,0 +1,89 @@
+# Unix SMB/CIFS implementation.
+#
+# Copyright (C) Samuel Cabrero <scabr...@samba.org> 2024
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+""" Winbind varlink service tests """
+
+import sys
+import os
+import pwd
+import grp
+
+sys.path.insert(0, "bin/python")
+os.environ["PYTHONUNBUFFERED"] = "1"
+
+from samba.tests.varlink.base import VarlinkTestCase
+
+
+class VarlinkGetMembershipsTests(VarlinkTestCase):
+    def setUp(self):
+        super().setUp()
+
+    def tearDown(self):
+        super().tearDown()
+
+    def testGetMembershipsByGroup(self):
+        for group in self.groups:
+            full_name = "%s%s%s" % (self.domain,
+                                    self.winbind_separator,
+                                    group["groupname"])
+            full_members_names = []
+            for m in group["members"]:
+                full_members_names.append("%s%s%s" % (self.domain,
+                                          self.winbind_separator,
+                                          m))
+            vl_members = []
+            with self.cli.open("io.systemd.UserDatabase", namespaced=True) as 
conn:
+                for r in conn.GetMemberships(service=self.varlink_service,
+                                             groupName=full_name,
+                                             _more=True):
+                    self.assertIsNotNone(r)
+                    vl_members.append(r.userName)
+            self.assertEqual(sorted(vl_members),
+                             sorted(full_members_names))
+
+    def testGetMembershipsByUser(self):
+        for user in self.users:
+            full_username = "%s%s%s" % (self.domain,
+                                        self.winbind_separator,
+                                        user["username"])
+            pwent = pwd.getpwnam(full_username)
+            glgid = os.getgrouplist(pwent.pw_name, pwent.pw_gid)
+            nss_list = []
+            for gid in glgid:
+                grent = grp.getgrgid(gid)
+                # nss_wrapper looks into files first, and "ADDOMAIN/domain 
users" is
+                # mapped to "users" from files NSS group db.
+                gname = grent.gr_name
+                if gname == "users":
+                    gname = "%s%s%s" % (self.domain,
+                                        self.winbind_separator,
+                                        "domain users")
+                nss_list.append(gname)
+
+            vl_list = []
+            with self.cli.open("io.systemd.UserDatabase", namespaced=True) as 
conn:
+                for r in conn.GetMemberships(service=self.varlink_service,
+                                             userName=full_username,
+                                             _more=True):
+                    self.assertIsNotNone(r)
+                    vl_list.append(r.groupName)
+
+            self.assertEqual(sorted(nss_list), sorted(vl_list))
+
+if __name__ == "__main__":
+    import unittest
+    unittest.main()
diff --git a/python/samba/tests/varlink/getuserrecord.py 
b/python/samba/tests/varlink/getuserrecord.py
new file mode 100644
index 00000000000..81ec8480da6
--- /dev/null
+++ b/python/samba/tests/varlink/getuserrecord.py
@@ -0,0 +1,59 @@
+# Unix SMB/CIFS implementation.
+#
+# Copyright (C) Samuel Cabrero <scabr...@samba.org> 2023
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+""" Winbind varlink service tests """
+
+import sys
+import os
+
+sys.path.insert(0, "bin/python")
+os.environ["PYTHONUNBUFFERED"] = "1"
+
+from samba.tests.varlink.base import VarlinkTestCase
+
+
+class VarlinkGetUserRecordTests(VarlinkTestCase):
+    def setUp(self):
+        super().setUp()
+
+    def tearDown(self):
+        super().tearDown()
+
+    def testGetUserRecord(self):
+        for user in self.users:
+            with self.cli.open("io.systemd.UserDatabase", namespaced=True) as 
conn:
+                full_username = "%s%s%s" % (self.domain,
+                                            self.winbind_separator,
+                                            user["username"])
+                r = conn.GetUserRecord(service=self.varlink_service,
+                                        userName=full_username)
+                self.assertIsNotNone(r)
+                self.assertFalse(r.incomplete)
+                self.assertIsNotNone(r.record)
+                self.assertEqual(r.record["service"], self.varlink_service)
+                self.assertEqual(r.record["userName"], full_username)
+                self.assertEqual(r.record["uid"], user["uid"])
+                self.assertEqual(r.record["gid"], user["gid"])
+                self.assertEqual(r.record["shell"], user["shell"])
+                self.assertEqual(r.record["homeDirectory"], user["dir"])
+                self.assertEqual(r.record["disposition"], "regular")
+
+


-- 
Samba Shared Repository


Reply via email to