1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-07 17:18:11 +03:00
Commit Graph

177 Commits

Author SHA1 Message Date
Günther Deschner
a5f0186f70 Remove remaining old srvsvc client and server rpc code entirely.
Guenther
2008-03-21 04:16:22 +01:00
Marc VanHeyningen
3fc85d2259 Coverity fixes 2008-03-17 20:52:25 +01:00
Günther Deschner
997a0a4a12 Cosmetics: make check_bind_req() debug statements a little nicer.
Guenther
2008-02-27 19:08:59 +01:00
Günther Deschner
aa7023b88d Yippie! LSARPC server-side migration to pidl finished.
Guenther
2008-02-19 01:23:05 +01:00
Günther Deschner
acce1092d9 Build the generated ntsvcs server (not at all useable yet).
Guenther
2008-02-17 23:03:22 +01:00
Günther Deschner
7845a0d9a8 YES! NETLOGON rpc server side migration to pidl finished.
Guenther
2008-02-16 14:53:45 +01:00
Jeremy Allison
67768fc71f Currently we don't SPNEGO negotiate back to NTLMSSP. Note this.
Jeremy.
2008-02-14 18:08:23 -08:00
Günther Deschner
c6d9650930 w00t! SAMR server-side conversion to pidl is finished.
Guenther
2008-02-12 14:55:20 +01:00
Günther Deschner
2df3408079 Let _samr_Close() use pidl generated server code.
Guenther
2008-01-31 11:20:13 +01:00
Günther Deschner
d5ebfccebb Use generated DSSETUP client & server rpc functions and remove the hand-written ones.
Guenther
2008-01-25 15:30:43 +01:00
Volker Lendecke
616d6b97e5 Don't copy the rpc function pointers
This actually shows up in a valgrind massif run with 4.1% of allocated memory.
I don't see why we would have to make a copy here.

Metze?
2007-12-09 11:11:21 -08:00
Jeremy Allison
f35a266b3c 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.
2007-10-18 17:40:25 -07:00
Volker Lendecke
b474600973 r16050: Set the session key "SystemLibraryDTC" on ntlmssp binds. We only do INTEGRITY
and PRIVACY, so no other cases to take care of so far...

Andrew B., if you have time, could you take a look? This makes us survive the
RPC-SAMBA3SESSIONKEY test.

Volker
(cherry picked from commit 25cc1e7ff1)
2007-10-18 09:25:09 +02:00
Gerald (Jerry) Carter
5c6c8e1fe9 [GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch. 2007-10-10 15:34:30 -05:00
Volker Lendecke
6585ea2cb7 r24809: Consolidate the use of temporary talloc contexts.
This adds the two functions talloc_stackframe() and talloc_tos().

 * When a new talloc stackframe is allocated with talloc_stackframe(), then
 * the TALLOC_CTX returned with talloc_tos() is reset to that new
 * frame. Whenever that stack frame is TALLOC_FREE()'ed, then the reverse
 * happens: The previous talloc_tos() is restored.
 *
 * This API is designed to be robust in the sense that if someone forgets to
 * TALLOC_FREE() a stackframe, then the next outer one correctly cleans up and
 * resets the talloc_tos().

The original motivation for this patch was to get rid of the
sid_string_static & friends buffers. Explicitly passing talloc context
everywhere clutters code too much for my taste, so an implicit
talloc_tos() is introduced here. Many of these static buffers are
replaced by a single static pointer.

The intended use would thus be that low-level functions can rather
freely push stuff to talloc_tos, the upper layers clean up by freeing
the stackframe. The more of these stackframes are used and correctly
freed the more exact the memory cleanup happens.

This patch removes the main_loop_talloc_ctx, tmp_talloc_ctx and
lp_talloc_ctx (did I forget any?)

So, never do a

tmp_ctx = talloc_init("foo");

anymore, instead, use

tmp_ctx = talloc_stackframe()

:-)

