1
0
mirror of https://github.com/samba-team/samba.git synced 2025-10-28 03:33:13 +03:00
Commit Graph

108 Commits

Author SHA1 Message Date
Stefan Metzmacher
c3b2d2cca3 r4557: support for [flags()] on typedef enum|bitmap
NDR_PAHEX is handled by ndr_print_enum() now

metze
2007-10-10 13:08:27 -05:00
Stefan Metzmacher
a8d61aa473 r4551: add support for a pidl extensions
'declare bitmap foo1;'
'declare enum foo2;'

and also allow

typedef [public] bitmap ...
typedef [public] enum ...

you need to a forward declaration of bitmaps and enums

when you want to use them in another idl file,
and you need to make the real declaration to be public

see the next commit to samr.idl and netlogon.idl

metze
2007-10-10 13:08:26 -05:00
Stefan Metzmacher
2f3aea72ee r4540: sync enum and bitmap code
metze
2007-10-10 13:08:19 -05:00
Stefan Metzmacher
052a7d4f9a r4535: add full support for
typedef bitmap {
    FLAG1 = 0x01
} fooflags;

typedef struct {
    fooflags flags;
}

metze
2007-10-10 13:08:19 -05:00
Andrew Tridgell
1a24a50384 r4526: - much simpler (and more accurate!) ndr_size_*() code generation. It
is less efficient, but I really doubt that matters.

- use enum in epmapper.idl for protocol type

- added support for "enum8bit" flag, used in epmapper.idl
2007-10-10 13:08:18 -05:00
Andrew Tridgell
0939b83a0f r4523: the PROPERTIES change for typedef was not quite as simple as I thought. This puts in a workaround
that fixes things for now
2007-10-10 13:08:18 -05:00
Andrew Tridgell
dee8eff259 r4521: fixed up the handling of PROPERTIES elements after the change to support enum 2007-10-10 13:08:18 -05:00
Andrew Tridgell
1852033f2e r4518: added proper support for "typedef enum" in pidl. We can now use enums as types in switch
statements and variable types, and the value will be printed with its string name and value
2007-10-10 13:08:17 -05:00
Tim Potter
60f266bf6a r4509: Add missing cr. 2007-10-10 13:08:16 -05:00
Andrew Tridgell
e399834ae1 r4170: don't check array size for conformant arrays (they are checked separately) 2007-10-10 13:07:22 -05:00
Andrew Tridgell
3040cd6515 r4139: 2nd attempt at fixing the null ptr in size_is() problem. 2007-10-10 13:06:30 -05:00
Andrew Tridgell
8cbd3f47a9 r4136: when we have a size or switch variable that is a pointer we need to check that the server
hasn't given us a null pointer, otherwise we can segv when we dereference it. For example:

  [size_is(*size)] *x;
  uint32 *size;

if a broken server gave us x != NULL and size == NULL then we would crash. I've added
a check_null_pointer() call in pidl to catch this.
2007-10-10 13:06:29 -05:00
Andrew Tridgell
83221a0da0 r4112: when a pointer is NULL on the wire ensure it is null in the structure 2007-10-10 13:06:27 -05:00
Andrew Tridgell
e839b19ec5 r4110: fixed pidl to allow arrays to have size_is() and length_is() elements
that depend on variables that come after the array in the structure or function.

This has been something that has been problematic for a while, but the
winreg QueryValue problem finally prompted me to fix it properly. We
should now go back and fix up all the ugly workarounds we have used to
avoid this problem in other calls.

Unfortunately the solution is fairly complex, and involves the use of
the internal ndr token lists (similar to the solution for relative
pointers). I wonder if anyone else will be able to follow the logic if
I get run over by a bus :-)
2007-10-10 13:06:27 -05:00
Jelmer Vernooij
a00bda88e1 r3861: - Put ndr and rpc client code in seperate files
- Add some const
2007-10-10 13:05:58 -05:00
Jelmer Vernooij
3c436590ae r3790: use a registration function that is called from dcerpc_*_init functions
rather then a large table in librpc/gen_ndr/tables.c. This will allow us
to only link in only the required gen_ndr files (speeds up linking quite a
bit, makes binaries smaller).

