1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00
Commit Graph

4031 Commits

Author SHA1 Message Date
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 2301a4b38a)
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 b5260cf0d4)
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 ef7f9a01b4)
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 13d09c8e9a)
2007-10-10 13:11:15 -05:00
Andrew Bartlett
038c4c4c6a r6024: Some of the ordering constraints on the popt callbacks were getting
painful, so don't call lp_*() functions until the post stage (rather
than in the cli_credentails_init(), which is called in the pre stage),
and don't open the secrets.ldb looking for the machine account details
until we actually need them (well after popt is done, and we know we have the other things right).

Set the domain and realm, as well as the account and password for -P
(fetch machine password) operation.

Allow NETLOGON credentials to be stored in this structure - will allow
SCHANNEL to be made more generic.

Clarify why we don't do special checks for NULL pointers, particularly
in the anonymous check (it indicates a programmer error, not a
run-time condition).

Also make lib/credentials.c a little more consistant.

Andrew Bartlett
(This used to be commit 730e6056b7)
2007-10-10 13:11:15 -05:00
Jelmer Vernooij
d600b78c33 r6019: Add IDL and server side code for Test_DoublePointer
(This used to be commit 0559f22bbe)
2007-10-10 13:11:15 -05:00
Jelmer Vernooij
fa9fa3d99e r6018: Add idl and server side for Test_Surrounding
(This used to be commit ed11601aef)
2007-10-10 13:11:14 -05:00
Jelmer Vernooij
1e415ce7ba r6015: Add testprogs/ directory and original rpcecho sources
( from tridges junkcode at http://samba.org/ftp/unpacked/junkcode/rpcecho-win32 )
(This used to be commit e33397f383)
2007-10-10 13:11:14 -05:00
Andrew Bartlett
44484c7861 r6010: Change the testing order, so we test all transports for each binding
option, rather than all binding options for each transport.

This means that we get to most of the tests earlier, with at least
some binding options.  (And allows us to have some confidence before
waiting for an RPC-SAMR test to finish with bigendian).

Andrew Bartlett
(This used to be commit 5c3e4df804)
2007-10-10 13:11:14 -05:00
Stefan Metzmacher
3ec2c008b8 r6000: add some notes about the cases where compression (or what ever this is)
is used, in the reply.

metze
(This used to be commit 618dadb7ef)
2007-10-10 13:11:14 -05:00
Stefan Metzmacher
220f82e570 r5999: ups, remove the testvalue that I used against my w2k3 server
metze
(This used to be commit 3d3e09af16)
2007-10-10 13:11:14 -05:00
Stefan Metzmacher
01ab1128ce r5998: I was wrong with the highwater mark...
I think I now understand how it works:-)

metze
(This used to be commit f8add2e66a)
2007-10-10 13:11:14 -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 d6c80ff74b)
2007-10-10 13:11:13 -05:00
Jelmer Vernooij
4a095be541 r5989: Display authentication information (list of available auth protocols
+ principal names per endpoint) to gepdump. Still need to fix memory management
in the GTK+ utilities...
(This used to be commit b48a0af0b0)
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 e13c671619)
2007-10-10 13:11:12 -05:00
Jelmer Vernooij
9b48673ad9 r5987: Add credentials callback for gtk+. The gtk+ apps now no longer
ask for a password when kerberos is being used.
(This used to be commit 642ec7cbef)
2007-10-10 13:11:12 -05:00
Jelmer Vernooij
df8c102ec9 r5986: Fix the build. Metze, could you please verify that this fix is correct?
(This used to be commit f3006e623b)
2007-10-10 13:11:12 -05:00
Andrew Bartlett
8307c19c78 r5985: Actually adding auth_domain.c in -r 5983 would probably have been a
good idea....

Andrew Bartlett
(This used to be commit 84b566a36b)
2007-10-10 13:11:12 -05:00
Andrew Bartlett
c62fc9b46f r5984: Add index and attributes to default ldif for secrets.ldb
Andrew Bartlett
(This used to be commit 41dea45892)
2007-10-10 13:11:12 -05:00
Andrew Bartlett
d735487aad r5983: Start support for being a domain member in Samba4.
This adds the auth_domain module to the auth subsystem, and cleans up
some small details around the join process (ensuring all the right
info is in the DB).

Andrew Bartlett
(This used to be commit 858cbfb821)
2007-10-10 13:11:12 -05:00
Jelmer Vernooij
1cb21b84a9 r5980: Fix double free after unexpected disconnect.
(This used to be commit 6149bd3702)
2007-10-10 13:11:12 -05:00
Jelmer Vernooij
4c4738938a r5977: Fix uninitialised memory bug in ndr_pull_ref_ptr(). This fixes the
Test_DoublePointer test failure.
(This used to be commit 4089d5f67d)
2007-10-10 13:11:11 -05:00
Jelmer Vernooij
7c55d0ffa5 r5976: SIDs can't have more then 5 subauths (caught by [validate] and
range())
(This used to be commit ec1eaa274b)
2007-10-10 13:11:11 -05:00
Jelmer Vernooij
88a5f8b26f r5963: Fix parameter passing for gentest and locktest
(This used to be commit 28914c89dc)
2007-10-10 13:11:11 -05:00
Stefan Metzmacher
1bb3e99d06 r5949: give things more meaning, and reuse structs where it is possible
to make things more clear

metze
(This used to be commit adefeeb4f3)
2007-10-10 13:11:11 -05:00
Stefan Metzmacher
07c705745a r5947: print out the password hashes when -d 100 is in use,
very usefull for creating a keytab file with

