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

63 Commits

Author SHA1 Message Date
Jelmer Vernooij
75b3cfc17d r5663: Revert some changes I didn't mean to commit...
(This used to be commit 54e0be6f1e)
2007-10-10 13:10:57 -05:00
Jelmer Vernooij
631aa1f0ef r5661: Be a little stricter on syntax regarding arrays. A pointer to an
array can now only be :

 type *name[];

rather then :

 type *name;

which was supported in the past. Warnings will be given when the first
syntax is used. Reasons for this change in behaviour include improved
readability and the fact that the second format makes dealing with multiple
levels of pointers harder.
(This used to be commit a416de5825)
2007-10-10 13:10:57 -05:00
Jelmer Vernooij
67bc7ddbe9 r5360: Remove a couple of unused functions.
(This used to be commit d8a0a69721)
2007-10-10 13:09:45 -05:00
Jelmer Vernooij
632acd9bc7 r5286: Some first steps in making the pidl code somewhat more generic for the
various data types:

Add ndr_flags argument to all ndr push/pull scalar functions
(This used to be commit ab490c0c88)
2007-10-10 13:09:36 -05:00
Andrew Tridgell
2c0a1f5391 r5084: - handle arbitrary data in the NULL record reply type for nbt name queries
- fixed unaligned pulls at the end of the packet in the ndr lib
(This used to be commit 61c43509f7)
2007-10-10 13:09:20 -05:00
Andrew Tridgell
3dd17f1288 r5034: - added a type mapping function in pidl, so the type names in our IDL
files don't need to match the type names in the generated headers

- with this type mapping we no longer need definitions for the
  deprecated "int32", "uint8" etc form of types. We can now force
  everyone to use the standard types int32_t, uint8_t etc.

- fixed all the code that used the deprecated types

- converted the IDL types "int64" and "uint64" to "dlong" and
  "udlong". These are the 4 byte aligned 64 bit integers that
  Microsoft internally define as two 32 bit integers in a
  structure. After discussions with Ronnie Sahlberg we decided that
  calling these "int64" was confusing, as it implied a true 8 byte
  aligned type

- fixed all the cases where we incorrectly used things like
  "NTTIME_hyper" in our C code. The generated API now uses a NTTIME for
  those. The fact that it is hyper-aligned on the wire is not relevant
  to the API, and should remain just a IDL property
(This used to be commit f86521677d)
2007-10-10 13:09:15 -05:00
Andrew Tridgell
ea923fb4a2 r4885: added a new NBT client library. Features include:
- structures defined using IDL in nbt.idl
 - build around our events structure, and talloc
 - fully async
 - supports all NBT packet fields as per rfc1002
 - easy interfaces for name query and status

For the moment there are just a couple of test functions in
namequery.c, test_name_query() and test_name_status(). These will be
removed when we hook the new library into libcli/ fully

The new library will also be a fairly good basis for a nbt
server. Although it can't be a server as-is, I wrote it with the needs
of a server in mind (for example, extremely scalable idtree based
packet handling)
(This used to be commit ae7e625bfa)
2007-10-10 13:09:01 -05:00
Andrew Tridgell
11ce2cfd70 r4591: - converted the other _p talloc functions to not need _p
- added #if TALLOC_DEPRECATED around the _p functions

- fixes the code that broke from the above

while doing this I fixed quite a number of places that were
incorrectly using the non type-safe talloc functions to use the type
safe ones. Some were even doing multiplies for array allocation, which
is potentially unsafe.
(This used to be commit 6e7754abd0)
2007-10-10 13:08:30 -05:00
Andrew Tridgell
e159e42d84 r4550: talloc() is now typesafe. It is exactly equivalent to the old talloc_p() macro. Use
talloc_size() if you want the old behaviour.

I have kept talloc_p() as an alias for now. Once we change all calls
to be plain talloc() then we can remove it.
(This used to be commit 2011bbeb84)
2007-10-10 13:08:26 -05:00
Andrew Tridgell
74eb0017be 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 :-)
(This used to be commit e839b19ec5)
2007-10-10 13:06:27 -05:00
Stefan Metzmacher
87d5e061e0 r4102: more uint64 vs HYPER_T fixes
NOTE:
 [u]int64 uses 4 Byte alignment
 and HYPER_T uses 8 Byte alignment

metze
(This used to be commit 717454eb2f)
2007-10-10 13:06:26 -05:00
Andrew Tridgell
c9932a3a92 r4051: use talloc_array() instead of talloc() when allocating arrays in auto-generated ndr code
(This used to be commit 90cdfd921e)
2007-10-10 13:06:18 -05:00
Stefan Metzmacher
05def77d80 r3984: success full parse the repsFrom/repsTo LDAP fields
metze
(This used to be commit 56c66f4a09)
2007-10-10 13:06:11 -05:00
Stefan Metzmacher
e547588368 r3956: start to decode the repsFrom and repsTo fileds but not ready
metze
(This used to be commit 44f168c44d)
2007-10-10 13:06:07 -05:00
Jelmer Vernooij
8c2e179d47 r3611: DCOM client support works!!
The torture test DCOM-SIMPLE now successfully does an
IStream_Read and a IStream_Write call.

