1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-17 02:05:21 +03:00

636 Commits

Author SHA1 Message Date
Andrew Tridgell
aac3090e35 r5352: added a function nbt_name_string() that formats a nbt_name structure
as a human readable string. The format is designed to be able to be
used as the DN for the WINS database as well, while coping with
arbitrary bytes in the name (except nul bytes)
2007-10-10 13:09:45 -05:00
Andrew Bartlett
34b1da7303 r5330: Remove #include <sys/time.h> from includes.h.
Add #include "system/time.h" back (it was removed in some of these
places because the definitions were provided by <sys/time.h> on tridge's
platform.)

Andrew Bartlett
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
8e5d3a74d3 r5326: removed the charset conversion from the nbtname code, so we no longer
convert from/to DOS strings in NBT names. This will allow us to
support all foreign names as a WINS server, as long as they don't
contain a 0 byte.
2007-10-10 13:09:41 -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
80ffcc650c r5322: removed a whole bunch of #include lines that minimal_includes.pl
thinks are not needed. Now to see how this fares on the build farm :)
2007-10-10 13:09:41 -05:00
Andrew Tridgell
196c45b834 r5309: removed ads.h from includes.h 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
93931b1a74 r5300: more uint32 and system/filesys.h build fixes when developer mode is enabled 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
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
2502b02898 r5275: - added support for NBT_OPCODE_MULTI_HOME_REG (opcode 0xf) for WINS name registrations
- fixed a bug in the send queue handling on timeouts

- added support for handling unexpected replies (replies to the wrong
  port) at the nbtsocket layer

- added separate layer 2 code for wins refresh and wins registration
2007-10-10 13:09:36 -05:00
Andrew Tridgell
554d1b70e7 r5261: translate nbt rcode errors to NTSTATUS codes 2007-10-10 13:09:35 -05:00
Andrew Tridgell
919bc14e7b r5260: - show an error message on nmblookup failure
- always try to enable broadcast on nbt name sockets (this matches
  samba3 behaviour better)
2007-10-10 13:09:35 -05:00
Andrew Tridgell
76be35cb99 r5250: - added low level support for retrying nbt name queries, rather than
having the 2nd layer functions do retries themselves. This makes the
  code simpler, and allows the TRN_ID to be reused in the retry (which
  is how it is supposed to work).

- added support for WACK replies to nbt name requests. A WACK reply
  specifies a timeout to wait for the real reply.

- added WINS name refresh async calls, supporting multiple wins
  servers and multiple IPs to register
2007-10-10 13:09:34 -05:00
Jelmer Vernooij
b72a0ac654 r5237: Add error code for "class not registered" 2007-10-10 13:09:33 -05:00
Stefan Metzmacher
274ef2a206 r5199: fix some minor configure bugs
metze
2007-10-10 13:09:30 -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
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
abacbc9192 r5145: define struct ipv4_addr in misc.idl,
so we can use it in nbt.idl and
get a nicer debug output

metze
2007-10-10 13:09:27 -05:00
Stefan Metzmacher
add1c57937 r5137: fix types
metze
2007-10-10 13:09:26 -05:00
Stefan Metzmacher
344367cc4c r5136: fix types
metze
2007-10-10 13:09:26 -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
69e6a1cd4b r5121: added periodic name refresh requests for all our registered names, reporting any
name conflicts
2007-10-10 13:09:24 -05:00
Andrew Tridgell
6726f15cf4 r5120: encode outgoing nbt packets when queueing them rather than in the send
event code, as elements of the callers packet structure could go away
while the queue is pending (if for example a name was de-registered
while a packet referencing that name is queued)
2007-10-10 13:09:24 -05:00
Andrew Tridgell
d656fba6f1 r5117: used a composite function to add 4 stage name registration. We send 3
broadcast name registration demands per name per interface at 1 second
intervals, then send a name overwrite request and demand. Any name
conflict replies are reported.
2007-10-10 13:09:24 -05:00
Andrew Tridgell
506e1e823c r5116: fixed build of the nbtlist code 2007-10-10 13:09:24 -05:00
Andrew Tridgell
d7d31fdc66 r5114: the nbtd task can now act as a basic B-node server. It registers its
names on the network and answers name queries. Lots of details are
still missing, but at least this now means you don't need a Samba3
nmbd to use Samba4.

missing pieces include:

 - name registrations should be "shout 3 times, then demand"

 - no WINS server yet

 - no master browser code
2007-10-10 13:09:23 -05:00
Andrew Tridgell
2fedca6adf r5108: the beginnings of a nbtd server for Samba4. Currently just displays
the packets it receives, but it at least shows how the server
structure will work.

To implement it I extended the libcli/nbt/ library to allow for an
incoming packet handler to be registered. That allows the nbt client
library to be used for low level processing of the nbtd server packets.

Other changes:

 - made the socket library always set SO_REUSEADDR when binding to an
   interface, to ensure that restarts of a server don't have to wait
   for a couple of minutes.

 - made the nbt port configurable. Defaults to 137, but other ports
   will be useful for testing.
2007-10-10 13:09:23 -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 Bartlett
ffad9b22be r5092: Add a bit more const - moving it further into the LDB layer.
Andrew Bartlett
2007-10-10 13:09:22 -05:00
Andrew Tridgell
3351c636af r5053: - fix up the library dependencies so that tools that need nbt don't
need to pull in the whole dcerpc subsystem

- moved smbencrypt.c code into libcli/auth/
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
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
Stefan Metzmacher
522af7ecc0 r4958: fix compiler warnings
metze
2007-10-10 13:09:10 -05:00
Andrew Tridgell
3e13e1d526 r4957: the fetchfile _recv() function was neglecting to steal the data and
free the connection context. This left a whole lot of state hanging
around and didn't give the memory to the caller properly
2007-10-10 13:09:10 -05:00
Andrew Tridgell
8f19b6886c r4954: we don't need the separate event_remove_*() calls any more, as you now
remove an event by calling talloc_free().
2007-10-10 13:09:09 -05:00
Andrew Tridgell
f8a950b57d r4952: removed a bogus talloc_steal() that was trying to cope with the
inverted memory hierarchy. Now the memory hierarchy is logical its not
needed (and can cause a double free in RPC-SCHANNEL)
2007-10-10 13:09:09 -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
Andrew Tridgell
4a351901aa r4950: removed some excessive debugging messages 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
7f981b9ed9 r4944: every event_add_*() caller was having to call talloc_steal() to take
control of the event, so instead build that into the function. If you
pass NULL as mem_ctx then it leaves it as a child of the events
structure.
2007-10-10 13:09:08 -05:00
Andrew Tridgell
a3c7417cfe r4943: Smplified the events handling code a lot. The first source of
complexity was that events didn't automatically cleanup
themselves. This was because the events code was written before we had
talloc destructors, so you needed to call event_remove_XX() to clean
the event out of the event lists from every piece of code that used
events. I have now added automatic event destructors, which in turn
allowed me to simplify a lot of the calling code.

The 2nd source of complexity was caused by the ref_count, which was
needed to cope with event handlers destroying events while handling
them, which meant the linked lists became invalid, so the ref_count ws
used to mark events for later destruction.

The new system is much simpler. I now have a ev->destruction_count,
which is incremented in all event destructors. The event dispatch code
checks for changes to this and handles it.
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
347dfa4724 r4937: simplify the connect code in the same way 2007-10-10 13:09:07 -05:00