1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

50 Commits

Author SHA1 Message Date
Volker Lendecke
75d3b9ce08 s3: Fix some False/NULL hickups
Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Tue Dec 20 13:13:17 CET 2011 on sn-devel-104
2011-12-20 13:13:17 +01:00
Rusty Russell
6bc59d77b6 tdb_store: check returns for 0, not -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>
2011-06-20 11:18:35 +02:00
Andrew Bartlett
ad0a07c531 s3-talloc Change TALLOC_ZERO_P() to talloc_zero()
Using the standard macro makes it easier to move code into common, as
TALLOC_ZERO_P isn't standard talloc.
2011-06-09 12:40:08 +02:00
Andrew Bartlett
d5e6a47f06 s3-talloc Change TALLOC_P() to talloc()
Using the standard macro makes it easier to move code into common, as
TALLOC_P isn't standard talloc.
2011-06-09 12:40:08 +02:00
Rusty Russell
7deeacae2b gencache: don't use CLEAR_IF_FIRST as fallback.
CLEAR_IF_FIRST only works if *all* openers use that flag.

So just truncate the file: it's racy, but that's what we're doing anyway.

We'd really need a TDB_OPENCHECK_OR_CLEAR flag to do this properly (or in
TDB2, a open hook at the right point).

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
2011-04-19 12:06:05 +09:30
Günther Deschner
d8cfca3a9b s3: only include tdb headers where needed.
Guenther
2011-05-06 10:48:10 +02:00
Günther Deschner
0e771263ee s3-includes: only include system/filesys.h when needed.
Guenther
2011-03-30 01:13:07 +02:00
Volker Lendecke
e113b1c64f s3: netsamlogon_clear_cached_user only needs the SID 2010-12-19 23:25:06 +01:00
Volker Lendecke
ff5f767d0e s3: Remove two pointless slprintf calls 2010-12-19 23:25:06 +01:00
Andrew Bartlett
f768b32e37 libcli/security Provide a common, top level libcli/security/security.h
This will reduce the noise from merges of the rest of the
libcli/security code, without this commit changing what code
is actually used.

This includes (along with other security headers) dom_sid.h and
security_token.h

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Tue Oct 12 05:54:10 UTC 2010 on sn-devel-104
2010-10-12 05:54:10 +00:00
Jeremy Allison
f98d217514 Change to using TDB_INCOMPATIBLE_HASH (the jenkins hash) on all
TDB_CLEAR_IF_FIRST tdb's. For tdb's like gencache where we open
without CLEAR_IF_FIRST and then with CLEAR_IF_FIRST if corrupt
this is still safe to use as if opening an existing tdb the new
hash will be ignored - it's only used on creating a new tdb not
opening an old one.

Jeremy.
2010-09-27 17:18:54 -07:00
Andrew Bartlett
cba7f8b827 s3:dom_sid Global replace of DOM_SID with struct dom_sid
This matches the structure that new code is being written to,
and removes one more of the old-style named structures, and
the need to know that is is just an alias for struct dom_sid.

Andrew Bartlett

Signed-off-by: Günther Deschner <gd@samba.org>
2010-05-21 10:39:59 +02:00
Jelmer Vernooij
b8268cf7b0 s3: Remove use of iconv_convenience. 2010-05-18 11:45:31 +02:00
Volker Lendecke
3ea64e0ad8 s3: Replace most calls to sid_append_rid() by sid_compose() 2010-01-10 20:56:16 +01:00
Stefan Metzmacher
8f19c08072 s3: let netsamlogon_cache_init() use tdb_check()
If the check fails we try to unlink the old file and
start with an empty cache.

