1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-04 00:23:49 +03:00
Commit Graph

170 Commits

Author SHA1 Message Date
Andrew Bartlett
da66b53e6a r18021: Add ldapi support to our LDAP client. To be used for testing an
OpenLDAP backend.

Andrew Bartlett
2007-10-10 14:17:03 -05:00
Jelmer Vernooij
f7afa1cb77 r17930: Merge noinclude branch:
* Move dlinklist.h, smb.h to subsystem-specific directories
 * Clean up ads.h and move what is left of it to dsdb/
   (only place where it's used)
2007-10-10 14:16:54 -05:00
Stefan Metzmacher
96259f0f24 r17430: implement the LDAP_SERVER_PERMISSIVE_MODIFY control in the client
metze
2007-10-10 14:15:24 -05:00
Stefan Metzmacher
40dc7c1787 r17429: implement the LDAP_SERVER_SHOW_DELETED control in the client
metze
2007-10-10 14:15:24 -05:00
Stefan Metzmacher
84e74a759c r17420: add client support for the LDAP_SERVER_DOMAIN_SCOPE control
metze
2007-10-10 14:15:24 -05:00
Stefan Metzmacher
4ccd0f8171 r17419: add client support for the LDAP_SERVER_SEARCH_OPTIONS support.
with this you can limit a search to a specific partitions
or a search over all partitions without getting referrals.
(Witch is the default behavior on the Global Catalog Port)

metze
2007-10-10 14:15:24 -05:00
Stefan Metzmacher
23759a1e9b r17418: add client support for the LDAP_SERVER_SD_FLAGS control
metze
2007-10-10 14:15:23 -05:00
Stefan Metzmacher
f2196bf9b6 r17230: don't overwrite the error with NT_STATUS_NO_MEMORY
metze
2007-10-10 14:10:22 -05:00
Andrew Bartlett
003e2ab93c r17222: Change the function prototypes for the GENSEc and TLS socket creation
routines to return an NTSTATUS.  This should help track down errors.

Use a bit of talloc_steal and talloc_unlink to get the real socket to
be a child of the GENSEC or TLS socket.

Always return a new socket, even for the 'pass-though' case.

Andrew Bartlett
2007-10-10 14:10:20 -05:00
Andrew Bartlett
5d7c9c12cb r17197: This patch moves the encryption of bulk data on SASL negotiated security
contexts from the application layer into the socket layer.

This improves a number of correctness aspects, as we now allow LDAP
packets to cross multiple SASL packets.  It should also make it much
easier to write async LDAP tests from windows clients, as they use SASL
by default.  It is also vital to allowing OpenLDAP clients to use GSSAPI
against Samba4, as it negotiates a rather small SASL buffer size.

This patch mirrors the earlier work done to move TLS into the socket
layer.

Unusual in this pstch is the extra read callback argument I take.  As
SASL is a layer on top of a socket, it is entirely possible for the
SASL layer to drain a socket dry, but for the caller not to have read
all the decrypted data.  This would leave the system without an event
to restart the read (as the socket is dry).

As such, I re-invoke the read handler from a timed callback, which
should trigger on the next running of the event loop.  I believe that
the TLS code does require a similar callback.

In trying to understand why this is required, imagine a SASL-encrypted
LDAP packet in the following formation:

+-----------------+---------------------+
| SASL  Packet #1 | SASL Packet #2      |
----------------------------------------+
| LDAP Packet #1       | LDAP Packet #2 |
----------------------------------------+

In the old code, this was illegal, but it is perfectly standard
SASL-encrypted LDAP.  Without the callback, we would read and process
the first LDAP packet, and the SASL code would have read the second SASL
packet (to decrypt enough data for the LDAP packet), and no data would
remain on the socket.

Without data on the socket, read events stop.  That is why I add timed
events, until the SASL buffer is drained.

Another approach would be to add a hack to the event system, to have it
pretend there remained data to read off the network (but that is ugly).

In improving the code, to handle more real-world cases, I've been able
to remove almost all the special-cases in the testnonblock code.  The
only special case is that we must use a deterministic partial packet
when calling send, rather than a random length.  (1 + n/2).  This is
needed because of the way the SASL and TLS code works, and the 'resend
on failure' requirements.

Andrew Bartlett
2007-10-10 14:10:18 -05:00
Andrew Bartlett
36aa839080 r16073: On an incoming wildcard search, it is critical that the size be
correct, or we try and do a memcmp on the trailing '\0'.

This happens because we now use memcmp for the prefix matching.

I just wish I had a test other than a particular invocation of the OSX
client.  (I've tried and failed so far)

Andrew Bartlett
2007-10-10 14:08:57 -05:00
Andrew Tridgell
61c6100617 r15854: more talloc_set_destructor() typesafe fixes 2007-10-10 14:08:32 -05:00
Jelmer Vernooij
aa6d66fda6 r15573: Fix build of systems that have iconv headers in non-standard locations
Split of system/locale.h header from system/iconv.h

Previously, iconv wasn't being used on these systems
2007-10-10 14:05:58 -05:00
Andrew Bartlett
09b2f30dfa r15400: Move the TLS code behind the socket interface.
This reduces caller complexity, because the TLS code is now called
just like any other socket.  (A new socket context is returned by the
tls_init_server and tls_init_client routines).

When TLS is not available, the original socket is returned.

Andrew Bartlett
2007-10-10 14:05:32 -05:00
Jelmer Vernooij
f919fd6655 r15384: Improve naming of socket library, disable Requires(.private)? fields in pkg-config files for now as
they break external projects.
2007-10-10 14:05:30 -05:00
Jelmer Vernooij
c95ad11307 r15373: Rename SOCKET to LIBSAMBA-SOCKET to prevent name clashes with -lsocket on SUN
boxes.
2007-10-10 14:05:28 -05:00
Jelmer Vernooij
0d99397007 r15365: Fix error in my previous commit, caught by metze. 2007-10-10 14:05:27 -05:00
Jelmer Vernooij
12ba42de58 r15358: Fix some compiler warnings / type safety. Found by tcc 2007-10-10 14:05:25 -05:00
Jelmer Vernooij
f0afe9e2ff r15313: Fix some dependencies in dso mode 2007-10-10 14:05:09 -05:00
Jelmer Vernooij
5b3ab728ed r15297: Move create_security_token() to samdb as it requires SAMDB (and the rest of LIBSECURITY doesn't)
Make the ldb password_hash module only depend on some keys manipulation code, not full heimdal
Some other dependency fixes
2007-10-10 14:05:04 -05:00
Simo Sorce
d448389be8 r15288: fix some problems 2007-10-10 14:05:02 -05:00
Simo Sorce
6fff8f871a r15241: Add helper function to set reconnect status defaults 2007-10-10 14:04:23 -05:00
Simo Sorce
e2102999e2 r15238: Add some code to automatically reconnect if we want to. 2007-10-10 14:04:23 -05:00
Jelmer Vernooij
adc8a019b6 r15207: Introduce PRIVATE_DEPENDENCIES and PUBLIC_DEPENDENCIES as replacement
for REQUIRED_SUBSYSTEMS.
2007-10-10 14:04:18 -05:00
Simo Sorce
3be3b1130c r15181: Don't try kerberos sign/seal when in SSL 2007-10-10 14:04:13 -05:00
Jelmer Vernooij
7146c1600f r14724: Rearrange some source files, install more headers. 2007-10-10 13:59:14 -05:00
Jelmer Vernooij
51b4270513 r14542: Remove librpc, libndr and libnbt from includes.h 2007-10-10 13:58:42 -05:00
Jelmer Vernooij
e1f896948f r14511: Install more headers 2007-10-10 13:57:35 -05:00
Andrew Tridgell
7d0eb678bf r14424: another empty controls case 2007-10-10 13:57:21 -05:00
Andrew Tridgell
9787fb8e91 r14423: don't die on no controls 2007-10-10 13:57:21 -05:00
Jelmer Vernooij
2c74698032 r13960: Generate makefile rules for installing/removing shared modules. 2007-10-10 13:52:32 -05:00
Simo Sorce
1e2c13b2d5 r13609: Get in the initial work on making ldb async
Currently only ldb_ildap is async, the plan
is to first make all backend support the async calls,
and then remove the sync functions from backends and
keep the only in the API.

Modules will need to be transformed along the way.

Simo
2007-10-10 13:51:59 -05:00
Stefan Metzmacher
54f0b19c55 r13508: some ASN.1 element in LDAP are optional,
make it possible to code the difference between a zero length and a NULL DATA_BLOB...

metze
2007-10-10 13:51:56 -05:00
Stefan Metzmacher
1db9501c52 r13506: zero memory as some ASN.1 elements are optional, and we should initialize
them for the internal use...

found by 'make valgrindtest'

metze
2007-10-10 13:51:56 -05:00
Simo Sorce
0e2cca9153 r13372: fixes ... still no joy 2007-10-10 13:51:51 -05:00
Simo Sorce
e1318383e9 r13361: initial implementation of the vlv control
seem still buggy, can't make w2k3 to like it yet
2007-10-10 13:51:50 -05:00
Simo Sorce
933a80397d r13354: Add tests to check that controls work properly
Fix asq module, add a second_stage_init to register with rootdse
Fix asq control ldap parsing routines (this was nasty to find out)
2007-10-10 13:51:48 -05:00
Simo Sorce
bf20a848fd r13352: Integrate Patch to support the ManageDSAIT control
from Pete Rowley <prowley@redhat.com>
2007-10-10 13:51:48 -05:00
Andrew Bartlett
0cbe18211a r13344: Trust SASL to have subtle distinctions between NULL and zero-length
responses...

Also trust OpenLDAP to be pedantic about it, breaking connections to AD.

In any case, we now get this 'right' (by nasty overloading hacks, but
hey), and we can now use system-supplied OpenLDAP libs and SASL/GSSAPI
to talk to Samba4.

Andrew Bartlett
2007-10-10 13:51:46 -05:00
Andrew Bartlett
3e46289775 r13342: Make the GSSAPI SASL mech actually work, by (shock horror) reading the spec.
GSSAPI differs from GSS-SPNEGO in an additional 3 packets, negotiating
a buffer size and what integrity protection/privacy should be used.

I worked off draft-ietf-sasl-gssapi-03, and this works against Win2k3.

I'm doing this in the hope that Apple clients as well as SASL-based
LDAP tools may get a bit further.

I still can't get ldapsearch to work, it fails with the ever-helpful
'Local error'.

Andrew Bartlett
2007-10-10 13:51:46 -05:00
Stefan Metzmacher
1fe6718949 r12984: add parse code and ldbsearch cmdline code for
NOTIFICATION LDAP Controls
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ldap/ldap/ldap_server_notification_oid.asp

this doesn't work yet, but it shows that we need to extend ldb to correctly
handle async requests...

metze
2007-10-10 13:51:14 -05:00
Simo Sorce
bebd403523 r12977: Some code to implement the client side of the Dirsync control
Still investigating how it works.

Simo.
2007-10-10 13:51:13 -05:00
Simo Sorce
dd386bdc6c r12925: implement client side of ASQ control 2007-10-10 13:51:07 -05:00
Simo Sorce
a7e2fe3cb3 r12917: fix decoding of ldap controls
some more work on timeouts
2007-10-10 13:51:02 -05:00
Simo Sorce
77125feaff r12733: Merge ldap/ldb controls into main tree
There's still lot of work to do but the patch is stable
enough to be pushed into the main samba4 tree.

Simo.
2007-10-10 13:49:47 -05:00
Jelmer Vernooij
c722f665c9 r12694: Move some headers to the directory of the subsystem they belong to. 2007-10-10 13:49:39 -05:00
Jelmer Vernooij
70e7449318 r12608: Remove some unused #include lines. 2007-10-10 13:49:03 -05:00
Jelmer Vernooij
ca8db1a0cd r12592: Remove some useless dependencies 2007-10-10 13:49:00 -05:00
Jelmer Vernooij
0aca5fd513 r12542: Move some more prototypes out to seperate headers 2007-10-10 13:47:55 -05:00
Jelmer Vernooij
b24f2583ed r12498: Eliminate INIT_OBJ_FILES and ADD_OBJ_FILES. We were not using
the difference between these at all, and in the future the
fact that INIT_OBJ_FILES include smb_build.h will be sufficient to
have recompiles at the right time.
2007-10-10 13:47:45 -05:00