1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

279 Commits

Author SHA1 Message Date
Jelmer Vernooij
6b749f225e r16526: Add torture_setup_server() with test.
(This used to be commit 6a1ed8ad75)
2007-10-10 14:09:32 -05:00
Jelmer Vernooij
3fc105b106 r16524: Fix double evaluation.
(This used to be commit 93f7adfb14)
2007-10-10 14:09:32 -05:00
Jelmer Vernooij
c692456f24 r16518: Split up torture_util.c in smb and non-smb specific parts.
Add torture_temp_dir() function, with test.
(This used to be commit c9d287dc0e)
2007-10-10 14:09:31 -05:00
Andrew Bartlett
cb93d28e7c r16489: Because the torture/ui.h file isn't automaticly generated, the
prototypes in it need to use the PRINTF_ATTRIBUTE() macro, rather than
_PRINTF_ATTRIBUTE() (which becomes PRINTF_ATTRIBUTE() only in proto
files, but not C files).

This found a number of missing descriptions in the LOCAL-SOCKET test.

Andrew Bartlett
(This used to be commit 1009d55c8c)
2007-10-10 14:09:30 -05:00
Jelmer Vernooij
845df42a19 r16333: Move more code out of the core smbtorture. It now no longer
contains protocol-specific code.
(This used to be commit 819d3b4576)
2007-10-10 14:09:11 -05:00
Jelmer Vernooij
835d8ed2f6 r16332: Fix two small bugs found by the buildfarm.
(This used to be commit 3decb34bb6)
2007-10-10 14:09:11 -05:00
Jelmer Vernooij
0f62c11199 r16329: Convert to new UI API.
(This used to be commit c7d1d86853)
2007-10-10 14:09:10 -05:00
Jelmer Vernooij
920c1ca95c r16328: Wrap all existing tests in simple single-function testsuites.
(This used to be commit 7e811adf59)
2007-10-10 14:09:10 -05:00
Jelmer Vernooij
324583b28f r16316: Convert to new torture UI API.
(This used to be commit ff87504c41)
2007-10-10 14:09:10 -05:00
Jelmer Vernooij
69270cfff6 r16315: Convert to new API.
(This used to be commit 0e52a831ed)
2007-10-10 14:09:09 -05:00
Jelmer Vernooij
582d46ec42 r16304: Improve testing UI API. This now allows registering the full
test suite tree, looks a bit more like other unit testing API's,
fixes some memory responsibility issues, introduces testcases,
and removes the need for tests to call torture_ok().
(This used to be commit 0445b1a56a)
2007-10-10 14:09:09 -05:00
Jelmer Vernooij
123e50735a r16184: Convert to UI API. The async test was previously broken (fails
with NT_STATUS_NO_MEMORY) and still does.
(This used to be commit 5c2e136ef9)
2007-10-10 14:09:05 -05:00
Jelmer Vernooij
b617c831a4 r16171: Convert to UI API
(This used to be commit 075dfb4c52)
2007-10-10 14:09:04 -05:00
Jelmer Vernooij
1cb88c8c98 r16170: Convert to UI API
(This used to be commit 7dad6f9c0a)
2007-10-10 14:09:04 -05:00
Jelmer Vernooij
d3c0cfb8a2 r16169: Convert to UI API
(This used to be commit 6306a3cc17)
2007-10-10 14:09:04 -05:00
Jelmer Vernooij
978dee520e r16164: Convert to UI API
(This used to be commit 5cd95ec885)
2007-10-10 14:09:03 -05:00
Jelmer Vernooij
6845e402e1 r16163: Convert to UI API
(This used to be commit 067c58f0d9)
2007-10-10 14:09:03 -05:00
Jelmer Vernooij
c714fdaa22 r16162: Convert to UI API
(This used to be commit 78db534f65)
2007-10-10 14:09:02 -05:00
Stefan Metzmacher
20389549f1 r15862: add a LOCAL-EVENT torture test
- it currently tests the standard events code
- with epoll enabled and disabled