metze
2009-12-07 19:56:56 +01:00
Michael Adam
0cea990d75 s3: put netsamlogon_cache.tdb into cache_dir instead of lock_dir
Michael
2009-01-16 01:02:24 +01:00
Günther Deschner
4b59ecb903 s3-build: no need to duplicate generated ndr_ prototypes.
Guenther
2008-10-20 19:47:00 +02:00
Günther Deschner
c48186f507 s3: use samba4 prototype for ndr_push/pull_struct_blob.
Guenther
2008-09-23 09:37:23 +02:00
Ephi Dror
1d26beb708 Correct the netsamlogon_clear_cached_user function.
(This used to be commit bb13312d9d)
2008-08-27 17:28:34 -07:00
Günther Deschner
b437f09595 samlogoncache: Use data_blob_const in netsamlogon_cache_get.
Guenther
(This used to be commit f27a20f25c)
2008-04-21 10:25:28 +02:00
Volker Lendecke
e6a1027757 Fix a valgrind error
In winbind, we're using the info3 struct to send it to the winbind client after
netsamlogon_cache_store. Without this info3->base.account_name.string was
prematurely freed.
(This used to be commit aa4377561b)
2008-03-25 23:36:13 +01:00
Günther Deschner
bddceee09a Fix memleak in netsamlogon_cache_get().
Guenther
(This used to be commit b736c77dc6)
2008-02-28 23:15:11 +01:00
Günther Deschner
7269a504fd Add my copyright.
Guenther
(This used to be commit d078a87571)
2008-02-27 19:38:48 +01:00
Volker Lendecke
6548493de7 Fix a C++ warning
(This used to be commit ac027a9b2e)
2008-02-23 11:04:13 +01:00
Günther Deschner
8027b7c25d Use netr_SamInfo3 in samlogon cache and use ndr functions for storing the blob.
Guenther
(This used to be commit bf860ae1ac)
2008-02-17 02:11:59 +01:00
Volker Lendecke
2e07c2ade8 s/sid_to_string/sid_to_fstring/
least surprise for callers
(This used to be commit eb523ba776)
2007-12-15 22:47:30 +01:00
Volker Lendecke
14ef4cdec1 Replace sid_string_static with sid_to_string
This adds 28 fstrings on the stack, but I think an fstring on the stack is
still far better than a static one.
(This used to be commit c7c885078b)
2007-12-15 22:09:37 +01:00
Jeremy Allison
30191d1a57 RIP BOOL. Convert BOOL -> bool. I found a few interesting
bugs in various places whilst doing this (places that assumed
BOOL == int). I also need to fix the Samba4 pidl generation
(next checkin).
Jeremy.
(This used to be commit f35a266b3c)
2007-10-18 17:40:25 -07:00
Andrew Tridgell
5e54558c6d r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text
(This used to be commit b0132e94fc)
2007-10-10 12:28:22 -05:00
Jeremy Allison
d824b98f80 r23779: Change from v2 or later to v3 or later.
Jeremy.
(This used to be commit 407e6e695b)
2007-10-10 12:28:20 -05:00
Günther Deschner
e7d06b1c25 r22655: Call correct free-macros in netsamlogon_cache_get() error paths. Forgot those
in the previous commit.

Guenther
(This used to be commit fce2fe9903)
2007-10-10 12:19:53 -05:00
Günther Deschner
b213b35e08 r22647: Avoid leaking a full info3 structure on each winbindd cached login by making
netsamlogon_cache_get() return a talloc'ed structure.

Guenther
(This used to be commit 5b149967cc)
2007-10-10 12:19:52 -05:00
Volker Lendecke
bcab9254cc r22091: Fix an uninitialized variable warning
(This used to be commit a6e1e39f1d)
2007-10-10 12:19:10 -05:00
Stefan Metzmacher
bc2b6436d0 r22009: change TDB_DATA from char * to unsigned char *
and fix all compiler warnings in the users

metze
(This used to be commit 3a28443079)
2007-10-10 12:19:00 -05:00
Günther Deschner
cece5a62ae r21998: Fix tdb keynames in netsamlogon_clear_cached_user().
No point in deleting U/DOMAIN/RID and UG/DOMAIN/RID keys if we only store U/SID
and UG/SID keys :-)

Next we need to verify the need of calling netsamlogon_clear_cached_user() at all.

Guenther
(This used to be commit 78d13f1467)
2007-10-10 12:18:58 -05:00
Stefan Metzmacher
1c98e62118 r21975: if we use the _bystring() version when storing, we should use it on fetch too...
metze
(This used to be commit d105723f06)
2007-10-10 12:18:54 -05:00
Günther Deschner
257c5c095b r19368: Use WINBINDD_CACHE_TDB_DEFAULT_HASH_SIZE whereever the winbindd tdb is
opened.