Volker
2007-10-10 12:30:24 -05:00
Andrew Tridgell
87c91e4362 r23801: The FSF has moved around a lot. This fixes their Mass Ave address. 2007-10-10 12:28:27 -05:00
Jeremy Allison
407e6e695b r23779: Change from v2 or later to v3 or later.
Jeremy.
2007-10-10 12:28:20 -05:00
Gerald Carter
ebcae48ec1 r23274: merge CloseEventlog() pidl conversion from 3.0.26 && fix a few init call renames for svcctl in the previous commit 2007-10-10 12:23:02 -05:00
Jelmer Vernooij
ad98126187 r22055: Port the endpoint mapper (and functions it requires) to Samba 3. 2007-10-10 12:19:06 -05:00
Volker Lendecke
21c08e7ef4 r19220: Check if a backend has set rng_fault_state and send a dce-level fault pdu.
Volker
2007-10-10 12:15:22 -05:00
Gerald Carter
cf1404a0d7 r18789: Replace the winreg server code with the libndr parsing code.
Many things work (OpenHKLM, etc...) but some still don't.
This shouldn't block anyone so I'm checking it in.
Will probably move to a bzr tree after this for
longer dev cycles between checkins.
2007-10-10 12:00:57 -05:00
Jelmer Vernooij
5de76767e8 r18654: Rename "struct uuid" => "struct GUID" for consistency. 2007-10-10 11:52:19 -05:00
Jelmer Vernooij
9e9a053661 r18572: Use the autogenerated client and server for the echo interface and implement
some of the missing functions. RPC-ECHO now passes against Samba3.
2007-10-10 11:51:51 -05:00
Volker Lendecke
ae6b9b34e5 r17348: Some C++ warnings 2007-10-10 11:38:27 -05:00
Jeremy Allison
9dafb7f48c r16945: Sync trunk -> 3.0 for 3.0.24 code. Still need
to do the upper layer directories but this is what
everyone is waiting for....

Jeremy.
2007-10-10 11:19:14 -05:00
Gerald Carter
154e4a2815 r16785: BUG 3908: Fix rpc bin authentication failure which broke user password changes
Jeremy, please review.
2007-10-10 11:19:10 -05:00
Jeremy Allison
ce14daf51c r16582: Fix Klocwork #1997 and all generic class of problems
where we don't correctly check the return from memdup.
Jeremy.
2007-10-10 11:19:01 -05:00
Jeremy Allison
93ca3eee55 r15129: Separate out mechanism and policy for NTLMSSP auth/sign/seal.
With this change (and setting lanman auth = no in smb.conf)
we have *identical* NTLMSSP flags to W2K3 in SPNEGO auth.
Jeremy
2007-10-10 11:16:25 -05:00
Günther Deschner
3f195f8248 r14597: Merge DCERPC_FAULT constants from Samba 4.
Guenther
2007-10-10 11:15:38 -05:00
Jeremy Allison
1d710d06a2 r13915: Fixed a very interesting class of realloc() bugs found by Coverity.
realloc can return NULL in one of two cases - (1) the realloc failed,
(2) realloc succeeded but the new size requested was zero, in which
case this is identical to a free() call.

The error paths dealing with these two cases should be different,
but mostly weren't. Secondly the standard idiom for dealing with
realloc when you know the new size is non-zero is the following :

 tmp = realloc(p, size);
 if (!tmp) {
    SAFE_FREE(p);
    return error;
 } else {
    p = tmp;
 }

However, there were *many* *many* places in Samba where we were
using the old (broken) idiom of :

 p = realloc(p, size)
 if (!p) {
    return error;
 }

which will leak the memory pointed to by p on realloc fail.

This commit (hopefully) fixes all these cases by moving to
a standard idiom of :

 p = SMB_REALLOC(p, size)
 if (!p) {
    return error;
 }

Where if the realloc returns null due to the realloc failing
or size == 0 we *guarentee* that the storage pointed to by p
has been freed. This allows me to remove a lot of code that
was dealing with the standard (more verbose) method that required
a tmp pointer. This is almost always what you want. When a
realloc fails you never usually want the old memory, you
want to free it and get into your error processing asap.

For the 11 remaining cases where we really do need to keep the
old pointer I have invented the new macro SMB_REALLOC_KEEP_OLD_ON_ERROR,
which can be used as follows :

 tmp = SMB_REALLOC_KEEP_OLD_ON_ERROR(p, size);
 if (!tmp) {
    SAFE_FREE(p);
    return error;
 } else {
    p = tmp;
 }

SMB_REALLOC_KEEP_OLD_ON_ERROR guarentees never to free the
pointer p, even on size == 0 or realloc fail. All this is
done by a hidden extra argument to Realloc(), BOOL free_old_on_error
which is set appropriately by the SMB_REALLOC and SMB_REALLOC_KEEP_OLD_ON_ERROR
macros (and their array counterparts).

It remains to be seen what this will do to our Coverity bug count :-).

