1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-10 01:18:15 +03:00
Commit Graph

499 Commits

Author SHA1 Message Date
Andrew Tridgell
45508b85da r2969: inet_ntoa() takes an address in network byte order, so now that we
parse the RHS as IDL, we need to use htonl() to convert back to
network byte order before we can display the IP
2007-10-10 12:59:53 -05:00
Stefan Metzmacher
eff51fc623 r2952: add idl and torture test for DsCrackNames
(I need to find out what the fields mean but it works)

metze
2007-10-10 12:59:51 -05:00
Jelmer Vernooij
273d0049b5 r2938: Use IDL to dissect the RHS of floors in protocol towers 2007-10-10 12:59:50 -05:00
Andrew Tridgell
1d21c9a9d1 r2929: longhorn does not produce sorted directory listings! This is
excellent, as it means we don't lose any compatibility by also not
giving sorted listings. I was very much afraid that applications had
begun to rely on this (as its guaranteed by w2k NTFS).

no longer mark a non-sorting server as an error
2007-10-10 12:59:49 -05:00
Jelmer Vernooij
f355cd4264 r2921: Add a few more protocols and fix the numbers associated with some of
the current ones. It took me three hours to realise that the DCOM standard
contains false protocol numbers (apparently someone converted the protocol
numbers to hex twice, i.e. 13 -> 0c and 14 to 0d). There are no longer
duplicates in the list with protocol numbers now.
2007-10-10 12:59:48 -05:00
Volker Lendecke
ab52ebfdcc r2912: Test for the sort-of weird file stamp semantics. The last_write seems to be
updated only by an arbitrary close() after the file was actually written to.

Volker
2007-10-10 12:59:47 -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
75ca5ba509 r2909: fix some RAW-SEARCH torture mem leaks 2007-10-10 12:59:47 -05:00
Jelmer Vernooij
e9a7f729b3 r2896: Add torture test for EnumValue() 2007-10-10 12:59:45 -05:00
Volker Lendecke
8e26775134 r2895: Another nut to crack, not sure how hard: The statinfo on a file does obviously
not change during a write. The nasty thing: Excel 2003 obviosly does depend on
this.

Volker
2007-10-10 12:59:45 -05:00
Stefan Metzmacher
de73676342 r2888: - add 'Ds' prefix to Bind and Unbind call on drsuapi
- rename handle -> bind_handle

- change function types to NTSTATUS

metze
2007-10-10 12:59:42 -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 Tridgell
04eaae59cd r2854: added a RPC-COUNTCALLS torture test - a useful varient on the full scanner in RPC-SCANNER 2007-10-10 12:59:39 -05:00
Stefan Metzmacher
1dabd04e26 r2853: add torture test to find the defaultNamingContext on the RootDSE
try a sasl sealed CompareRequest

