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

850 Commits

Author SHA1 Message Date
Andrew Tridgell
39d1ced21b r5107: moved the horrible ldap socket code, and the even worse
asn1-tied-to-blocking-sockets code into the ldap client and torture
suite, and out of the generic libs, so nobody else is tempted to use
it for any new code.
2007-10-10 13:09:23 -05:00
Andrew Tridgell
cf6a46c3cb 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
2007-10-10 13:09:22 -05:00
Andrew Bartlett
e5afc36093 r5090: Fix up the IDL for LogonGetDomainInfo in NETLOGON.
Andrew Bartlett
2007-10-10 13:09:21 -05:00
Andrew Bartlett
2e31694f9e r5089: Fix indentation. 2007-10-10 13:09:21 -05:00
Jeremy Allison
554e27023f r5071: Reverted (per tridge request).
Jeremy.
2007-10-10 13:09:19 -05:00
Jeremy Allison
40c1e16b5b r5068: I'm pretty sure an old search request is allowed to return changed case
versions of filenames. Tridge please check I haven't screwed this up.
Jeremy.
2007-10-10 13:09:18 -05:00
Andrew Tridgell
ec32b22ed5 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.
2007-10-10 13:09:15 -05:00
Andrew Tridgell
f36e4cf686 r5035: fixed composite test to use --num-ops command line option 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
Tim Potter
e32ade4485 r4980: Copy RAP callno constants from Samba 3 and start to use them. 2007-10-10 13:09:11 -05:00
Tim Potter
c475fa4457 r4975: Update usage of talloc in rap torture code.
Don't use ZERO_STRUCTP() when creating a new struct rap_call.
2007-10-10 13:09:11 -05:00
Tim Potter
37b4d1a676 r4973: Add a RAP scanner to smbtorture. win2k has call numbers 0-215 although
the cifs tr lists 250-318 also.
2007-10-10 13:09:10 -05:00
Andrew Tridgell
5e8fd5f701 r4951: some of the code dealing with libcli was getting too complex trying to
handle the inverted memory hierarchy that a normal session
establishment gave. The inverted hierarchy came from that fact that
you first establish a socket, then a transport, then a session and
finally a tree. That leads to the socket being at the top of the
memory hierarchy and the tree at the bottom, which makes no sense from
the users point of view, as they want to be able to free the tree and
have everything disappear.

The core problem was that the libcli interface didn't distinguish
between establishing a primary context and a secondary context. If you
establish a 2nd session on a transport then you want the transport to
be referenced by the session, whereas if you establish a primary
session then you want the transport to be a child of the session.

To fix this I have added "parent_ctx" and "primary" arguments to the
libcli intialisation functions. This makes using the library much
easier, and gives us a memory hierarchy that makes much more sense.

I was prompted to do this by a bug in the cifs backend, which was
caused by the socket not being properly torn down on a disconnect due
to the inverted memory hierarchy.
2007-10-10 13:09:09 -05:00
Volker Lendecke
fa435bf7c8 r4949: First version of a fetchfile composite function which connects to a server and
loads a file. Needs a smb url parsing wrapper.

Volker
2007-10-10 13:09:08 -05:00
Andrew Tridgell
442308970c r4938: allow the caller to supply an existing event_context if they want to
in smb_composite_connect_send(). This makes doing parallel calls much
easier.
2007-10-10 13:09:07 -05:00
Andrew Tridgell
852f1e73b4 r4899: fixed build 2007-10-10 13:09:04 -05:00
Andrew Tridgell
239c310f25 r4891: - added a generic resolve_name() async interface in libcli/resolve/,
which will eventually try all resolution methods setup in smb.conf

 - only resolution backend at the moment is bcast, which does a
   parallel broadcast to all configured network interfaces, and takes
   the first reply that comes in (this nicely demonstrates how to do
   parallel requests using the async APIs)

 - converted all the existing code to use the new resolve_name() api

 - removed all the old nmb code (yay!)