metze
(This used to be commit 15b80a28db)
2007-10-10 13:11:11 -05:00
Andrew Bartlett
e25cff1c11 r5942: A couple of small changes to fix things up with the new credentials
infrustructure.

Andrew Bartlett
(This used to be commit d51718ab8a)
2007-10-10 13:11:11 -05:00
Andrew Bartlett
645711c602 r5941: Commit this patch much earlier than I would normally prefer, but metze needs a working tree...
The main volume of this patch was what I started working on today:
 - Cleans up memory handling around DCE/RPC pipes, to have a parent talloc context.
 - Uses sepereate inner loops for some of the DCE/RPC tests

The other and more important part of this patch fixes issues
surrounding the new credentials framwork:

This makes the struct cli_credentials always a talloc() structure,
rather than on the stack.  Parts of the cli_credentials code already
assumed this.

There were other issues, particularly in the DCERPC over SMB handling,
as well as little things that had to be tidied up before test_w2k3.sh
would start to pass.

Andrew Bartlett
(This used to be commit 0453f9d05d)
2007-10-10 13:11:11 -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 08d4c3b9f8)
2007-10-10 13:11:10 -05:00
Andrew Tridgell
da5349dede r5939: improve talloc_realloc() docs after feedback from lifeless
(This used to be commit 301cbb0d12)
2007-10-10 13:11:10 -05:00
Andrew Tridgell
689a803ac7 r5938: - allow NULL string argument to talloc_vasprintf_append()
- default to using va_copy(), thus assuming a modern libc
(This used to be commit 3060b26c9e)
2007-10-10 13:11:10 -05:00
Andrew Tridgell
340d35be2d r5937: - performance improvement to talloc_asprintf_append()
- allow standalone talloc to use gcc printf attributes
(This used to be commit e25aa54e96)
2007-10-10 13:11:10 -05:00
Jelmer Vernooij
455be8fb82 r5932: Use cli_credentials somewhat more in the Gtk+ code
Support ncacn_spx in DCE/RPC bindings.
(This used to be commit a0233a3a9a)
2007-10-10 13:11:10 -05:00
Jelmer Vernooij
b7676c4b48 r5930: Fix initialisation of dcerpc_binding->authservice
(This used to be commit f8cf161e0e)
2007-10-10 13:11:10 -05:00
Jelmer Vernooij
13b0776f60 r5929: Use cli_credentials for the SMB functions as well.
Fix a couple of bugs in the new cli_credentials code
(This used to be commit 4ad481cfe5)
2007-10-10 13:11:09 -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 ccefd78233)
2007-10-10 13:11:08 -05:00
Jelmer Vernooij
34cde06513 r5924: Use cli_credentials in libnet/.
(This used to be commit e5bc6f4f17)
2007-10-10 13:11:08 -05:00
Jelmer Vernooij
02075be0bb r5917: First step in using the new cli_credentials structure. This patch
puts support for it into popt_common, adds a few utility functions
(in lib/credentials.c) and the callback functions for the command-line
(lib/cmdline/credentials.c). Comments are welcome :-)
(This used to be commit 1d49b57c50)
2007-10-10 13:11:08 -05:00
Jelmer Vernooij
105660d3f9 r5906: Fix the usage of the internal popt (make proto should ignore it)
Updated included popt to 1.7.
(This used to be commit d60cb643e8)
2007-10-10 13:11:08 -05:00
Andrew Bartlett
63b5ad6d54 r5903: While I can't test IPv6, metze asked me to commit a matching change
for unknown hosts that I just did for IPv4.

Andrew Bartlett
(This used to be commit 7e1d82a200)
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 824289dcc2)
2007-10-10 13:11:07 -05:00
Andrew Bartlett
4037a7e80c r5901: Add another option to the test script - the realm, which must match
the real ream, not just the short domain name.

Andrew Bartlett
(This used to be commit d585e1a759)
2007-10-10 13:11:07 -05:00
Andrew Bartlett
a25443dbeb r5900: Use flatname to specify the netbios domain name (matches what win2k3
uses for trusted domain records) in the secrets join records.

Andrew Bartlett
(This used to be commit a6c502832c)
2007-10-10 13:11:07 -05:00
Andrew Bartlett
439056c1db r5899: Fix spelling.
Andrew Bartlett
(This used to be commit 50af206477)
2007-10-10 13:11:07 -05:00
Andrew Bartlett
3240f01636 r5898: Handle errors in the 'sync' name and IP address handling code.
Andrew Bartlett
(This used to be commit 6b8b40f73b)
2007-10-10 13:11:07 -05:00
Andrew Bartlett
48e7cfbe1d r5895: Remove old auth_domain code - to be replaced with entirely new implementation.
Andrew Bartlett
(This used to be commit a16339729d)
2007-10-10 13:11:06 -05:00
Andrew Bartlett
5aa2646be8 r5879: Rename SAMR_FIELD_WORKSTATION to SAMR_FIELD_WORKSTATIONS - it is a list.
Andrew Bartlett
(This used to be commit 7822101cb5)
2007-10-10 13:11:06 -05:00
Andrew Bartlett
2b41ba049e r5878: Be clear which machine name (We have one worksation, and one BDC) we
are doing logins with.

Andrew Bartlett
(This used to be commit b7297c44fa)
2007-10-10 13:11:06 -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 b484776cc4)
2007-10-10 13:11:06 -05:00
Andrew Bartlett
00ac91fa29 r5876: Add a test account for the duration of the samsync - to ensure we have
a good variety of things to test against.

Add code to testjoin to handle this just like test machine accounts

Soon I'll remove the 'must change password' flag, so we can do logins with it.

Andrew Bartlett
(This used to be commit 08b47e2dc0)
2007-10-10 13:11:06 -05:00