1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-24 02:04:21 +03:00

313 Commits

Author SHA1 Message Date
Jelmer Vernooij
b54d14a01a r2696: DCOM updates:
- Start working on OXIDResolver interface
 - Add torture test for SimplePing()
2007-10-10 12:59:24 -05:00
Andrew Tridgell
c82a9cf750 r2680: switched the libcli/raw/ code over to use talloc_reference(), which simplifies things quite a bit 2007-10-10 12:59:21 -05:00
Andrew Tridgell
dc53150861 r2675: added a convenience function
void *talloc_reference(const void *context, const void *ptr);

this function makes a secondary reference to ptr, and hangs it off the
given context. This greatly simplifies some of the current reference
counting code in the samr server and I suspect it will be widely used
in other places too.

the way you use it is like this:

	domain_state->connect_state = talloc_reference(domain_state, connect_state);

that makes the element connect_state of domain_state a secondary
reference to connect_state. The connect_state structure will then only
be freed when both domain_state and the original connect_state go
away, allowing you to free them independently and in any order.

you could do this alrady using a talloc destructor, and that is what
the samr server did previously, but that meant this construct was
being reinvented in several places. So this convenience function sets
up the destructor for you, giving a much more convenient and less
error prone API.
2007-10-10 12:59:20 -05:00
Andrew Tridgell
c51ca7c0e7 r2673: in the rpc server, free up the old call when we decide to extend an
existing call rather than creating a new one. This prevents call
structures hanging around on the rpc connection context until it is
closed
2007-10-10 12:59:20 -05:00
Andrew Tridgell
8dc23821c9 r2671: we're getting too many errors caused by the talloc_realloc() API not
taking a context (so when you pass a NULL pointer you end up with
memory in a top level context). Fixed it by changing the API to take a
context. The context is only used if the pointer you are reallocing is
NULL.
2007-10-10 12:59:20 -05:00
Andrew Tridgell
d78eea9eb8 r2670: use a destructor to auto-close the samr ldb when the last user
disconnects. Previously the ldb was always kept open.
2007-10-10 12:59:20 -05:00
Andrew Tridgell
278cef77f0 r2669: convert make_user_info() and associated functions from malloc to talloc 2007-10-10 12:59:19 -05:00
Andrew Tridgell
2662be3a2b r2663: fix an epmapper server leak - another talloc_realloc(NULL, ) leak 2007-10-10 12:59:19 -05:00
Andrew Tridgell
c315d6ac1c r2660: - converted the libcli/raw/ library to use talloc_increase_ref_count()
rather than manual reference counts

- properly support SMBexit in the cifs and posix backends

- added a logoff method to all backends

With these changes the RAW-CONTEXT test now passes against the posix backend
2007-10-10 12:59:18 -05:00
Andrew Tridgell
230e1cd777 r2648: - use a destructor on struct server_connection to simplify the
connection termination cleanup, and to ensure that the event
  contexts are properly removed for every process model

- gave auth_context the new talloc treatment, which removes another
  source of memory leaks.
2007-10-10 12:59:16 -05:00
Andrew Tridgell
2dc334a328 r2646: - use a talloc destructor to ensure that sockets from the new socket
library are closed on abnormal termination

- convert the service.h structures to the new talloc methods
2007-10-10 12:59:16 -05:00
Andrew Tridgell
1ee5ed4197 r2635: mem_ctx cleanups on the lsa and netlogon pipes in the rpc server 2007-10-10 12:59:15 -05:00
Andrew Tridgell
f12ee2f241 r2629: convert gensec to the new talloc model
by making our gensec structures a talloc child of the open connection
we can be sure that it will be destroyed when the connection is
dropped.
2007-10-10 12:59:14 -05:00
Andrew Tridgell
26da45a801 r2628: got rid of some warnings and converted a few more places to use hierarchical memory allocation 2007-10-10 12:59:14 -05:00
Andrew Tridgell
76d0b8206c r2627: use the new talloc capabilities in a bunch more places in the rpc
server code. This fixes a number of memory leaks I found when testing
with valgrind and smbtorture, as the cascading effect of a
talloc_free() ensures that anything derived from the top level object
is destroyed on disconnect.
2007-10-10 12:59:13 -05:00
Andrew Tridgell
fee98137ad r2615: fixed a bug in the server side support for CONNECT level security 2007-10-10 12:59:12 -05:00
Andrew Tridgell
f4660857bc r2614: support CONNECT level DCE/RPC security in both client and
server. CONNECT security uses NTLMSSP, but does not do any signing or
sealing (or equivalently, its like signing, but with a zero filled
checksum).
2007-10-10 12:59:12 -05:00
Andrew Tridgell
efb2b88edd r2592: this fixes one of the security memory leaks in the server 2007-10-10 12:59:10 -05:00
Andrew Bartlett
f3bf57ca6b r2537: Add static and use strlen_m instead of str_charnum().
Andrew Bartlett
2007-10-10 12:59:04 -05:00
Jelmer Vernooij
00de28876d r2519: Registry RPC pipe fixes (use struct registry_key instead of REG_KEY, etc) 2007-10-10 12:59:01 -05:00
Andrew Bartlett
131420b45e r2515: Fixes from smbtorture - these session keys are not individually encrypted.
Andrew Bartlett
2007-10-10 12:59:01 -05:00
Tim Potter
32f0f3154a r2458: Rename policy handle parameters for the SAMR pipe. Parameters now
have the handle type implied by the parameter name.  There are four
types of handle: connect, domain, user and group handles.  The
various samr_Connect functions return a connect handle, and the
samr_OpenFoo functions return a foo handle.

