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

270 Commits

Author SHA1 Message Date
Andrew Bartlett
e578c33c2c r7757: Add NTLMv2 support to the NT1 Session setup (ie, not SPNEGO/NTLMSSP)
Session Setup code.

Add a mem_ctx argument to a few of the NTLMv2 support functions, and
add smb.conf options to control client NTLMv2 behaviour.

Andrew Bartlett
(This used to be commit 3f35cdb218a3dae08a05e77452ca9f73716ceb28)
2007-10-10 13:18:32 -05:00
Stefan Metzmacher
d52ce8ff0c r7731: change debug level to not spam the build-farm smbd log
metze
(This used to be commit 3a1ed83fd0714fa46055c8fe5b039986909f9a45)
2007-10-10 13:18:27 -05:00
Tim Potter
cd8cb33d3a r6851: Typo in comment.
(This used to be commit e1864a7ac91b6bdd49c0cee26b592dc6d963e35d)
2007-10-10 13:16:51 -05:00
Andrew Bartlett
874cd2db86 r6460: Push the client credentials into NTLMSSP, allowing logins of the form
user@REALM for the first time.

Fix the build for smbencrypt.c

Andrew Bartlett
(This used to be commit 5a6a57cd93e22e612bfbb8a8f7bc29269a9a3ac6)
2007-10-10 13:11:39 -05:00
Andrew Bartlett
7cabdeb7ec r6113: Move GENSEC and the kerberos code out of libcli/auth, and into
auth/gensec and auth/kerberos.

This also pulls the kerberos configure code out of libads (which is
otherwise dead), and into auth/kerberos/kerberos.m4

Andrew Bartlett
(This used to be commit e074d63f3dcf4f84239a10879112ebaf1cfa6c4f)
2007-10-10 13:11:20 -05:00
Andrew Bartlett
e6aeeb5269 r6094: Work on the Kerberos code recently merged from Samba 3.0. This fixes
up issues I introduced during the merge, that caused a segfault.

I've still not got the keytab code to work for me (using Samba3 to
generate the keytab) so this is still not fully tested, but it's
better than it was.

To add debugging, I now use the krb5_get_error_message() function from
Heimdal when present, to return the custom error string, which
contains far, far more information than the simple error code does.

(This last point may well be worth merging back into 3.0)

Andrew Bartlett
(This used to be commit ed5755d9d1e48df7ae77a9410d30e10cb8b0cbd7)
2007-10-10 13:11:18 -05:00
Andrew Bartlett
73b77ee151 r6030: Missing from previous commit, a small header file to link
libcli/auth/schannel.c and libcli/auth/schannel_sign.c

Andrew Bartlett
(This used to be commit 1e0e66d7202d3f0e7fb3c90f2ca608fa08a713a6)
2007-10-10 13:11:15 -05:00
Andrew Bartlett
2eb3d68062 r6028: A MAJOR update to intergrate the new credentails system fully with
GENSEC, and to pull SCHANNEL into GENSEC, by making it less 'special'.

GENSEC now no longer has it's own handling of 'set username' etc,
instead it uses cli_credentials calls.

In order to link the credentails code right though Samba, a lot of
interfaces have changed to remove 'username, domain, password'
arguments, and these have been replaced with a single 'struct
cli_credentials'.

In the session setup code, a new parameter 'workgroup' contains the
client/server current workgroup, which seems unrelated to the
authentication exchange (it was being filled in from the auth info).

This allows in particular kerberos to only call back for passwords
when it actually needs to perform the kinit.

The kerberos code has been modified not to use the SPNEGO provided
'principal name' (in the mechListMIC), but to instead use the name the
host was connected to as.  This better matches Microsoft behaviour,
is more secure and allows better use of standard kerberos functions.

To achieve this, I made changes to our socket code so that the
hostname (before name resolution) is now recorded on the socket.

In schannel, most of the code from librpc/rpc/dcerpc_schannel.c is now
in libcli/auth/schannel.c, and it looks much more like a standard
GENSEC module.  The actual sign/seal code moved to
libcli/auth/schannel_sign.c in a previous commit.

