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

873 Commits

Author SHA1 Message Date
Andrew Tridgell
dbef4fd5c3 r5333: weird, w2k3 always sends a positive name release response, even for names that
have never been registered. I wonder if there is some reason?
2007-10-10 13:09:43 -05:00
Andrew Tridgell
80a95d5688 r5328: - allow case sensitive nbt name lookups
- added --case-sensitive option to nmblookup

 - added case sensitivity tests to the NBT-WINS test
2007-10-10 13:09:42 -05:00
Andrew Tridgell
6d775f1216 r5325: - expanded the NBT-WINS test to include scopes
- fixed the bugs that the new test found
2007-10-10 13:09:41 -05:00
Andrew Tridgell
bd2c55a519 r5310: allow for rounding errors in the sleep test 2007-10-10 13:09:40 -05:00
Andrew Tridgell
bf43c9bdcf r5308: trimmed back a lot of the old macros from smb_macros.h 2007-10-10 13:09:40 -05:00
Andrew Tridgell
0df3fdd817 r5305: removed libcli/ldap/ldap.h from includes.h 2007-10-10 13:09:39 -05:00
Andrew Tridgell
b902ea546d r5304: removed lib/socket/socket.h from includes.h 2007-10-10 13:09:39 -05:00
Andrew Tridgell
9db6c79e90 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.
2007-10-10 13:09:38 -05:00
Andrew Tridgell
6f79432fe6 r5296: - only include the tdb headers where they are needed
- removed the u32 hack in events.c as I think this was only needed as
  tdb.h defines u32. Metze, can you check that this hack is indeed no
  longer needed on your suse system?
2007-10-10 13:09:38 -05:00
Andrew Tridgell
bb1ab11d8e r5294: - added a separate NBT-WINS test for WINS operations (register, refresh, release and query)
- change the iface_n_*() functions to return a "const char *" instead of a "struct ipv4_addr"
  I think that in general we should move towards "const char *" for
  all IP addresses, as this makes IPv6 much easier, and is also easier
  to debug. Andrew, when you get a chance, could you fix some of the
  auth code to use strings for IPs ?

- return a NTSTATUS error on bad name queries and node status instead
  of using rcode. This makes the calling code simpler.

- added low level name release code in libcli/nbt/

- use a real IP in the register and wins nbt torture tests, as w2k3
  WINS server silently rejects some operations that don't come from the
  IP being used (eg. it says "yes" to a release, but does not in fact
  release the name)
2007-10-10 13:09:37 -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
d51fcee29a r5277: initialise the multi_homed flag in the name registration test 2007-10-10 13:09:36 -05:00
Andrew Tridgell
d56e68ebf5 r5252: - fixed nmblookup for the nbt api changes
- added a simple WINS server name registration and query test
2007-10-10 13:09:34 -05:00
Jelmer Vernooij
7b847de64f r5209: Fix the endpoint mapper to work with IPX endpoints (which
accidently have the same protocol id as UUID's)
Before this, Samba would give NDR errors when contacting
a remote server that has IPX support enabled.

This one was on my long due bugs list.
2007-10-10 13:09:31 -05:00
Andrew Tridgell
7f54c8a339 r5197: moved events code to lib/events/ (suggestion from metze) 2007-10-10 13:09:30 -05:00
Andrew Tridgell
236403cc4d r5195: most events don't need the time of the event, so save a gettimeofday() call
and just use timeval_current() when its actually needed
2007-10-10 13:09:30 -05:00
Andrew Tridgell
d7b4b6de51 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)
2007-10-10 13:09:29 -05:00
Andrew Tridgell
bb1298a2eb r5156: started on test driven development of the nbt server. This adds a
NBT-REGISTER test that tests that a server correctly defends its name
against broadcast name registrations.

Jeremy, you might like to look at this. Samba3 nmbd fails to respond.
2007-10-10 13:09:28 -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
cbc1f17282 r5148: use ipv4_addr also in epmapper idl
metze
2007-10-10 13:09:28 -05:00
Stefan Metzmacher
add1c57937 r5137: fix types
metze
2007-10-10 13:09:26 -05:00
Andrew Tridgell
2d23c665ff r5130: added a single NBT name query benchmark. It keeps 10 queries in flight at a time. 2007-10-10 13:09:25 -05:00
Andrew Tridgell
cf11d05e35 r5126: the composite code is no longer client specific or smb specific, so
rename the core structure to composite_context and the wait routine to
composite_wait() (suggestion from metze)
2007-10-10 13:09:25 -05:00
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