1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00
Commit Graph

94 Commits

Author SHA1 Message Date
Stefan Metzmacher
a28b67c733 r20064: - fix pushing of DeReplicaObjectIdentifierX, this lets the DsAddEntry()
request work correctly
- the error structures all have the same type

metze
(This used to be commit 3322dbd901)
2007-10-10 14:28:57 -05:00
Jelmer Vernooij
8d870db811 r19859: Reuse referrent ids when pushing full pointers (still need to
avoid pushing the referred object twice) and add test for full pointers.
(This used to be commit 1638c8d234)
2007-10-10 14:28:26 -05:00
Stefan Metzmacher
787a4d6f45 r17888: use talloc_*_ptrtype() macros as wrappers arround the talloc_*_size()
functions to get rid of c++ warnings

metze
(This used to be commit 7579503bb8)
2007-10-10 14:16:51 -05:00
Stefan Metzmacher
94bf599886 r15629: fix some warnings
metze
(This used to be commit 803a602990)
2007-10-10 14:07:25 -05:00
Jelmer Vernooij
2420b38336 r15427: Rename private to private_data to prevent errors from C++ errors (which
we care about in Samba3)
(This used to be commit eb07aea711)
2007-10-10 14:05:36 -05:00
Jelmer Vernooij
e002300f23 r15328: Move some functions around, remove dependencies.
Remove some autogenerated headers (which had prototypes now autogenerated by pidl)
Remove ndr_security.h from a few places - it's no longer necessary
(This used to be commit c19c2b51d3)
2007-10-10 14:05:17 -05:00
Jelmer Vernooij
ecf0dd6baf r14488: Install more headers.
Generate different #include lines in pidl depending on whether
we're building inside or outside of the Samba tree (useful for
3rd-party projects).
(This used to be commit 0c18883315)
2007-10-10 13:57:32 -05:00
Jelmer Vernooij
83d8fd3dcf r14484: Install more headers
(This used to be commit 430c6516d3)
2007-10-10 13:57:31 -05:00
Jelmer Vernooij
1060f6b3f6 r14402: Generate seperate headers for RPC client functions.
(This used to be commit 7054ebf024)
2007-10-10 13:57:19 -05:00
Jelmer Vernooij
912f556dba r12651: Remove STR_LARGE_SIZE as it's no longer used
(This used to be commit 8e95aee6fb)
2007-10-10 13:49:35 -05:00
Jelmer Vernooij
2cd5ca7d25 r12542: Move some more prototypes out to seperate headers
(This used to be commit 0aca5fd513)
2007-10-10 13:47:55 -05:00
Jelmer Vernooij
e748b53e43 r12513: Similar change as my previous commit, but now for transfer syntaxes.
Avoids converting a static string to GUID every time we check whether
a transfer syntax is equal to that of NDR.
(This used to be commit 8dcfcaf75a)
2007-10-10 13:47:49 -05:00
Stefan Metzmacher
fd18ab334a r11973: make it easier to find bugs
metze
(This used to be commit 247f90c28d)
2007-10-10 13:46:53 -05:00
Stefan Metzmacher
0e65d30bb7 r10869: add dummy functions and dummy parsing of XPRESS decompression,
this is the compression algorithm used by w2k3 for DsGetNCChanges().

This algorithm isn't known yet, but it seems to be some sort of Lempel-Ziv
algorithm.

metze
(This used to be commit 694252b6e0)
2007-10-10 13:39:38 -05:00
Stefan Metzmacher
ec96a742f7 r9373: - create a hierachical memory tree with recursiv ndr_pull_* functions
- with this it's also possible to talloc_free() the ndr_pull structure
  and talloc_steal(ndr->current_mem_ctx); to fetch the whole data of the hierachical tree
- if the toplevel struct is a valid talloc pointer it's also possible to use
  NDR_PULL_SET_MEM_CTX(ndr, mem_ctx); to the the toplevel pointer with the struct pointer

(NOTE: no callers are using this yet, but they shortly will)

metze
(This used to be commit 1a2b836958)
2007-10-10 13:33:29 -05:00
Andrew Tridgell
8b80ef14fe r8500: greatly reduce the number of build warnings on x86-64 (every NDR macro
in the generated code from pidl generated a warning)
(This used to be commit 22f7fd7634)
2007-10-10 13:23:10 -05:00
Stefan Metzmacher
3d3a86f95d r8227: add STR_LARGE_SIZE flag, to support strings where the size is length+1,
metze
(This used to be commit cdd03fe87d)
2007-10-10 13:19:22 -05:00
Stefan Metzmacher
e296c8de6e r8212: fix pushing of nbt_string's:
- we now use an ndr_token_list, for the nbt string label pointer offsets
  this avoids to scan the whole buffer

- we need to check for already send string on a per component basis
  not only for the fullname

e.g.
w2k3 response this in the CLDAP netlogon replies

forest: w2k3.vmnet1.vm.base
dns_name: sub1.
pdc_dns_name: w2k3-104.

and this will be interpreted like

forest: w2k3.vmnet1.vm.base
dns_name: sub1.w2k3.vmnet1.vm.base
pdc_dns_name: w2k3-104.w2k3.vmnet1.vm.base

metze
(This used to be commit d18303a0e2)
2007-10-10 13:19:20 -05:00
Stefan Metzmacher
148235a009 r8148: - make the PAC generation code a bit more readable and add some outof memory checks
- move to handmodified pull/push code for PAC_BUFFER
  to get the _ndr_size field and the subcontext size right

