summaryrefslogtreecommitdiff
path: root/source3/winbindd/winbindd.h
AgeCommit message (Collapse)AuthorFilesLines
2025-02-22winbindd: remember ForestTrustInformation in routing_domain->ftiStefan Metzmacher1-0/+2
This will be used for sid/name filtering in the following commits. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-08winbindd: use struct winbindd_domain_ref in struct getgrent_stateStefan Metzmacher1-1/+1
In the next commits it will be possible that struct winbindd_domain instances become stale because trusted domains were reloaded. That means aync state structure should not use pointers to 'struct winbindd_domain' as they can become stale! Instead they should use 'struct winbindd_domain_ref domain' in the async state and use winbindd_domain_ref_set/get() to manage the 'struct winbindd_domain' pointer. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-08winbindd: use struct winbindd_domain_ref in struct getpwent_stateStefan Metzmacher1-1/+1
In the next commits it will be possible that struct winbindd_domain instances become stale because trusted domains were reloaded. That means aync state structure should not use pointers to 'struct winbindd_domain' as they can become stale! Instead they should use 'struct winbindd_domain_ref domain' in the async state and use winbindd_domain_ref_set/get() to manage the 'struct winbindd_domain' pointer. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-08winbindd: add struct winbindd_domain_ref infrastructureStefan Metzmacher1-2/+29
In the next commits it will be possible that struct winbindd_domain instances become stale because trusted domains were reloaded. That means aync state structure should not use pointers to 'struct winbindd_domain' as they can become stale! Instead they should use 'struct winbindd_domain_ref domain' in the async state and use winbindd_domain_ref_set/get() to manage the 'struct winbindd_domain' pointer. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2025-02-08winbindd: winbindd_child->domain is a talloc grant parent if validStefan Metzmacher1-1/+1
This comment makes it easier to spot if we still have 'struct winbindd_domain' pointers in state structures, which should be replaced by struct winbindd_domain_ref, in order to handle stale domains after reloading trusts. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2024-10-01s3:winbindd: it's 2024 and all AD domains should be native nowStefan Metzmacher1-1/+0
No need to use dssetup_DsRoleGetPrimaryDomainInformation that only adds latency... Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2023-07-19s3:winbindd: Fix code spellingAndreas Schneider1-1/+1
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Joseph Sutton <josephsutton@catalyst.net.nz>
2023-06-13s3:winbind: Add lookup_aliasmem to winbindd_methods and implement it in all ↵Pavel Filipenský1-0/+8
backends Signed-off-by: Pavel Filipenský <pfilipensky@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2022-12-21winbindd: Add force_dc to bypass cached connection and DC lookupRalph Boehme1-0/+1
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-11-04s3:winbind: Avoid unnecessary locking in wb_parent_idmap_setup_send()Pavel Filipenský1-0/+1
A function in tevent environment can span over several context loop iterations. Every iteration 'unschedules' the current code and a different functions can access not yet fully initialized structures. A locking is used to avoid this. In tevent, we use tevent queues as a locking mechanism. Every function trying to access lock protected data, puts itself to a queue. The function must remove itself from the queue only after the complete work is done. A good coding practise is to lock only the smallest code path and not to use the locking if not needed. wb_parent_idmap_setup_send() uses queue "wb_parent_idmap_config_queue" for: - testing if the setup is ready - setting up all idmap domains But "testing if the setup is ready" can be coded as an atomic operation without needing a lock. Signed-off-by: Pavel Filipenský <pfilipen@redhat.com> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Fri Nov 4 10:06:28 UTC 2022 on sn-devel-184
2022-07-15s3:winbind: Change max_groups, num_groups from int to uint32_t in getpwent_statePavel Filipenský1-2/+2
Signed-off-by: Pavel Filipenský <pfilipen@redhat.com> Reviewed-by: Andreas Schneider <asn@samba.org>
2022-07-15s3:winbind: Fix trailing whitespace in winbindd.hPavel Filipenský1-1/+1
Signed-off-by: Pavel Filipenský <pfilipen@redhat.com> Reviewed-by: Andreas Schneider <asn@samba.org>
2022-05-19s3:winbind: Remove struct winbindd_child_dispatch_tableSamuel Cabrero1-9/+0
All parent-child communication is based in NDR and dispatched as a local RPC call. Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Thu May 19 18:50:24 UTC 2022 on sn-devel-184
2022-04-13s3:winbind: Remove no longer used domain's private_data pointerSamuel Cabrero1-4/+0
BUG: https://bugzilla.samba.org/show_bug.cgi?id=15046 Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2022-04-13s3:winbind: Do not use domain's private data to store the ADS_STRUCTSamuel Cabrero1-0/+2
The ADS_STRUCT is not allocated using talloc and there are many places casting this pointer directly so use a typed pointer. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15046 Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2022-04-13s3:winbind: Do not use domain's private data to store the SAMR pipesSamuel Cabrero1-0/+6
The domain's private_data pointer is also used to store a ADS_STRUCT, which is not allocated using talloc and there are many places casting this pointer directly. The recently added samba.tests.pam_winbind_setcred was randomly failing and after debugging it the problem was that kerberos authentication was failing because the time_offset passed to kerberos_return_pac() was wrong. This time_offset was retrieved from ads->auth.time_offset, where the ads pointer was directly casted from domain->private_data but private_data was pointing to a winbind_internal_pipes struct. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15046 Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2022-02-23s3:winbind: Store canonical principal and realm in ccache entrySamuel Cabrero1-0/+2
They will be used later to refresh the tickets. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14979 Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2021-07-14s3:winbind: Get rid of the winbind dc-connect childIsaac Boukris1-5/+2
The new code uses PING_DC to tell the child to try to go online. Pair-Programmed-With: Andreas Schneider <asn@samba.org> Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org> Signed-off-by: Isaac Boukris <iboukris@samba.org> Signed-off-by: Stefan Metzmacher <metze@samba.org>
2021-04-29winbindd: remove obsolete sequence_number from struct winbindd_methodsRalph Boehme1-3/+0
Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Thu Apr 29 15:49:16 UTC 2021 on sn-devel-184
2020-10-23winbindd: add generic wb_parent_idmap_setup_send/recv() helpersStefan Metzmacher1-0/+13
This is more or less a copy of wb_xids2sids_init_dom_maps_send/recv, but it's more generic and doesn't imply global state. It also closes a initialization race by using a tevent_queue to serialize the calls. In the next commits we'll replace wb_xids2sids_init_dom_maps_send/recv. We'll also use the new function in the wb_sids2xids code. BUG: https://bugzilla.samba.org/show_bug.cgi?id=14539 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2019-04-18winbind: Return queried domain name from name_to_sidChristof Schmitt1-0/+1
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13831 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org>
2018-11-12s3:winbindd: Also log the process name in winbinddAndreas Schneider1-0/+1
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2018-11-01s3: winbind: Remove fstring from wb_acct_info structSamuel Cabrero1-2/+2
The group enumeration backend functions try to allocate an array of wb_acct_info structs with a number of elements equal to the number of groups. In domains with a large number of groups this allocation may fail due to the size of the chunk. Found while trying to enumerate the groups in a domain with more than 700k groups. Signed-off-by: Samuel Cabrero <scabrero@suse.de> Reviewed-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-04-24winbind: Remove an unused struct declarationVolker Lendecke1-8/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Tue Apr 24 04:44:30 CEST 2018 on sn-devel-144
2018-03-01winbind: Fix a race between the sigchld and 0-sized socket readVolker Lendecke1-0/+1
Fix a bug when a child dies when a request is pending in the child. If the signal handler fires before epoll finds out the other end of the parent-child socket is closed, we close the socket on our side without taking care of the pending request. This causes two problems: First, that one pending request never is replied to properly, and secondly, we might end up with EPOLL_DEL on a wrong file descriptor. This causes all sorts of trouble if we hit an active one. The fix for this problem is not to close the socket in winbind_child_died(). This however stops an idle child that dies hard from being properly cleaned up. The fix for that is to add the child->monitor_fde that is set pending only when no child request is active. This way we can remove the close(sock) in the signal handler. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13309 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2018-03-01winbind: Remove the "winbindd_children" globalVolker Lendecke1-2/+0
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13309 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2018-02-23winbind: Use one queue for all domain childrenStefan Metzmacher1-0/+1
If we have multiple domain children, it's important that the first idle child takes over the next waiting request. Before we had the problem that a request could get stuck in the queue of a busy child, while later requests could get served fine by other children. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13292 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Fri Feb 23 09:04:23 CET 2018 on sn-devel-144
2018-02-23winbind: Maintain a binding handle per domain and always go via ↵Volker Lendecke1-0/+2
wb_domain_request_send() Pair-Programmed-With: Stefan Metzmacher <metze@samba.org> BUG: https://bugzilla.samba.org/show_bug.cgi?id=13292 Signed-off-by: Stefan Metzmacher <metze@samba.org> Signed-off-by: Volker Lendecke <vl@samba.org>
2018-02-10winbindd: remove const from set_routing_domain()Stefan Metzmacher1-1/+1
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13235 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2018-02-10winbindd: fix LSA connections via DCERPC_AUTH_SCHANNELStefan Metzmacher1-1/+0
Bug: https://bugzilla.samba.org/show_bug.cgi?id=13231 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2018-01-13winbindd: add set_routing_domain()Ralph Boehme1-0/+1
2018-01-13winbindd: remember the secure_channel_type in winbindd_domainStefan Metzmacher1-0/+1
This way we have an indication of non direct trusts with SEC_CHAN_NULL. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2017-09-30winbind: Remove the use of "talloc_dict"Volker Lendecke1-2/+0
As members we only collect names, indexed by sids. This is served well by just a simple dbwrap_rbt. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2017-08-30winbind: Rename winbindd_cm_conn->netlogon_creds to _ctxVolker Lendecke1-1/+1
We have too many variables called _creds :-) Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Wed Aug 30 22:44:45 CEST 2017 on sn-devel-144
2017-03-18s3:winbind: Remove unused struct getpwent_userAndreas Schneider1-11/+0
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Sat Mar 18 08:59:01 CET 2017 on sn-devel-144
2017-03-06Revert "winbind: Remove "lookup_usergroups" winbind method"Volker Lendecke1-0/+8
This reverts commit b231814c6b0ad17255139bc8934f269610348b2b. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12612 Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2017-01-04winbind: Simplify query_user_list to only return ridsVolker Lendecke1-2/+1
Unfortunately this is a pretty large patch, because many functions implement this API. The alternative would have been to create a new backend function, add the new one piece by piece and then remove the original function. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Uri Simchoni <uri@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2017-01-04winbind: Remove "lookup_usergroups" winbind methodVolker Lendecke1-8/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Uri Simchoni <uri@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2017-01-04winbind: Remove "query_user" backend functionVolker Lendecke1-6/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Uri Simchoni <uri@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2017-01-02winbind: Go throught wb_getpwsid for listing usersVolker Lendecke1-3/+2
This makes sure we get the same results for getpwnam and getpwent. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Uri Simchoni <uri@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2016-10-11winbindd: Remove now unused domain->methodsChristof Schmitt1-5/+4
Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2016-09-10winbindd: Remove unused enum ent_typeChristof Schmitt1-6/+0
Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Sat Sep 10 18:41:26 CEST 2016 on sn-devel-144
2015-08-24winbind: Remove "have_idmap_config" from winbindd_domainVolker Lendecke1-7/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Bug: https://bugzilla.samba.org/show_bug.cgi?id=11464 Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Mon Aug 24 19:19:31 CEST 2015 on sn-devel-104
2015-05-20s3:winbindd: make sure we remove pending io requests before closing client ↵Stefan Metzmacher1-0/+1
sockets This avoids a crash inside the tevent epoll backend. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11141 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Wed May 20 22:16:54 CEST 2015 on sn-devel-104
2015-05-06Last lot of convert uint32 to uint32_t in winbindd, I promise.Richard Sharpe1-1/+1
Signed-off-by: Richard Sharpe <rsharpe@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Wed May 6 07:03:27 CEST 2015 on sn-devel-104
2015-04-29Change all uint32/16/8 to 32_t/16_t/8_t in winbindd.Richard Sharpe1-19/+19
Signed-off-by: Richard Sharpe <rsharpe@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2014-07-11s3:winbindd: remove unused get[pw|gr]ent_initialized from winbindd_cli_stateStefan Metzmacher1-4/+0
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Fri Jul 11 18:46:09 CEST 2014 on sn-devel-104
2014-07-04winbindd: Use a remote RPC server when we are an RODC when neededAndrew Bartlett1-0/+1
This allows us to operate against the local cache where possible, but to forward some operations to the read-write DC. Andrew Bartlett Change-Id: Idc78ae379a402969381758919fcede17568f094e Pair-programmed-with: Garming Sam <garming@catalyst.net.nz> Signed-off-by: Andrew Bartlett <abartlet@samba.org> Signed-off-by: Garming Sam <garming@catalyst.net.nz> Reviewed-by: Nadezhda Ivanova <nivanova@samba.org>
2014-06-11librpc/idl: Merge wbint.idl with winbind.idl so we can forward IRPC requests ↵Andrew Bartlett1-1/+1
to internal winbind calls Change-Id: Iba3913d5a1c7f851b93f37e9beb6dbb20fbf7e55 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2014-01-07s3:winbindd: make use of rpccli_{create,setup}_netlogon_creds()Stefan Metzmacher1-0/+3
Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>