1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-07 01:58:28 +03:00

89 Commits

Author SHA1 Message Date
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
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
Stefan Metzmacher
52e2d03825 r1274: revert -r 1239 as discussed with abartlet
metze
2007-10-10 12:56:48 -05:00
Stefan Metzmacher
b25dd341e0 r1239: move the old msrpc_<gen|parse>() functions to ndr_<push|pull>_format_blob()
simular to ndr_<push|pull>_struct_blob()

metze
2007-10-10 12:56:46 -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
2ac79dfba0 r1030: added server side schannel support 2007-10-10 12:56:30 -05:00
Andrew Tridgell
ae5a5113fb r937: - added a simple QuerySecurity implementation in samr server
- 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()
2007-10-10 12:56:20 -05:00
Andrew Tridgell
b3c00acdf0 r895: use _t in base ndr fns 2007-10-10 12:56:18 -05:00
Stefan Metzmacher
2986c5f08c r890: convert samba4 to use [u]int8_t instead of [u]int8
metze
2007-10-10 12:56:16 -05:00
Stefan Metzmacher
af6f1f8a01 r889: convert samba4 to use [u]int16_t instead of [u]int16
metze
2007-10-10 12:56:16 -05:00
Stefan Metzmacher
0e5517d937 r884: convert samba4 to use [u]int32_t instead of [u]int32
metze
2007-10-10 12:56:15 -05:00
Andrew Tridgell
9a9244a1c6 r873: converted samba4 to use real 64 bit integers instead of
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.
2007-10-10 12:56:14 -05:00
Andrew Tridgell
849d0d314a r275: added IDL and test code for samr_QueryDisplayInfo3(),
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.
2007-10-10 12:51:19 -05:00
Andrew Tridgell
af34710d4d r152: a quick airport commit ....
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.
2007-10-10 12:51:11 -05:00
Andrew Tridgell
1f89d89954 the endpoint mapper now works in bigendian mode -
Andrew Tridgell
7895796ef8 fixed formatting of uuids in debug output -
Andrew Tridgell
a0a51af6b7 added support for big-endian ucs2 strings (as used by big-endian
msrpc).

this was easier than I expected!
-
Andrew Tridgell
bb1af644a5 a fairly large commit!
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.
-
Tim Potter
370512f664 Added routines for arrays of uint16s. -