2007-10-10 13:09:03 -05:00
Andrew Tridgell
d93b6a5b8e r4888: use the neater calling convention 2007-10-10 13:09:03 -05:00
Andrew Tridgell
c06b25c269 r4832: added simple testing of tcp sockets to LOCAL-SOCKET test 2007-10-10 13:08:59 -05:00
Andrew Tridgell
9f12a45a05 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
2007-10-10 13:08:59 -05:00
Andrew Tridgell
4a963e3b7a r4792: use type safety int the test suite too 2007-10-10 13:08:55 -05:00
Andrew Tridgell
b8c5269482 r4779: demonstrate doing 50 parallel loadfile operations, with a callback for completion 2007-10-10 13:08:54 -05:00
Andrew Tridgell
080d0518bc r4777: added a smb_composite_sesssetup() async composite function. This
encapsulates all the different session setup methods, including the
multi-pass spnego code.

I have hooked this into all the places that previously used the
RAW_SESSSETUP_GENERIC method, and have removed the old
RAW_SESSSETUP_GENERIC code from clisession.c and clitree.c. A nice
side effect is that these two modules are now very simple again, back
to being "raw" session setup handling, which was what was originally
intended.

I have also used this to replace the session setup code in the
smb_composite_connect() code, and used that to build a very simple
replacement for smbcli_tree_full_connection().

As a result, smbclient, smbtorture and all our other SMB connection
code now goes via these composite async functions. That should give
them a good workout!
2007-10-10 13:08:53 -05:00
Andrew Bartlett
70860779ae r4776: Add more debugs to SamSync test.
Andrew Bartlett
2007-10-10 13:08:53 -05:00
Andrew Tridgell
71cbe28734 r4758: - added async support to the session request code
- added async support to the negprot client code

- removed two unused parameters from smbcli_full_connection() code

- converted smbclient to use smbcli_full_connection() rather than
  reinventing everything itself
2007-10-10 13:08:50 -05:00
Andrew Tridgell
468f8ebbfd r4757: added the ability of the clisocket level of libcli to handle async
socket connections. This was complicated by a few factors:

 - it meant moving the event context from clitransport to clisocket,
   so lots of structures changed

 - we need to asynchronously handle connection to lists of port
   numbers, not just one port number. The code internally tries each
   port in the list in turn, without ever blocking

 - the man page on how connect() is supposed to work asynchronously
   doesn't work in practice (now why doesn't this surprise me?). The
   getsockopt() for SOL_ERROR is supposed to retrieve the error, but
   in fact the next (unrelated) connect() call on the same socket also
   gets an error, though not the right error. To work around this I
   need to tear down the whole socket between each attempted port. I
   hate posix.

Note that clisocket.c still does a blocking name resolution call in
smbcli_sock_connect_byname(). That will be fixed when we add the async
NBT resolution code.

Also note that I arranged things so that every SMB connection is now
async internally, so using plain smbclient or smbtorture tests all the
async features of this new code.
2007-10-10 13:08:50 -05:00
Stefan Metzmacher
8308da6ce4 r4726: - use the name tcon and tid instead of conn and cnum
- make use of talloc destructors

metze
2007-10-10 13:08:48 -05:00
Andrew Tridgell
ef4dbc443d r4710: added a smb_composite_savefile() function, and expanded the test suite a little 2007-10-10 13:08:46 -05:00
Andrew Bartlett
cd9e795e40 r4708: Comparing with LDAP, it is clear that these 'flags' are in fact the
POSIX offset for the trusted domain.

Andrew Bartlett
2007-10-10 13:08:46 -05:00
Stefan Metzmacher
d896ac603a r4707: w2k3 don't restict passwords on
netr_ServerPasswordSet and netr_ServerPasswordSet2

so we do now

I also add a torture test for this

metze
2007-10-10 13:08:46 -05:00
Andrew Bartlett
8f47c7b02c r4706: Fix the build, after I renamed these elements in the IDL.
Andrew Bartlett
2007-10-10 13:08:45 -05:00
Andrew Bartlett
51e94fa26c r4703: Add support for EnumTrustDomain, and expand the testsuite.
Add my copyright to the SAMR server.

Andrew Bartlett
2007-10-10 13:08:45 -05:00
Stefan Metzmacher
7d8ba92da2 r4702: implment idl, torture test and server code for netr_ServerPasswordSet2()
metze
2007-10-10 13:08:45 -05:00
Andrew Tridgell
516f68fb05 r4700: first attempt at a composite async function, smb_composite_loadfile(),
which combineds ntcreatex, readx and close into a single call that
behaves just like a normal libcli async call.
2007-10-10 13:08:45 -05:00
Andrew Bartlett
c19f1850ee r4699: Move the test_EnumTrustDom() test into the test_CreateTrustedDomain
test.  This way, it must have at least one domain to enumerate.