The schannel credentails structure is now merged with the rest of the
credentails, as many of the values (username, workstation, domain)
where already present there.  This makes handling this in a generic
manner much easier, as there is no longer a custom entry-point.

The auth_domain module continues to be developed, but is now just as
functional as auth_winbind.  The changes here are consequential to the
schannel changes.

The only removed function at this point is the RPC-LOGIN test
(simulating the load of a WinXP login), which needs much more work to
clean it up (it contains copies of too much code from all over the
torture suite, and I havn't been able to penetrate its 'structure').

Andrew Bartlett
(This used to be commit 2301a4b38a21aa60917973451687063d83d18d66)
2007-10-10 13:11:15 -05:00
Andrew Bartlett
46b22b073c r6027: Add copyright, and add a useful debug message.
Andrew Bartlett
(This used to be commit b5260cf0d4c4f2e81a310d1c94160c9fbaaa331f)
2007-10-10 13:11:15 -05:00
Andrew Bartlett
f82bafa067 r6026: Update the kerberos keytab code to match Samba3 again.
(untested at this point).

Andrew Bartlett
(This used to be commit ef7f9a01b4f3fa41fd7981b260fa2fadc7ce10ad)
2007-10-10 13:11:15 -05:00
Andrew Bartlett
f312d91d60 r6025: Remove unused variables. This code will be modified again for the new
cli_credentials code shortly.

Andrew Bartlett
(This used to be commit 13d09c8e9a50ae265059e4a0d92a07c651018a6c)
2007-10-10 13:11:15 -05:00
Andrew Bartlett
b8f395cf78 r5992: Rename schannel.c -> schannel_sign.c. The rest of the schannel code
(from librpc) will be moved into schannel.c soon.

Andrew Bartlett
(This used to be commit d6c80ff74b0550641c253316b37f1050c207791c)
2007-10-10 13:11:13 -05:00
Andrew Bartlett
79f6bcd5ae r5988: Fix the -P option (use machine account credentials) to use the Samba4
secrets system, and not the old system from Samba3.

This allowed the code from auth_domain to be shared - we now only
lookup the secrets.ldb in lib/credentials.c.

In order to link the resultant binary, samdb_search() has been moved
from deep inside rpc_server into lib/gendb.c, along with the existing
gendb_search_v().  The vast majority of this patch is the simple
rename that followed,

(Depending on the whole SAMDB for just this function seemed pointless,
and brought in futher dependencies, such as smbencrypt.c).

Andrew Bartlett
(This used to be commit e13c671619bd290a8b3cae8555cb281a9a185ee0)
2007-10-10 13:11:12 -05:00
Stefan Metzmacher
376b03ebd8 r5940: fix schannel against w2k, it skips the confounder in the signature (24 bytes) for singed packets
but it accepts 32 bytes from the client.

(w2k3 accept it the otherway arround too)

metze
(This used to be commit 08d4c3b9f8558ee40c73a22b3ec110b052f28110)
2007-10-10 13:11:10 -05:00
Jelmer Vernooij
05bc2d7b2c r5928: Use cli_credentials in:
- gtk+ (returned by GtkHostBindingDialog as well now)
 - torture/
 - librpc/
 - lib/com/dcom/
(This used to be commit ccefd782335e01e8e6ecb2bcd28a4f999c53b1a6)
2007-10-10 13:11:08 -05:00
Andrew Bartlett
df64302213 r5902: A rather large change...
I wanted to add a simple 'workstation' argument to the DCERPC
authenticated binding calls, but this patch kind of grew from there.

With SCHANNEL, the 'workstation' name (the netbios name of the client)
matters, as this is what ties the session between the NETLOGON ops and
the SCHANNEL bind.  This changes a lot of files, and these will again
be changed when jelmer does the credentials work.

I also correct some schannel IDL to distinguish between workstation
names and account names.  The distinction matters for domain trust
accounts.

Issues in handling this (issues with lifetime of talloc pointers)
caused me to change the 'creds_CredentialsState' and 'struct
dcerpc_binding' pointers to always be talloc()ed pointers.

In the schannel DB, we now store both the domain and computername, and
query on both.  This should ensure we fault correctly when the domain
is specified incorrectly in the SCHANNEL bind.

In the RPC-SCHANNEL test, I finally fixed a bug that vl pointed out,
where the comment claimed we re-used a connection, but in fact we made
a new connection.

This was achived by breaking apart some of the
dcerpc_secondary_connection() logic.

The addition of workstation handling was also propogated to NTLMSSP
and GENSEC, for completeness.

The RPC-SAMSYNC test has been cleaned up a little, using a loop over
usernames/passwords rather than manually expanded tests.  This will be
expanded further (the code in #if 0 in this patch) to use a newly
created user account for testing.

In making this test pass test_rpc.sh, I found a bug in the RPC-ECHO
server, caused by the removal of [ref] and the assoicated pointer from
the IDL.  This has been re-added, until the underlying pidl issues are
solved.
(This used to be commit 824289dcc20908ddec957a4a892a103eec2da9b9)
2007-10-10 13:11:07 -05:00
Andrew Bartlett
928af7e6ff r5877: It is not an error to have a zero-length secret, after decryption.
Andrew Bartlett
(This used to be commit b484776cc4d48690d45c668f9253015eb0d6207d)
2007-10-10 13:11:06 -05:00
Andrew Bartlett
42031bc4be r5668: Add tests to RPC-SAMLOGON to test for user@REALM style logins. These
need a NULL domain (or a "" domain, except this breaks NTLMv2, and I
need to look into it a bit more).

Add support to the Samba4 server for these logins.  This will need
extension when we handle trusted domains as a DC, as it is a principal
name, not just another format for the username.

Andrew Bartlett
(This used to be commit de02c7c222a32d2b3fb8ee8b715749b96cb647f9)
2007-10-10 13:10:58 -05:00
Andrew Bartlett
765832748b r5667: Move schannel state into libcli/auth (as it belongs with schannel,
which will move in with the rest of GENSEC shortly).

Add the RID as another element in the schannel state.

Andrew Bartlett
(This used to be commit 69114b4a8e1c937ab5ff12ca91dd22bd83fd9a3b)
2007-10-10 13:10:58 -05:00
Stefan Metzmacher
70f7c56168 r5601: add a gsskrb5 backend that uses lorikeet-heimdal's new gssapi with
GSS_C_DCE_STYLE support, it's just a start and does work correctly yet

metze
(This used to be commit 87ff661703f467db3dfcb33084041c3e2951e0ee)
2007-10-10 13:10:55 -05:00
Jelmer Vernooij
c52fb55903 r5437: Allow Samba4 to be compiled by tcc (www.tinycc.org). It still crashes when linking though.
(This used to be commit 2e1e8db6dc877eb32b51cfc3d9c8f463d14530ec)
2007-10-10 13:10:45 -05:00
Andrew Bartlett
c8ca613e93 r5330: Remove #include <sys/time.h> from includes.h.
Add #include "system/time.h" back (it was removed in some of these
places because the definitions were provided by <sys/time.h> on tridge's
platform.)

Andrew Bartlett
(This used to be commit 34b1da730304bed7fee5bae7cbde7fbccecb6af5)
2007-10-10 13:09:43 -05:00
Andrew Tridgell
9515fc4406 r5322: removed a whole bunch of #include lines that minimal_includes.pl
thinks are not needed. Now to see how this fares on the build farm :)
(This used to be commit 80ffcc650c9c86141507edd8338b97814a85f868)
2007-10-10 13:09:41 -05:00
Andrew Tridgell
a0e6f6c05b r5309: removed ads.h from includes.h
(This used to be commit 196c45b834c39f293b9533cec5cfe5a77382d4e2)
2007-10-10 13:09:40 -05:00
Andrew Tridgell
8674eaa5cc r5300: more uint32 and system/filesys.h build fixes when developer mode is enabled
(This used to be commit 93931b1a741a3722c311ada80c4c9d3d670f91b2)
2007-10-10 13:09:39 -05:00
Andrew Tridgell
e82aad1ce3 r5298: - got rid of pstring.h from includes.h. This at least makes it a bit
less likely that anyone will use pstring for new code

 - got rid of winbind_client.h from includes.h. This one triggered a
   huge change, as winbind_client.h was including system/filesys.h and
   defining the old uint32 and uint16 types, as well as its own
   pstring and fstring.
