1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-02 09:47:23 +03:00

681 Commits

Author SHA1 Message Date
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
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
266fd2751c r4898: - removed the unused wins_srv_*() code
- expanded the generic async name resolver to try multiple methods

- added wins resolutions to the list of methods tried

- fixed up the random trn id generation to use the good random generator
2007-10-10 13:09:04 -05:00
Andrew Tridgell
e7262dccce r4863: schema_find_attribute() should be static 2007-10-10 13:09:01 -05:00
Simo Sorce
0315159daf r4862: - better structure schema tests
- fix check for deletion of required attributes on modify
  removed by mistake with the previous commits
2007-10-10 13:09:00 -05:00
Simo Sorce
c6257379e0 r4859: changed a numbe rof things:
- Try to no tcopy memory if not necessary
- let the searches hang around until we finish the operation
- greatly simplify the modify operation

still todo:

- check attributes syntax
- check objectclasses type, we cannot allow to add a new structural
  objectclass to an exixting entry unless the existing one is a parent
- more tests
2007-10-10 13:09:00 -05:00
Simo Sorce
a30f647b8a r4844: - Remove the unused attrsyn structure
- Change 0 to NULL when checking allocations
- Introduce the schema_attr_cmp hepler function
- Do not allow auxiliary classes to be missing
- Try to ease code readability and try to get
  main code out of loops when possibile.
2007-10-10 13:09:00 -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
0395380351 r4818: missed version.h here 2007-10-10 13:08:59 -05:00
Andrew Tridgell
520cff73c6 r4817: ccache was being made ineffective on all the build farm machines
because the version number was being auto-updated and included in all
C files. With this change it is only included where needed.
2007-10-10 13:08:59 -05:00
Andrew Tridgell
b221c3dbb9 r4801: remove the two bogus ctype.h includes 2007-10-10 13:08:57 -05:00
Andrew Tridgell
ad1af519eb r4793: minor doc updates 2007-10-10 13:08:55 -05:00
Andrew Tridgell
c283e1a3ef r4790: added type checking helper macros in talloc. These take advantage of
the type names that talloc already keeps around for pointers, and
allows the user to type check void* private pointers. It can also be
used to implement polymorphism in C, as I'm sure someone would have
pointed out to me sooner or later :-)
2007-10-10 13:08:55 -05:00
Simo Sorce
e895fcf4a3 r4786: forgot to commit the exclusion for schema checking against our control entries 2007-10-10 13:08:55 -05:00
Simo Sorce
42a20f6fa4 r4784: finally make schema module use a single ldb
add the new test-schema test
2007-10-10 13:08:54 -05:00
Andrew Tridgell
6534ce650b r4781: the tolower() in schema.c is a premature optimisation. I suspect the
"distinguishedName" checking in that module is incorrect and should be
removed, but meanwhile, lets not make it slow down the compile of
every other module.
2007-10-10 13:08:54 -05:00
Simo Sorce
18cd6cb674 r4775: use schema_attr_cmp wrapper to check for the special dn/distinguishedName case alias 2007-10-10 13:08:53 -05:00
Simo Sorce
8c11038d67 r4759: use ldb_attr_cmp() to compare attribute names
check required attributes are not deleted on modify operation
if the objectclass is deleted then deny the operation if
orphan atributes are left behind
2007-10-10 13:08:51 -05:00
Andrew Tridgell
d2f76c3671 r4756: a slight tidy up in the events code 2007-10-10 13:08:50 -05:00
Andrew Tridgell
b787dd166f r4753: added the ability for the generic socket library to handle async
connect(). This required a small API change (the addition of
a socket_connect_complete() method)
2007-10-10 13:08:50 -05:00
Andrew Tridgell
7893251456 r4744: until we decide what to do about attribute aliasing (see my recent
samba-technical posting), this is an interim solution that makes us
work pretty much like w2k3 does.
2007-10-10 13:08:49 -05:00
Stefan Metzmacher
05c3d1c4a6 r4727: add a reference to the event context
to that the destructor don't double free the registered events
when the event context is first in the talloc_free() hierarchie

fixes a bug with process_model_thread and the talloc_steal(conn, ev)

metze
2007-10-10 13:08:49 -05:00
Andrew Tridgell
8033ef6b71 r4719: snprintf.c is used outside of samba, so don't use our special types 2007-10-10 13:08:48 -05:00
Andrew Tridgell
603ef69be0 r4718: don't use the deprecated __va_copy() unless va_copy() is unavailable 2007-10-10 13:08:47 -05:00
Simo Sorce
a681ae365f r4714: move the ldb code to the new talloc interface (eg remove _p suffix)
this helps standalone building of ldb

renew the schema module
split code into functions to improve readability and code reuse

add and modify works correctly but we need a proper testsuite

Simo
2007-10-10 13:08:47 -05:00
Andrew Tridgell
4ec47cc108 r4711: - deprecate talloc_destroy()
- expanded the talloc_realloc() test a little (I was concerned about a
  possible bug, which turned out to be an illusion)

- don't enable gcov by default in Makefile.talloc
2007-10-10 13:08:46 -05:00
Stefan Metzmacher
9b9501bc03 r4689: - make talloc_report_depth() public
- add talloc_parent() to return the parent context of a pointer

these are very use full for debuging

metze
2007-10-10 13:08:43 -05:00
Stefan Metzmacher
4ab63d5479 r4688: don't run male proto for lib/talloc/
metze
2007-10-10 13:08:43 -05:00