1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

287 Commits

Author SHA1 Message Date
Andrew Tridgell
55d4d36993 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
(This used to be commit cf6a46c3cb)
2007-10-10 13:09:22 -05:00
Andrew Tridgell
759da3b915 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.
(This used to be commit ec32b22ed5)
2007-10-10 13:09:15 -05:00
Stefan Metzmacher
0475cfe570 r4941: - all needed data is now in sam.ldb and hacked.ldb is not needed anymore by the hacked ldap backend
- readd the schema naming context container object as it's needed for a w2k3 dc join

metze
(This used to be commit c583f80623)
2007-10-10 13:09:08 -05:00
Andrew Bartlett
757a063a13 r4897: Unbreak the LDAP server. Somehow the generic service structures
(which seem just a little too complex) changed, but this code was not
updated or tested.

Also clarify the existing code, by not reusing variables.

Andrew Bartlett
(This used to be commit eb46adade4)
2007-10-10 13:09:04 -05:00
Stefan Metzmacher
9327ec51d1 r4728: split up server_services into:
- stream_socket services
  the smb, ldap and rpc service which sets up a srtam socket end then
  waits for connections
and
- task services
  which this you can create a seperate task that do something
  (this is also going through the process_model subsystem
  so with -M standard a new process for this created
  with -M thread a new thread ...

I'll add datagram services later when we whave support for datagram sockets in lib/socket/

see the next commit as an example for service_task's

metze
(This used to be commit d5fa02746c)
2007-10-10 13:08:49 -05:00
Stefan Metzmacher
ef4e85614e r4716: add a real ugly hack to get all ldap queries of an
w2k3 dc join working

I just commit that to not lose it if my home box would crash...

you need a hacked.ldb with some stuff in it, I'll explain later

and you need --option="ldapsrv:hacked=yes"

so what is left now is KRB5 support for DCERPC in the server
as the EVENT LOG of w2k3 says...

metze
(This used to be commit d72760d26f)
2007-10-10 13:08:47 -05:00
Stefan Metzmacher
09c34de35a r4709: fix compiler warnings
metze
(This used to be commit 7aa86445e3)
2007-10-10 13:08:46 -05:00
Stefan Metzmacher
047d41cc49 r4634: disable sign and seal in ldap_server for now.
metze
(This used to be commit 872c687184)
2007-10-10 13:08:37 -05:00
Stefan Metzmacher
b343cc97de r4629: we now have a global macro NT_STATUS_HAVE_NO_MEMORY()
so don't use a local one

metze
(This used to be commit dd217f7916)
2007-10-10 13:08:36 -05:00
Stefan Metzmacher
e1426c51ab r4628: this function should be static
metze
(This used to be commit 590afa88f1)
2007-10-10 13:08:35 -05:00
Andrew Tridgell
ddc10d4d37 r4549: got rid of a lot more uses of plain talloc(), instead using
talloc_size() or talloc_array_p() where appropriate.

also fixed a memory leak in pvfs_copy_file() (failed to free a memory
context)
(This used to be commit 89b74b5354)
2007-10-10 13:08:25 -05:00
Andrew Tridgell
cc55aef7c1 r4547: - added talloc_new(ctx) macro that is a neater form of the common talloc(ctx, 0) call.
- cleaned up some talloc usage in various files

I'd like to get to the point that we have no calls to talloc(), at
which point we will rename talloc_p() to talloc(), to encourage
everyone to use the typesafe functions.
(This used to be commit e6c81d7c9f)
2007-10-10 13:08:20 -05:00
Andrew Tridgell
500d5523d2 r4475: fixed smbd to work with the small changes in the ldb API (the most important
change was in the ldb_msg_add_*() routines, which now use the msg as a context,
and thus it needs to be a talloc ptr)
(This used to be commit 1a4713bfd0)
2007-10-10 13:07:55 -05:00
Andrew Bartlett
9a6671cf95 r4459: GENSEC refinements:
In developing a GSSAPI plugin for GENSEC, it became clear that the API
needed to change:
 - GSSAPI exposes only a wrap() and unwrap() interface, and determines
   the location of the signature itself.
 - The 'have feature' API did not correctly function in the recursive
   SPNEGO environment.

As such, NTLMSSP has been updated to support these methods.

The LDAP client and server have been updated to use the new wrap() and
unwrap() methods, and now pass the LDAP-* tests in our smbtorture.
(Unfortunely I still get valgrind warnings, in the code that was
previously unreachable).

Andrew Bartlett
(This used to be commit 9923c3bc1b)
2007-10-10 13:07:53 -05:00
Andrew Bartlett
44113c4de1 r4355: More work from the elves on Christmas eve:
- Update Samba4's kerberos code to match the 'salting' changes in
   Samba3 (and many other cleanups by jra).

 - Move GENSEC into the modern era of talloc destructors.  This avoids
   many of the memory leaks in this code, as we now can't somehow
   'forget' to call the end routine.
  - This required fixing some of the talloc hierarchies.

 - The new krb5 seems more sensitive to getting the service name
   right, so start actually setting the service name on the krb5 context.

Andrew Bartlett
(This used to be commit 278bf1a61a)
2007-10-10 13:07:37 -05:00
Stefan Metzmacher
0ad10aec63 r4079: implement the gensec_have_feature() correctly by asking
the backend what is actually in use

metze
(This used to be commit 6f3eb7bc03)
2007-10-10 13:06:23 -05:00
Andrew Tridgell
4183b2ac38 r4037: fixed a bunch of "might be uninitialised" warnings after enabling -O1 in my compile
(This used to be commit 0928b1f5b6)
2007-10-10 13:06:16 -05:00
Stefan Metzmacher
15543f18ac r4000: DATA_BLOB.data is uint8_t * not void * :-)
(thanks abartlet for telling me)

