1
0
mirror of https://github.com/samba-team/samba.git synced 2025-10-24 15:33:20 +03:00
Commit Graph

125 Commits

Author SHA1 Message Date
Andrew Bartlett
eefd46289b Fix more valgrind issues.
This passes down the timeout more consistantly, and ensures that no
matter how the modules screw up, we don't free() the memory we are
going to write into the ASN1 packet until we actually write it out.

Andrew Bartlett
2008-03-29 13:32:15 +11:00
Andrew Bartlett
9c9a4731ca Remove useless layer of indirection, where every service called
task_service_init() manually.  Now this is called from service.c for
all services.

Andrew Bartlett
2008-02-04 21:58:29 +11:00
Andrew Bartlett
0d830580e3 Rework service init functions to pass down service name. This is
needed to change prefork behaviour based on what service is being
started.

Andrew Bartlett and David Disseldorp
2008-02-04 17:48:51 +11:00
Jelmer Vernooij
44e1cfd2d0 util: Move asn1 to lib/util to trim down the number of subsystems. 2008-01-15 01:04:38 +01:00
Jelmer Vernooij
18cd08623e r26672: Janitorial: Remove uses of global_loadparm. 2008-01-05 13:06:03 -06:00
Jelmer Vernooij
50c46160d9 r26669: Janitorial: Remove uses of global_loadparm. 2008-01-05 09:42:02 -06:00
Andrew Bartlett
592c10ae11 r26648: Move detection of global catalog captability to a central function, so
this can be shared with the CLDAP server (for the netlogon reply).

Andrew Bartlett
2008-01-03 12:33:35 -06:00
Jelmer Vernooij
1b947fe0e6 r26430: require explicit specification of loadparm context. 2007-12-21 05:49:58 +01:00
Jelmer Vernooij
a35e51871b r26402: Require a talloc context in libnetif. 2007-12-21 05:49:33 +01:00
Jelmer Vernooij
9f975417cc r26401: Don't cache interfaces context in libnetif. 2007-12-21 05:49:32 +01:00
Jelmer Vernooij
e452cb2859 r26325: Remove use of global_loadparm in netif. 2007-12-21 05:48:37 +01:00
Jelmer Vernooij
6fd0d9d3b7 r26313: Fix more uses of static loadparm. 2007-12-21 05:48:25 +01:00
Jelmer Vernooij
99113075c4 r26266: Remove more global_loadparm uses. 2007-12-21 05:47:42 +01:00
Jelmer Vernooij
7280c1e941 r26252: Specify loadparm_context explicitly when creating sessions. 2007-12-21 05:47:29 +01:00
Jelmer Vernooij
2c6b755309 r26250: Avoid global_loadparm in a couple more places. 2007-12-21 05:47:28 +01:00
Jelmer Vernooij
a33a553054 r26238: Add a loadparm context parameter to torture_context, remove more uses of global_loadparm. 2007-12-21 05:47:20 +01:00
Jelmer Vernooij
1386c5c925 r26237: Add loadparm context to the server service interface. 2007-12-21 05:47:15 +01:00
Jelmer Vernooij
ba75f1613a r26228: Store loadparm context in auth context, move more loadparm_contexts up the call stack. 2007-12-21 05:47:05 +01:00
Jelmer Vernooij
0721a07aad r26227: Make loadparm_context part of a server task, move loadparm_contexts further up the call stack. 2007-12-21 05:47:04 +01:00
Andrew Bartlett
54f4c8ba61 r25921: Now also listen on ldapi by default in the LDAP server
Create a phpLDAPadmin configuration file example to use ldapi to talk
to Samba4

Andrew Bartlett
2007-12-21 05:45:03 +01:00
Jelmer Vernooij
190d73b44b r25548: Convert to standard bool type. 2007-10-10 15:07:53 -05:00
Jelmer Vernooij
3fcc960839 r25398: Parse loadparm context to all lp_*() functions. 2007-10-10 15:07:25 -05:00
Andrew Bartlett
4cc4ed7719 r25299: Modify the provision script to take an additional argument: --server-role
This must be set to either 'domain controller', 'domain member' or 'standalone'.

The default for the provision now changes to 'standalone'.

This is not because Samba4 is particularlly useful in that mode, but
because we still want a positive sign from the administrator that we
should advertise as a DC.

We now do more to ensure the 'standalone' and 'member server'
provision output is reasonable, and try not to set odd things into the
database that only belong for the DC.