metze
(This used to be commit ce5fd2293d)
2007-10-10 14:08:34 -05:00
Jelmer Vernooij
495652fe24 r15821: Fix static library build.
(This used to be commit d9d8f93af1)
2007-10-10 14:08:28 -05:00
Jelmer Vernooij
4099637512 r15819: Use updated API in smbtorture, use UI tools in registry tests.
(This used to be commit 4c452090fb)
2007-10-10 14:08:27 -05:00
Jelmer Vernooij
9ee60bc671 r15605: Yet another dependencies fix
(This used to be commit eef495a8ef)
2007-10-10 14:06:59 -05:00
Jelmer Vernooij
172a83d724 r15573: Fix build of systems that have iconv headers in non-standard locations
Split of system/locale.h header from system/iconv.h

Previously, iconv wasn't being used on these systems
(This used to be commit aa6d66fda6)
2007-10-10 14:05:58 -05:00
Andrew Bartlett
c2cc10c786 r15356: Remove unused 'flags' argument from socket_send() and friends.
This is in preperation for making TLS a socket library.

Andrew Bartlett
(This used to be commit a312812b92)
2007-10-10 14:05:25 -05:00
Jelmer Vernooij
f7c86b912d r15331: Integrate LIBSMB and LIBCLI into new LIBCLI_SMB
(This used to be commit 4ec89bce87)
2007-10-10 14:05:18 -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
69b51f702a r15207: Introduce PRIVATE_DEPENDENCIES and PUBLIC_DEPENDENCIES as replacement
for REQUIRED_SUBSYSTEMS.
(This used to be commit adc8a019b6)
2007-10-10 14:04:18 -05:00
Andrew Tridgell
c8610144f7 r15049: for really efficient oplock handling with thousands of open files we
will need a separate messaging endpoint per open file. To make this
efficient extend the messaging layer to have a new registration
function for temporary message types that maps via an idtree.

I have updated the LOCAL-MESSAGING test to use the new function.
(This used to be commit 4b976851d8)
2007-10-10 14:04:03 -05:00
Stefan Metzmacher
1af925f394 r14860: create libcli/security/security.h
metze
(This used to be commit 9ec706238c)
2007-10-10 13:59:44 -05:00
Jelmer Vernooij
e70eae2b4c r14721: Fix a couple of warnings.
(This used to be commit 426ac78108)
2007-10-10 13:59:13 -05:00
Jelmer Vernooij
909b111f58 r14720: Add torture_context argument to all torture tests
(This used to be commit 3c7a5ce291)
2007-10-10 13:59:13 -05:00
Jelmer Vernooij
d64ccc0176 r14599: Pass ACLs down the registry layer.
(This used to be commit 6cdefd8945)
2007-10-10 13:58:59 -05:00
Jelmer Vernooij
35349a58df r14542: Remove librpc, libndr and libnbt from includes.h
(This used to be commit 51b4270513)
2007-10-10 13:58:42 -05:00
Jelmer Vernooij
d09b70c98b r14527: Fix build problems.
(This used to be commit 863ca4014d)
2007-10-10 13:57:37 -05:00
Jelmer Vernooij
5c79bbadd5 r14497: Fix build with shared libraries
(This used to be commit c74fc55831)
2007-10-10 13:57:34 -05:00
Jelmer Vernooij
8528016978 r14464: Don't include ndr_BASENAME.h files unless strictly required, instead
try to include just the BASENAME.h files (containing only structs)
(This used to be commit 3dd477ca51)
2007-10-10 13:57:27 -05:00
Jelmer Vernooij
ceb6e9717b r13960: Generate makefile rules for installing/removing shared modules.
(This used to be commit 2c74698032)
2007-10-10 13:52:32 -05:00
Jelmer Vernooij
4ac2be9958 r13924: Split more prototypes out of include/proto.h + initial work on header
file dependencies
(This used to be commit 1228358767)
2007-10-10 13:52:24 -05:00
Stefan Metzmacher
1a53c1dc92 r13346: use private proto header files for the torture tests
metze
(This used to be commit 67837dbd2b)
2007-10-10 13:51:47 -05:00
Andrew Bartlett
f55ea8bb3d r12804: This patch reworks the Samba4 sockets layer to use a socket_address
structure that is more generic than just 'IP/port'.

It now passes make test, and has been reviewed and updated by
metze. (Thankyou *very* much).

This passes 'make test' as well as kerberos use (not currently in the
testsuite).

The original purpose of this patch was to have Samba able to pass a
socket address stucture from the BSD layer into the kerberos routines
and back again.   It also removes nbt_peer_addr, which was being used
for a similar purpose.