(This used to be commit 9db6c79e902ec538108d6b7d3324039aabe1704f)
2007-10-10 13:09:38 -05:00
Stefan Metzmacher
10c211f2af r5199: fix some minor configure bugs
metze
(This used to be commit 274ef2a206aa00b3155adc27f5b7e35d3fa52bf6)
2007-10-10 13:09:30 -05:00
Stefan Metzmacher
f0d97d27ae r5136: fix types
metze
(This used to be commit 344367cc4cdb232c394ce45ab64cc357cce4259f)
2007-10-10 13:09:26 -05:00
Andrew Bartlett
ea2209e3db r5092: Add a bit more const - moving it further into the LDB layer.
Andrew Bartlett
(This used to be commit ffad9b22be595279b247fa72d51145830fecbb06)
2007-10-10 13:09:22 -05:00
Andrew Tridgell
99ecf2d953 r5053: - fix up the library dependencies so that tools that need nbt don't
need to pull in the whole dcerpc subsystem

- moved smbencrypt.c code into libcli/auth/
(This used to be commit 3351c636af23ad88649e84f4cb88fc1167d5c654)
2007-10-10 13:09:18 -05:00
Andrew Tridgell
759da3b915 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.
(This used to be commit ec32b22ed5ec224f6324f5e069d15e92e38e15c0)
2007-10-10 13:09:15 -05:00
Stefan Metzmacher
52a6067fcb r4958: fix compiler warnings
metze
(This used to be commit 522af7ecc0020b7c56182ca628f6d1623abe303e)
2007-10-10 13:09:10 -05:00
Andrew Bartlett
4962fd4f28 r4893: Move to using secrets.ldb for the Kerberos verify, instead of
secrets.tdb from Samba3.

