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

189 Commits

Author SHA1 Message Date
Andrew Bartlett
f6566480b7 r24248: Attempt to fix bug #4830 by <mwallnoefer@yahoo.de>. If there is no
payload to the control, we still need to inialise *value, as otherwise
we read uninitialised data later.

Andrew Bartlett
2007-10-10 15:01:30 -05:00
Andrew Bartlett
dc27a7e41c r23810: Make things static, and remove unsued code.
This includes some of the original ildap ldap client API.  ldb
provides a much easier abstraction on this to use, and doesn't use
these functions.

Andrew Bartlett
2007-10-10 14:59:21 -05:00
Andrew Tridgell
fcf38a38ac r23792: convert Samba4 to GPLv3
There are still a few tidyups of old FSF addresses to come (in both s3
and s4). More commits soon.
2007-10-10 14:59:12 -05:00
Andrew Tridgell
26cf849408 r23036: error checking on asn1_init() failure 2007-10-10 14:52:43 -05:00
Andrew Tridgell
3db49c2ec9 r23030: finally fixed up our asn1 code to use better memory allocation. This
should allow us to fix some long standing memory leaks.
2007-10-10 14:52:42 -05:00
Andrew Bartlett
7b086eebd6 r22884: Be consistant with the case of these constants.
Andrew Bartlett
2007-10-10 14:52:28 -05:00
Stefan Metzmacher
d19195bfa5 r22405: fix memory leak in error path
metze
2007-10-10 14:51:15 -05:00
Andrew Bartlett
eef710668f r21806: I've been working over the last week to fix up the LDAP backend for
Samba4.  This only broke on global catalog queries, which turned out to
be due to changes in the partitions module that metze needed for his
DRSUAPI work.

I've reworked partitions.c to always include the 'problematic' control,
and therefore demonstrated that this is the issue.  This ensures
consistency, and should help with finding issues like this in future.

As this control (DSDB_CONTROL_CURRENT_PARTITION_OID) is not intended to
be linearised, I've added logic to allow it to be skipped when creating
network packets.

I've likewise make our LDAP server skip unknown controls, when marked
'not critical' on it's input, rather than just dropping the entire
request.  I need some help to generate a correct error packet when it is
marked critical.

Further work could perhaps be to have the ldap_encode routine return a
textual description of what failed to encode, as that would have saved
me a lot of time...

Andrew Bartlett
2007-10-10 14:49:29 -05:00
Andrew Bartlett
7f115579d2 r21761: - Give more detail on LDAP client library failures (make it clear
where the error is from)

- Make default error string more consistant

Andrew Bartlett
2007-10-10 14:49:24 -05:00
Stefan Metzmacher
d40465470f r21511: this seems to be the nicer fix for the problem with
the windows 2000 LDAP client

metze
2007-10-10 14:48:47 -05:00
Stefan Metzmacher
f17da75754 r21501: ugly but the windows 2000 mmc deturns decoding error without this
metze
2007-10-10 14:48:45 -05:00
Stefan Metzmacher
b69471866c r20141: use the gensec_features of the cli_credentials for ildap connections,
instead of hardcoded GENSEC_FEATURE_SEAL.

That means plain LDAP is now the default.

metze
2007-10-10 14:29:13 -05:00
Andrew Bartlett
2b569c42e0 r19598: Ahead of a merge to current lorikeet-heimdal:
Break up auth/auth.h not to include the world.

Add credentials_krb5.h with the kerberos dependent prototypes.

Andrew Bartlett
2007-10-10 14:25:00 -05:00
Jelmer Vernooij
7a01235067 r19507: Merge my DSO fixes branch. Building Samba's libraries as shared libraries
works again now, by specifying --enable-dso to configure.
2007-10-10 14:24:41 -05:00
Andrew Bartlett
441a4f6262 r18989: Fixes found by these two LDAP testsuites:
- http://www.ee.oulu.fi/research/ouspg/protos/testing/c06/ldapv3/
- http://gleg.net/protover_ldap_sample.shtml

Also fixes found by a subsequent audit of the code for similar issues.
2007-10-10 14:20:26 -05:00
Andrew Tridgell
c440e0eed9 r18309: FreeBSD 6.1 has a symbol ldap_new_connection() in the system ldap
library. Even though we don't like to that library, it gets loaded via
nss-ldap, which means nss-ldap calls into the samba ldap lib with the
wrong parameters, and crashes.

We really need to use a completely different namespace in libcli/ldap/
2007-10-10 14:18:06 -05:00
Andrew Tridgell
f4b4bd945f r18256: use the right status variable 2007-10-10 14:17:57 -05:00
Andrew Bartlett
556a21faee r18025: Don't try to set a target host if there isn't one (such as with ldapi://).
Andrew Bartlett
2007-10-10 14:17:04 -05:00
Andrew Bartlett
1920cb8b39 r18024: The %c sscanf format I'm using doesn't null terminate.
Andrew Bartlett
2007-10-10 14:17:04 -05:00
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