summaryrefslogtreecommitdiff
path: root/source3/winbindd/winbindd_ads.c
AgeCommit message (Collapse)AuthorFilesLines
2023-11-21winbind: Fix Coverity ID 1398910Volker Lendecke1-0/+2
Coverity isn't smart enough for talloc Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2023-07-19s3:winbindd: Fix code spellingAndreas Schneider1-2/+2
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/+26
backends Signed-off-by: Pavel Filipenský <pfilipensky@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2023-02-08ldap: Cut down on string substitutionJoseph Sutton1-5/+6
Constant strings can be inserted directly into format strings, reducing the amount of string substitution to be performed. Signed-off-by: Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2023-02-06s3:winbind: Remove unused variableAndreas Schneider1-5/+0
source3/winbindd/winbindd_ads.c:1399:6: error: variable 'ret_count' set but not used [-Werror,-Wunused-but-set-variable] int ret_count; ^ Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-12-16s3-librpc: add ads.idl and convert ads_struct to talloc.Günther Deschner1-2/+2
Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-06-27s3:libads: Allocate ads->auth.password under ADS_STRUCT talloc contextSamuel Cabrero1-2/+6
Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-06-27s3:libads: Allocate ads->auth.realm under ADS_STRUCT talloc contextSamuel Cabrero1-3/+3
Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-06-27s3:libads: Allocate ADS_STRUCT under a talloc contextSamuel Cabrero1-12/+4
The ads_destroy() function is now static and only called from the ADS_STRUCT destructor. Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-06-27s3:winbind: Create a temporary talloc context for ↵Samuel Cabrero1-4/+9
ads_cached_connection_connect() Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-06-27s3:winbind: Pass a memory context to ads_cached_connection_connect()Samuel Cabrero1-8/+12
The ads struct will be allocated under this context. Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-06-27s3:winbind: Allocate a temporary memory context for ads_cached_connection()Samuel Cabrero1-9/+18
Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-06-27s3:winbind: Allocate a temporary talloc context for ↵Samuel Cabrero1-6/+14
ads_idmap_cached_connection() Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-06-27s3:winbind: Init pointers to NULL and use new debug macrosSamuel Cabrero1-8/+9
Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-06-27s3:winbind: Return ADS_STATUS from ads_cached_connection()Samuel Cabrero1-29/+26
Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-06-27s3:winbind: Pass a memory context to ads_idmap_cached_connection()Samuel Cabrero1-1/+3
Prepare to allocate ADS_STRUCT under a talloc context. Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-06-27s3:winbind: Fix a memory leak in ads_cached_connection()Samuel Cabrero1-1/+3
The trust password was leaked. Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-06-27s3:winbind: Fix a memory leak in ads_idmap_cached_connection()Samuel Cabrero1-4/+9
The trust password was leaked. Signed-off-by: Samuel Cabrero <scabrero@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2022-04-13s3:winbind: Do not use domain's private data to store the ADS_STRUCTSamuel Cabrero1-5/+5
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-01-21s3:winbindd: Do not set ADS_AUTH_ALLOW_NTLMSSP in FIPS modePavel Filipenský1-1/+18
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14955 Pair-Programmed-With: Andreas Schneider <asn@samba.org> Signed-off-by: Pavel Filipenský <pfilipen@redhat.com> Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2022-01-21s3:winbindd: Remove trailing spaces from winbindd_ads.cPavel Filipenský1-19/+19
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14955 Signed-off-by: Pavel Filipenský <pfilipen@redhat.com> Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
2021-04-29winbindd: remove obsolete sequence_number from struct winbindd_methodsRalph Boehme1-1/+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
2021-04-29s3:winbindd: Remove obsolete sequence_number callback from ads backendAndreas Schneider1-49/+1
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2020-09-14winbind: Fix a memleakLaurent Menase1-0/+1
Bug: https://bugzilla.samba.org/show_bug.cgi?id=14388 Signed-off-by: Laurent Menase <laurent.menase@hpe.com> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: Noel Power <noel.power@suse.com> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Mon Sep 14 13:33:13 UTC 2020 on sn-devel-184
2019-10-09s3:libnet: Require sealed LDAP SASL connections for joiningAndreas Schneider1-1/+4
Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Alexander Bokovoy <ab@samba.org>
2019-09-20s3-winbindd: fix forest trusts with additional trust attributes.Günther Deschner1-1/+1
BUG: https://bugzilla.samba.org/show_bug.cgi?id=14130 Guenther Signed-off-by: Guenther Deschner <gd@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2019-04-18winbind: Return queried domain name from name_to_sidChristof Schmitt1-1/+2
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>
2019-02-27winbind: Align integer typesVolker Lendecke1-3/+3
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2018-12-20winbindd: Use dom_sid_str_bufVolker Lendecke1-9/+17
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
2018-12-07winbindd: Use dom_sid_str_bufVolker Lendecke1-3/+3
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2018-11-01s3: winbind: Remove fstring from wb_acct_info structSamuel Cabrero1-4/+4
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-11libsmb: Give namequery.c its own headerVolker Lendecke1-0/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2018-02-23winbind: make sure we don't contact trusted domains via LDAP as AD DCStefan Metzmacher1-0/+23
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13278 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2017-05-17winbindd: Give winbindd_ads.c its own headerVolker Lendecke1-0/+1
Not necessary to compile all of winbind when playing with ads.h Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2017-03-06Revert "winbind: Remove "lookup_usergroups" winbind method"Volker Lendecke1-0/+377
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-03-02s3:winbindd: fix endless forest trust scanStefan Metzmacher1-0/+8
Commit 0392ebcd1d48e9f472f2148b85316a77d9cc953b effectively disabled the enumeration of trusts in other forests. The fixes for https://bugzilla.samba.org/show_bug.cgi?id=11691 changed the way we fill domain->domain_flags for domains in other forests. Commit fffefe72fcc62d9688b45f53a5327667dc0b2fe6 readded the ability to enumerate trusts of other forests again, in order to fix https://bugzilla.samba.org/show_bug.cgi?id=11830 Now we have the problem that multiple domains (even outside of our forest) are considert to be our forest root, as they have the following flags: NETR_TRUST_FLAG_TREEROOT and NETR_TRUST_FLAG_IN_FOREST. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12605 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org> Autobuild-User(master): Ralph Böhme <slow@samba.org> Autobuild-Date(master): Thu Mar 2 17:53:14 CET 2017 on sn-devel-144
2017-02-24s3:winbindd: allow a fallback to NTLMSSP for LDAP connectionsStefan Metzmacher1-0/+2
This matches the behaviour of pdb_get_trust_credentials() for our machine account and allows us to fallback to NTLMSSP when contacting trusted domains. BUG: https://bugzilla.samba.org/show_bug.cgi?id=12598 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Ralph Boehme <slow@samba.org>
2017-01-13winbind: Fix CID 1398534 Dereference before null checkJeremy Allison1-4/+4
Make all query_user_list backends consistent. Signed-off-by: Jeremy Allison <jra@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org> Autobuild-Date(master): Fri Jan 13 13:33:37 CET 2017 on sn-devel-144
2017-01-11winbind: Fix CID 1398530 Resource leakVolker Lendecke1-2/+3
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2017-01-04winbind: Simplify query_user_list to only return ridsVolker Lendecke1-50/+20
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-377/+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-166/+0
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Uri Simchoni <uri@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2016-12-04winbind: lookup_usergroups_cached doesn't use the "domain" parameterVolker Lendecke1-1/+1
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org>
2016-12-02lib: Add samlogon_cache.hVolker Lendecke1-0/+1
Move prototypes into its own header file Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
2016-06-02winbindd: prevent log spam when enumerating usersRalph Boehme1-3/+8
When enumerating users we try to fetch sAMAccountType attribute which might not be present for whatever reason. Signed-off-by: Ralph Boehme <slow@samba.org> Reviewed-by: Uri Simchoni <uri@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Uri Simchoni <uri@samba.org> Autobuild-Date(master): Thu Jun 2 09:04:13 CEST 2016 on sn-devel-144
2016-01-13winbindd: Remove double retry from some ADS methodsChristof Schmitt1-14/+12
The retry through the new reconnect_ads layer is enough. This structure also makes the distinction between retry layer and actual methods call a bit clearer. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11670 Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
2015-11-06Fix various spelling errorsMathieu Parent1-1/+1
Reviewed-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Andrew Bartlett <abartlet@samba.org> Autobuild-Date(master): Fri Nov 6 13:43:45 CET 2015 on sn-devel-104
2015-06-05winbind: Lookup groupmem via primaryGroupIDVolker Lendecke1-0/+98
Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: "Stefan (metze) Metzmacher" <metze@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Fri Jun 5 17:21:04 CEST 2015 on sn-devel-104
2015-05-06Last lot of convert uint32 to uint32_t in winbindd, I promise.Richard Sharpe1-2/+2
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>