1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-22 22:04:08 +03:00

708 Commits

Author SHA1 Message Date
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
826baec7b3 r5307: removed db_wrap.h from includes.h 2007-10-10 13:09:40 -05:00
Andrew Tridgell
cfee0fb02e r5306: removed all the unused mutex functions from mutex.c. When (if?) we
decide to reinstate the mutex code for the threads process model, I'd
like to do it a little differently. At least this gets it out of
includes.h for now.
2007-10-10 13:09:40 -05:00
Andrew Tridgell
b902ea546d r5304: removed lib/socket/socket.h from includes.h 2007-10-10 13:09:39 -05:00
Andrew Tridgell
b4993c738b r5303: fixed build of gconf registry backend 2007-10-10 13:09:39 -05:00
Andrew Tridgell
e7e015f79b r5302: fixed a compilation problem on solaris caused by the recent include
changes
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
483b7af1fd r5299: fixed an include ordering problem 2007-10-10 13:09:38 -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
b4103d9f2b r5297: ensure pstring is not in the generated prototypes 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
Andrew Tridgell
e820fca506 r5292: ensure we cleanup the epoll_fd on event context destruction 2007-10-10 13:09:37 -05:00
Stefan Metzmacher
b4928f3ea8 r5284: this is needed on my server
+/* this #undef is needed on my SuSE 9.2 Box with glibc-devel-2.3.3-118 */
+#undef u32

as sys/epoll.h has this:
typedef union epoll_data
{
  void *ptr;
  int fd;
  uint32_t u32;
  uint64_t u64;
} epoll_data_t;

metze
2007-10-10 13:09:36 -05:00
Andrew Tridgell
4165f21635 r5274: fixed some const warnings by making the str_list_ functions return "const char **" 2007-10-10 13:09:35 -05:00
Andrew Tridgell
34e1a3ad78 r5273: fixed another bug in the code that keeps timed events
sorted. Hopefully it really works now :-)
2007-10-10 13:09:35 -05:00
Jelmer Vernooij
f2e6d71584 r5240: Don't return WERR_OK when no values were found (reported by Matt Cobb) 2007-10-10 13:09:33 -05:00
Andrew Tridgell
e8e499755a r5221: replace the str_list_*() code with new code based on talloc(). This is
a precursor to adding the wins client code in the nbt server.
2007-10-10 13:09:32 -05:00
Andrew Tridgell
d89b493aaf r5217: avoid epoll_ctl() if the event flags are already set correctly 2007-10-10 13:09:32 -05:00
Stefan Metzmacher
274ef2a206 r5199: fix some minor configure bugs
metze
2007-10-10 13:09:30 -05:00
Andrew Tridgell
2d7242f2ec r5198: don't consider failure to remove an epoll event as enough reason to
fallback to select(). This can happen in too many situations.
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
26aa1aa693 r5194: added support for using epoll instead of select() on systems that have
it. epoll is much more scalable than select(), but only exists on some
systems (such as Linux with the 2.6.x kernel). The code detects any
epoll system call failures at runtime and falls back to select() if
there is a problem, so it should be safe to compile this on a 2.6
kernel and run it on a 2.4.x kernel.

The speedup is quite large. It gains 20% in packet rate in the
BENCH-NBT test, on top of another 20% gain from the better timer
handling I added earlier. The really big gain will be when we are
dealing with large numbers of file descriptors. With epoll we can
handle hundreds of file descriptors all O(1), whereas with select it
is O(n).
2007-10-10 13:09:30 -05:00
Andrew Tridgell
7be0bc93bd r5189: fixed a double free bug in the ltdb indexing code 2007-10-10 13:09:29 -05:00
Andrew Tridgell
b45b9436d7 r5187: ordered the timed events in the events code, which makes processing
events much more efficient (no linked lists need to be traversed, so
large numbers of timers are no problem)
2007-10-10 13:09:29 -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
2eefe4f8de r5170: fixed a bug handling events that have already timed out - they were
being treated as events that never time out, so they happened on the
next other event
2007-10-10 13:09:28 -05:00
Stefan Metzmacher
1c48c30aaf r5143: don't generate prototypes for lib/tdb/
metze
2007-10-10 13:09:27 -05:00
Stefan Metzmacher
d8aeb69ea8 r5142: fix compiler warning
metze
2007-10-10 13:09:27 -05:00
Stefan Metzmacher
670e088e94 r5135: I prepare a clean up in includes.h
metze
2007-10-10 13:09:25 -05:00
Stefan Metzmacher
6bb07a0ed8 r5134: - fix types to always use _t types
- add #include "system/filesys.h" where needed

metze
2007-10-10 13:09:25 -05:00
Andrew Tridgell
69e97ad9c3 r5129: make sure we don't spin chewing CPU time due to my last change 2007-10-10 13:09:25 -05:00
Andrew Tridgell
0f1fb7017e r5123: fixed a bug in the timed events handling. It was possible for a timed
event handler to trigger a free that could cause a timer to be
triggered twice. This changs fixes it properly by marking timer events
to be removed using a zero next_event time.

I also changed the default timeout for events.c to be infinite, so if
there are no events to handle then smbd will sit forever doing
nothing. That allows it to be swapped out completely when idle.
2007-10-10 13:09:25 -05:00
Andrew Tridgell
e73e49aaa6 r5119: fflush after talloc reports to ensure they are fully on disk when using tee 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 Tridgell
95d9766be8 r5106: removed a bunch of unused socket functions. We still need
open_socket_out() as its used by the ldap client code (uggh)
2007-10-10 13:09:23 -05:00
Andrew Tridgell
ce62105434 r5105: removed some unused events functions. These are no longer needed as
destructors are used to remove pending socket events
2007-10-10 13:09:23 -05:00
Andrew Tridgell
339964a596 r5104: - added support for task based servers. These are servers that within
themselves are run as a single process, but run as a child of the
  main process when smbd is run in the standard model, and run as part
  of the main process when in the single mode.

- rewrote the winbind template code to use the new task services. Also
  fixed the packet queueing

- got rid of event_context_merge() as it is no longer needed
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
9493c47b18 r5093: Make debugs less confusing when a 0 NTTIME is printed.
Andrew Bartlett
2007-10-10 13:09:22 -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
4337901c1b r5052: minor formatting fix 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
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
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