1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-28 17:47:29 +03:00

835 Commits

Author SHA1 Message Date
Andrew Bartlett
2f6d723e1f r18249: Keep trying to start an GENSEC mech from the list until one actually
starts.

Andrew Bartlett
(This used to be commit 7dba525f5598199e89badbf15e0f5f09023c6cfa)
2007-10-10 14:17:55 -05:00
Andrew Bartlett
a22780bd4c r18242: The cyrus-sasl encode/decode routines process the entire input.
Andrew Bartlett
(This used to be commit 32d8a23d5499ef3d913240b5693b54eb2e78cd7d)
2007-10-10 14:17:54 -05:00
Stefan Metzmacher
a46e12d0e0 r18213: don't list LIBREPLACE depdendecies explicit and
always at it as first private dependencies

metze
(This used to be commit 135d096776b53ae09ffc2b4f767dfbd18139570f)
2007-10-10 14:17:50 -05:00
Andrew Bartlett
9ca2814c3f r18198: Fix callbacks to use allocated or constant memory, not the stack.
These values are used by SASL at a later time, and must remain valid.

Make the password callback actually return the password.

Andrew Bartlett
(This used to be commit 8e12f92bbe3aa878292169f4699502e241ef6c0b)
2007-10-10 14:17:48 -05:00
Stefan Metzmacher
33d6ffe16a r18164: enable the SASL library if found
metze
(This used to be commit 675541f24e4681161fcc85422c14f9ecbf30e048)
2007-10-10 14:17:45 -05:00
Andrew Bartlett
3549adc7ce r18155: Add my work in progress, a module to link with Cyrus-SASL, for a
DIGEST-MD5 implemenation in particular.

However, I can't make this work:  Cyrus-SASL isn't loading the mech...

Andrew Bartlett
(This used to be commit 0b193d28c896c9d212a536da7d87634543d971a5)
2007-10-10 14:17:43 -05:00
Andrew Tridgell
014f70008f r18130: the move to system/ in libreplace broke some things ... should be
happier now
(This used to be commit 18542f184f75074e56a9793a9e3b6c6d747bb9e6)
2007-10-10 14:17:37 -05:00
Andrew Bartlett
c3b54cf75b r18068: This splits the handling of multiple SASL packets between the GENSEC
backend (if it chooses to implement it), or the GENSEC socket code.

This is to allow us to handle DIGEST-MD5 across to cyrus-sasl.

Andrew Bartlett
(This used to be commit 0a098006b431f4aa48632a27ca08e9adca8d9609)
2007-10-10 14:17:11 -05:00
Jelmer Vernooij
0329d755a7 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)
(This used to be commit f7afa1cb77f3cfa7020b57de12e6003db7cfcc42)
2007-10-10 14:16:54 -05:00
Andrew Bartlett
9356831484 r17871: Add an option to make the system account behave as anonymous on the
network.  This helps where we are trying to talk to an LDAP server,
until we share a common SASL authentication scheme.

Andrew Bartlett
(This used to be commit f9d39dba41441cd5d06964ce0aebef9bcba40759)
2007-10-10 14:16:50 -05:00
Andrew Tridgell
b21b119cbc r17824: add a wrapper for the common partitions_basedn calculation
(This used to be commit 09007b0907662a0d147e8eb21d5bdfc90dbffefc)
2007-10-10 14:16:45 -05:00
Andrew Tridgell
0fd9807942 r17823: get rid of most of the samdb_base_dn() calls, as they are no longer
needed in searches
(This used to be commit a5ea749f0ac63bf495a55ee8d9d002208ab93572)
2007-10-10 14:16:45 -05:00
Stefan Metzmacher
845e288ea4 r17774: this macro is unused
metze
(This used to be commit 2f4aa95f8d414262eb4d78060ee3a97a85ec5182)
2007-10-10 14:16:40 -05:00
Simo Sorce
a23b63a8e5 r17516: Change helper function names to make more clear what they are meant to do
(This used to be commit ad75cf869550af66119d0293503024d41d834e02)
2007-10-10 14:15:31 -05:00
Stefan Metzmacher
358b1b2ea6 r17381: - we don't need debug messages twice
- also user_info->mapped is maybe uninitialized
  in auth_password_check() as it we do the mapping in
  auth_password_check_send()