It is a large change, but worthwhile I feel.

Andrew Bartlett
(This used to be commit 88198c4881)
2007-10-10 13:49:57 -05:00
Stefan Metzmacher
80c0d16de0 r12791: fix compiler warning
metze
(This used to be commit 6647feb761)
2007-10-10 13:49:55 -05:00
Andrew Bartlett
e0dc53cf09 r12782: Don't segfault if we cannot setup messaging.
Andrew Bartlett
(This used to be commit 59c380e048)
2007-10-10 13:49:54 -05:00
Jelmer Vernooij
25bb00fbcd r12693: Move core data structures out of smb.h into core.h
torture prototypes in seperate header
(This used to be commit 73610639b2)
2007-10-10 13:49:39 -05:00
Jelmer Vernooij
d4de4c2d21 r12608: Remove some unused #include lines.
(This used to be commit 70e7449318)
2007-10-10 13:49:03 -05:00
Jelmer Vernooij
19d606ce18 r12584: Move NDR tests from rpc/ to local/, add to list of tests
to run for 'make all'
(This used to be commit e71cd4778b)
2007-10-10 13:48:59 -05:00
Jelmer Vernooij
7285e102f0 r12523: Convert the registry subsystem to use a seperate prototype header
(note that this doesn't use the distinction between private
 and public prototypes yet)
(This used to be commit 60e11f5758)
2007-10-10 13:47:51 -05:00
Jelmer Vernooij
09c44f6cae r12500: Use init functions explicitly in a few more places. 'gensec' and 'librpc'
are the only two subsystems left to convert.
(This used to be commit f6bbc72996)
2007-10-10 13:47:46 -05:00
Jelmer Vernooij
d8e35f8828 r12498: Eliminate INIT_OBJ_FILES and ADD_OBJ_FILES. We were not using
the difference between these at all, and in the future the
fact that INIT_OBJ_FILES include smb_build.h will be sufficient to
have recompiles at the right time.
(This used to be commit b24f2583ed)
2007-10-10 13:47:45 -05:00
Andrew Tridgell
d811ea17bb r12158: added ldif handlers for the ntSecurityDescriptor attribute, so when
displaying security descriptors in ldbsearch or ldbedit you can see
the SDDL version.

