1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-14 01:57:53 +03:00

451 Commits

Author SHA1 Message Date
Andrew Tridgell
f19201ea27 r2643: convert more of the auth subsyystem to the new talloc methods. This
also fixes a memory leak found with --leak-check.
2007-10-10 12:59:15 -05:00
Andrew Tridgell
56ecda2178 r2634: use discard_const_p() in a few places 2007-10-10 12:59:14 -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
458f853288 r2626: the symbol gai_error is defined in /usr/include, so don't use that name in our code 2007-10-10 12:59:13 -05:00
Andrew Tridgell
dabc7ddd9f r2625: use talloc_p, not talloc when possible (when allocating a structure in particular), as it gives us type checking. 2007-10-10 12:59:13 -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 Bartlett
dfecb01506 r2552: Character set conversion and string handling updates.
The intial motivation for this commit was to merge in some of the
bugfixes present in Samba3's chrcnv and string handling code into
Samba4.  However, along the way I found a lot of unused functions, and
decided to do a bit more...

The strlen_m code now does not use a fixed buffer, but more work is
needed to finish off other functions in str_util.c.  These fixed
length buffers hav caused very nasty, hard to chase down bugs at some
sites.

The strupper_m() function has a strupper_talloc() to replace it (we
need to go around and fix more uses, but it's a start).  Use of these
new functions will avoid bugs where the upper or lowercase version of
a string is a different length.

I have removed the push_*_allocate functions, which are replaced by
calls to push_*_talloc.  Likewise, pstring and other 'fixed length'
wrappers are removed, where possible.

I have removed the first ('base pointer') argument, used by push_ucs2,
as the Samba4 way of doing things ensures that this is always on an
even boundary anyway.  (It was used in only one place, in any case).
2007-10-10 12:59:05 -05:00
Jelmer Vernooij
0fb0530389 r2538: Support IPv6 as transport for MSRPC. Tested against Win2k3
Implemented using the POSIX getaddrinfo() call (specified by POSIX 1003.1-2003 and 2553)
I'm not sure how portable this function is, so we might have to add a sys_getaddrinfo() later on.
2007-10-10 12:59:04 -05:00
Jelmer Vernooij
2762ed3b9b r2518: Some long overdue changes:
- Samba4-style code in lib/registry (struct registry_key instead of REG_KEY, etc)
 - Use hives (like Windows has drives) instead of one root key (like a Unix FS)
 - usability fixes in the GTK utilities (autodetect the username,
	enable/disable options, etc)
 - fix gwsam compile
 - several bugfixes in the registry rpc code
 - do charset conversion in nt4 registry backend
2007-10-10 12:59:01 -05:00
Tim Potter
a0e571a9dd r2489: Rename account_flags in EnumDomainAliases() to acct_flags. 2007-10-10 12:58:57 -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
9c0e50a6f3 r2443: check return code of event_loop_once() to catch thet cases where the server
closes the connetion and we got EBADF from select() and event_loop_once() fails

metze
2007-10-10 12:58:54 -05:00
Tim Potter
04aec4c0a3 r2399: Display text description of rpc fault in debug message. 2007-10-10 12:58:48 -05:00
Andrew Tridgell
01d66f68f6 r2383: fixed the handling of sending zero length dcerpc packets (I broke this
recently, and this broke the autoidl code)
2007-10-10 12:58:47 -05:00
Andrew Tridgell
7d3e347422 r2382: considerably improved the Bind and Unbind IDL and test code. We can
now do these two calls successfully against w2k3.

note that you must use ncacn_ip_tcp, and must enable dcerpc sealing,
otherwise w2k3 refuses the first DRSUAPI call.
2007-10-10 12:58:46 -05:00
Andrew Tridgell
09651b831d r2304: fixed a bug in old style NTLM signing 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 Bartlett
49171e4203 r2287: Add static.
Andrew Bartlett
2007-10-10 12:58:39 -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 Tridgell
22a6e5d50d r2275: don't crash on a rpc BIND_NAK response ... 2007-10-10 12:58:37 -05:00
Andrew Tridgell
f6ea24296a r2266: yay! LSA session keys on TCP now work! 2007-10-10 12:58:35 -05:00
Tim Potter
6c1a72c5d6 r2247: talloc_destroy -> talloc_free 2007-10-10 12:58:34 -05:00
Tim Potter
79969dc8da r2234: Tridge, this is a patch to allow people to set the REF_ALLOC flag on
a dcerpc_pipe structure as we discussed this morning.
2007-10-10 12:58:33 -05:00
Andrew Tridgell
e909bfa708 r2209: patch from volker to add EnumPorts spoolss IDL and test code
the ndr->offset=0; stuff is ugly. We need a better way to handle this.
2007-10-10 12:58:31 -05:00
Volker Lendecke
ef5414676e r2208: little attempt to (almost) fix spoolss relative 2007-10-10 12:58:31 -05:00
Andrew Tridgell
8ffe136ad2 r2206: another (untested) attempt to make RELATIVE_CURRENT work for volker,
plus removed unused ndr_pull_relative() function

once volker commits a test for this I'll be able to ensure it really works as expected
2007-10-10 12:58:31 -05:00
Andrew Tridgell
d2d3433de1 r2205: fixed an incorrect cast that broke relative strings in spoolss 2007-10-10 12:58:31 -05:00
Andrew Tridgell
bd45329a3f r2204: added [flag(RELATIVE_CURRENT)] to change [relative] pointer behaviour
for this struct and all sub-structures to be like spoolss relative
pointers (where offset is relative to current position).

volker will test this for me :)
2007-10-10 12:58:31 -05:00
Andrew Tridgell
e99d88915f r2199: the unknown 16 bit number in lsa_LookupPrivDisplayName() is a language
ID, so the client can choose what language they get the privilege
description in.