metze
(This used to be commit 2783bf393f)
2007-10-10 13:06:13 -05:00
Stefan Metzmacher
1814aad561 r3962: fix compiler warnings
metze
(This used to be commit 3bfb732187)
2007-10-10 13:06:08 -05:00
Stefan Metzmacher
8a18778286 r3783: - don't use make proto for ldb anymore
- split ldh.h out of samba's includes.h

- make ldb_context and ldb_module private to the subsystem

- use ltdb_ prefix for all ldb_tdb functions

metze
(This used to be commit f5ee40d6ce)
2007-10-10 13:05:52 -05:00
Stefan Metzmacher
0a5ea499ec r3762: - only load the readed bytes into the input buffer
- fix compiler warnings with gcc-4.0

metze
(This used to be commit 7a931ea0f4)
2007-10-10 13:05:52 -05:00
Simo Sorce
679e95db03 r3754: merge in ldb modules support from the tmp branch ldbPlugins
(This used to be commit 71323f424b)
2007-10-10 13:05:51 -05:00
Jelmer Vernooij
8e16d8a76f r3733: More build system fixes/features:
- Use .mk files directly (no need for a SMB_*_MK() macro when adding a new SUBSYSTEM, MODULE or BINARY). This allows addition of new modules and subsystems without running configure
 - Add support for generating .dot files with the Samba4 dependency tree (as used by the graphviz and springgraph utilities)
(This used to be commit 64826da834)
2007-10-10 13:05:47 -05:00
Andrew Tridgell
dde0705807 r3507: - added deferred replies on sharing violation in pvfs open. The
deferred reply is short-circuited immediately when the file is
  closed by another user, allowing it to be opened by the waiting user.

- added a sane set of timeval manipulation routines

- converted all the events code and code that uses it to use struct
  timeval instead of time_t, which allows for microsecond resolution
  instead of 1 second resolution. This was needed for doing the pvfs
  deferred open code, and is why the patch is so big.