Guenther
(This used to be commit 49e9e1a3e7)
2007-10-10 12:15:31 -05:00
Volker Lendecke
a1d47f3e99 r15227: Fix a valgrind error. We are marshalling here, not unmarshalling.
Jeremy, can you check this? This was part of your -O6 on 64bit sweep.

Volker
(This used to be commit 4fa5dbcc8d)
2007-10-10 11:16:29 -05:00
Volker Lendecke
eae063e965 r13991: Fix Coverity bug # 69
(This used to be commit 6dc79e6b12)
2007-10-10 11:11:03 -05:00
Jeremy Allison
d1f91f7c72 r12043: It's amazing the warnings you find when compiling on a 64-bit
box with gcc4 and -O6...
Fix a bunch of C99 dereferencing type-punned pointer will break
strict-aliasing rules errors. Also added prs_int32 (not uint32...)
as it's needed in one place. Find places where prs_uint32 was being
used to marshall/unmarshall a time_t (a big no no on 64-bits).
More warning fixes to come.
Thanks to Volker for nudging me to compile like this.
Jeremy.
(This used to be commit c65b752604)
2007-10-10 11:05:42 -05:00
Gerald Carter
a4d729bdfa r11661: Store the INFO3 in the PAC data into the netsamlogon_cache.
Also remove the mem_ctx from the netsamlogon_cache_store() API.

Guenther, what should we be doing with the other fields in
the PAC_LOGON_INFO?
(This used to be commit 8bead2d282)
2007-10-10 11:05:23 -05:00
Gerald Carter
ce0a1fa159 r11652: Reinstate the netsamlogon_cache in order to work
around failed query_user calls.  This fixes
logons to a member of a Samba domain as a user from a
trusted AD domain.

As per comments on samba-technical, I still need to add

(a) cache the PAC info as werll as NTLM net_user_info_3
(b) expire the cache when the SMB session goes away

Both Jeremy and Guenther have signed off on the idea.
(This used to be commit 0c2bb5ba7b)
2007-10-10 11:05:23 -05:00
Gerald Carter
f02a98d9b6 r9590: forget to remove this from the 3.0 tree
(This used to be commit 74f8718438)
2007-10-10 11:03:22 -05:00
Gerald Carter
dab71bed4e r9588: remove netsamlogon_cache interface...everything seems to work fine. Will deal with any fallout from special environments using a non-cache solution
(This used to be commit e1de6f238f)
2007-10-10 11:03:22 -05:00
Jeremy Allison
acf9d61421 r4088: Get medieval on our ass about malloc.... :-). Take control of all our allocation
functions so we can funnel through some well known functions. Should help greatly with
malloc checking.
HEAD patch to follow.
Jeremy.
(This used to be commit 620f2e608f)
2007-10-10 10:53:32 -05:00
Jeremy Allison
b9fcb5b961 r4005: Fix for bug #2071 reported by Jason Mader <jason@ncac.gwu.edu>.
Use correct enum type for comparisons.
Jeremy.
(This used to be commit b926480d05)
2007-10-10 10:53:27 -05:00
Gerald Carter
ed5fd7117e r2086: fix bug with winbindd_getpwnam() caused by Microsoft DC's not filling in the username in the user_info3
(This used to be commit 4703a71fa8)
2007-10-10 10:52:31 -05:00
Volker Lendecke
97b200d422 Apply some const
(This used to be commit 8037750df5)
2004-03-30 08:03:32 +00:00
Gerald Carter
c674e411c7 i guess i'm the only one this ever annyoed...
fix the confusion when we tdb_lock_bystring() but
we retrieve an entry using tdb_fetch_by_string.
It's now always tdb.*bystring()
(This used to be commit 66359531b8)
2003-07-10 20:37:01 +00:00
Gerald Carter
93bcb9963b merge of the netsamlogon caching code from APPLIANCE_HEAD
This replaces the universal group caching code (was originally
based on that code).  Only applies to the the RPC code.

One comment: domain local groups don't show up in 'getent group'
that's easy to fix.

Code has been tested against 2k domain but doesn't change anything
with respect to NT4 domains.

netsamlogon caching works pretty much like the universal group
caching code did but has had much more testing and puts winbind
mostly back in sync between branches.
(This used to be commit aac01dc7bc)
2003-06-21 04:05:01 +00:00