1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-31 01:48:16 +03:00

108 Commits

Author SHA1 Message Date
Stefan Metzmacher
748ab5449b r6574: send a value for embedded ref pointers,
(this fixes the doublepointer test against w2k3)

but we accept zero pointers on the receive side,
because it's used in DRSUAPI

metze
2007-10-10 13:16:27 -05:00
Stefan Metzmacher
a29d52817c r6519: move string handling functions to a seperate file
metze
2007-10-10 13:16:21 -05:00
Jelmer Vernooij
4089d5f67d r5977: Fix uninitialised memory bug in ndr_pull_ref_ptr(). This fixes the
Test_DoublePointer test failure.
2007-10-10 13:11:11 -05:00
Jelmer Vernooij
ea61ec1122 r5866: Add InitShutdown IDL and torture test.
Implement push side of NDR_LEN4|NDR_NOTERM strings (pull side was already present)
2007-10-10 13:11:05 -05:00
Stefan Metzmacher
8ac0928a91 r5796: add ndr_* function for int8 and int16
metze
2007-10-10 13:11:03 -05:00
Stefan Metzmacher
a8f7c3e59f r5765: remove unused var
metze
2007-10-10 13:11:01 -05:00
Stefan Metzmacher
112043b180 r5764: add support for embedded ref pointers
metze
2007-10-10 13:11:01 -05:00
Jelmer Vernooij
fa97059d00 r5427: NTSTATUS is treated by pidl as a 'real' scalar now. 2007-10-10 13:10:45 -05:00
Andrew Tridgell
bc8d60c918 r5414: - added libcli/wins/, a basic client library for WINS replication
- added a new IDL type "udlongr", which is like udlong, but with the
  two uint32 halves reversed

- modified the winsrepl.idl to cope with a wider range of packets
2007-10-10 13:10:43 -05:00
Jelmer Vernooij
efc2e41b8d r5376: ORPC is NDR specific, so move it to ndr.pm.
Get rid of register_enum/register_bitmap, etc. (use list of
types in ndr.pm instead)
2007-10-10 13:09:48 -05:00
Jelmer Vernooij
53b4ecbcc7 r5363: - ndr_%_ptr -> ndr_%_unique_ptr
- ndr_%_relative% -> ndr_%_relative_ptr%
- Change pointer_default() default to "unique"
  (DCE uses "ptr" as default, MIDL doesn't follow the standard and uses "unique")
2007-10-10 13:09:46 -05:00
Jelmer Vernooij
c9d7b88756 r5361: Rename some functions, add tests to validator. 2007-10-10 13:09:46 -05:00
Jelmer Vernooij
ab490c0c88 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
2007-10-10 13:09:36 -05:00
Andrew Tridgell
72048e3717 r5155: define ipv4address as a based IDL type, mapped to a "const char *" in
the header, and defined on the wire as a 4 byte network byte order
IP. This means the calling code doesn't have to worry about network
byte order conversions.
2007-10-10 13:09:28 -05:00
Stefan Metzmacher
8507a57b88 r5139: fix types
metze
2007-10-10 13:09:26 -05:00
Andrew Tridgell
2dd7ccf724 r5118: added support for node status replies in nbtd. nmblookup -S now works against Samba4.
Also added support for the '*' wildcard name
2007-10-10 13:09:24 -05:00
Andrew Tridgell
1d1a9c11ee r5036: changed HYPER_T to the more standard "hyper" 2007-10-10 13:09:15 -05:00
Andrew Tridgell
f86521677d 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
2007-10-10 13:09:15 -05:00
Andrew Tridgell
ae7e625bfa 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)
2007-10-10 13:09:01 -05:00
Stefan Metzmacher
0d2286ba56 r4676: NTTIME_1sec is a standard NTTIME for the calling code
as it's already converted in the pull/push code

metze
2007-10-10 13:08:41 -05:00
Andrew Bartlett
1fed79cb0f r4673: Fix the IDL for the QuerySecret LSA call.
This call uses a new IDL type, NTTIME_hyper.  This is 8-byte aligned,
as the name suggests.

Expand the QuerySecret LSA calls in RPC-SAMLOGON and RPC-LSA, to
validate the behaviour of times, and of the old secrets.

Thanks to tridge for spotting the use of HYPER!