(This used to be commit 0d51511d40)
2007-10-10 13:05:23 -05:00
Andrew Tridgell
6f214cc510 r3494: got rid of include/rewrite.h, and split out the dynconfig.h header
(This used to be commit 558de54ec6)
2007-10-10 13:05:22 -05:00
Andrew Tridgell
a99b6219a8 r3481: split out client.h and events.h
(This used to be commit c6f4865744)
2007-10-10 13:05:20 -05:00
Andrew Tridgell
a42142439a r3464: split out registry.h, rap.h and ldap_server.h
(This used to be commit 70d2090f6b)
2007-10-10 13:05:17 -05:00
Andrew Tridgell
3643fb1109 r3463: separated out some more headers (asn_1.h, messages.h, dlinklist.h and ioctl.h)
(This used to be commit b97e395c81)
2007-10-10 13:05:17 -05:00
Andrew Tridgell
edbfc0f6e7 r3453: - split out the auth and popt includes
- tidied up some of the system includes

- moved a few more structures back from misc.idl to netlogon.idl and samr.idl now that pidl
  knows about inter-IDL dependencies
(This used to be commit 7b7477ac42)
2007-10-10 13:05:13 -05:00
Andrew Tridgell
ead3508ac8 r3447: more include/system/XXX.h include files
(This used to be commit 264ce91810)
2007-10-10 13:05:12 -05:00
Andrew Tridgell
284349482f r3443: the next stage in the include files re-organisation.
I have created the include/system/ directory, which will contain the
wrappers for the system includes for logical subsystems. So far I have
created include/system/kerberos.h and include/system/network.h, which
contain all the system includes for kerberos code and networking code.
These are the included in subsystems that need kerberos or networking
respectively.

Note that this method avoids the mess of #ifdef HAVE_XXX_H in every C
file, instead each C module includes the include/system/XXX.h file for
the logical system support it needs, and the details are kept isolated
in include/system/

This patch also creates a "struct ipv4_addr" which replaces "struct
in_addr" in our code. That avoids every C file needing to import all
the system networking headers.
(This used to be commit 2e25c71853)
2007-10-10 13:05:11 -05:00
Andrew Tridgell
c4cff94beb r3316: give the LDAP server a chance of operating correctly non-blocking (it
didn't handle EINTR or EAGAIN)
(This used to be commit c35a8f92c2)
2007-10-10 13:04:53 -05:00
Andrew Tridgell
c6888da148 r3304: changed the API to lib/socket/ a little.
The main change is to make socket_recv() take a pre-allocated buffer,
rather than allocating one itself. This allows non-blocking users of
this API to avoid a memcpy(). As a result our messaging code is now
about 10% faster, and the ncacn_ip_tcp and ncalrpc code is also
faster.

The second change was to remove the unused mem_ctx argument from
socket_send(). Having it there implied that memory could be allocated,
which meant the caller had to worry about freeing that memory (if for
example it is sending in a tight loop using the same memory
context). Removing that unused argument keeps life simpler for users.
(This used to be commit a16e4756cd)
2007-10-10 13:04:52 -05:00
Andrew Tridgell
9d055846f2 r3278: - rewrote the client side rpc connection code to use lib/socket/
rather than doing everything itself. This greatly simplifies the
  code, although I really don't like the socket_recv() interface (it
  always allocates memory for you, which means an extra memcpy in this
  code)

- fixed several bugs in the socket_ipv4.c code, in particular client
  side code used a non-blocking connect but didn't handle EINPROGRESS,
  so it had no chance of working. Also fixed the error codes, using
  map_nt_error_from_unix()

- cleaned up and expanded map_nt_error_from_unix()

- changed interpret_addr2() to not take a mem_ctx. It makes absolutely
  no sense to allocate a fixed size 4 byte structure like this. Dozens
  of places in the code were also using interpret_addr2() incorrectly
  (precisely because the allocation made no sense)