this is the first time I've seen a language ID on the wire in CIFS.
2007-10-10 12:58:30 -05:00
Andrew Tridgell
f2a0438c66 r2185: add a callback function to the dcerpc async API
also add a demonstration of its use in the netlogon async example
2007-10-10 12:58:30 -05:00
Andrew Tridgell
7256945b52 r2184: use the smb.conf socket options for client code too 2007-10-10 12:58:30 -05:00
Andrew Tridgell
7fdb778f81 r2180: added RPC flags "padcheck" which enables checking of all received pad
bytes to make sure they are zero. Non-zero values usually indicate one
of two things:

 - the server is leaking data through sending uninitialised memory
 - we have mistaken a real field in the IDL for padding

to differentiate between the two you really need to run with
"print,padcheck" and look carefully at whether the non-zero pad bytes
are random or appear to be deliberate.
2007-10-10 12:58:29 -05:00
Andrew Tridgell
756f28ac95 r2159: converted samba4 over to UTF-16.
I had previously thought this was unnecessary, as windows doesn't use
standards compliant UTF-16, and for filesystem operations treats bytes
as UCS-2, but Bjoern Jacke has pointed out to me that this means we
don't correctly store extended UTF-16 characters as UTF-8 on
disk. This can be seen with (for example) the gothic characters with
codepoints above 64k.

This commit also adds a LOCAL-ICONV torture test that tests the first
1 million codepoints against the system iconv library, and tests 5
million random UTF-16LE buffers for identical error handling to the
system iconv library.

the lib/iconv.c changes need backporting to samba3
2007-10-10 12:58:27 -05:00
Andrew Tridgell
9e120bff7a r2158: removed a misleading comment (the extra uint16 is just padding) 2007-10-10 12:58:27 -05:00
Andrew Tridgell
5ab362cede r2128: netlogon DELTA_POLICY fix from rrenard 2007-10-10 12:58:27 -05:00
Andrew Tridgell
5be1b54d15 r2127: more lsa IDL updates from Richard Renard 2007-10-10 12:58:26 -05:00
Andrew Tridgell
253203f58f r2126: two more lsa functions worked out by richard renard 2007-10-10 12:58:26 -05:00
Stefan Metzmacher
2de544181e r2121: fix compiler warning
metze
2007-10-10 12:58:26 -05:00
Andrew Tridgell
a86e629a39 r2118: fixed the receipt of bigendian rpc packets with the new async code.
The fix uses the new talloc_increase_ref_count() function in an
interesting way. I suspect this sort of technique will become quite
common.
2007-10-10 12:58:26 -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
Andrew Tridgell
83fbe080e7 r2103: in the conversion to async rpc I simplified the smb backend to only
use readx/writex instead of the more efficient SMBtrans calls. This
patch restores the efficiency by using SMBtrans when possible.
2007-10-10 12:58:25 -05:00
Andrew Tridgell
f5d004d8eb r2100: rework the dcerpc client side library so that it is async. We now
generate a separate *_send() async function for every RPC call, and
there is a single dcerpc_ndr_request_recv() call that processes the
receive side of any rpc call. The caller can use
dcerpc_event_context() to get a pointer to the event context for the
pipe so that events can be waited for asynchronously.

The only part that remains synchronous is the initial bind
calls. These could also be made async if necessary, although I suspect
most applications won't need them to be.
2007-10-10 12:58:24 -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 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
271831f97f r2029: changed our client side dcerpc padding to match what w2k3 does - a 16
byte padding of the payload portion of the packet.
2007-10-10 12:58:18 -05:00
Stefan Metzmacher
80f27766cb r1995: a ndrdump file from abartlet make it clear that this isn't a pointer
to a uint32, there're two uint32 with 0x00000000

metze
2007-10-10 12:58:16 -05:00
Stefan Metzmacher
a3a4b9c9ea r1994: fix compiler warning
metze
2007-10-10 12:58:15 -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
6ffdfd7799 r1985: take advantage of the new talloc in a few more places 2007-10-10 12:58:14 -05:00