This also allows us to specify security descriptors in our
setup/*.ldif files in SDDL format, which is much more convenient than
the NDR binary format!
(This used to be commit 8185731c18)
2007-10-10 13:47:16 -05:00
Andrew Tridgell
79eae8ffff r12137: added sddl_encode(), the reverse of the sddl_decode() function added a
couple of days ago. Doesn't yet encode using the shorthand for well
known SIDs.
(This used to be commit 655a4ebe8e)
2007-10-10 13:47:13 -05:00
Stefan Metzmacher
150848248a r12014: free the irpc_request structure with the irpc_call_recv functions,
to match all other _recv functions we have

metze
(This used to be commit bd4f85ab5f)
2007-10-10 13:46:59 -05:00
Andrew Tridgell
f5ed8cc829 r12010: - added support for domain specific SID codes in SDDL strings
- added a bunch more tests to LOCAL-SDDL (all the ones from our schema)

- fixed 'mixed coded declarations' bug
(This used to be commit c30e7698e8)
2007-10-10 13:46:59 -05:00
Andrew Tridgell
86a6ce529f r12009: made the LOCAL-SDDL test less verbose by default, and add it to the
standard tests for the build farm
(This used to be commit 9d6d9b6e50)
2007-10-10 13:46:58 -05:00
Andrew Tridgell
3aaa6ff496 r12008: added a simple LOCAL-SDDL test suite. Only one example so far. Will be
filled in with more examples as I expand the sddl parsing code.
(This used to be commit 8f80e483a3)
2007-10-10 13:46:58 -05:00
Tim Potter
16a9bfd33f r11625: NULL terminate list of strings. For some reason this wasn't causing a
crash on i386 but was on ia64.
(This used to be commit 12c77bb2e1)
2007-10-10 13:46:00 -05:00
Stefan Metzmacher
a8d741b4f7 r11554: make us able to run without depending on 127.0.0.1
metze
(This used to be commit 6bae17d279)
2007-10-10 13:45:53 -05:00
Jelmer Vernooij
3b12c3bd34 r10594: Add initial framework for lib/registry torture tests
(This used to be commit 985c6a8fcc)
2007-10-10 13:39:09 -05:00
Jelmer Vernooij
87af8061c7 r10592: Add "adfgets()" function, which allocates and reads a line from a fd.
Also add torture tests for this function and file_{load,save}. I've hardcoded
a file name here.. should I handle that neater somehow?
(This used to be commit 8fa383f182)
2007-10-10 13:39:08 -05:00
Jelmer Vernooij
01319b8462 r10516: Add seperator argument to str_list_{make,join}_shell()
(This used to be commit 0a5c9197f2)
2007-10-10 13:38:59 -05:00
Jelmer Vernooij
85abc86b21 r10514: Add str_list_make_shell() and str_list_join_shell()
(This used to be commit 8b86a5da73)
2007-10-10 13:38:59 -05:00
Andrew Tridgell
06085e7bc0 r10490: - allow deferred irpc replies to set the status
- add an example of deferred reply for echodata in LOCAL-IRPC
(This used to be commit 858a757a6d)
2007-10-10 13:38:54 -05:00
Andrew Tridgell
d9ca09b8b4 r10370: only validate the re-generated binding string for hostnames with IPs
Jelmer, can you see a better approach to this? As far as I am aware
protocol towers don't use hostnames, they always use IP addresses
(This used to be commit 7a3ec95d99)
2007-10-10 13:38:32 -05:00
Andrew Tridgell
6bfea63356 r10199: added a LOCAL-RESOLVE torture test, useful for measuring the overhead of
the async name resolution mechanisms
(This used to be commit b3a9d759bb)
2007-10-10 13:38:08 -05:00
Andrew Tridgell
fc58570940 r8887: fixed the irpc error that caused ia64 to fail the LOCAL-IRPC test
(This used to be commit ce9a262d37)
2007-10-10 13:30:15 -05:00
Andrew Tridgell
4c747e59d8 r8879: more expansion of the irpc test to try to uncover the ia64 mystery
(This used to be commit ff03b8148b)
2007-10-10 13:30:14 -05:00
Stefan Metzmacher
555eee1456 r8874: test some more combinations
metze
(This used to be commit 32c64e5bc2)
2007-10-10 13:30:14 -05:00
Stefan Metzmacher
18daf6ec4d r8873: add more checks
metze
(This used to be commit bfc855d78f)
2007-10-10 13:30:13 -05:00
Stefan Metzmacher
e232ec6394 r8871: add some debugging code to findout why LOCAL-IRPC fails on 64bit hosts
metze
(This used to be commit 2c36b64dcc)
2007-10-10 13:30:13 -05:00
Stefan Metzmacher
c846ec3398 r8867: try to fix the LOCAL-IRPC test on 64bit platforms
metze
(This used to be commit b7401c142a)
2007-10-10 13:30:13 -05:00
Andrew Tridgell
27f457e3a8 r8818: - fix LOCAL-IRPC test for new ref-alloc semantics of irpc
- fixed return result from LOCAL-IRPC test

- added timelimit support

- ensure we free messages as they complete
(This used to be commit ab9a5fd84b)
2007-10-10 13:30:08 -05:00
Andrew Tridgell
df8bce7ac2 r8817: - fixed return result from LOCAL-MESSAGING test
- added timelimit support
(This used to be commit dbac93e313)
2007-10-10 13:30:08 -05:00
Andrew Tridgell
e835621799 r8520: fixed a pile of warnings from the build farm gcc -Wall output on
S390. This is an attempt to avoid the panic we're seeing in the
automatic builds.

The main fixes are:

 - assumptions that sizeof(size_t) == sizeof(int), mostly in printf formats

 - use of NULL format statements to perform dn searches.

 - assumption that sizeof() returns an int
(This used to be commit a58ea6b385)
2007-10-10 13:29:34 -05:00
Andrew Tridgell
50ea5cb419 r8412: cope with some lost messages in the ping test (netbsd gets this)
(This used to be commit fcf60823c6)
2007-10-10 13:22:59 -05:00
Andrew Tridgell
5e3ce33188 r7901: check if system supports UTF-16LE at all in LOCAL-ICONV test
(This used to be commit aa9e7cf63a)
2007-10-10 13:18:47 -05:00
Andrew Tridgell
7ea949e7ab r7898: don't die on bad iconv libs in LOCAL-ICONV test
(This used to be commit fe7055df94)
2007-10-10 13:18:47 -05:00
Andrew Tridgell
4f6225d695 r7655: test the evnt friendly socket_connect() in the LOCAL-SOCKET test
(This used to be commit b9ed92d550)
2007-10-10 13:18:18 -05:00
Stefan Metzmacher
1b11f11b34 r7426: add an option to disable progress output
torture:progress=no

metze
(This used to be commit 820e5a1270)
2007-10-10 13:17:52 -05:00
Andrew Tridgell
74aeab5329 r7358: make the irpc test use two messaging contexts, not one, so it better
matches the LOCAL-MESSAGING test
(This used to be commit 5883ce16d0)
2007-10-10 13:17:46 -05:00
Andrew Tridgell
412e4bd820 r7321: add nbtd statistics serving over irpc
(This used to be commit 4c0ed7328b)
2007-10-10 13:17:41 -05:00
Andrew Tridgell
d934cb71d0 r7295: added an irpc benchmark. It gets about 16k messages/sec on my laptop,
compared to about 20k messages/sec for the raw messaging layer. I
think that is quite acceptable given the extra functionality.
(This used to be commit a05d38d1d9)
2007-10-10 13:17:38 -05:00
Andrew Tridgell
bf1ffa283c r7294: implemented the irpc messaging system. This is the core of the
management system I proposed on samba-technical a couple of days
ago. Essentially it is a very lightweight way for any code in Samba to
make IDL based rpc calls to anywhere else in the code, without the
client or server having to go to the trouble of setting up a full rpc
service.

It can be used with any of our existing IDL, but I expect it will
mostly be used for a new set of Samba specific management calls.

The LOCAL-IRPC torture test demonstrates how it can be used by calling
the echo_AddOne() call over this transport.
(This used to be commit 3d589a0995)
2007-10-10 13:17:37 -05:00
Andrew Tridgell
0e5de220d9 r6563: - fixed the local messaging torture test not to fork, as this causes
trouble with the epoll() based event handling

- changes the test to use a local directory instead of the prefix lock
  directory, so the LOCAL-MESSAGING test can run as non-root even when
  the lock directory is not writeable
(This used to be commit 079e1f4e85)
2007-10-10 13:16:26 -05:00
Andrew Bartlett
df64302213 r5902: A rather large change...
I wanted to add a simple 'workstation' argument to the DCERPC
authenticated binding calls, but this patch kind of grew from there.

With SCHANNEL, the 'workstation' name (the netbios name of the client)
matters, as this is what ties the session between the NETLOGON ops and
the SCHANNEL bind.  This changes a lot of files, and these will again
be changed when jelmer does the credentials work.

I also correct some schannel IDL to distinguish between workstation
names and account names.  The distinction matters for domain trust
accounts.

Issues in handling this (issues with lifetime of talloc pointers)
caused me to change the 'creds_CredentialsState' and 'struct
dcerpc_binding' pointers to always be talloc()ed pointers.

In the schannel DB, we now store both the domain and computername, and
query on both.  This should ensure we fault correctly when the domain
is specified incorrectly in the SCHANNEL bind.

In the RPC-SCHANNEL test, I finally fixed a bug that vl pointed out,
where the comment claimed we re-used a connection, but in fact we made
a new connection.

This was achived by breaking apart some of the
dcerpc_secondary_connection() logic.

The addition of workstation handling was also propogated to NTLMSSP
and GENSEC, for completeness.

The RPC-SAMSYNC test has been cleaned up a little, using a loop over
usernames/passwords rather than manually expanded tests.  This will be
expanded further (the code in #if 0 in this patch) to use a newly
created user account for testing.

In making this test pass test_rpc.sh, I found a bug in the RPC-ECHO
server, caused by the removal of [ref] and the assoicated pointer from
the IDL.  This has been re-added, until the underlying pidl issues are
solved.
(This used to be commit 824289dcc2)
2007-10-10 13:11:07 -05:00
Andrew Tridgell
bed7c9ec32 r5304: removed lib/socket/socket.h from includes.h
(This used to be commit b902ea546d)
2007-10-10 13:09:39 -05:00
Andrew Tridgell
e82aad1ce3 r5298: - got rid of pstring.h from includes.h. This at least makes it a bit
less likely that anyone will use pstring for new code

 - got rid of winbind_client.h from includes.h. This one triggered a
   huge change, as winbind_client.h was including system/filesys.h and
   defining the old uint32 and uint16 types, as well as its own
   pstring and fstring.
(This used to be commit 9db6c79e90)
2007-10-10 13:09:38 -05:00
Andrew Tridgell
131dc76d56 r5197: moved events code to lib/events/ (suggestion from metze)
(This used to be commit 7f54c8a339)
2007-10-10 13:09:30 -05:00
Andrew Tridgell
66170ef8b3 r5185: make all the events data structures private to events.c. This will
make it possible to add optimisations to the events code such as
keeping the next timed event in a sorted list, and using epoll for
file descriptor events.

I also removed the loop events code, as it wasn't being used anywhere,
and changed timed events to always be one-shot (as adding a new timed
event in the event handler is so easy to do if needed)
(This used to be commit d7b4b6de51)
2007-10-10 13:09:29 -05:00
Andrew Tridgell
55d4d36993 r5102: This is a major simplification of the logic for controlling top level
servers in smbd. The old code still contained a fairly bit of legacy
from the time when smbd was only handling SMB connection. The new code
gets rid of all of the smb_server specific code in smbd/, and creates
a much simpler infrastructures for new server code.

Major changes include:

 - simplified the process model code a lot.

 - got rid of the top level server and service structures
   completely. The top level context is now the event_context. This
   got rid of service.h and server.h completely (they were the most
   confusing parts of the old code)

 - added service_stream.[ch] for the helper functions that are
   specific to stream type services (services that handle streams, and
   use a logically separate process per connection)

 - got rid of the builtin idle_handler code in the service logic, as
   none of the servers were using it, and it can easily be handled by
   a server in future by adding its own timed_event to the event
   context.

 - fixed some major memory leaks in the rpc server code.

 - added registration of servers, rather than hard coding our list of
   possible servers. This allows for servers as modules in the future.

 - temporarily disabled the winbind code until I add the helper
   functions for that type of server

 - added error checking on service startup. If a configured server
   fails to startup then smbd doesn't startup.

 - cleaned up the command line handling in smbd, removing unused options
(This used to be commit cf6a46c3cb)
2007-10-10 13:09:22 -05:00
Andrew Tridgell
759da3b915 r5037: got rid of all of the TALLOC_DEPRECATED stuff. My apologies for the
large commit. I thought this was worthwhile to get done for
consistency.
(This used to be commit ec32b22ed5)
2007-10-10 13:09:15 -05:00
Andrew Tridgell
a3c562b751 r4832: added simple testing of tcp sockets to LOCAL-SOCKET test
(This used to be commit c06b25c269)
2007-10-10 13:08:59 -05:00
Andrew Tridgell
8783aa8ea5 r4831: added udp support to our generic sockets library.
I decided to incorporate the udp support into the socket_ipv4.c
backend (and later in socket_ipv6.c) rather than doing a separate
backend, as so much of the code is shareable. Basically this adds a
socket_sendto() and a socket_recvfrom() call and not much all.

For udp servers, I decided to keep the call as socket_listen(), even
though dgram servers don't actually call listen(). This keeps the API
consistent.

I also added a simple local sockets testsuite in smbtorture,
LOCAL-SOCKET
(This used to be commit 9f12a45a05)
2007-10-10 13:08:59 -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
cc55aef7c1 r4547: - added talloc_new(ctx) macro that is a neater form of the common talloc(ctx, 0) call.
- cleaned up some talloc usage in various files

I'd like to get to the point that we have no calls to talloc(), at
which point we will rename talloc_p() to talloc(), to encourage
everyone to use the typesafe functions.
(This used to be commit e6c81d7c9f)
2007-10-10 13:08:20 -05:00
Andrew Tridgell
65f96eba32 r4473: - moved talloc into its own lib/talloc/ area
- added gcov flags to Makefile.talloc

- expanded talloc testsuite to add a test for realloc with a child ptr

- fixed a bug in talloc_realloc() with realloc of a ptr that has child ptrs
(This used to be commit 98b5f73c1b)
2007-10-10 13:07:55 -05:00
Andrew Tridgell
f9e507980e r4466: rather than defining "STANDALONE" for building tdb, ldb and talloc
outside the tree, instead defined _SAMBA_BUILD_ inside the Samba
build. This makes it easier to pull code out of Samba for external
use.
(This used to be commit 09e98c8745)
2007-10-10 13:07:54 -05:00
Stefan Metzmacher
15543f18ac r4000: DATA_BLOB.data is uint8_t * not void * :-)
(thanks abartlet for telling me)

metze
(This used to be commit 2783bf393f)
2007-10-10 13:06:13 -05:00
Stefan Metzmacher
089f3843c5 r3967: fix compiler warnings
metze
(This used to be commit 3f2c3ce2f0)
2007-10-10 13:06:09 -05:00
Andrew Tridgell
63a6cd6245 r3749: don't consider it a failure if we fail to re-encode a codepoint above
1M, or in the case of non-UTF charsets, above 256
(This used to be commit 02595c14ac)
2007-10-10 13:05:50 -05:00
Andrew Bartlett
438a54b8b4 r3553: Allow talloc_reference to take a NULL pointer for the "ptr" argument.
This allows potentially NULL pointers to be referenced, without an if ()
for every use.  (previously, it would segfault).

Update doco, and allow talloc_unlink to match.

Andrew Bartlett
(This used to be commit 59757c7f9d)
2007-10-10 13:05:31 -05:00
Andrew Tridgell
dde0705807 r3507: - added deferred replies on sharing violation in pvfs open. The
deferred reply is short-circuited immediately when the file is
  closed by another user, allowing it to be opened by the waiting user.

- added a sane set of timeval manipulation routines

- converted all the events code and code that uses it to use struct
  timeval instead of time_t, which allows for microsecond resolution
  instead of 1 second resolution. This was needed for doing the pvfs
  deferred open code, and is why the patch is so big.
(This used to be commit 0d51511d40)
2007-10-10 13:05:23 -05:00
Andrew Tridgell
ead3508ac8 r3447: more include/system/XXX.h include files
(This used to be commit 264ce91810)
2007-10-10 13:05:12 -05:00
Andrew Tridgell
28785364ba r3446: created include/system/iconv.h and include/system/shmem.h
(This used to be commit 70055fb1f4)
2007-10-10 13:05:12 -05:00
Andrew Tridgell
90067934cd r3428: switched to using minimal includes for the auto-generated RPC code.
The thing that finally convinced me that minimal includes was worth
pursuing for rpc was a compiler (tcc) that failed to build Samba due
to reaching internal limits of the size of include files. Also the
fact that includes.h.gch was 16MB, which really seems excessive. This
patch brings it back to 12M, which is still too large, but
better. Note that this patch speeds up compile times for both the pch
and non-pch case.

This change also includes the addition iof a "depends()" option in our
IDL files, allowing you to specify that one IDL file depends on
another. This capability was needed for the auto-includes generation.
(This used to be commit b8f5fa8ac8)
2007-10-10 13:05:09 -05:00
Andrew Tridgell
ba6d5fcb97 r3324: made the smbtorture code completely warning free
(This used to be commit 7067bb9b52)
2007-10-10 13:04:55 -05:00
Andrew Tridgell
05ad898f68 r3271: use "struct messaging_context *" instead of "void *" in messaging API
(This used to be commit cc93813e4a)
2007-10-10 13:04:48 -05:00
Jelmer Vernooij
06b3879c8f r3167: Add a member 'endpoint' to the dcerpc_binding struct to use instead of
options[0].
(This used to be commit 18582083af)
2007-10-10 13:02:28 -05:00
Jelmer Vernooij
86cd076c0b r3157: Add ncacn_http
(This used to be commit a0c4138edf)
2007-10-10 13:02:27 -05:00
Jelmer Vernooij
f1dd80e74e r3156: Couple of fixes in the conversion functions between binding structs and
protocol towers
(This used to be commit f41dfc6c5a)
2007-10-10 13:02:26 -05:00
Jelmer Vernooij
8debe5a6b8 r3136: - Allow specifying socket type when adding smbd service
- Make sure a epm_tower struct is completely initialized
- Some more minor fixes
(This used to be commit d560dcbdb8)
2007-10-10 13:02:25 -05:00
Andrew Tridgell
517238f0aa r3130: - added a LOCAL-IDTREE test suite
- made idtree return a "struct idr_context *" instead of a void*

- more efficient idr_remove for ids that are not present (patch from Jim Houston)
(This used to be commit f8d12d4b4a)
2007-10-10 13:02:24 -05:00
Jelmer Vernooij
27129573ff r3125: Store object UUID directly instead of using a pointer (struct dcerpc_binding)
Let test fail if messaging_init() fails instead of generating segfault in the LOCAL-MESSAGING test
(This used to be commit 0609f410ef)
2007-10-10 13:02:23 -05:00
Jelmer Vernooij
77b691e670 r3124: Add dcerpc_binding_from_tower()
Add tests for dcerpc_binding_from_tower()
(This used to be commit 88c6d34bba)
2007-10-10 13:02:23 -05:00
Jelmer Vernooij
a8d4d3c9f6 r3123: Add dcerpc_binding_build_tower()
Add local test for testing the functions dcerpc_parse_binding(),
	dcerpc_binding_string() and dcerpc_binding_build_tower()
(This used to be commit 7a07c2c769)
2007-10-10 13:02:23 -05:00
Andrew Tridgell
ca7e02fd37 r3026: - added automatic retry to messages when the servers listen queue is
full. This means callers can just "send and forget" rather than
  having to check for a temporary failure. The mechanism takes nice
  advantage of the timed events handling is our events code. A message
  will only fail now if we completely run out of some resource (such
  as memory).

- changed the test code not to do retries itself, but only to warn on real failures
(This used to be commit 8cddc610a2)
2007-10-10 12:59:59 -05:00
Andrew Tridgell
6cc8941f05 r3023: added immediate send of messages when they are first queued. This makes things a bit more efficient
(This used to be commit 8380225d32)
2007-10-10 12:59:59 -05:00
Andrew Tridgell
21e72e0154 r3021: under heavy load the listen queue for messaging unix domain socket can fill up, leading to refused
connections. The caller needs to retry. This adds testing of the retry in LOCAL-MESSAGING
(This used to be commit 2c568d4dc2)
2007-10-10 12:59:58 -05:00
Andrew Tridgell
6723885121 r3019: make the LOCAL-MESSAGING test a 2 process test
(This used to be commit 68890247c1)
2007-10-10 12:59:58 -05:00
Andrew Tridgell
6591a22614 r3016: - converted the events code to talloc
- added the new messaging system, based on unix domain sockets. It
  gets over 10k messages/second on my laptop without any socket
  cacheing, which is better than I expected.

- added a LOCAL-MESSAGING torture test
(This used to be commit 3af06478da)
2007-10-10 12:59:57 -05:00
Andrew Tridgell
7d32679e96 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;
}
(This used to be commit 814881f0e5)
2007-10-10 12:59:39 -05:00
Andrew Tridgell
ae30c7c5e6 r2799: removed one last occurance of torture_ldb_alloc()
(This used to be commit 5045482b14)
2007-10-10 12:59:35 -05:00
Andrew Tridgell
15b9736ed3 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.
(This used to be commit 6c563887f1)
2007-10-10 12:59:34 -05:00
Andrew Tridgell
4f13ebef5d 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
(This used to be commit 8d4dc99b82)
2007-10-10 12:59:29 -05:00
Andrew Tridgell
facfe8867d 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
(This used to be commit 18d3e2647f)
2007-10-10 12:59:29 -05:00
Andrew Tridgell
8ae2cd82ca 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
(This used to be commit a87584c8e3)
2007-10-10 12:59:26 -05:00
Andrew Tridgell
7cc7c553cb 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
(This used to be commit 91669ea830)
2007-10-10 12:59:25 -05:00
Andrew Tridgell
a675b09e8d 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.
(This used to be commit 911a8d590c)
2007-10-10 12:59:24 -05:00
Andrew Tridgell
4a17f26292 r2170: if we don't have a native iconv library then we can't build this test
(This used to be commit 5cf9333f60)
2007-10-10 12:58:28 -05:00
Andrew Tridgell
960c1d13c1 r2165: generalise the charset torture test to add testing of CP850
potentially we can test any charset
(This used to be commit e754d0cbca)
2007-10-10 12:58:28 -05:00
Andrew Tridgell
31c1c7846f 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
(This used to be commit 756f28ac95)
2007-10-10 12:58:27 -05:00