There is one exception - the samr_{Get,Set}Security function can
take any type of handle.

Fix up all C callers.
2007-10-10 12:58:55 -05:00
Stefan Metzmacher
2fd577d241 r2447: let the server code use the new lib/socket/ stuff
metze
2007-10-10 12:58:54 -05:00
Andrew Tridgell
1b4cee825e r2435: got rid of another pointless strnequal() 2007-10-10 12:58:52 -05:00
Stefan Metzmacher
1854907da8 r2326: remove definition and usage of struct socket_context
metze
2007-10-10 12:58:44 -05:00
Andrew Tridgell
daaee86d14 r2301: add a server side warning when we receive more RPC data than we
expect. It isn't an error as w2k3 does this on its first packet when
NTLM2 signing is used.
2007-10-10 12:58:41 -05:00
Andrew Tridgell
fce7a4218b r2294: this fixes the NTLM2 sign+seal combination. I have now tested:
NTLM sign
 NTLM sign+seal
 NTLM2 sign
 NTLM2 sign+seal

and all of the above both with and without key exchange

the NTLM2 seal case is ugly and involves an extra data copy, which
some API changes in gensec or the ndr layer might avoid in future.
2007-10-10 12:58:40 -05:00
Andrew Tridgell
d8825b69ac r2293: fixed older NTLM sign/seal in the server 2007-10-10 12:58:40 -05:00
Andrew Bartlett
b80d849b6b r2290: Fix 'lsakey' for the server-side, it is static for
'authenticated' connections.

Fix kerberos session key issues - we need to call the
routine for extracting the session key, not just read the cache.

Andrew Bartlett
2007-10-10 12:58:40 -05:00
Andrew Bartlett
a1fe175eec r2284: Thanks to some great detective work by tridge, NTLM2 signing now works.
This means that 'require NTLMv2 session security' now works for RPC
pipe signing.  We don't yet have sealing, but it can't be much further.

This is almost all tridge's code, munged into a form that can work
with the GENSEC API.

This commit also includes more lsakey fixes - that key is used for all
DCE-RPC level authenticated connections, even over CIFS/ncacn_np.

No doubt I missed something, but I'm going to get some sleep :-)

Andrew Bartlett
2007-10-10 12:58:39 -05:00
Andrew Bartlett
a089bcf503 r2282: Remove one more magic constant from the source, replace with sizeof().
Andrew Bartlett
2007-10-10 12:58:39 -05:00
Andrew Bartlett
7be16e5036 r2281: Add a few comments. 2007-10-10 12:58:38 -05:00
Andrew Tridgell
3b4ed24f4b r2280: fixed the session key choice for ncacn_np and ncacn_ip_tcp in the rpc server 2007-10-10 12:58:38 -05:00
Tim Potter
6c1a72c5d6 r2247: talloc_destroy -> talloc_free 2007-10-10 12:58:34 -05:00
Andrew Tridgell
a5eb6cad50 r2105: added a TestSleep() operation to the echo pipe and extended the
RPC-ECHO test to use it to test asynchronous rpc operations.
2007-10-10 12:58:25 -05:00
Stefan Metzmacher
98e4b23d45 r2059: abartlet: is there a better way to fix this compiler warning
(the same problem as in -r 2056)