This test can now be run successfully against the "Simple DCOM" Visual
Studio example.

(You have to quote out line 337 in pidl. pidl complains if the variable
 that contains the array size follows the array. I still need to fix this
 properly)

Next goals:
 - Clean up code
 - Server side support
 - Support custom marshalling
 - Support DCOM interfaces in files other then dcom.idl
(This used to be commit 8693344772)
2007-10-10 13:05:39 -05:00
Andrew Tridgell
12f4a44cf5 r3549: added support for DOS extended attribute lists (name/value pairs)
stored in posix xattrs
(This used to be commit bad6a88371)
2007-10-10 13:05:31 -05:00
Stefan Metzmacher
a2fd2488c7 r3484: - add support for conformant string arrays at the end of a struct
- add support for strings where the length excludes the NULLTERM

metze
(This used to be commit 8251d8b3e5)
2007-10-10 13:05:21 -05:00
Andrew Tridgell
37fffa54cf r3424: don't run mkproto.pl on pidl generated code, instead rely on pidl generating the
prototypes itself
(This used to be commit e694aeefe7)
2007-10-10 13:05:08 -05:00
Andrew Tridgell
74dd7d9062 r3395: added support for "string32" type, to fix the fixed width string
problem that tim found.
(This used to be commit 2cf35cb4d2)
2007-10-10 13:05:05 -05:00
Jelmer Vernooij
fe15b46d61 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.
(This used to be commit 7c823f886a)
2007-10-10 12:59:55 -05:00
Andrew Tridgell
8d0f79595b 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)
(This used to be commit dbe6430d78)
2007-10-10 12:59:50 -05:00
Andrew Tridgell
6a2422932b 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 :)
(This used to be commit bd45329a3f)
2007-10-10 12:58:31 -05:00
Andrew Tridgell
4d390df586 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.
(This used to be commit 7fdb778f81)
2007-10-10 12:58:29 -05:00
Andrew Tridgell
b7e1ea20dc r1985: take advantage of the new talloc in a few more places
(This used to be commit 6ffdfd7799)
2007-10-10 12:58:14 -05:00
Stefan Metzmacher
1a89c76c93 r1884: remove empty header file
metze
(This used to be commit 874d450609)
2007-10-10 12:58:08 -05:00
Stefan Metzmacher
10126065d4 r1848: fix LIBNDR_STRING_FLAGS to include LIBNDR_STRING_BYTESIZE
metze
(This used to be commit 7f1fceeb7f)
2007-10-10 12:58:01 -05:00
Stefan Metzmacher
07eab50180 r1847: add STR_BYTESIZE flag, to handle cases where
the size is in bytes not in unicode chars

metze
(This used to be commit 6d094d60d3)
2007-10-10 12:58:01 -05:00
Andrew Tridgell
e2357c67f5 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.
(This used to be commit ecb7378bbc)
2007-10-10 12:57:54 -05:00
Tim Potter
638d332495 r1269: Add a 'base' field to the ndr_ofs_list structure which is the base to
which the offset applies to.  In an array of structures containing
relative members, the offset applies to the start of the array element
being marshalled.  Previously, there was no way to access the relevant
structure start as by the time we have hit buffers, the head of the
offset list will be the last structure being marshalled.

Interestingly enough, this makes relstrs go away.  I think we thought
they were a special case in samba 3 but it turns out they are just
regular relative elements in the idl.  This makes spoolss a lot simpler
than I thought it would be.

I've run the samr and lsa tests and this doesn't seem to break anything.
It looks like security descriptors are the only structures that contain
relative members.

Oh yeah, this will probably require a 'make clean && make' otherwise you
will get bizzare errors.
(This used to be commit d379dcdfd5)
2007-10-10 12:56:47 -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
2558f81a8d the endpoint mapper now works in bigendian mode
(This used to be commit 1f89d89954)
2003-12-31 01:32:33 +00:00
Andrew Tridgell
06ae424835 * 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
(This used to be commit 3dd978b12b)
2003-12-02 00:31:54 +00:00
Andrew Tridgell
5b46116923 added netr_ServerReqChallenge and cleaned up byte array printing
(This used to be commit bb42107dcc)
2003-12-01 03:19:43 +00:00
Andrew Tridgell
df5949efb4 added auto-generation of the IDL interface tables. This makes two less
places that need to be edited when someone adds a new IDL file.
(This used to be commit ccd9ddeed6)
2003-11-28 00:48:05 +00:00
Andrew Tridgell
c7fd83d0b2 added the dcerpc remote management interfaces as mgmt.idl, and wrote a
test suite. The test suite dumps all of the interfaces available on
all pipes. There sure are a lot more interfaces on w2k3 than w2k !
(This used to be commit f94bc07990)
2003-11-24 01:24:29 +00:00
Andrew Tridgell
800d3e0134 ooh, this is fun!
I have recoded the core dcerpc packet structures (all the PDUs etc) in
terms of IDL, which means we now use pidl to generate all the code for
handling the most basic dcerpc packets. This is not normally possible
as it isn't completely valid NDR, but pidl has a number of extensions
that make it quite easy.