Each gen_ndr_* file now has a init function that calls the init functions
of the interfaces it contains. I did it this way to keep pidl's code simple,
though it might hurt startup time a bit. I'd be happy to change it if
people like one function better.
2007-10-10 13:05:53 -05:00
Jelmer Vernooij
7466947a23 r3689: Large number of COM updates:
- Work on server side and local COM support (should work, just no
	  example classes yet)
 - Use vtables so that local and remote calls can be used transparently
 - Generate 'proxies and stubs' rather then heavily modified code in client.pm and server.pm. proxies (client side code) are generated in proxy.pm, stubs (server side dispatchers) are generated in stubs.pm
 - Support registering classes and interfaces
 - DCOM interfaces no longer have to be in the same IDL file as their
    base interface, which will allow us to split up dcom.idl
2007-10-10 13:05:44 -05:00
Jelmer Vernooij
709f279b19 r3626: More minor DCOM fixes 2007-10-10 13:05:40 -05:00
Jelmer Vernooij
54e1e5edca r3606: More DCOM fixes:
- OXID tables work now. IOXIDResolver is used if there is used for getting a STRINGBINDING if none is known yet
 - Add custom dissectors for STRINGARRAY and DUALSTRINGARRAY. If there's a way to get rid of these later on (by supporting them thru pidl somehow), I'd be happy to use that instead of doing it manually.

I can now get to the point where we have created an object and are connected to
it. The only thing left to do is being able to set the Object UUID properly..
2007-10-10 13:05:38 -05:00
Jelmer Vernooij
c052f2e1ed r3513: Add (the infrastructure for) DCOM support. Contents:
- Support for sending over the object UUID in DCERPC calls
 - Simple torture test for the DCOM "Simple" object
 - Generate extra argument for "object" interfaces in pidl
 - Some stubs for common DCOM functions
2007-10-10 13:05:23 -05:00
Stefan Metzmacher
8251d8b3e5 r3484: - add support for conformant string arrays at the end of a struct
- add support for strings where the length excludes the NULLTERM

metze
2007-10-10 13:05:21 -05:00
Andrew Tridgell
b8f5fa8ac8 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.
2007-10-10 13:05:09 -05:00
Andrew Tridgell
009488dfe5 r3423: auto-generate prototypes for all external functions in pidl 2007-10-10 13:05:08 -05:00
Jelmer Vernooij
f3da7c8b44 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).
2007-10-10 13:01:53 -05:00
Jelmer Vernooij
7c823f886a r2990: Add support to pidl for autogenerating ndr_size_*() functions. Adding
the [gensize] property to a struct or union will make pidl generate a
ndr_size_*() function.

(not all nasty bits of NDR are completely covered yet by the
 ndr_size*() functions, support for those will be added when necessary)

I also have a local patch (not applied now) that simplifies the pidl output
and eliminates the number of functions required. It would, however, make
pidl more complex.
2007-10-10 12:59:55 -05:00
Andrew Tridgell
21ed51d47f r2988: this should fix support for negative switch levels in PIDL 2007-10-10 12:59:55 -05:00
Andrew Tridgell
cc00f9b6b8 r2968: fixed the byte order problem with the new RHS parsing on ncacn_ip_tcp 2007-10-10 12:59:53 -05:00
Andrew Tridgell
dbe6430d78 r2948: added support for the [range(low,high)] attribute in pidl. This allows
range checking of any integer value, to help protect against denial of
service attacks (which could otherwise cause large memory allocations)
2007-10-10 12:59:50 -05:00
Jelmer Vernooij
309623447e r2933: Only pull a union once when it occurs in a subcontext 2007-10-10 12:59:49 -05:00
Jelmer Vernooij
85fb26a05d r1786: Add support for the 'helpstring' attribute on interfaces 2007-10-10 12:57:56 -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
45c3d0036b r1736: - Pidl updates:
- Support for "object oriented" interfaces in pidl
 - Support for inherited interfaces in pidl
 - Simplification of the support for properties on an interface