metze
2007-10-10 12:58:22 -05:00
Andrew Bartlett
8115e44d47 r2055: Add PRINTF_ATTRIBUTE to many more parts of the code, and a new
--enable-developer warning for when they are missing.

Andrew Bartlett
2007-10-10 12:58:21 -05:00
Andrew Tridgell
da60987a92 r2051: switched the samdb over to using the new destructor and reference
count features of talloc, instead of re-implementing both those
features inside of samdb (which is what we did before).

This makes samdb considerably simpler, and also fixes some bugs, as I
found some error paths that didn't call samdb_close(). Those are now
handled by the fact that a talloc_free() will auto-close and destroy
the samdb context, using a destructor.
2007-10-10 12:58:21 -05:00
Andrew Tridgell
1fdccf8dc7 r2050: fixed a case where code assumed you could Realloc the result of a data_blob() 2007-10-10 12:58:21 -05:00
Andrew Bartlett
86f61568ea r2041: Fix NTLMSSP RPC sealing, client -> win2k3 server.
The bug (found by tridge) is that Win2k3 is being tighter about the
NTLMSSP flags.  If we don't negotiate sealing, we can't use it.

We now have a way to indicate to the GENSEC implementation mechanisms
what things we want for a connection.

Andrew Bartlett
2007-10-10 12:58:19 -05:00
Andrew Tridgell
5894b5c0f3 r2038: get rid of the optimisation in the dcerpc server that tries to avoid a
data copy by playing internal games with DATA_BLOB and free().
2007-10-10 12:58:19 -05:00
Andrew Bartlett
486215edc1 r1993: Allow WinXP domain logon to progress a bit further (it seems broken for me).
Fix indent, and add a few more useful debug messages.

Send a fault, if the bind is not accepted - don't just leave the client hanging.

Andrew Bartlett
2007-10-10 12:58:15 -05:00
Andrew Tridgell
e35bb094c5 r1983: a completely new implementation of talloc
This version does the following:

  1) talloc_free(), talloc_realloc() and talloc_steal() lose their
     (redundent) first arguments

  2) you can use _any_ talloc pointer as a talloc context to allocate
     more memory. This allows you to create complex data structures
     where the top level structure is the logical parent of the next
     level down, and those are the parents of the level below
     that. Then destroy either the lot with a single talloc_free() or
     destroy any sub-part with a talloc_free() of that part

  3) you can name any pointer. Use talloc_named() which is just like
     talloc() but takes the printf style name argument as well as the
     parent context and the size.

The whole thing ends up being a very simple piece of code, although
some of the pointer walking gets hairy.

So far, I'm just using the new talloc() like the old one. The next
step is to actually take advantage of the new interface
properly. Expect some new commits soon that simplify some common
coding styles in samba4 by using the new talloc().
2007-10-10 12:58:14 -05:00
Stefan Metzmacher
a6ce6ee878 r1843: return DCERPC_FAULT_LOGON_FAILURE when the auth fails
metze
2007-10-10 12:58:00 -05:00
Andrew Tridgell
ec41c73ae1 r1818: _really_ fixed epmapper this time, it was using more than one old rpc interface method. 2007-10-10 12:57:59 -05:00
Andrew Tridgell
b2152912ca r1817: fixed fault code generation for unimplemented functions in epmapper
thanks to volker for spotting these!
2007-10-10 12:57:59 -05:00
Volker Lendecke
48df39c133 r1814: Fix the build.
Tridge, in rpc_epmapper.c there's a whole bunch of "return
NT_STATUS_NOT_IMPLEMENTED". You told me that's wrong, you should generate the
correct fault pdu. Or is epmapper special in that respect?

Volker
2007-10-10 12:57:58 -05:00
Andrew Tridgell
ecb7378bbc r1757: much simpler (and smaller, faster etc) way of doing relative pointers
in pidl. This mechanism should be much easier to extend to the
"retrospective subcontexts" that jelmer needs.

also produced more standards complient full-pointer offsets. This
keeps ethereal happy with decoding our epmapper frames.
2007-10-10 12:57:54 -05:00
Jelmer Vernooij
547f860285 r1703: - Lots of RPC updates, adding new pipes and protocols.
- More updates/fixes to the ethereal parser generator
2007-10-10 12:57:49 -05:00
Stefan Metzmacher
76cb9966bf r1546: fix the build the function name has changed to srvsvc_NetRemoteTOD
because I implemented the idl for it

metze
2007-10-10 12:57:41 -05:00