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

33 Commits

Author SHA1 Message Date
Jelmer Vernooij
b2125c125f r4394: Use 'raw' protocol towers in the lists in the endpoint rather then
dcerpc_binding structs.
(This used to be commit 9175b72972)
2007-10-10 13:07:42 -05:00
Stefan Metzmacher
bb072199b1 r4288: don't use struct dcerpc_interface_table anymore in the
main rpc server code. let the backends specify a ndr_push/ndr_pull function
like we already do with the dispatch() function.

this allows an interface implmentation to work as real proxy
without needing to know the idl for an interface that means
just the plain decrypted payload can be forwarded

If someone want to write such a backend, patches are wellcome

metze
(This used to be commit a150bdf140)
2007-10-10 13:07:32 -05:00
Stefan Metzmacher
e900618654 r3972: use GUID_* naming context and move GUID_* functions to one place
metze
(This used to be commit 523e6acf4f)
2007-10-10 13:06:09 -05:00
Andrew Tridgell
c051779a0a r3468: split out dcerpc_server.h
(This used to be commit 729e0026e4)
2007-10-10 13:05:17 -05:00
Andrew Tridgell
90067934cd r3428: switched to using minimal includes for the auto-generated RPC code.
The thing that finally convinced me that minimal includes was worth
pursuing for rpc was a compiler (tcc) that failed to build Samba due
to reaching internal limits of the size of include files. Also the
fact that includes.h.gch was 16MB, which really seems excessive. This
patch brings it back to 12M, which is still too large, but
better. Note that this patch speeds up compile times for both the pch
and non-pch case.

This change also includes the addition iof a "depends()" option in our
IDL files, allowing you to specify that one IDL file depends on
another. This capability was needed for the auto-includes generation.
(This used to be commit b8f5fa8ac8)
2007-10-10 13:05:09 -05:00
Jelmer Vernooij
3965113fc7 r3158: Use the new tower build functions to generate protocol towers, making it
easier to deal with more different transports.
(This used to be commit ee9bcfddf0)
2007-10-10 13:02:27 -05:00
Jelmer Vernooij
a9081b527b r3118: Eliminate struct dcesrv_ep_description and replace it with
struct dcerpc_binding.
(This used to be commit 2046e14cf8)
2007-10-10 13:02:23 -05:00
Jelmer Vernooij
ac989eda6d r3114: - More work on merging the various structs that describe endpoints
- Add protocol sequence to dcerpc transports (will be used later on)
- Add more transports to the list
(This used to be commit ab110192e6)
2007-10-10 13:02:23 -05:00
Jelmer Vernooij
0d35bae3c4 r3112: Fix two more instances of epm_towers (sorry, metze!)
(This used to be commit 7baf493966)
2007-10-10 13:02:22 -05:00
Jelmer Vernooij
aa1c83bdbb r3111: Add a few more protocol identifiers, rhs for ncalrpc
(This used to be commit 53567a83cb)
2007-10-10 13:02:22 -05:00
Jelmer Vernooij
31403d548e r3043: Use binding strings for specifying endpoints. The property for
specifying a endpoint is now also 'endpoint' instead of 'endpoints'. The
default endpoint (if none is specified) is still "ncacn_np:[\\pipe\\ifacename]",
where ifacename is the name of the interface.

Examples:

[
  uuid(60a15ec5-4de8-11d7-a637-005056a20182),
  endpoint("ncacn_np:[\\pipe\\rpcecho]", "ncacn_ip_tcp:")
]
interface rpcecho
{
	void dummy();
}

dcerpc_binding is now converted to ep_description in the server, but I hope to
completely eliminate ep_description later on.

The eventual goal of all these changes is to make it easier to add
 transports as I'm going to add support for
 ncalrpc (local RPC over named pipes) and ncacn_unix_stream (Unix sockets).