Andrew Bartlett
2007-10-10 13:08:40 -05:00
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
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
29955004aa r4519: added the enum print function in ndr_basic.c 2007-10-10 13:08:17 -05:00
Stefan Metzmacher
717454eb2f r4102: more uint64 vs HYPER_T fixes
NOTE:
 [u]int64 uses 4 Byte alignment
 and HYPER_T uses 8 Byte alignment

metze
2007-10-10 13:06:26 -05:00
Stefan Metzmacher
623411f74e r3997: fix STR_CHARLEN pull case
metze
2007-10-10 13:06:12 -05:00
Stefan Metzmacher
523e6acf4f r3972: use GUID_* naming context and move GUID_* functions to one place
metze
2007-10-10 13:06:09 -05:00
Stefan Metzmacher
db35f3b0f9 r3869: in the NDR encoded replPropertyMetaData attribute in ADS
I see a new 64 bit time field which are seconds since 1601,

this will be mapped to NTTIME by th eparsing code

+#define NTTIME_1sec NTTIME

metze
2007-10-10 13:05:59 -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
Stefan Metzmacher
8bd2e3cb4e r3787: a function to generate a random GUID
metze
2007-10-10 13:05:53 -05:00
Stefan Metzmacher
436da375a2 r3785: this strings are not const
metze
2007-10-10 13:05:53 -05:00
Stefan Metzmacher
07405f1c67 r3582: more gcc-4.0 signedness fixes
metze
2007-10-10 13:05:35 -05:00
Andrew Tridgell
bad6a88371 r3549: added support for DOS extended attribute lists (name/value pairs)
stored in posix xattrs
2007-10-10 13:05:31 -05:00
Stefan Metzmacher
f631069582 r3512: - support DsCrackName GUID strings ('{faedf4f9-0de8-4582-b8b6-c475efefbe5a}')
- resolve the GUID's we got in DsGetDomainControllerInfo in the DsCrackNames test

metze
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
Jelmer Vernooij
0873bf2cbe r3432: Support WERROR's in arguments (not just as return type). Some of
the DCOM calls are wrappers around several local calls, so you get things like:

WERROR foobar ( [in] int num_ifaces,
			   [in,size_is(num_ifaces)] IID *ifaces,
			   [out,size_is(num_ifaces)] WERROR *results);
2007-10-10 13:05:10 -05:00
Andrew Tridgell
2cf35cb4d2 r3395: added support for "string32" type, to fix the fixed width string
problem that tim found.
2007-10-10 13:05:05 -05:00
Andrew Bartlett
8b38bffc70 r3073: Fix bug in the handling of null-terminated ASCII strings in RPC.
Because we didn't count the null terminator, we would not move past it
in the packet.

Andrew Bartlett
2007-10-10 13:01:55 -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
d8152f8961 r2989: fix the printing of unions with negative cases when :print is used 2007-10-10 12:59:55 -05:00
Andrew Tridgell
24122eb93e r2987: added support for signed 32 bit integers in pidl 2007-10-10 12:59:54 -05:00
Andrew Tridgell
aad0e7e9d8 r2910: I noticed that the samr torture test was doing its own DOS->UNIX
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.
2007-10-10 12:59:47 -05:00
Andrew Tridgell
814881f0e5 r2857: this commit gets rid of smb_ucs2_t, wpstring and fpstring, plus lots 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;
}
2007-10-10 12:59:39 -05:00
Andrew Bartlett
dfecb01506 r2552: Character set conversion and string handling updates.
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).
2007-10-10 12:59:05 -05:00
Andrew Tridgell
d2d3433de1 r2205: fixed an incorrect cast that broke relative strings in spoolss 2007-10-10 12:58:31 -05:00
Andrew Tridgell
7fdb778f81 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.
2007-10-10 12:58:29 -05:00
Andrew Tridgell
756f28ac95 r2159: converted samba4 over to UTF-16.
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
2007-10-10 12:58:27 -05:00
Stefan Metzmacher
a3a4b9c9ea r1994: fix compiler warning
metze
2007-10-10 12:58:15 -05:00
Andrew Tridgell
6ffdfd7799 r1985: take advantage of the new talloc in a few more places 2007-10-10 12:58:14 -05:00
Stefan Metzmacher
6d094d60d3 r1847: add STR_BYTESIZE flag, to handle cases where
the size is in bytes not in unicode chars

metze
2007-10-10 12:58:01 -05:00