Andrew Bartlett
(This used to be commit 21bfda2a0d1c8373f8800269ed9b982e1b9a19e5)
2007-10-10 13:09:04 -05:00
Andrew Bartlett
f1aaef3015 r4890: Try to cope with mechanism mismatch in the client speaks first version
of the SPNEGO state-machine.  (Such as on LDAP and HTTP)

Andrew Bartlett
(This used to be commit c1cae6b3b1efe109a09e449ed2e09983431eac7e)
2007-10-10 13:09:03 -05:00
Andrew Bartlett
899f610fb4 r4692: Make the client SPNEGO code bail out in a couple more cases.
Andrew Bartlett
(This used to be commit a062ac122c402fb2cf31eb8e76f4077b1f33b8eb)
2007-10-10 13:08:44 -05:00
Andrew Bartlett
a249198d53 r4682: A LDB-based secrets implementation in Samba4.
This uses LDB (a local secrets.ldb and the global samdb) to fill out
the secrets from an LSA perspective.

Some small changes to come, but the bulk of the work is now done.

A re-provision is required after this change.

Andrew Bartlett
(This used to be commit ded33033521a6a1c7ea80758c5c5aeeebb182a51)
2007-10-10 13:08:42 -05:00
Stefan Metzmacher
fd4831f1f0 r4650: - make more use of bitmap and enum's
- move some structs out of misc.idl

metze
(This used to be commit b6543a6e3057b5588ec50a2ebf6c7c932209efe6)
2007-10-10 13:08:39 -05:00
Andrew Bartlett
e8c06b9221 r4641: Push a few more details into the schannel ldb, and into the
credentials struct it maintains.

Clearly much of this will be replaced with some system to pass and
store the session_info, as that is the 'right way' to handle this.

Andrew Bartlett
(This used to be commit c6fcb33a887fbf0c0b42c3bc331df942a985128c)
2007-10-10 13:08:38 -05:00
Andrew Bartlett
7db9de3ea9 r4635: Fix NTLMSSP to return NT_STATUS_OK when it has constructed the auth
token in the client (the final token in the negotiation).

Consequential fixes in the SPNEGO code, which now uses the out.length
as the indicator of 'I need to send something to the other side'.