that to Kai Blin <kai.blin@gmail.com> and valgrind to find
this bug

metze
(This used to be commit d88aabef64316cebca46037b67dd2df7cfd4d482)
2007-10-10 14:15:20 -05:00
Stefan Metzmacher
bdbc9b3908 r17344: move the gensec_update_request structure into the header file
and add a private_data for the backends.

metze
(This used to be commit 015a65e00187e684b3e4d1f4ca07edb9f022f61b)
2007-10-10 14:15:17 -05:00
Stefan Metzmacher
d6301c8472 r17343: let auth_winbind use IRPC against the winbind task.
(currently this uses the sync IRPC_CALL(), but when
auth_check_password will be async for the backend this will
change to IRPC_CALL_SEND()

the old module which uses the samba3 protocol against winbind
is still available as 'winbind_samba3'

metze
(This used to be commit 26efc732ab668bcb55fd0796818aabe45add2b25)
2007-10-10 14:15:17 -05:00
Stefan Metzmacher
7a845bcb01 r17341: pass a messaging context to auth_context_create()
and gensec_server_start().

calling them with NULL for event context or messaging context
is no longer allowed!

metze
(This used to be commit 679ac74e71b111344f1097ab389c0b83a9247710)
2007-10-10 14:15:17 -05:00
Andrew Bartlett
582cf8c1c0 r17332: May as well make this a round number
(This used to be commit a2d614147663c4f9b80d6e383819e92ca45e013b)
2007-10-10 14:15:16 -05:00
Stefan Metzmacher
4fe4093643 r17285: some reformating
metze
(This used to be commit c865aea260dd22b8b5d63e60fd917a52ed719993)
2007-10-10 14:15:06 -05:00
Stefan Metzmacher
622d1db80a r17284: move the input checking stuff from ntlmssp_update() into its
own function.

metze
(This used to be commit ee81ad57938a9f54533a0028b87fd84bde90db8d)
2007-10-10 14:15:06 -05:00
Stefan Metzmacher
96f60a37f6 r17273: add an async version of auth_check_password() on the public
auth interface and implement the sync version as wrapper
to auth_check_password_send/recv()

as next all callers need to be converted to the async interface
and then the modules

metze
(This used to be commit ed40bb3c16279f9727be67e889270da5efb8ddb9)
2007-10-10 14:10:26 -05:00
Stefan Metzmacher
de4c2bbc6c r17272: move the callback stuff into a substructure
metze
(This used to be commit c49e27d5d0289e3525f7f6197b031e7d300df81b)
2007-10-10 14:10:26 -05:00
Stefan Metzmacher
e8623667d3 r17270: split the logic of saying this auth backend wants to handle this
request from the password checking. This will help to make
the password checking hook async later

metze
(This used to be commit 5b26cbc3428b4c186235cc08c9ace1c23f59dd7f)
2007-10-10 14:10:25 -05:00
Stefan Metzmacher
64d6abac74 r17267: - add an async interface for gensec_update() to the public gensec api
- note this is still uses the sync update() hook of the gensec modules
  but it allows me to fix the callers first

Later auth_check_password() will also get an async version,
so that we can later implement an async version of auth_winbind
using async IRPC to the winbind task.

metze
(This used to be commit d5638a4fafd1d60ccc4cd76e92a1b2b0093865a7)
2007-10-10 14:10:25 -05:00
Andrew Bartlett
1ea4f560fc r17223: In some protocols it is not possible to negoitate off some features,
without the agreement of the peer.  This can cause problems, because
one side things sealing is disabled, while the other thinks it is
enabled.

Andrew Bartlett
(This used to be commit 68ddc4921f43252b3fba73e9d85cc38c359d599d)
2007-10-10 14:10:20 -05:00
Andrew Bartlett
9d6f276717 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
(This used to be commit 003e2ab93c87267ba28cd67bd85975bad62a8ea2)
2007-10-10 14:10:20 -05:00
Andrew Bartlett
ba07fa43d0 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
(This used to be commit 5d7c9c12cb2b39673172a357092b80cd814850b0)
2007-10-10 14:10:18 -05:00
Andrew Bartlett
b718193b6b r17173: Check for oversize output, not oversize input, and fix the GSSAPI mech
to work (it broke it in the previous commit).

Andrew Bartlett
(This used to be commit e96638bc74f0752ce8af6626a04c92d48b917ffe)
2007-10-10 14:10:16 -05:00
Andrew Bartlett
048d0c64f9 r17171: Add a gensec function to determine the maximum negotiated buffer size,
and the maximum amount of user data that may be fitted into that.

This is used in the new SASL code, to correctly honour SASL buffer sizes.

Andrew Bartlett
(This used to be commit cbbe99d9c1f0262e67a495fb098cacc09fd78e05)
2007-10-10 14:10:15 -05:00
Andrew Bartlett
d5aeddf2ef r17170: Catch some more out-of-memory cases, and provide some clues when
chasing down bad signatures that may be due to data truncation.

Andrew Bartlett
(This used to be commit d304760d3d909e55cbf2c744cdb2b4137f74b81b)
2007-10-10 14:10:15 -05:00
Andrew Bartlett
51de50de29 r16961: Merge 'seperate policy from logic' changes from Samba3. The 56-bit
flag is handled just like all the others.

Also negotiate the unknown 0x02000000 flag, to match windows.

Andrew Bartlett
(This used to be commit 1d0befdb681ed9974d1bdff46ce56353552ee0e0)
2007-10-10 14:10:03 -05:00
Andrew Bartlett
3ed1e8ff3c r16829: Fix a number of issues raised by the IBM checker, or gcc warnings.
In particular, this removes one use of the LDB_DN_NULL_FAILED macro,
which was being used on more than DNs, had an embedded goto, and
confused the IBM checker.

In the password_hash code, ensure that sambaAttr is not, before
checking the number of values.

In GENSEC, note that this switch value can't occour.  This seems to be
the only way to quiet both the IBM checker and gcc, as well as cope
with possibly invalid inputs.

Andrew Bartlet
(This used to be commit 3e58350ec2ab883795b1dd03ac46a3520cac67d0)
2007-10-10 14:09:48 -05:00
Stefan Metzmacher
0646a91bc9 r16569: - use push_string()
metze
(This used to be commit f099fcb6e3a38d6df22cb3a0c7c666333e41f11b)
2007-10-10 14:09:35 -05:00
Jelmer Vernooij
4bd40183af r16516: Get rid of file_exists() as there already is a file_exist().
(This used to be commit c4b3c2b18c6df43c8a4808fab72bc45439ba9421)
2007-10-10 14:09:31 -05:00
Andrew Bartlett
1fde679dae r16238: Use a baseDN for the auth_sam searches, to allow continued function
with partitions.

Also fix some debug messages.

Andrew Bartlett
(This used to be commit a2441ae99a6c3b4bf40f5369477a9bc0f3019c34)
2007-10-10 14:09:08 -05:00
Andrew Bartlett
9482de3979 r16218: If a connection is forced as 'anonymous', don't treat it as
'authentication requested'...

Andrew Bartlett
(This used to be commit d5fc88c93697dbcab13b2356ef4e5d1d2a7d59eb)
2007-10-10 14:09:06 -05:00
Gerald Carter
e3a6c6be79 r16100: Patch from Michael Wood <mwood@icts.uct.ac.za>: s/then/than/ for correct grammar
(This used to be commit 26a2fa97e4c819e630bc9b50e11c8d5328c7b8c8)
2007-10-10 14:08:59 -05:00
Andrew Bartlett
e0bb0e9f95 r16056: Fix errors found by trying to use our kpasswd server and the Apple client.
Andrew Bartlett
(This used to be commit ae2913898c983dcba69b5d0b89c428e450e9bf5f)
2007-10-10 14:08:54 -05:00
Stefan Metzmacher
ba4f9bc008 r15988: try to fix the build on au2 IRIX 6.4
metze
(This used to be commit 9e93e6f5fb654e4162bbc039306a4b79003e22d7)
2007-10-10 14:08:46 -05:00
Jelmer Vernooij
7ef96bd3c4 r15876: Fix build on IPv6-less systems.
(This used to be commit 180925659fad50ff82693284587ae4e735458c6b)
2007-10-10 14:08:36 -05:00
Andrew Tridgell
cdc64c448d r15853: started the process of removing the warnings now that
talloc_set_destructor() is type safe. The end result will be lots less
use of void*, and less calls to talloc_get_type()
(This used to be commit 6b4c085b862c0932b80b93e316396a53b993544c)
2007-10-10 14:08:32 -05:00
Jelmer Vernooij
05b1657769 r15702: Fix typo
(This used to be commit 26442023d12760828acd8b6e2a1dedeaf4e96958)
2007-10-10 14:08:07 -05:00
Jelmer Vernooij
53f005f6aa r15572: Trim build/m4/rewrite.m4 a bit more, remove unused tests.
(This used to be commit d72c5c8f755277eb22e1f6834d98202f00c09934)
2007-10-10 14:05:58 -05:00
Andrew Bartlett
c07db9b462 r15511: Using this name causes less warnings on the IBM checker, due to using
the original, rather than equivilant, enum type.

Andrew Bartlett
(This used to be commit 3d43e458a828801a294e56a1aeb74a4d7cbf9f23)
2007-10-10 14:05:44 -05:00
Andrew Bartlett
8792ff810d r15501: Allow interactive password prompting on kerberos as well.
Andrew Bartlett
(This used to be commit 7003c3e8dee2d2bfc391875d90eb747616cb361a)
2007-10-10 14:05:42 -05:00
Andrew Bartlett
bfbc269d0d r15498: Initialise the callback_running field, and get the flag set/clear the
right way around for all the callers.

Andrew Bartlett
(This used to be commit f9bcfb04aa3ec93eed7076dbb1fed50cf1edb424)
2007-10-10 14:05:42 -05:00
Andrew Bartlett
44c36af9b6 r15485: This 'fake' GSSAPI doesn't do the extra SASL negotiation correctly, so
don't attribute the GSSAPI SASL mech to it.

Andrew Bartlett
(This used to be commit 23a4db28ed825bc8c45e5f704137a72386394f45)
2007-10-10 14:05:40 -05:00
Andrew Bartlett
5f4d86f955 r15426: Implement SPNEGO as the default RPC authentication mechanism. Where
this isn't supported, fallback to NTLM.

Also, where we get a failure as 'logon failure', try and do a '3
tries' for the password, like we already do for CIFS.  (Incomplete:
needs a mapping between RPC errors and the logon failure NTSTATUS).

Because we don't yet support Kerberos sign/seal to win2k3 SP1 for
DCE/RPC, disable this (causing SPNEGO to negotiate NTLM) when kerberos
isn't demanded.

Andrew Bartlett
(This used to be commit b3212d1fb91b26c1d326a289560106dffe1d2e80)
2007-10-10 14:05:36 -05:00
Jelmer Vernooij
086c9cc5f4 r15422: Fix issues with functions being called recursively in the credentials
callback code.
(This used to be commit edf0701e877592695bd69124e528338c27f24efd)
2007-10-10 14:05:35 -05:00