(This used to be commit f3da7c8b44)
2007-10-10 13:01:53 -05:00
Jelmer Vernooij
ae0aa86039 r2938: Use IDL to dissect the RHS of floors in protocol towers
(This used to be commit 273d0049b5)
2007-10-10 12:59:50 -05:00
Jelmer Vernooij
e2d27b9d23 r2921: Add a few more protocols and fix the numbers associated with some of
the current ones. It took me three hours to realise that the DCOM standard
contains false protocol numbers (apparently someone converted the protocol
numbers to hex twice, i.e. 13 -> 0c and 14 to 0d). There are no longer
duplicates in the list with protocol numbers now.
(This used to be commit f355cd4264)
2007-10-10 12:59:48 -05:00
Andrew Tridgell
5b44130afa 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.
(This used to be commit 8dc23821c9)
2007-10-10 12:59:20 -05:00
Andrew Tridgell
9f0638c0cf r2663: fix an epmapper server leak - another talloc_realloc(NULL, ) leak
(This used to be commit 2662be3a2b)
2007-10-10 12:59:19 -05:00
Andrew Tridgell
d79c7d41da 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.
(This used to be commit 76d0b8206c)
2007-10-10 12:59:13 -05:00
Andrew Tridgell
b83ba93eae 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().
(This used to be commit e35bb094c5)
2007-10-10 12:58:14 -05:00
Andrew Tridgell
350673b2d0 r1818: _really_ fixed epmapper this time, it was using more than one old rpc interface method.
(This used to be commit ec41c73ae1)
2007-10-10 12:57:59 -05:00
Andrew Tridgell
dd4a93dfa0 r1817: fixed fault code generation for unimplemented functions in epmapper
thanks to volker for spotting these!
(This used to be commit b2152912ca)
2007-10-10 12:57:59 -05:00
Volker Lendecke
6706ba5bb4 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
(This used to be commit 48df39c133)
2007-10-10 12:57:58 -05:00
Jelmer Vernooij
1f0ea81ae9 r1703: - Lots of RPC updates, adding new pipes and protocols.
- More updates/fixes to the ethereal parser generator
(This used to be commit 547f860285)
2007-10-10 12:57:49 -05:00
Andrew Tridgell
ae444c03ea r1046: initialise a structure element caught by valgrind
(This used to be commit 4daab1eaec)
2007-10-10 12:56:34 -05:00
Andrew Tridgell
8087d844ef r995: - renamed many of our crypto routines to use the industry standard
names rather than our crazy naming scheme. So DES is now called
  des_crypt() rather than smbhash()

- added the code from the solution of the ADS crypto challenge that
  allows Samba to correctly handle a 128 bit session key in all of the
  netr_ServerAuthenticateX() varients. A huge thanks to Luke Howard
  from PADL for solving this one!

- restructured the server side rpc authentication to allow for other
  than NTLMSSP sign and seal. This commit just adds the structure, the
  next commit will add schannel server side support.

- added 128 bit session key support to our client side code, and
  testing against w2k3 with smbtorture. Works well.
(This used to be commit 729b2f41c9)
2007-10-10 12:56:25 -05:00
Stefan Metzmacher
f9d8f8843d r884: convert samba4 to use [u]int32_t instead of [u]int32
metze
(This used to be commit 0e5517d937)
2007-10-10 12:56:15 -05:00
Andrew Tridgell
8fb8c40d3b fixed the rpc epmapper server. This fixes rpc over tcp.
(This used to be commit 6ac547fa5f)
2004-01-09 02:43:23 +00:00
Stefan Metzmacher
7e6cf43756 This patch adds a better dcerpc server infastructure.
1.) We now register endpoint servers add startup via register_backend()
    and later use the smb.conf 'dcerpc endpoint servers' parameter to setup the dcesrv_context

2.) each endpoint server can register at context creation time as much interfaces as it wants
    (multiple interfaces on one endpoint are supported!)
    (NOTE:  there's a difference between 'endpoint server' and 'endpoint'!
	    for details look at rpc_server/dcesrv_server.h)

3.) one endpoint can have a security descriptor registered to it self
    this will be checked in the future when a client wants to connect
    to an smb pipe endpoint.

4.) we now have a 'remote' endpoint server, which works like the ntvfs_cifs module
    it takes this options in the [globals] section:

    dcerpc remote:interfaces = srvsvc, winreg, w32time, epmapper
    dcerpc remote:binding = ...
    dcerpc remote:user = ...
    dcerpc remote:password = ...