(This used to be commit 7f2c771b0e)
2007-10-10 13:04:49 -05:00
Jelmer Vernooij
8debe5a6b8 r3136: - Allow specifying socket type when adding smbd service
- Make sure a epm_tower struct is completely initialized
- Some more minor fixes
(This used to be commit d560dcbdb8)
2007-10-10 13:02:25 -05:00
Stefan Metzmacher
98c8cb195a r3099: implment sldb_ModifyDN()
metze
(This used to be commit a25d1c4419)
2007-10-10 13:02:21 -05:00
Stefan Metzmacher
d970cafc4b r3098: - fix segfault in sldb_Compare()
- be more verbose on the INVALID_DN errstr

metze
(This used to be commit 4b8d90866e)
2007-10-10 13:02:20 -05:00
Stefan Metzmacher
fd07fc88e7 r3097: - an empty string is a valid DN
- detect in valid DN's

- some error handling fixes

metze
(This used to be commit d92eff2328)
2007-10-10 13:02:20 -05:00
Simo Sorce
2d2f43c939 r2908: fix typo
(This used to be commit f544f83063)
2007-10-10 12:59:47 -05:00
Stefan Metzmacher
585571a824 r2892: fix compiler warning
metze
(This used to be commit 1a3b546fce)
2007-10-10 12:59:44 -05:00
Stefan Metzmacher
22f0d7012c r2891: call rootDSE only with LDAP_SEARCH_SCOPE_BASE
this is needed because of the global catalog

metze
(This used to be commit 071c19c25d)
2007-10-10 12:59:43 -05:00
Stefan Metzmacher
437a037b7b r2890: fix segfault when call is destroyed and we dereference it
metze
(This used to be commit 82e792a0ce)
2007-10-10 12:59:43 -05:00
Stefan Metzmacher
e465b65274 r2886: missing stuff from last commit
metze
(This used to be commit f3f2d1c676)
2007-10-10 12:59:42 -05:00
Stefan Metzmacher
48d87ea356 r2885: windows doesn't try to do sign or seal by default
metze
(This used to be commit 0f5267c29c)
2007-10-10 12:59:42 -05:00
Stefan Metzmacher
c4005997b9 r2881: also bind the ldap service on the global catalog service port
(port 3268)

metze
(This used to be commit 7d17122c71)
2007-10-10 12:59:42 -05:00
Stefan Metzmacher
bd7cd1953a r2880: move the rootdse.ldif template to the source/ dir
so that that it will be easier found by running
./script/rootdse.pl

metze
(This used to be commit 650713f7fe)
2007-10-10 12:59:41 -05:00
Stefan Metzmacher
73e9f435f5 r2878: add server sasl support
(there are a lot of clean ups following later, but the LDAP-BASIC test
 works :-)

metze
(This used to be commit 34fe29c04a)
2007-10-10 12:59:41 -05:00
Stefan Metzmacher
85e18e252d r2877: the Bind and Unbind function are already moved...
metze
(This used to be commit 5c3f3b4072)
2007-10-10 12:59:41 -05:00
Stefan Metzmacher
4c2bbb1edb r2876: - more than one rootDSE entry in the database is an error!
- don't say that we provide the same functionality as w2k3

- netbiosname is always upper case hostname

- minor fixes rootdse.pl

metze
(This used to be commit 0b30ec593f)
2007-10-10 12:59:41 -05:00
Simo Sorce
d669d6a892 r2875: some fixes + (C) note
(This used to be commit d878c3c365)
2007-10-10 12:59:41 -05:00
Simo Sorce
7251e37bb6 r2874: Italian CodeJam commit :-)
implemented rootDSE on ldb with rootdse.ldif and related script to populate a basic rootDSE tree
(This used to be commit 923c936088)
2007-10-10 12:59:41 -05:00
Stefan Metzmacher
4503ddc155 r2864: - Bind and Unbind are no directory partition operations
- move Bind Unbind code to a seperate file