Merge the NTLM and SPNEGO DCE-RPC authentication routines in the client.

Fix the RPC-MULTIBIND test consequent to this merge.

Andrew Bartlett
(This used to be commit 43e3516fc03008e97ebb4ad1a0cde464303f43c6)
2007-10-10 13:08:37 -05:00
Stefan Metzmacher
46a32687da r4620: - add interface functions to the auth subsystem so that callers doesn't need to
use function pointers anymore
- make the module init much easier
- a lot of cleanups

don't try to read the diff in auth/ better read the new files

it passes test_echo.sh and test_rpc.sh

abartlet: please fix spelling fixes

metze
(This used to be commit 3c0d16b8236451f2cfd38fc3db8ae2906106d847)
2007-10-10 13:08:34 -05:00
Andrew Tridgell
11ce2cfd70 r4591: - converted the other _p talloc functions to not need _p
- added #if TALLOC_DEPRECATED around the _p functions

- fixes the code that broke from the above

while doing this I fixed quite a number of places that were
incorrectly using the non type-safe talloc functions to use the type
safe ones. Some were even doing multiplies for array allocation, which
is potentially unsafe.
(This used to be commit 6e7754abd0c225527fb38363996a6e241b87b37e)
2007-10-10 13:08:30 -05:00
Andrew Bartlett
0773193057 r4565: Make the order of the initialisation more sensible.
Andrew Bartlett
(This used to be commit 5598cda08b46e61695b753e049288a0b498502c4)
2007-10-10 13:08:28 -05:00
Andrew Tridgell
ddc10d4d37 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)
(This used to be commit 89b74b53546e1570b11b3702f40bee58aed8c503)
2007-10-10 13:08:25 -05:00
Andrew Bartlett
e1944a3d6d r4531: Include the OID locally, as it seems to be hard to get the includes
right.

Andrew Bartlett
(This used to be commit a742ea1e1221058ae6a99e317fbf18c80bc49aed)
2007-10-10 13:08:18 -05:00
Andrew Bartlett
5e9a136908 r4530: Start adding a bit of Doxygen compatible documentation comments to GENSEC.
Andrew Bartlett
(This used to be commit c7acea9d5a097b51693f41de93274b857f7be0e3)
2007-10-10 13:08:18 -05:00
Andrew Bartlett
5e94b016f0 r4504: Setting
.enabled = True

on modules we know are good (and we want on be default) seems neater.

Andrew Bartlett
(This used to be commit 18850c66b7c8ac5e8caf08151dbb9b72cf93230f)
2007-10-10 13:08:16 -05:00
Andrew Bartlett
c8ba520c5a r4500: Allow GENSEC modules to be disabled by setting a flag on their module
definition, not by hardcoded reference in loadparm.c

Andrew Bartlett
(This used to be commit 43558eaf7604d2bb0187e0d1ba0686935a965ad7)
2007-10-10 13:08:15 -05:00
Andrew Bartlett
8eb981c90a r4499: Almost make our Samba4 server pass the RPC-SAMLOGON torture test.
I just need to fix a couple of NTLMv2 issues before we can fully pass,
and put this in test_rpc.sh, as a 'should pass' test.

Andrew Bartlett
(This used to be commit 4b52409e385366d87724bb79f4fad4803e8ecfec)
2007-10-10 13:08:15 -05:00
Andrew Bartlett
0dcd464596 r4494: Allow gensec_gssapi to use the SPNEGO mech provided by Heimdal (off by
default at this point), and include the GSSAPI OIDs in our source, per
advice by lha that this is easier than getting the includes right.

Andrew Bartlett
(This used to be commit 9ff8b2b4d12d364084df5c95a752ce2a0546053d)
2007-10-10 13:08:12 -05:00
Andrew Bartlett
3b182e2bf4 r4470: Try not to have GSSAPI built unless we detected krb5. We should split
these tests out a bit, but for now it's an indicator we can use.

Andrew Bartlett
(This used to be commit 2b0605dbaee18da4ebb676fc292b324d21805ef7)
2007-10-10 13:07:55 -05:00