5.) we currently have tree endpoint servers: epmapper, rpcecho and remote

    the default for the 'dcerpc endpiont servers = epmapper, rpcecho'

    for testing you can also do
    dcerpc endpoint servers = rpcecho, remote, epmapper
    dcerpc remote:interfaces = srvsvc, samr, netlogon

6,) please notice the the epmapper now only returns NO_ENTRIES
    (but I think we'll find a solution for this too:-)

7.) also there're some other stuff left, but step by step :-)

This patch also includes updates for the
register_subsystem() , ntvfs_init(), and some other funtions
to check for duplicate subsystem registration


metze

(hmmm, my first large commit...I hope it works as supposed :-)
(This used to be commit 917e45dafd)
2004-01-08 22:55:27 +00:00
Andrew Tridgell
24c22aef90 a fairly large commit!
This adds support for bigendian rpc in the client. I have installed
SUN pcnetlink locally and am using it to test the samba4 rpc
code. This allows us to easily find places where we have stuffed up
the types (such as 2 uint16 versus a uint32), as testing both
big-endian and little-endian easily shows which is correct. I have now
used this to fix several bugs like that in the samba4 IDL.

In order to make this work I also had to redefine a GUID as a true
structure, not a blob. From the pcnetlink wire it is clear that it is
indeed defined as a structure (the byte order changes). This required
changing lots of Samba code to use a GUID as a structure.

I also had to fix the if_version code in dcerpc syntax IDs, as it
turns out they are a single uint32 not two uint16s.

The big-endian support is a bit ugly at the moment, and breaks the
layering in some places. More work is needed, especially on the server
side.
(This used to be commit bb1af644a5)
2003-12-16 09:02:58 +00:00
Andrew Tridgell
f6eb8342cb added auto-generation of the server side boilerplate code for each
pipe.

The server side code gets generated as librpc/gen_ndr/ndr_NAME_s.c and
gets included in the pipe module
(This used to be commit bd3dcfe582)
2003-12-14 13:22:12 +00:00
Andrew Tridgell
d262b8c3c7 completed the linkage between the endpoint mapper and the dcerpc
server endpoints. We can now successfully setup listening endpoints on
high ports, then use our endpoint mapper redirect incoming clients to
the right port.

also greatly cleanup the rpc over tcp session handling.
(This used to be commit 593bc29bbe)
2003-12-13 23:25:15 +00:00
Andrew Tridgell
d4705378ce dcerpc over tcp in the samba4 server now works to some extent. It
needs quite a bit more work to get it finished. The biggest missing
feature is the lack of NTLMSSP which is needed for basic
authentication over tcp
(This used to be commit 9fb0f03693)
2003-12-13 10:58:48 +00:00
Andrew Tridgell
8faa77f177 rpcdump.exe now works fine against a Samba4 server
for some reason the epm_Lookup replies can't be parsed by ethereal,
although w2k parses then fine as does the Samba4 NDR code.
(This used to be commit 097e7ca99d)
2003-12-13 04:46:50 +00:00
Andrew Tridgell
da86d3af31 added the epm_Map() call.
the RPC-EPMAPPER torture test now passes
(This used to be commit fbdcf9ef54)
2003-12-13 03:23:41 +00:00
Andrew Tridgell
340d9b71f9 added a basic dcerpc endpoint mapper to Samba4. Currently only
implements the epm_Lookup() call, I'll add the other important calls
soon. I was rather pleased to find that epm_Lookup() worked first
time, which is particularly surprising given its complexity.

This required quite a bit of new infrastructure:

  * a generic way of handling dcerpc policy handles in the rpc server

  * added type checked varients of talloc. These are much less error
    prone. I'd like to move to using these for nearly all uses of
    talloc.

  * added more dcerpc fault handling code, and translation from
    NTSTATUS to a dcerpc fault code

  * added data_blob_talloc_zero() for allocating an initially zero
    blob

  * added a endpoint enumeration hook in the dcerpc endpoint server
    operations
(This used to be commit 3f85f9b782)
2003-12-13 02:20:40 +00:00