metze
(This used to be commit 3aa1a29897)
2007-10-10 12:59:40 -05:00
Stefan Metzmacher
7a4478845f r2863: move the logical ldapsrv functions to a seperate file
metze
(This used to be commit 5173c4d4fe)
2007-10-10 12:59:40 -05:00
Stefan Metzmacher
2a1ee36e7f r2862: prepare LDAP SASL support for the server
metze
(This used to be commit 9a7505bd74)
2007-10-10 12:59:40 -05:00
Stefan Metzmacher
9abbd9e860 r2855: fix error codes for Compare
metze
(This used to be commit d23335bc14)
2007-10-10 12:59:39 -05:00
Andrew Tridgell
1aabcd7312 r2836: removed a couple of unused variables
(This used to be commit 391b09dad1)
2007-10-10 12:59:38 -05:00
Stefan Metzmacher
85428819e3 r2825: fix the build
this function names are unsed elsewhere in the code too

metze
(This used to be commit a8f2fe0ff0)
2007-10-10 12:59:37 -05:00
Simo Sorce
cf42c06c86 r2820: complete the parsing routing with correct support for escaped chars
clean up simple_ldb functions
(This used to be commit 3af61cb6cd)
2007-10-10 12:59:37 -05:00
Stefan Metzmacher
85b78669b4 r2816: fix 'Default-First-Site-Name' dn
metze
(This used to be commit ae4b99d15c)
2007-10-10 12:59:36 -05:00
Simo Sorce
44a556fd5a r2815: add some more docs
add a nearly complete rfc conformat dn parsing function
(This used to be commit 1bc5a94488)
2007-10-10 12:59:36 -05:00
Andrew Tridgell
1429ed54f1 r2792: got rid of talloc_ldb_alloc() and instead created talloc_realloc_fn(),
so talloc now doesn't contain any ldb specific functions.

allow NULL to be passed to a couple more talloc() functions
(This used to be commit 1246f80d80)
2007-10-10 12:59:34 -05:00
Simo Sorce
338c90404f r2758: keep docos handy while developing it
(This used to be commit 5f9b58c785)
2007-10-10 12:59:31 -05:00
Stefan Metzmacher
a4a360b7fe r2757: some minor fixes
metze
(This used to be commit 991b4777c8)
2007-10-10 12:59:30 -05:00
Simo Sorce
53e5e96830 r2754: Change sldb_trim_dn() to be sldb_fix_dn() as we are not really trimming.
Make it handle all cases:
- remove spaces before and after ','
- remove spaces after '='

TODO: check if there are escape chars in the RFC, they are not handled here yet.

Simo.
(This used to be commit ba2970c3a4)
2007-10-10 12:59:30 -05:00
Stefan Metzmacher
525dc6f089 r2748: implement sldb_Compare()
Simo: this commit should not conflict much with your changes:-)

metze
(This used to be commit 6825e78e01)
2007-10-10 12:59:30 -05:00
Stefan Metzmacher
ab5a0d31a3 r2731: use debug level 10 everywhere
metze
(This used to be commit a0e4dca3da)
2007-10-10 12:59:27 -05:00
Stefan Metzmacher
6baf350771 r2724: - use ldapsrv_service and set it up with the rootDSE and default partition
(this is not complete yet)

- call asn1_free() after each call

metze
(This used to be commit 0aa622bdc4)
2007-10-10 12:59:26 -05:00
Stefan Metzmacher
aee52f2b57 r2722: remove tmp debug messages
metze
(This used to be commit 60dcba3e91)
2007-10-10 12:59:26 -05:00
Stefan Metzmacher
4d541b26ea r2720: -implement sldb_Modify() call
metze
(This used to be commit e74d3895f0)
2007-10-10 12:59:26 -05:00
Stefan Metzmacher
7c0efa5cf1 r2714: - add sldb_Add() implementation
- fix some errstr settings

metze
(This used to be commit 7419c6dabb)
2007-10-10 12:59:25 -05:00
Simo Sorce
eac532ee3a r2695: revert "Del" renaming
(This used to be commit ddd74dae8e)
2007-10-10 12:59:24 -05:00
Stefan Metzmacher
43d45f80ad r2693: - send a reply when no attributes there
- add some debug messages