- after looking closely to the sample w2k3 PAC in our torture test (and some more in my archive)
  I found out that the first uint32 before the netr_SamInfo3 was also a pointer,
  (and we passed a NULL pointer there before, so I think that was the reason why the windows clients doesn't want our PAC)

  w2k3 uses this for unique pointers:

  ptr = ndr->ptr_count * 4;
  ptr |= 0x00020000;
  ndr->ptr_count;

- do one more pull/push round with the sample PAC

metze
(This used to be commit 0eee179415)
2007-10-10 13:19:13 -05:00
Andrew Tridgell
152a6a00c3 r7865: changed pidl to take a "const void *" instead of a "void *" for the
structure in ndr_push_*() and ndr_print_*(). The push and print
functions really should not modify the structure.

metze, to make this work I had to change your spoolss hand
marshaller. Can you please check it is OK? I think that the IN and OUT
sides of that function are not ever called on the same structure, so I
think that attempt at remembering the value by assigning to
r->in._offered was not doing anything anyway, but please correct me if
I have misunderstood it.

If you really do need to remember something on those structures I'd
suggest the ndr_token_store() and ndr_token_retrieve() functions,
which are used by pidl for just this sort of thing.
(This used to be commit eee528be97)
2007-10-10 13:18:44 -05:00
Stefan Metzmacher
19a154fe2b r7186: add [relative_base] property, which is allowed on typedef's
(maybe we could add them to elements latter...)

with this property all relative pointers from inside the struct or union
are relative to the struct/union start

metze
(This used to be commit c0dd18326c)
2007-10-10 13:17:24 -05:00
Stefan Metzmacher
8618c6a906 r7182: remove current support for RELATIVE_CURRENT, this will be replaced with a better aproach later
metze
(This used to be commit 9a4e9f68fb)
2007-10-10 13:17:23 -05:00
Jelmer Vernooij
e427f58622 r6973: Merge new version of pidl into the main SAMBA_4_0 branch.
The main difference in this new version is the extra data structure generated
between the IDL data structure and the NDR parser:

IDL -> NDR -> { ndr_parser, ndr_header, eparser, etc }

This makes the ndr_parser.pm internals much more sane.

Other changes include:

- Remove unnecessary calls with NDR_BUFFERS (for example, GUID doesn't have any buffers, just scalars) as well as some (unnecessary) nested setting of flags.
- Parse array loops in the C code rather then calling ndr_pull_array(). This allows us to have, for example, arrays of pointers or arrays of pointers to arrays, etc..
- Use if() {} rather then if () goto foo; everywhere
- NDR_IN no longer implies LIBNDR_FLAG_REF_ALLOC
- By default, top level pointers are now "ref" (as is the default in
  most other IDL compilers). This can be overridden using the
  default_pointer_top() property.
- initial work on new ethereal parser generators by Alan DeKok and me
- pidl now writes errors in the standard format used by compilers, which
  is parsable by most editors
- ability to warn about the fact that pidl extension(s) have been used,
  useful for making sure IDL files work with other IDL compilers.

oh, and there's probably some other things I can't think of right now..
(This used to be commit 13cf227615)
2007-10-10 13:17:01 -05:00
Andrew Tridgell
2f2fc84a7c r6720: added support for the remaining 2 types of CLDAP netlogon
response.

To work around the fact that the type of the returned data is not
encoded in the packet, this required adding ndr_pull_union_blob()
which allows us to pull a blob into a union with a specified switch
value, in this case the switch value comes from the calling NtVer field.
(This used to be commit bd27e626c2)
2007-10-10 13:16:37 -05:00
Stefan Metzmacher
14b63614fa r6519: move string handling functions to a seperate file
metze
(This used to be commit a29d52817c)
2007-10-10 13:16:21 -05:00
Jelmer Vernooij
3b8c824c16 r6180: Use token_lists for storing switch values
(This used to be commit f66e11137e)
2007-10-10 13:11:23 -05:00
Stefan Metzmacher
0403e2032b r6129: - add our own MSZIP decompression implementation
(taken from cabextract.c from KDE)
  this code maybe need to be rewritten and the
  compression side needs to be done,
  but for now it seems to works

- remove the dependency to zlib

metze
(This used to be commit 5e8558c5b4)
2007-10-10 13:11:20 -05:00
Stefan Metzmacher
5a9ceee7a5 r6061: add start of compression support in our rpc code
this is not complete cuurently...

but I want other people to test it and help me on finishing it.
(try to change the #if 0 in torture/rpc/drsuapi.c into #if 1)

metze
(This used to be commit 335adef370)
2007-10-10 13:11:16 -05:00
Jelmer Vernooij
e9ca6e48ff r5775: Remove some unused functions (unions are no longer as special as they used to be)
Add oxid mapping table support in DCOM
(This used to be commit e193555f0e)
2007-10-10 13:11:02 -05:00
Stefan Metzmacher
1ecdd79847 r5736: fix to avoid endless recursion in ndr_size_*() calculation
metze
(This used to be commit eaac0f2147)
2007-10-10 13:11:00 -05:00
Jelmer Vernooij
ffae01d432 r5672: Use switch_type() and the token storage mechanism for unions:
- Makes union handling less special
 - Allows unions in arrays, etc
 - Compatible with midl
 - Pidl will warn about switch_type() and the type of the switch_is() variable being different
(This used to be commit dc6b4ffc82)
2007-10-10 13:10:58 -05:00
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