- Start on dcom rpc torture tests
2007-10-10 12:57:51 -05:00
Andrew Tridgell
0d063725e1 r1671: make [relative] pointers in idl much more generic, treating them just
like normal pointers in most cases. This means we can now support
relative pointers to unions, builtin types etc, whereas we could only
previously support relative pointers to structures.

metze needs this for the PAC decoding.
2007-10-10 12:57:48 -05:00
Tim Potter
d9b4e45f46 r1611: Put a brace on a new line. 2007-10-10 12:57:44 -05:00
Andrew Tridgell
0a67b9c324 r1148: fixed a minor formatting error in generated code 2007-10-10 12:56:41 -05:00
Andrew Tridgell
ad3324a79c r1133: - add ndr_pull_ptr() as a separate call instead of ndr_pull_uint32()
(useful for debugging IDL)

- fixed a couple of places that auto-generate incorrect printf style arguments
  for ndr_pull_error()
2007-10-10 12:56:39 -05:00
Andrew Tridgell
dffe916516 r1014: change the handling of r->out to auto-zero the structure, and auto-copy
in,out,ref vars
2007-10-10 12:56:26 -05:00
Andrew Tridgell
20cc981e33 r894: use _t in generated pidl code 2007-10-10 12:56:18 -05:00
Andrew Tridgell
866ef2edab added a little bit of const magic to get rid of the data in librpc/gen_ndr/*.o -
Andrew Tridgell
a4aa9168c0 make pidl no longer dependent on Data::Dumper, which isn't installed
on some systems
-
Andrew Tridgell
fa45529af7 fixed the handling of zero-length top level arrays in pidl -
Andrew Tridgell
5fed4681ed fix _ptr_ declaration -
Andrew Tridgell
28fa62d63d handle the auto-allocation of [ref] output arrays in pidl. This
can simplify rpc servers a lot.
-
Andrew Tridgell
46e0a35819 * the RPC-ECHO pipe now works in smbd, as long as the data sizes
don't cause fragmented pdus (I'll add fragments shortly)

 * change data_blob_talloc() to not zero memory when the 2nd argument
   is NULL. The zeroing just masks bugs, and can't even allow a DOS
   attack

 * modified pidl to ensure that [ref] arguments to the out side of
   functions are allocated when parsing the in side. This allows rpc
   backends to assume that [ref] variables are all setup. Doesn't work
   correctly for [ref] arrays yet

 * changed DLIST_ADD_END() to take the type instead of a tmp
   variable. This means you don't need to declare a silly tmp variable in
   the caller
-
Andrew Tridgell
c598590a11 more portable array of endpoints code from pidl -
Andrew Tridgell
c4c09e9413 netr_DatabaseSync() now works fully for databases 0, 1 and 2 -
Andrew Tridgell
3dd978b12b * netr_ServerPasswordSet() now works - the test suite changes the
machine account password.

  * neater handling on value() options in IDL. The auto-print code
    will now display the right value so you don't need to initialise
    it in your C code
-
Andrew Tridgell
4fa3ad3ecb added netr_LogonSamLogon() and test code -
Andrew Tridgell
bb42107dcc added netr_ServerReqChallenge and cleaned up byte array printing -
Andrew Tridgell
c8b8480244 * added a bunch of placeholder IDL files
* allow for an interface to list its endpoints in the IDL file, so we
   can automatically make the server listen on the right pipes, and
   can scan pipes more easily (I don't take advantage of this yet,
   just putting the infrastructure in place)
-