metze
(This used to be commit 1de1beca66)
2007-10-10 12:59:23 -05:00
Simo Sorce
456e2f82e8 r2689: Use consistent naming Del -> Delete
Add delete functionality to ldb simple lda server backend
add some const in ldap.h
(This used to be commit 5ed9a6eb18)
2007-10-10 12:59:22 -05:00
Stefan Metzmacher
718bb5e8ff r2688: - fix case where listed attributes are asked
- use the return code of the functions
  and only call ldapsrv_terminate_connection from ldapsrv_recv() or ldapsrv_send()
- the rootdse is now a normal partition

metze
(This used to be commit af1501a28d)
2007-10-10 12:59:22 -05:00
Stefan Metzmacher
c8a7c5b95e r2685: ALLOC_CHECK() after talloc_steal() isn't needed
(thanks simo:-)

metze
(This used to be commit e62cd75d37)
2007-10-10 12:59:22 -05:00
Stefan Metzmacher
ccdb6138ab r2682: as sambdb holds all search data, don't double free the data
metze
(This used to be commit 740347255b)
2007-10-10 12:59:21 -05:00
Stefan Metzmacher
965feb2cff r2681: commit the first semi working search implementation
which exports data from a ldb.

I commit this code, so that someone can help me to find a strange
bug

metze
(This used to be commit 67bb491725)
2007-10-10 12:59:21 -05:00
Andrew Tridgell
764eddb696 r2646: - use a talloc destructor to ensure that sockets from the new socket
library are closed on abnormal termination

- convert the service.h structures to the new talloc methods
(This used to be commit 2dc334a328)
2007-10-10 12:59:16 -05:00
Andrew Tridgell
223e78990a r2628: got rid of some warnings and converted a few more places to use hierarchical memory allocation
(This used to be commit 26da45a801)
2007-10-10 12:59:14 -05:00
Stefan Metzmacher
9a7c87bb64 r2527: - add a dummy for a simple ldb backend
- handle the complete rootDSE search (maybe this will be also a partition module)

metze
(This used to be commit 6fc904a71c)
2007-10-10 12:59:02 -05:00
Stefan Metzmacher
0c7a18525c r2526: use LDAP error 53 (unwillingToPerform)
when the backend didn't implement the call

metze
(This used to be commit e2fe685849)
2007-10-10 12:59:02 -05:00
Stefan Metzmacher
1efef4a19f r2525: fix a search response when the backend didn't support Search
we return LDAP error 32 (noSuchObject) now instead of a protocol error

metze
(This used to be commit f9dc34cd0b)
2007-10-10 12:59:02 -05:00
Stefan Metzmacher
6ad5996ef5 r2523: - readd rootDSE reply
- add infrastructure start for having multiple directory partitions (backends)

metze
(This used to be commit 5103e7fe78)
2007-10-10 12:59:02 -05:00
Stefan Metzmacher
b6d3ba9672 r2509: add a struct ldapsrv_call which is simular to the dcesrv_call_state struct
and related stuff...

metze
(This used to be commit dc1f8212ff)
2007-10-10 12:59:00 -05:00
Stefan Metzmacher
7d06a06584 r2447: let the server code use the new lib/socket/ stuff
metze
(This used to be commit 2fd577d241)
2007-10-10 12:58:54 -05:00
Stefan Metzmacher
9041c3560f r2401: make our LDAP server useable:
- we need to mark the fd event as writable otherwise we'll never senda packet to the client
- a search response have to ended by a LDAP result message
- return currentTime, supportedLDAPVersion and dnsHostName for testing

ldap -x -s base -h ldap://localhost/ is now works against our LDAP server

metze
(This used to be commit 3a9ca35116)
2007-10-10 12:58:48 -05:00
Stefan Metzmacher
a560d554bd r2321: add complately untested LDAP server start
based on volker's patch

this is compiled by default but not started by default

metze
(This used to be commit 5387bc423d)
2007-10-10 12:58:43 -05:00