1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-14 19:24:43 +03:00

125 Commits

Author SHA1 Message Date
Simo Sorce
5dd4844cc5 r8926: RFC 2891 - LDAP Control Extension for Server Side Sorting of Search Results 2007-10-10 13:30:58 -05:00
Jelmer Vernooij
fac77f5fa2 r8811: Fix the build.. 2007-10-10 13:30:07 -05:00
Andrew Tridgell
a58ea6b385 r8520: fixed a pile of warnings from the build farm gcc -Wall output on
S390. This is an attempt to avoid the panic we're seeing in the
automatic builds.

The main fixes are:

 - assumptions that sizeof(size_t) == sizeof(int), mostly in printf formats

 - use of NULL format statements to perform dn searches.

 - assumption that sizeof() returns an int
2007-10-10 13:29:34 -05:00
Simo Sorce
876f0a095b r8514: add docs 2007-10-10 13:29:33 -05:00
Andrew Tridgell
8f69867867 r8272: added the hooks for adding a name to a messaging context, so we will
be able to send a message to the "ldap_server" task without having to
know its task ID.
2007-10-10 13:19:29 -05:00
Stefan Metzmacher
0297943ff2 r8222: 0 entries are no error, unless it's a base search
metze
2007-10-10 13:19:21 -05:00
Andrew Tridgell
44ded17bc2 r7918: fixed a crash bug in the ldap server 2007-10-10 13:18:50 -05:00
Andrew Tridgell
a7447e25ac r7911: task_terminate() is defined in the macosx headers, so change the name
to task_server_terminate()
2007-10-10 13:18:48 -05:00
Andrew Tridgell
355983493b r7854: only enable wrapping in the ldap server if it was negotiated by gensec 2007-10-10 13:18:43 -05:00
Andrew Tridgell
1dbb5bf2c1 r7801: the ldap server needs this logic too 2007-10-10 13:18:37 -05:00
Andrew Tridgell
40948ba384 r7777: allow for overriding the location of the sam databasein the ldap server, using
ldapsrv:samdb option. This allows the following:

          sam database=ldap://localhost
          ldapsrv:samdb=tdb:///home/tridge/samba/samba4/prefix/private/sam.ldb

which allows us to test putting the sam on an ldap server using our
own ldap server. This is a great stress test for the ldap code.
2007-10-10 13:18:35 -05:00
Andrew Tridgell
51ea22db2d r7753: removed debugging code :-) 2007-10-10 13:18:31 -05:00
Andrew Tridgell
30da6a1cc4 r7751: only enable tls on the ldaps port in ldap server, and reject non-tls
connections on that port
2007-10-10 13:18:31 -05:00
Andrew Tridgell
f22c3b84c8 r7749: some bug fixes from testing with socket:testnonblock
- fixed some infinite loops in asn1.c

- ensure asn1 callers know if an error is end of buffer or bad data

- handle npending 0 in ldap server
2007-10-10 13:18:30 -05:00
Andrew Tridgell
73cb4aad22 r7747: - simplified the ldap server buffer handling
- got rid of the special cases for sasl buffers

- added a tls_socket_pending() call to determine how much data is waiting on a tls connection

- removed the attempt at async handling of ldap calls. The buffers/sockets are all async, but the calls themselves
  are sync.
2007-10-10 13:18:30 -05:00
Andrew Tridgell
fed6f4cc6c r7746: - added TLS support to our ldap server
- this involved changing the buffer handling in the ldap server quite a
  lot, as it didn't handle partial packets at all

- removed completely bogus asn1_object_length() function. You can't
  do that with BER/DER
2007-10-10 13:18:30 -05:00
Andrew Tridgell
8698a20fcc r7726: - removed some unused variables
- handle ldb_errstring() calls on failed connect
2007-10-10 13:18:27 -05:00
Andrew Tridgell
09060994c1 r7720: - simplify the asn1 decode of ldap_search() a lot, taking advantage of
the fact that the ldap data structures now use ldb_message_element.

- fixed null termination of elements in ildap
2007-10-10 13:18:26 -05:00
Andrew Tridgell
f852661463 r7711: update callers of ldb_connect() for new syntax 2007-10-10 13:18:24 -05:00
Andrew Tridgell
f6abed5660 r7677: fixed ldap server to honor 'private path' 2007-10-10 13:18:21 -05:00
Andrew Tridgell
0981a375cf r7670: fixed rootDSE search in ldap server 2007-10-10 13:18:20 -05:00
Andrew Tridgell
3a3025485b r7633: this patch started as an attempt to make the dcerpc code use a given
event_context for the socket_connect() call, so that when things that
use dcerpc are running alongside anything else it doesn't block the
whole process during a connect.

Then of course I needed to change any code that created a dcerpc
connection (such as the auth code) to also take an event context, and
anything that called that and so on .... thus the size of the patch.

