summaryrefslogtreecommitdiffstats
path: root/source3/winbindd/winbindd_cache.c
Commit message (Collapse)AuthorAgeFilesLines
* librpc/idl: Merge wbint.idl with winbind.idl so we can forward IRPC requests ↵Andrew Bartlett2014-06-111-1/+1
| | | | | | | | to internal winbind calls Change-Id: Iba3913d5a1c7f851b93f37e9beb6dbb20fbf7e55 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* winbindd: Call set_dc_type_and_flags on the internal domainAndrew Bartlett2014-06-111-2/+4
| | | | | | | | | | | | | | | | | | This allows the AD DC to be picked up correctly and gives the correct DNS name. To ensure no confusion, we also always init it with the full DNS name. It also means that, aside from the BUILTIN domain the initialized flag is set only in one place, which will help when we add more details to the domain structure in the future. This in turn allows kerberos authentication against winbindd on the AD DC. Andrew Bartlett Change-Id: Idc829cfe5f2e867c87107b49275b17f294821dcd Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org>
* lib-util: rename memdup to smb_memdup and fix all callersBjörn Baumbach2014-04-161-1/+1
| | | | | Signed-off-by: Björn Baumbach <bb@sernet.de> Reviewed-by: Volker Lendecke <vl@samba.org>
* s3:winbindd fix use of uninitialized variablesChristian Ambach2013-12-101-0/+13
| | | | | | | Bug: https://bugzilla.samba.org/show_bug.cgi?id=10280 Signed-off-by: Christian Ambach <ambi@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* winbind: Make centry_start staticChristof Schmitt2013-11-151-1/+2
| | | | | | | | | | centry_start is only used in winbindd_cache.c Signed-off-by: Christof Schmitt <cs@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Autobuild-User(master): Christof Schmitt <cs@samba.org> Autobuild-Date(master): Fri Nov 15 18:05:41 CET 2013 on sn-devel-104
* s3-winbindd: Fix #10264, cache_traverse_validate_fn failure for NDR cache ↵Günther Deschner2013-11-131-1/+2
| | | | | | | | | | | | | | | | entries. We need to increase the keysize limit for NDR queries. A wbint_LookupSids query for just 20 sids already hits the older limit. Guenther https://bugzilla.samba.org/show_bug.cgi?id=10264 Signed-off-by: Günther Deschner <gd@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Wed Nov 13 19:33:46 CET 2013 on sn-devel-104
* winbind3: Fix CID 241468 Resource leakVolker Lendecke2013-10-211-0/+1
| | | | | | | We were leaking centry in this error case Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Jeremy Allison <jra@samba.org>
* winbind: Fix bug 9854 -- NULL pointer dereferenceVolker Lendecke2013-05-071-3/+3
| | | | | | | | Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Michael Adam <obnox@samba.org> Autobuild-User(master): Michael Adam <obnox@samba.org> Autobuild-Date(master): Tue May 7 14:49:07 CEST 2013 on sn-devel-104
* BUG 9766: Cache name_to_sid/sid_to_name correctly.Andreas Schneider2013-04-091-0/+21
| | | | | | | | | | | | | If there is no domain_name specified we still need to set to for caching else we will not find the entry later if we lookup the entry with the domain_name. Reviewed-by: Guenther Deschner <gd@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Signed-off-by: Andreas Schneider <asn@samba.org> Autobuild-User(master): Günther Deschner <gd@samba.org> Autobuild-Date(master): Tue Apr 9 16:32:44 CEST 2013 on sn-devel-104
* winbind: Correctly use names in the domain struct.Andreas Schneider2013-03-051-4/+15
| | | | Reviewed-by: David Disseldorp <ddiss@samba.org>
* winbind: Use talloc for allocating domain, dns, forest and dc name.Andreas Schneider2013-03-051-3/+8
| | | | Reviewed-by: David Disseldorp <ddiss@samba.org>
* winbind: Don't leak centry memory.Andreas Schneider2013-02-221-0/+1
| | | | Reviewed-by: Alexander Bokovoy <ab@samba.org>
* winbind: Make domain_name const in wcache_ndr_key().Andreas Schneider2013-02-221-1/+1
| | | | Reviewed-by: Alexander Bokovoy <ab@samba.org>
* winbind: Fix some missing NULL checksVolker Lendecke2013-01-111-24/+29
| | | | | | | Reviewed-by: Stefan Metzmacher <metze@samba.org> Autobuild-User(master): Stefan Metzmacher <metze@samba.org> Autobuild-Date(master): Fri Jan 11 18:55:41 CET 2013 on sn-devel-104
* winbind: Fix error check in unpack_tdc_domainsVolker Lendecke2013-01-111-2/+5
| | | | Reviewed-by: Stefan Metzmacher <metze@samba.org>
* winbind: Use talloc in resolve_username_to_alias().Andreas Schneider2012-12-121-3/+5
| | | | | | | Found by Coverity. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* winbind: Use talloc in resolve_alias_to_username().Andreas Schneider2012-12-121-3/+5
| | | | | | | Found by Coverity. Signed-off-by: Andreas Schneider <asn@samba.org> Reviewed-by: Günther Deschner <gd@samba.org>
* s3: Do not free a string where we should notVolker Lendecke2012-11-261-1/+1
| | | | | | | Reviewed by: Jeremy Allison <jra@samba.org> Autobuild-User(master): Jeremy Allison <jra@samba.org> Autobuild-Date(master): Mon Nov 26 22:03:05 CET 2012 on sn-devel-104
* s3: Do not free a string where we should notVolker Lendecke2012-11-261-1/+1
| | | | Reviewed by: Jeremy Allison <jra@samba.org>
* Revert "s3-winbindd: make sure we obey the -n switch also for samlogon cache ↵David Disseldorp2012-11-091-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | access." This reverts commit ae6a779bf9f816680e724ede37324b7f5355996b. Bug 9125 analysis from Volker: The problem is that there are no network calls possible at all that would do what the samlogon cache does for us. There is just no way to retrieve the group membership in a complex trusted environment. If you have just a single domain with Samba as domain controller it might be possible, but even within a single domain it is not possible to correctly retrieve all group memberships using LDAP calls due to ACLs on directory objects. The call to get that is called NetSamLogon on the NETLOGON pipe. But this call requires user credentials and might trigger updating counts on the server. So to correctly implement wbinfo -r after a user has logged in, you have two alternatives: Save the info3 struct or the PAC in the netsamlogon cache. If you insist on doing network calls, you need to cache the user credentials somewhere to re-do the NetSamLogon call every time the wbinfo -r is requested. Reviewed-by: Andreas Schneider <asn@samba.org>
* s3:winbindd:cache: fix offline logons with cached credentials (bug #9321)Michael Adam2012-11-011-0/+7
| | | | | | | | | | | | | The removal of consumption of the time field from the centry as "removal of unused variable" in 21528da9cd12a4f5c3792a482a5d18fe946a6f7a had the side effect of changing the offset for reading the following nt password hash, so the read password hash was wrong. This patch re-installs the consumption of the time, thereby fixing the bug without changing the disk format of the cache. Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Stefan Metzmacher <metze@samba.org>
* Correctly check for errors in strlower_m() returns.Jeremy Allison2012-08-091-1/+1
|
* Check error returns from strupper_m() (in all reasonable places).Jeremy Allison2012-08-091-6/+14
|
* s3: rename sid_check_is_domain() to sid_check_is_our_sam()Michael Adam2012-07-121-2/+2
| | | | | | This does not check whether the given sid is the domain sid, but whether it is the sid of the local sam, which is different for a domain member server.
* Fix a bunch of "unused variable" warnings.Jeremy Allison2012-02-181-3/+0
| | | | | Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Sat Feb 18 06:22:40 CET 2012 on sn-devel-104
* s3: Fix some False/NULL hickupsVolker Lendecke2011-12-201-2/+2
| | | | | Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Tue Dec 20 13:13:17 CET 2011 on sn-devel-104
* s3-winbind: Add an update function for winbind cache.Andreas Schneider2011-12-031-2/+94
| | | | | | | | | | With 57b3d32 we changed the format for the winbind cache database and the code deleted the database for the upgrade. As this database holds also cached credentials, removing it is not an option. We need to update from version 1 to version 2. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Sat Dec 3 03:47:58 CET 2011 on sn-devel-104
* s3-winbind: Remove unused keys from list.Andreas Schneider2011-12-021-2/+0
| | | | | | | | DR and DE have been removed with 0834574fdd6b469797b3b6a4edd45f321b9b9971. Autobuild-User: Andreas Schneider <asn@cryptomilk.org> Autobuild-Date: Fri Dec 2 19:02:45 CET 2011 on sn-devel-104
* Fix bug #8521 - winbindd cache timeout expiry test was reversedJeremy Allison2011-10-121-1/+1
| | | | Found and fix reported by Micha Lenk <micha@lenk.info>. Thanks !
* Finish commit 8745c70d by Michael Adam.Jeremy Allison2011-09-151-5/+5
| | | | | | | | | If you're going to move winbindd_cache.tdb to the state_path, do it *everywhere*. Found by Ira Cooper <ira@wakeful.net>. Autobuild-User: Jeremy Allison <jra@samba.org> Autobuild-Date: Thu Sep 15 00:43:04 CEST 2011 on sn-devel-104
* s3: Fix a debug messageVolker Lendecke2011-09-081-2/+2
| | | | | Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Thu Sep 8 15:08:43 CEST 2011 on sn-devel-104
* s3:winbind: put winbindd_cache into the state dir, not the cache dirMichael Adam2011-09-071-1/+1
| | | | | | | | Despite the name, in winbind offline logon mode, this is a database that contains valuable information and should not be cleared. Autobuild-User: Michael Adam <obnox@samba.org> Autobuild-Date: Wed Sep 7 21:17:37 CEST 2011 on sn-devel-104
* Replace calls to sid_equal with calls to dom_sid_equalVolker Lendecke2011-08-171-1/+1
|
* tdb_compat: Higher level API fixes.Rusty Russell2011-06-201-1/+1
| | | | | | | | | | | | My previous patches fixed up all direct TDB callers, but there are a few utility functions and the db_context functions which are still using the old -1 / 0 return codes. It's clearer to fix up all the callers of these too, so everywhere is consistent: non-zero means an error. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* tdb_compat: use tdb_errorstr_compat()Rusty Russell2011-06-201-2/+2
| | | | | | | | Since TDB2 functions return the error directly, tdb_errorstr() taken an error code, not the tdb as it does in TDB1. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* tdb_traverse/tdb_traverse_read: check returns for negative, not -1.Rusty Russell2011-06-201-1/+1
| | | | | | | | | | | TDB2 returns a negative error number on failure. This is compatible if we always check for < 0 instead of == -1. Also, there's no tdb_traverse_read in TDB2: we don't try to make traverse reliable any more, so there are no write locks anyway. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* tdb_delete: check returns for 0, not -1.Rusty Russell2011-06-201-1/+1
| | | | | | | | TDB2 returns a negative error number on failure. This is compatible if we always check for != 0 instead of == -1. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* tdb_fetch_compat: use instead of tdb_fetch.Rusty Russell2011-06-201-5/+5
| | | | | | | This is a noop for tdb1. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
* s3-talloc Change TALLOC_ZERO_ARRAY() to talloc_zero_array()Andrew Bartlett2011-06-091-1/+1
| | | | | Using the standard macro makes it easier to move code into common, as TALLOC_ZERO_ARRAY isn't standard talloc.
* s3-talloc Change TALLOC_P() to talloc()Andrew Bartlett2011-06-091-2/+2
| | | | | Using the standard macro makes it easier to move code into common, as TALLOC_P isn't standard talloc.
* s3-talloc Change TALLOC_ARRAY() to talloc_array()Andrew Bartlett2011-06-091-9/+9
| | | | | Using the standard macro makes it easier to move code into common, as TALLOC_ARRAY isn't standard talloc.
* s3-talloc Change TALLOC_REALLOC_ARRAY() to talloc_realloc()Andrew Bartlett2011-06-091-1/+1
| | | | | | | Using the standard macro makes it easier to move code into common, as TALLOC_REALLOC_ARRAY isn't standard talloc. Andrew Bartlett
* s3-winbindd: make sure we obey the -n switch also for samlogon cache access.Günther Deschner2011-06-081-0/+4
| | | | | | | Guenther Autobuild-User: Günther Deschner <gd@samba.org> Autobuild-Date: Wed Jun 8 14:44:31 CEST 2011 on sn-devel-104
* s3: only include tdb headers where needed.Günther Deschner2011-05-061-0/+1
| | | | Guenther
* More simple const fixups.Jeremy Allison2011-05-051-2/+2
|
* s3: Fix Coverity ID 1137: CONSTANT_EXPRESSION_RESULTVolker Lendecke2011-04-011-2/+2
| | | | | Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Fri Apr 1 09:35:19 CEST 2011 on sn-devel-104
* s3-passdb: use passdb headers where needed.Günther Deschner2011-03-301-0/+1
| | | | Guenther
* s3-winbindd: copy acct_info to wb_acct_info so we dont need passdb for it.Günther Deschner2011-03-301-4/+4
| | | | Guenther
* s3-includes: only include system/filesys.h when needed.Günther Deschner2011-03-301-0/+1
| | | | Guenther
* s3: Remove unused args from nss_get_info_cachedVolker Lendecke2011-03-061-1/+0
|