This also means we get the server side dcerpc
marshalling/unmarshalling code for free.
(This used to be commit 92bcad0258)
2003-11-23 06:28:12 +00:00
Andrew Tridgell
86a604429e a fairly major upgrade to the dcerpc system
* added a NDR validator. The way it works is that when the
   DCERPC_DEBUG_VALIDATE_* flags are set the dcerpc system will
   perform NDR buffer validation. On sending a request the packet is
   first marshalled, then unmarahslled, then marshalled again, and it is
   confirmed that the two marshalling results are idential. This
   ensures that our pull and push routines are absolutely in sync, so
   that we can be very confident that if a routine works in the client
   then the corresponding routine must work on the server side. A
   similar validation is performed on all replies.

 * a result of this change is that pidl is fussier about the [ref]
   tag. You can only use it on pointers (which is the only place it
   makes sense)

 * fixed a basic alignment bug in the push side of the NDR code

 * added server side pull/push support. Our dcerpc system is now fully
   ready to be used on the server side.

 * fixed the relative offset pointer list. It must be traversed in
   reverse order on push

 * added automatic value setting for the size parameter in outgoing
   SdBuf structures.

 * expanded the ndr debugging code to always give a message on any
   failure

 * fixed the subcontext push code

 * fixed some memory leaks in smbtorture RPC tests
(This used to be commit 8ecf720206)
2003-11-22 08:11:32 +00:00
Andrew Tridgell
a465add90f * changed the way strings are handled in pidl to a much more general
interface. We now support an arbitrary set of flags to each parser,
  and these can be used to control the string types. I have provided
  some common IDL string types in librpc/idl/idl_types.h which needs to
  be included in every IDL file.

* added IDL for the endpoint mapper. Added a test suite that enumerates
  all endpoints on the server.
(This used to be commit d2665f36a7)
2003-11-21 13:14:17 +00:00
Tim Potter
49c02c6634 Start of winreg idl. Implement OpenHKLM, GetVersion and CloseKey.
(This used to be commit c8b87f5feb)
2003-11-21 05:28:36 +00:00
Tim Potter
20730626af Add initial work on eventlog - doesn't quite work yet.
(This used to be commit 99fff7b1e2)
2003-11-20 21:52:40 +00:00
Andrew Tridgell
b1e5882eb3 * fixed libndr.h header
* "make clean" now removed the generated files
(This used to be commit 683259a4dd)
2003-11-20 11:17:06 +00:00
Tim Potter
8f0f97b078 Added ATSVC pipe.
(This used to be commit 2740584867)
2003-11-20 03:27:56 +00:00
Andrew Tridgell
308cc429eb added samr_LookupNames() and test code
(This used to be commit f8397cbc85)
2003-11-20 03:09:19 +00:00
Andrew Tridgell
10ee36bede switched to a new way of handling unions, so that we can handle
alignment correctly for unions that have non-uint16 discriminants

fixed the union handling in srvsvc.idl. (metze, please take a look at
the changes, your IDL did match what was one the wire in most cases,
but isn't the way IDL is usually coded)
(This used to be commit 7b5d028729)
2003-11-19 22:10:20 +00:00
Andrew Tridgell
4e18040236 srvsvc IDL and test code from metze. Thanks!
(This used to be commit 54d3cb22dc)
2003-11-19 09:15:46 +00:00
Andrew Tridgell
892aa2fc75 added wkssvc.idl and test code
I think this is our first complete pipe for Samba4 (albeit a simple
one). Of course, there may be lots more info levels that Samba3 didn't
do. Time to explore :)
(This used to be commit 3305226140)
2003-11-17 12:43:18 +00:00
Andrew Tridgell
d285c6f14f * add another WERR err code
* use the top-level function argument printing to show more detail in
   RPC-* tests
(This used to be commit 33bb878562)
2003-11-17 11:55:56 +00:00
Andrew Tridgell
59df3ce5b5 security descriptors are no longer a "special" type, they are handled
using the [relative] property

this also fixes level3 of PrinterInfo (a relative secdesc)
(This used to be commit d5a15257fd)
2003-11-17 06:27:45 +00:00
Andrew Tridgell
90916de4a5 * more info levels for EnumPrinter
* use WERROR return type in spoolss EnumPrinter
(This used to be commit 8301a6b6ad)
2003-11-17 02:58:10 +00:00
Andrew Tridgell
657b4d2abd nicer method of handling spoolss EnumPrinters
this also handles the return of several printers (an array of relative
subcontexts)
(This used to be commit 060421c7dc)
2003-11-17 02:18:11 +00:00