There were 3 places where I punted:

  - abartlet wanted me to add a gensec_set_event_context() call
    instead of adding it to the gensec init calls. Andrew, my
    apologies for not doing this. I didn't do it as adding a new
    parameter allowed me to catch all the callers with the
    compiler. Now that its done, we could go back and use
    gensec_set_event_context()

  - the ejs code calls auth initialisation, which means it should pass
    in the event context from the web server. I punted on that. Needs fixing.

  - I used a NULL event context in dcom_get_pipe(). This is equivalent
    to what we did already, but should be fixed to use a callers event
    context. Jelmer, can you think of a clean way to do that?

I also cleaned up a couple of things:

 - libnet_context_destroy() makes no sense. I removed it.

 - removed some unused vars in various places
2007-10-10 13:18:15 -05:00
Andrew Tridgell
87fc307339 r7596: next step in ldap cleanup. I'm aiming to get rid of the cut&pasted
ldif parsing code in libcli/ldap/ldap_ldif.c, and instead use the ldb
ldif code. To do that I have changed the ldap code to use 'struct
ldb_message_element' instead of 'struct ldap_attribute'. They are
essentially the same structure anyway, so by making them really the
same it will be much easier to use the ldb code in libcli/ldap/

I have also made 'struct ldb_val' the same as a DATA_BLOB, which will
simplify data handling in quite a few places (I haven't yet removed
all the code that maps between these two, that will come later)
2007-10-10 13:18:12 -05:00
Andrew Tridgell
6123eb2eca r7594: abartlet is right that this hack is not actually necessary, it just
prevents a bogus:
  GSS Update failed: Miscellaneous failure (see text): ASN.1 identifier doesn't match expected value
error on every ldap connection. I'll remove it and let the error remain until Andrew
works out a better fix.
2007-10-10 13:18:12 -05:00
Andrew Tridgell
912d0427f5 r7593: simplified the memory management in the ldap code. Having a mem_ctx
element in a structure is not necessary any more.
2007-10-10 13:18:12 -05:00
Andrew Tridgell
69b02e8adb r7568: enable the NTLMSSP bulk data sign/seal code for out ldap server. This
now works with windows clients, as I fixed the zero length bind ack packet.

Andrew, note that this has the strncmp("NTLMSSP", data, 7) hack. Please
replace with a more correct fix as we discussed.
2007-10-10 13:18:10 -05:00
Andrew Tridgell
9b7a89735f r7565: fixed handling of sasl data in ldap server 2007-10-10 13:18:09 -05:00
Andrew Tridgell
96620ab2ee r7527: - added a ldb_search_bytree() interface, which takes a ldb_parse_tree
instead of a search expression. This allows our ldap server to pass
  its ASN.1 parsed search expressions straight to ldb, instead of going
  via strings.

- updated all the ldb modules code to handle the new interface

- got rid of the separate ldb_parse.h now that the ldb_parse
  structures are exposed externally

- moved to C99 structure initialisation in ldb

- switched ldap server to using ldb_search_bytree()
2007-10-10 13:18:06 -05:00
Simo Sorce
d58be9e74b r5585: LDB interfaces change:
changes:
- ldb_wrap disappears from code and become a private structure of db_wrap.c
  thanks to our move to talloc in ldb code, we do not need to expose it anymore

- removal of ldb_close() function form the code
  thanks to our move to talloc in ldb code, we do not need it anymore
  use talloc_free() to close and free an ldb database

- some minor updates to ldb modules code to cope with the change and fix some
  bugs I found out during the process
2007-10-10 13:10:55 -05:00
Simo Sorce
d7751e3181 r5583: some more docs 2007-10-10 13:10:54 -05:00
Andrew Tridgell
826baec7b3 r5307: removed db_wrap.h from includes.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
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
Günther Deschner
77b99c03b8 r5266: This is a nice typo ;-)
Guenther
2007-10-10 13:09:35 -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
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 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
Stefan Metzmacher
c583f80623 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
2007-10-10 13:09:08 -05:00
Andrew Bartlett
eb46adade4 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
2007-10-10 13:09:04 -05:00
Stefan Metzmacher
d5fa02746c 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
2007-10-10 13:08:49 -05:00
Stefan Metzmacher
d72760d26f 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
2007-10-10 13:08:47 -05:00
Stefan Metzmacher
7aa86445e3 r4709: fix compiler warnings
metze
2007-10-10 13:08:46 -05:00
Stefan Metzmacher
872c687184 r4634: disable sign and seal in ldap_server for now.
metze
2007-10-10 13:08:37 -05:00
Stefan Metzmacher
dd217f7916 r4629: we now have a global macro NT_STATUS_HAVE_NO_MEMORY()
so don't use a local one

metze
2007-10-10 13:08:36 -05:00
Stefan Metzmacher
590afa88f1 r4628: this function should be static
metze
2007-10-10 13:08:35 -05:00
Andrew Tridgell
89b74b5354 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)
2007-10-10 13:08:25 -05:00
Andrew Tridgell
e6c81d7c9f 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.
2007-10-10 13:08:20 -05:00