Jeremy.
2007-10-10 11:10:59 -05:00
Gerald Carter
b65be8874a r13571: Replace all calls to talloc_free() with thye TALLOC_FREE()
macro which sets the freed pointer to NULL.
2007-10-10 11:10:14 -05:00
Jeremy Allison
4877f336b2 r13557: (Hopefully) get the creds store/restore key right from
the correct part of the netlogon and schannel packets.
Jeremy.
2007-10-10 11:10:13 -05:00
Jeremy Allison
09f0b3e1a3 r13552: Make sure we're using the same name to load the stored
creds under all circumstances. This may be wrong, but
at least we're now consistent.
Jeremy.
2007-10-10 11:10:13 -05:00
Jeremy Allison
80f4868944 r13519: Fix the credentials chaining across netlogon pipe disconnects.
I mean it this time :-).
Jeremy.
2007-10-10 11:10:09 -05:00
Gerald Carter
17e63ac4ed r13316: Let the carnage begin....
Sync with trunk as off r13315
2007-10-10 11:06:23 -05:00
Jeremy Allison
23f16cbc2e r13293: Rather a big patch I'm afraid, but this should fix bug #3347
by saving the UNIX token used to set a delete on close flag,
and using it when doing the delete. libsmbsharemodes.so still
needs updating to cope with this change.
Samba4 torture tests to follow.
Jeremy.
2007-10-10 11:06:21 -05:00
Jeremy Allison
48dd8c732b r13176: Fix show-stopper bug for 3.0.21b where 4 leg NTLMSSP SPNEGO
auth was not generating the correct auth header on the 4th
packet. This may fix a lot of Windows client complaints and
is essential for release.
Jeremy.
2007-10-10 11:06:16 -05:00
Jeremy Allison
672113a627 r11950: If we got a connection oriented cancel pdu we would spin processing it.
Fix that, and also add in comments for all possible CL and CO PDU
types. Make sure we process them correctly.
Jeremy.
2007-10-10 11:05:39 -05:00
Jeremy Allison
d720867a78 r11137: Compile with only 2 warnings (I'm still working on that code) on a gcc4
x86_64 box.
Jeremy.
2007-10-10 11:05:02 -05:00
Jeremy Allison
a6d8a4b1ff r10792: Fix the "schannel not stored across client disconnects" problem.
Based on the Samba4 solution - stores data in
$samba/private/schannel_store.tdb.
This tdb is not left open but open and closed on demand.
Jeremy.
2007-10-10 11:04:54 -05:00
Gerald Carter
939c3cb5d7 r10656: BIG merge from trunk. Features not copied over
* \PIPE\unixinfo
* winbindd's {group,alias}membership new functions
* winbindd's lookupsids() functionality
* swat (trunk changes to be reverted as per discussion with Deryck)
2007-10-10 11:04:48 -05:00
Jeremy Allison
592ec9fbff r9080: If we don't understand the auth, bind nak not pdu fault.
Should fix usermgr on W2K3 SP1.
Jeremy.
2007-10-10 11:00:25 -05:00
Jeremy Allison
fd6e342746 r8805: Merge a duplicate struct. Get ready to support SPNEGO rpc binds.
Jeremy.
2007-10-10 11:00:18 -05:00
Jeremy Allison
475d5a277d r7708: Hint from Luke Howard (thanks Luke). Ensure the schannel authenticator is 8
byte aligned, just like the NTLMSSP ones. Trying to fix 64-bit Windows domain
logon.
Jeremy.
2007-10-10 10:57:20 -05:00
Jeremy Allison
877e0a61f5 r7385: Rewrite the RPC bind parsing functions to follow the spec. I haven't yet
tested this so I may have screwed this up - however it now follows the
DCE spec. valgrinded tests to follow....
Jeremy.
2007-10-10 10:57:07 -05:00
Volker Lendecke
c25b4afda2 r7217: Only allow schannel connections if a successful Auth2 has been done
before. Things tested: Domain join and subsequent interactive and network
logon to NT4, W2kSP and XPSP2 workstations and a NT4 domain trusting us. Right
now I've got problems with my W2k3 domain trusts. So this needs testing,
although I'm really confident that this does not break.

Volker
2007-10-10 10:57:05 -05:00
Herb Lewis
efea76ac71 r6225: get rid of warnings from my compiler about nested externs 2007-10-10 10:56:30 -05:00
Gerald Carter
4e0ac63c36 r6014: rather large change set....
pulling back all recent rpc changes from trunk into
3.0.  I've tested a compile and so don't think I've missed
any files.  But if so, just mail me and I'll clean backup
in a couple of hours.

Changes include \winreg, \eventlog, \svcctl, and
general parse_misc.c updates.

I am planning on bracketing the event code with an
#ifdef ENABLE_EVENTLOG until I finish merging Marcin's
changes (very soon).
2007-10-10 10:56:15 -05:00
Jeremy Allison
620f2e608f 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.
2007-10-10 10:53:32 -05:00
Andrew Bartlett
36741d3cf5 r1492: Rework our random number generation system.
On systems with /dev/urandom, this avoids a change to secrets.tdb for every fork().

For other systems, we now only re-seed after a fork, and on startup.
No need to do it per-operation.  This removes the 'need_reseed'
parameter from generate_random_buffer().

Andrew Bartlett
2007-10-10 10:52:13 -05:00