summaryrefslogtreecommitdiff
path: root/source4/librpc/ndr/ndr_basic.c
AgeCommit message (Collapse)AuthorFilesLines
2007-10-10r3073: Fix bug in the handling of null-terminated ASCII strings in RPC.Andrew Bartlett1-1/+1
Because we didn't count the null terminator, we would not move past it in the packet. Andrew Bartlett (This used to be commit 8b38bffc7098610c469ab61b7e0e6884f046f286)
2007-10-10r2990: Add support to pidl for autogenerating ndr_size_*() functions. AddingJelmer Vernooij1-0/+12
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 7c823f886afd0c4c6ee838f17882ca0658417011)
2007-10-10r2989: fix the printing of unions with negative cases when :print is usedAndrew Tridgell1-2/+2
(This used to be commit d8152f896119418d95d7697cc2ca23f5319c32a9)
2007-10-10r2987: added support for signed 32 bit integers in pidlAndrew Tridgell1-0/+31
(This used to be commit 24122eb93e39de8db3675618b6c227c95eb58d9c)
2007-10-10r2910: I noticed that the samr torture test was doing its own DOS->UNIXAndrew Tridgell1-129/+138
string conversion. For RPC, all string conversions are supposed to be done by the NDR layer, using string flags set in the IDL. The reason this wasn't working is that I had been too lazy to do the STR_ASCII string types properly at the NDR layer when initially writing ndr_basic.c. This commit fixes the ndr_basic code properly to do all ASCII varients, by re-using the non-ascii code and a "byte_mul" local variable. I have also removed the manual string conversion in the SAMR torture test code. (This used to be commit aad0e7e9d890bb56447f1f933b8f2bb78a3ee269)
2007-10-10r2857: this commit gets rid of smb_ucs2_t, wpstring and fpstring, plus lots ↵Andrew Tridgell1-7/+3
of associated functions. The motivation for this change was to avoid having to convert to/from ucs2 strings for so many operations. Doing that was slow, used many static buffers, and was also incorrect as it didn't cope properly with unicode codepoints above 65536 (which could not be represented correctly as smb_ucs2_t chars) The two core functions that allowed this change are next_codepoint() and push_codepoint(). These functions allow you to correctly walk a arbitrary multi-byte string a character at a time without converting the whole string to ucs2. While doing this cleanup I also fixed several ucs2 string handling bugs. See the commit for details. The following code (which counts the number of occuraces of 'c' in a string) shows how to use the new interface: size_t count_chars(const char *s, char c) { size_t count = 0; while (*s) { size_t size; codepoint_t c2 = next_codepoint(s, &size); if (c2 == c) count++; s += size; } return count; } (This used to be commit 814881f0e50019196b3aa9fbe4aeadbb98172040)
2007-10-10r2552: Character set conversion and string handling updates.Andrew Bartlett1-4/+4
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). (This used to be commit dfecb0150627b500cb026b8a4932fe87902ca392)
2007-10-10r2205: fixed an incorrect cast that broke relative strings in spoolssAndrew Tridgell1-1/+1
(This used to be commit d2d3433de1c1e1bc757381e9736147cc24fe8cf0)
2007-10-10r2180: added RPC flags "padcheck" which enables checking of all received padAndrew Tridgell1-0/+25
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 7fdb778f81f14aaab75ab204431e4342a462957a)
2007-10-10r2159: converted samba4 over to UTF-16.Andrew Tridgell1-4/+4
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 (This used to be commit 756f28ac95feaa84b42402723d5f7286865c78db)
2007-10-10r1994: fix compiler warningStefan Metzmacher1-1/+1
metze (This used to be commit a3a4b9c9ea2692b3ca85d9a4a094e36609831f19)
2007-10-10r1985: take advantage of the new talloc in a few more placesAndrew Tridgell1-11/+11
(This used to be commit 6ffdfd779936ce8c5ca49c5f444e8da2bbeee0a8)
2007-10-10r1847: add STR_BYTESIZE flag, to handle cases whereStefan Metzmacher1-6/+52
the size is in bytes not in unicode chars metze (This used to be commit 6d094d60d377479de28790bad8ceb4c083c902cd)
2007-10-10r1757: much simpler (and smaller, faster etc) way of doing relative pointersAndrew Tridgell1-0/+3
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 ecb7378bbcd86727aedfa04a9e302e06b0a2ccd9)
2007-10-10r1736: - Pidl updates:Jelmer Vernooij1-0/+48
- 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 (This used to be commit 45c3d0036b8510102816f9cdff9210098259cc5f)
2007-10-10r1274: revert -r 1239 as discussed with abartletStefan Metzmacher1-301/+0
metze (This used to be commit 52e2d038252bd745d53c687d266ad3ad62efa6fc)
2007-10-10r1239: move the old msrpc_<gen|parse>() functions to ↵Stefan Metzmacher1-0/+301
ndr_<push|pull>_format_blob() simular to ndr_<push|pull>_struct_blob() metze (This used to be commit b25dd341e0febd550a2936ca484b6fecce2ff8c2)
2007-10-10r1133: - add ndr_pull_ptr() as a separate call instead of ndr_pull_uint32()Andrew Tridgell1-0/+10
(useful for debugging IDL) - fixed a couple of places that auto-generate incorrect printf style arguments for ndr_pull_error() (This used to be commit ad3324a79ce030df4c5ed46408e662b46588f89f)
2007-10-10r1030: added server side schannel supportAndrew Tridgell1-0/+23
(This used to be commit 2ac79dfba0e64056a680f21d7dd0c007f79d4a70)
2007-10-10r937: - added a simple QuerySecurity implementation in samr serverAndrew Tridgell1-0/+12
- moved some sec desc defines into misc.idl - fixed pw_len field in UserInfo26 - made some pipes available on TCP - added netr_DsrEnumerateDomainTrusts() to netlogon - added templates for remaining netlogon IDL calls (from ethereal) - added a unistr_noterm vs unistr error detector in ndr basic decoder - added torture test for netr_DsrEnumerateDomainTrusts() (This used to be commit ae5a5113fb83640dcb9ae4642c1b9eaf28487956)
2007-10-10r895: use _t in base ndr fnsAndrew Tridgell1-4/+4
(This used to be commit b3c00acdf0e85563b5d5ce1f9bc86cc2e781d53e)
2007-10-10r890: convert samba4 to use [u]int8_t instead of [u]int8Stefan Metzmacher1-4/+4
metze (This used to be commit 2986c5f08c8f0c26a2ea7b6ce20aae025183109f)
2007-10-10r889: convert samba4 to use [u]int16_t instead of [u]int16Stefan Metzmacher1-9/+9
metze (This used to be commit af6f1f8a01bebbecd99bc8c066519e89966e65e3)
2007-10-10r884: convert samba4 to use [u]int32_t instead of [u]int32Stefan Metzmacher1-35/+35
metze (This used to be commit 0e5517d937a2eb7cf707991d1c7498c1ab456095)
2007-10-10r873: converted samba4 to use real 64 bit integers instead ofAndrew Tridgell1-16/+61
structures. This was suggested by metze recently. I checked on the build farm and all the machines we have support 64 bit ints, and support the LL suffix for 64 bit constants. I suspect some won't support strtoll() and related functions, so we will probably need replacements for those. (This used to be commit 9a9244a1c66654c12abe4379661cba83a73c4c21)
2007-10-10r275: added IDL and test code for samr_QueryDisplayInfo3(),Andrew Tridgell1-2/+18
samr_AddMultipleMembersToAlias(), samr_RemoveMultipleMembersFromAlias(), samr_OemChangePasswordUser2(), and samr_ChangePasswordUser2() The password change functions don't actually work yet (but should soon). At this stage I have just completed the IDL for them. Next step is to get the hash verifiers right and the torture test should be able to do password changes. (This used to be commit 849d0d314a2add80f2b2be6b503fea05973f998e)
2007-10-10r152: a quick airport commit ....Andrew Tridgell1-1/+1
added ldbedit, a _really_ useful command added ldbadd, ldbdel, ldbsearch and ldbmodify to build solved lots of timezone issues, we now pass the torture tests with client and server in different zones fixed several build issues I know this breaks the no-LDAP build. Wait till I arrive in San Jose for that fix. (This used to be commit af34710d4da1841653624fe304b1c8d812c0fdd9)
2003-12-31the endpoint mapper now works in bigendian modeAndrew Tridgell1-3/+3
(This used to be commit 1f89d89954a3501e08efa97d1276ba9bb2d2305f)
2003-12-16fixed formatting of uuids in debug outputAndrew Tridgell1-1/+1
(This used to be commit 7895796ef8a0dfe5de1404e630b2489fdec39a56)
2003-12-16added support for big-endian ucs2 strings (as used by big-endianAndrew Tridgell1-7/+17
msrpc). this was easier than I expected! (This used to be commit a0a51af6b746b1f82faaa49d33c17fea9d708fb0)
2003-12-16a fairly large commit!Andrew Tridgell1-47/+30
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 bb1af644a5a7b188290ce36232f255da0e5d66d2)
2003-12-12Added routines for arrays of uint16s.Tim Potter1-0/+33
(This used to be commit 370512f6644507ed0457de71ab5a50207e00e750)
2003-12-01added netr_ServerReqChallenge and cleaned up byte array printingAndrew Tridgell1-11/+10
(This used to be commit bb42107dccf3a384a4a5c029b4d2752e0898d7cb)
2003-12-01started adding netlogon IDL and test suiteAndrew Tridgell1-0/+28
(This used to be commit 3d64eefb464d09fb6e84d6139f801887a278cf86)
2003-11-26signed DCERPC over TCP now works !Andrew Tridgell1-50/+14
* moved ntlmssp code into libcli/auth/, and updated to latest ntlmssp code from samba3 (thanks Andrew! the new interface is great) * added signing/ntlmssp support in the dcerpc code * added a dcerpc_auth.c module for the various dcerpc auth mechanisms (This used to be commit c18c9b5585a3e5f7868562820c14f7cb529cdbcd)
2003-11-24added tests for epm_Map endpointer map callsAndrew Tridgell1-0/+3
(This used to be commit 570ad78525ffcc116842270b62ba41c86c2a018d)
2003-11-24added tests for the remaining calls on the rpc management interfaceAndrew Tridgell1-0/+32
(This used to be commit 00f9b0e12061c175334f96805ca8333f28f74d91)
2003-11-24added the dcerpc remote management interfaces as mgmt.idl, and wrote aAndrew Tridgell1-6/+13
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 f94bc079902d725b63155d8d2de5bf408c6e7335)
2003-11-23ooh, this is fun!Andrew Tridgell1-2/+52
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 92bcad02587c3c1b31b523ee9fa46658a6cef9ff)
2003-11-22 * fixed null terminated string handlingAndrew Tridgell1-2/+7
* fixed nested relative offsets in push functions the spoolss torture test now passes! (This used to be commit 60ced76160e4f4e2b511ebbeec31130c8ebcdd22)
2003-11-22a fairly major upgrade to the dcerpc systemAndrew Tridgell1-2/+22
* 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 8ecf720206a2eef3f8ea7cbdb1f460664a5dba9a)
2003-11-21* changed the way strings are handled in pidl to a much more generalAndrew Tridgell1-217/+191
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 d2665f36a75b482ff82733f72ffac938c2acf87a)
2003-11-21added 4 more levels to samr_QueryDisplayInfo()Andrew Tridgell1-21/+44
(This used to be commit f4cc593a5c7d75adaced2c33dd83c2ec741751be)
2003-11-20added samr_LookupNames() and test codeAndrew Tridgell1-1/+9
(This used to be commit f8397cbc8554b721093b8ae6ac6fb26d0ee9a7cf)
2003-11-20EnumPrinterData in spoolss now worksAndrew Tridgell1-0/+66
(This used to be commit af07ca7fbcb4118f2415218d0c48798119b7c6b2)
2003-11-18* use the new auto-generated debug code method.Andrew Tridgell1-0/+10
* add a couple more info levels to wkssvc (This used to be commit c69161bdb13745f271b0cfa9a9af349f7a95edc6)
2003-11-17 * add another WERR err codeAndrew Tridgell1-0/+16
* use the top-level function argument printing to show more detail in RPC-* tests (This used to be commit 33bb8785625b1845750f28f2d810e7096afe9f8e)
2003-11-17security descriptors are no longer a "special" type, they are handledAndrew Tridgell1-5/+41
using the [relative] property this also fixes level3 of PrinterInfo (a relative secdesc) (This used to be commit d5a15257fdd5f6cfe2706765a7c29f623ec1c6f8)
2003-11-17* more info levels for EnumPrinterAndrew Tridgell1-0/+11
* use WERROR return type in spoolss EnumPrinter (This used to be commit 8301a6b6ad45f76a42d0fcab6347c187eee615a9)
2003-11-17nicer method of handling spoolss EnumPrintersAndrew Tridgell1-4/+32
this also handles the return of several printers (an array of relative subcontexts) (This used to be commit 060421c7dc9aa611fe4160843a4f76498ab16bf4)