Andrew Bartlett
2007-10-10 15:07:09 -05:00
Jelmer Vernooij
abe8349f9b r25026: Move param/param.h out of includes.h 2007-10-10 15:05:38 -05:00
Jelmer Vernooij
0bcb21ed74 r25001: Fix more C++ and other warnings, fix some of the indentation with ts=4 lines that I accidently added earlier. 2007-10-10 15:05:28 -05:00
Jelmer Vernooij
31993cf67b r24780: More work allowing libutil to be used by external users. 2007-10-10 15:03:10 -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
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
Stefan Metzmacher
202645e196 r20322: I assume the options attribute of the nTDSDSA object contains
mutiple flags not just 1 for being a global catalog

metze
2007-10-10 14:29:40 -05:00
Andrew Bartlett
67d8365e83 r20149: Remove the smb.conf distinction between PDC and BDC. Now the correct
way to setup a Samba4 DC is to set 'server role = domain controller'.

We use the fSMORoleOwner attribute in the base DN to determine the PDC.

This patch is quite large, as I have corrected a number of places that
assumed taht we are always the PDC, or that used the smb.conf
lp_server_role() to determine that.

Also included is a warning fix in the SAMR code, where the IDL has
seperated a couple of types for group display enumeration.

We also now use the ldb database to determine if we should run the
global catalog service.

In the near future, I will complete the DRSUAPI
DsGetDomainControllerInfo server-side on the same basis.

Andrew Bartlett
2007-10-10 14:29:15 -05:00
Simo Sorce
a580c871d3 r19831: Big ldb_dn optimization and interfaces enhancement patch
This patch changes a lot of the code in ldb_dn.c, and also
removes and add a number of manipulation functions around.

The aim is to avoid validating a dn if not necessary as the
validation code is necessarily slow. This is mainly to speed up
internal operations where input is not user generated and so we
can assume the DNs need no validation. The code is designed to
keep the data as a string if possible.

The code is not yet 100% perfect, but pass all the tests so far.
A memleak is certainly present, I'll work on that next.

Simo.
2007-10-10 14:28:22 -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
Simo Sorce
3ce1796eb4 r18909: use newer functions that were introduced after this code was made 2007-10-10 14:20:20 -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
Andrew Tridgell
45c0580e5d r17644: change the ldap server to always use the single process model. We are
not aiming to produce a high performance parallel ldap server, so
better to reserve the extra CPUs on a SMP box for file serving.
2007-10-10 14:16:18 -05:00
Stefan Metzmacher
f20e251bfd r17586: merge lib/netif into lib/socket and use -lnsl -lsocket on the
configure check for the interfaces.

should fix the build on some old sun boxes

metze
2007-10-10 14:15:39 -05:00
Simo Sorce
ad75cf8695 r17516: Change helper function names to make more clear what they are meant to do 2007-10-10 14:15:31 -05:00
Stefan Metzmacher
10cb9c07ac r17237: - keep pointer to the different sockets
- we need this to later:
  - to disallow a StartTLS when TLS is already in use
  - to place the TLS socket between the raw and sasl socket
    when we had a sasl bind before the StartTLS
  - and rfc4513 says that the server may allow to remove the TLS from
    the tcp connection again and reuse raw tcp
  - and also a 2nd sasl bind should replace the old sasl socket

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
a1161cb30e r16972: Replace the sequence_number function pointer in ldb with the ldb flags.
The function pointer was meant to be unused, this patch fixes
partition.c to use ldb_sequence_number().  (No backend provided the
pointer any more).

Set the flags onto the ldb structure, so that all backends opened by
the partitions module inherit the flags.

Set the read-ony flag when accessed as the global catalog

Modify the LDAP server to track that this query is for the global
catalog (by incoming port), and set a opqaue pointer.

Next step is to read that opaque pointer in the partitions module.

Andrew Bartlett
2007-10-10 14:10:04 -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
Andrew Bartlett
9bbc93bef2 r15317: Because LDB is now async, there are more places were we might run the
even context again.  We need to ensure we don't process packets until
we are finished setting up the connection, have the ldb in place etc.

We may need to do the same in other servers.

Andrew Bartlett
2007-10-10 14:05:11 -05:00
Andrew Bartlett
a6c7979860 r14673: Don't double-free conn, it is below 'c' free'ed by
stream_terminate_connection()

Andrew Bartlett
2007-10-10 13:59:07 -05:00
Stefan Metzmacher
526f20bbec r14079: I just found the setproctitle library from alt linux:-)
- add set_title hook to the process models
- use setproctitle library in process_model standard if available
- the the title for the task servers and on connections

metze
2007-10-10 13:56:49 -05:00
Stefan Metzmacher
a465126e15 r14078: move ldb_global_init() to the main smbd code,
to fix the process_model standard

metze
2007-10-10 13:56:49 -05:00
Stefan Metzmacher
d9da948b0f r13941: fix the build
metze
2007-10-10 13:52:29 -05:00
Jelmer Vernooij
930daa9f41 r13926: More header splitups. 2007-10-10 13:52:26 -05:00