abartlet: we need to check how SINGING only can work,
          it failed for me:-(

metze
2007-10-10 12:59:38 -05:00
Andrew Tridgell
db1ed5675a r2833: - added a call to SamrQueryGroupMember for every group, and fix the
IDL so this works (the previous IDL was bogus)

- changed a hyper to uint64 after looking at output on cascade on sparc
2007-10-10 12:59:37 -05:00
Andrew Tridgell
5045482b14 r2799: removed one last occurance of torture_ldb_alloc() 2007-10-10 12:59:35 -05:00
Andrew Tridgell
6c563887f1 r2791: got rid of talloc_unreference() and instead created talloc_unlink(),
which is much clearer and simpler to use. It removes a specific parent
from a pointer, no matter whether that parent is a "reference" or a
direct parent. This gives complete control over the free process.
2007-10-10 12:59:34 -05:00
Andrew Tridgell
ad5a5ea08d r2787: force masktest to use RAW_SEARCH_BOTH_DIRECTORY_INFO so it can obtain the short name 2007-10-10 12:59:33 -05:00
Andrew Tridgell
6c46e4622a r2785: call init_iconv() in smbtorture to ensure we have no memory allocated
when a test started, thus making leak detection easier
2007-10-10 12:59:33 -05:00
Andrew Tridgell
630fefb24a r2774: get rid of the lanman specific code in masktest, and add a -l option 2007-10-10 12:59:31 -05:00
Andrew Tridgell
8d4dc99b82 r2744: ben elliston taught me about gcov today, which allows you to measure
the % coverage in terms of lines of code of a test suite. I thought a
good first place to start with gcov was the talloc test suite. When I
started the test suite covered about 60% of all lines of code in
talloc.c, and now it covers about 99%. The only lines not covered are
talloc corruption errors, as that would cause smb_panic() to fire.

It will be interesting to try gcov on the main Samba test suite for
smbd. We won't achieve 100% coverage, but it would be nice to get to
90% or more.

I also modified the talloc.c sources to be able to be build standalone, using:

  gcc -c -D_STANDALONE_ -Iinlcude lib/talloc.c

that should make it much easier to re-use talloc in other projects
2007-10-10 12:59:29 -05:00
Andrew Tridgell
18d3e2647f r2742: - fixed a bug in talloc_unreference()
- made the LOCAL-TALLOC smbtorture test much stricter, checking that
  block counts for every pointer are correct after every operation
2007-10-10 12:59:29 -05:00
Andrew Tridgell
f4a7a3282a r2738: free up the session information as soon as it is invalidated in the
RAW-CONTEXT test case
2007-10-10 12:59:28 -05:00
Jelmer Vernooij
1bb4718328 r2735: More DCOM updates:
- Several updates to the interface definitions after reading some more of the
 specs
  - Add Remote Activation interface
  - Add body extension uuids
 - Add oxidresolve torture test to list
 - Make pidl complain about object interfaces that don't inherit from IUnknown
2007-10-10 12:59:27 -05:00
Andrew Tridgell
a87584c8e3 r2718: - added a talloc_unreference() function as requested by metze.
- added documentation for talloc_unreference()

- made the abandoned child logic in talloc_free() clearer and more consistent
2007-10-10 12:59:26 -05:00
Andrew Tridgell
91669ea830 r2711: added a simple talloc speed tester. I get the following on my laptop:
MEASURING TALLOC VS MALLOC SPEED
  talloc: 279154 ops/sec
  malloc: 318758 ops/sec

which I think is an acceptable overhead for the increased functionality
2007-10-10 12:59:25 -05:00
Andrew Tridgell
e14ee428ec r2710: continue with the new style of providing a parent context whenever
possible to a structure creation routine. This makes for much easier
global cleanup.
2007-10-10 12:59:25 -05:00
Andrew Tridgell
911a8d590c r2709: finally solved the talloc reference problem.
The problem was that the simple "uint_t ref_count;" in a talloc chunk
did not give enough information. It told us that a pointer was
referenced more than once, but it didn't say who it was referenced
by. This means that when the pointer was freed we had no sane way to
clean up the reference.

I have now replaced ref_count with a "refs" list, which means that
references point to the pointer, and the pointer has a linked list of
references. So now we can cleanup from either direction without losing track of anything.

I've also added a LOCAL-TALLOC smbtorture test that tests talloc
behaviour for some common uses.
2007-10-10 12:59:24 -05:00
Jelmer Vernooij
9e74144aa8 r2699: Correct handle ServerAlive() and ServerAlive2() + add torture tests 2007-10-10 12:59:24 -05:00
Andrew Tridgell
c82a9cf750 r2680: switched the libcli/raw/ code over to use talloc_reference(), which simplifies things quite a bit 2007-10-10 12:59:21 -05:00
Andrew Tridgell
f31e5d56e3 r2676: add a test of the reference counting logic in the SAMR server into the
RPC-SAMR torture test. This closes the samr connection before working
on a open domain handle. The server is supposed to know that the open
domain handle still holds a reference to the connection, so the
connection remains valid even though it has been closed.
2007-10-10 12:59:20 -05:00
Andrew Tridgell
8dc23821c9 r2671: we're getting too many errors caused by the talloc_realloc() API not
taking a context (so when you pass a NULL pointer you end up with
memory in a top level context). Fixed it by changing the API to take a
context. The context is only used if the pointer you are reallocing is
NULL.
2007-10-10 12:59:20 -05:00
Andrew Tridgell
c315d6ac1c r2660: - converted the libcli/raw/ library to use talloc_increase_ref_count()
rather than manual reference counts

- properly support SMBexit in the cifs and posix backends

- added a logoff method to all backends

With these changes the RAW-CONTEXT test now passes against the posix backend
2007-10-10 12:59:18 -05:00
Andrew Tridgell
770aa7e01e r2659: removed some extraneous debug msgs 2007-10-10 12:59:17 -05:00
Andrew Tridgell
6e721393d0 r2649: - used some cpp tricks to make users of talloc() and talloc_realloc()
to get auto-naming of pointers very cheaply.

- fixed a couple of memory leaks found with the new tricks

A typical exit report for smbd is now:

talloc report on 'null_context' (total 811 bytes in 54 blocks)
        auth/auth_sam.c:334            contains     20 bytes in   1 blocks
        struct auth_serversupplied_info contains    498 bytes in  33 blocks
        UNNAMED                        contains      8 bytes in   1 blocks
        lib/data_blob.c:40             contains     16 bytes in   1 blocks
        iconv(CP850,UTF8)              contains     61 bytes in   4 blocks
        iconv(UTF8,CP850)              contains     61 bytes in   4 blocks
        iconv(UTF8,UTF-16LE)           contains     67 bytes in   4 blocks
        iconv(UTF-16LE,UTF8)           contains     67 bytes in   4 blocks
        UNNAMED                        contains     13 bytes in   1 blocks

which is much better than before
2007-10-10 12:59:16 -05:00
Andrew Tridgell
b378aae95d r2645: converted the NTLMSSP code to the new style of talloc 2007-10-10 12:59:16 -05:00
Andrew Tridgell
26da45a801 r2628: got rid of some warnings and converted a few more places to use hierarchical memory allocation 2007-10-10 12:59:14 -05:00
Andrew Tridgell
640ced4530 r2593: don't crash if the server doesn't know that 0 count searches mean 1 2007-10-10 12:59:11 -05:00
Andrew Tridgell
7b23624a0f r2589: a simple test to help find security related memory leaks. Run valgrind on smbd with
--show-leak=yes and --show-reachable=yes to track them down.
2007-10-10 12:59:09 -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 Bartlett
066789a479 r2551: Add const.
Andrew Bartlett
2007-10-10 12:59:05 -05:00
Andrew Bartlett
4904d814c0 r2547: Another place to use convert_string_talloc().
Andrew Bartlett
2007-10-10 12:59:05 -05:00
Andrew Bartlett
79776006b3 r2536: This is a classic case for the use of our new talloc code, and
convert_string_talloc().

Andrew Bartlett
2007-10-10 12:59:03 -05:00
Jelmer Vernooij
c98fbfe250 r2532: Don't run EnumValue torture test for now (idl needs fixing, doesn't compile) 2007-10-10 12:59:02 -05:00
Andrew Tridgell
4e4859c06b r2520: - finished implementing the server side of the old style search requests 2007-10-10 12:59:01 -05:00
Tim Potter
90a9e754db r2501: The AddMemberToAlias test doesn't need a domain_handle. 2007-10-10 12:58:59 -05:00
Andrew Tridgell
050dcd9b95 r2500: disable the sleep test in echo until we have a win32 echo server that
does Microsoft style async rpc serving
2007-10-10 12:58:59 -05:00
Tim Potter
a0e571a9dd r2489: Rename account_flags in EnumDomainAliases() to acct_flags. 2007-10-10 12:58:57 -05:00
Andrew Tridgell
71480271ad r2469: complete overhaul of the old-style RAW_SEARCH_ calls (the OS/2 and
original core level calls). The old code was completely wrong in many respects.

also fixed the EA_SIZE level in the server

extended the RAW-SEARCH test suite to test the new code properly
2007-10-10 12:58:56 -05:00
Stefan Metzmacher
a0c2a3a5d4 r2468: print out the names of the fault codes#
metze
2007-10-10 12:58:56 -05:00