Andrew Bartlett
2007-10-10 13:08:44 -05:00
Andrew Bartlett
271c8faadf r4698: - Initial implementation of trusted domains in LSA.
- Use templates for Secrets and the new trusted domains

 - Auto-add modifiedTime, createdTime and objectGUID to records in the
   samdb layer.

Andrew Bartlett
2007-10-10 13:08:44 -05:00
Andrew Bartlett
6a09a84320 r4694: 'fix' the behaviour for setting only the old, but not the new secret.
(The behaviour is a little odd, but we wanted bug-for-bug, right? :-)

Andrew Bartlett
2007-10-10 13:08:44 -05:00
Stefan Metzmacher
f0a0dbeb25 r4690: - add support for async rpc server replies
the backend should check for
(dce_call->state_flags & DCESRV_CALL_STATE_FLAG_MAY_ASYNC)
then it's allowed to reply async

then the backend should mark that call as async with
dce_call->state_flags |= DCESRV_CALL_STATE_FLAG_ASYNC;

later it has to manualy set r->out.result
and then send the reply by calling

status = dcesrv_reply(p->dce_call);

NOTE: that ncacn_np doesn't support async replies yet

- implement an async version of echo_TestSleep

- reenable the echo_TestSleep torture test
  (this need to be more strict when we have support for async ncacn_np)

metze
2007-10-10 13:08:43 -05:00
Stefan Metzmacher
b020dbec89 r4683: fix the build
metze
2007-10-10 13:08:42 -05:00
Andrew Bartlett
ded3303352 r4682: A LDB-based secrets implementation in Samba4.
This uses LDB (a local secrets.ldb and the global samdb) to fill out
the secrets from an LSA perspective.

Some small changes to come, but the bulk of the work is now done.

A re-provision is required after this change.

Andrew Bartlett
2007-10-10 13:08:42 -05:00
Andrew Bartlett
8807498f6d r4675: Prevent global warming, and save tridge's sainity by short-cutting the
testsuite for all the different flag types.  (We really only need to
know if we are getting the session key crypto stuff right, and one
call can tell us that).

Andrew Bartlett
2007-10-10 13:08:41 -05:00
Andrew Bartlett
5853af89c8 r4674: Test SetSecret behaviour for local and global secrets, when setting
only the OLD secret value.

Andrew Bartlett
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
Andrew Bartlett
357d9114f0 r4671: Expand the RPC-LSA test to set secret values twice.
Andrew Bartlett
2007-10-10 13:08:40 -05:00
Andrew Bartlett
a17a8fbf9a r4660: Test what we should return for a secret that does not exist.
Andrew Bartlett
2007-10-10 13:08:39 -05:00
Andrew Bartlett
43e3516fc0 r4635: Fix NTLMSSP to return NT_STATUS_OK when it has constructed the auth
token in the client (the final token in the negotiation).

Consequential fixes in the SPNEGO code, which now uses the out.length
as the indicator of 'I need to send something to the other side'.

Merge the NTLM and SPNEGO DCE-RPC authentication routines in the client.

Fix the RPC-MULTIBIND test consequent to this merge.

Andrew Bartlett
2007-10-10 13:08:37 -05:00
Andrew Tridgell
ba6caa99a4 r4631: don't consider an epmapper insert as a failure for the moment 2007-10-10 13:08:36 -05:00
Andrew Tridgell
5f10a8f8d0 r4625: added a test that demonstrates that once a context_id is established,
it can't be changed (so you have to create a new context_id, not
change the interface bound to an existing one)
2007-10-10 13:08:35 -05:00
Jelmer Vernooij
1f8f4dd179 r4624: Several crash fixes for DCOM
More work on the example class implementation
2007-10-10 13:08:35 -05:00
Jelmer Vernooij
b1ff606670 r4621: Add torture tests for epm_Insert and epm_Delete 2007-10-10 13:08:35 -05:00