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

149 Commits

Author SHA1 Message Date
Andrew Bartlett
b3a38e9c8c r6498: Add comments in line with those I already added to 3.0.
Please don't re-invent security=server :-)

Andrew Bartlett
2007-10-10 13:16:19 -05:00
Stefan Metzmacher
be5e301442 r6484: fix NTLMSSP client against w2k and w2k3
if we use lm_response = data_blob(NULL, 0);

we got NT_STATUS_INVALID_PARAMETER

(abartlet: we should maybe also give this error in our server code)

metze
2007-10-10 13:16:19 -05:00
Tim Potter
764b967926 r6466: Spelling. 2007-10-10 13:11:39 -05:00
Andrew Bartlett
78dc57c655 r6465: Use talloc_zero for the gensec_ntlmssp_state structure, as the history
of this code has too many pre-zeroed structure assumptions.

Remove unused 'stub' functions

Andrew Bartlett
2007-10-10 13:11:39 -05:00
Andrew Bartlett
eebbb4205b r6464: Remove the last of the Samba3 NTLMSSP API. This removes the rudundent
struct ntlmssp_state, and pushes all the member elements into struct
gensec_ntlmssp_state.

This also removes the 2-layer start function, caused by the previous
double abstraction layer.

Andrew Bartlett
2007-10-10 13:11:39 -05:00
Andrew Bartlett
227f2578da r6463: Move NTLM2 and NTLM (v1) specific variables into a union for DCE/RPC.
Andrew Bartlett
2007-10-10 13:11:39 -05:00
Andrew Bartlett
7a93ac49c2 r6462: Move the arcfour sbox state into it's own structure, and allocate it
with talloc() for the NTLMSSP system.

Andrew Bartlett
2007-10-10 13:11:39 -05:00
Andrew Bartlett
5a6a57cd93 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
2007-10-10 13:11:39 -05:00
Andrew Bartlett
2f22841c67 r6458: Split up NTLMSSP into a new directory, and into seperate files for the
client and server logic code.  In future, this may allow us to build
only the NTLMSSP client, and not the server, but in the short-term, it
allows me greater sainity in moving around these files.

Andrew Bartlett
2007-10-10 13:11:38 -05:00
Andrew Bartlett
fc3e3653eb r6455: Remove wrapper functions, and ntlmssp_end (which is well handed by talloc() now).
Andrew Bartlett
2007-10-10 13:11:38 -05:00
Andrew Bartlett
b14c530dfd r6454: Start to migrate NTLMSSP away from it's own API to just use GENSEC.
The aim here is to remove the extra layer of abstraction, and to then
use the credentials code directly in the NTLMSSP layer.

Andrew Bartlett
2007-10-10 13:11:38 -05:00
Andrew Bartlett
24f98f32aa r6453: Move verbose errors for the schannel 'not in the DB, or DB corrupt' error cases.
Andrew Bartlett
2007-10-10 13:11:38 -05:00
Tim Potter
1738761d89 r6359: Fix compiler warning with struct sockaddr. I'm sure I fixed this a few
weeks ago - weird.
2007-10-10 13:11:34 -05:00
Andrew Tridgell
e6376b2430 r6340: - added an easy to use function to initialise a temporary ldb with some ldif
- init the schannel.ldb with some CASE_INSENSITIVE attributes
2007-10-10 13:11:33 -05:00
Tim Potter
9c45f8d7bc r6322: Fix compile warning for struct sockaddr. 2007-10-10 13:11:31 -05:00
Stefan Metzmacher
8059315034 r6128: fix the build
metze
2007-10-10 13:11:20 -05:00
Andrew Bartlett
e074d63f3d 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
2007-10-10 13:11:20 -05:00
Andrew Bartlett
2301a4b38a 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
2007-10-10 13:11:15 -05:00
Andrew Bartlett
e13c671619 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
2007-10-10 13:11:12 -05:00
Andrew Bartlett
84b566a36b r5985: Actually adding auth_domain.c in -r 5983 would probably have been a
good idea....

Andrew Bartlett
2007-10-10 13:11:12 -05:00
Andrew Bartlett
858cbfb821 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
2007-10-10 13:11:12 -05:00
Andrew Bartlett
a16339729d r5895: Remove old auth_domain code - to be replaced with entirely new implementation.
Andrew Bartlett
2007-10-10 13:11:06 -05:00
Andrew Bartlett
de02c7c222 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
2007-10-10 13:10:58 -05:00
Andrew Tridgell
9db6c79e90 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.
2007-10-10 13:09:38 -05:00
Stefan Metzmacher
add1c57937 r5137: fix types
metze
2007-10-10 13:09:26 -05:00
Andrew Tridgell
2eba223bda r4955: fixed a couple of minor memory leaks in the auth_sam code 2007-10-10 13:09:09 -05:00
Andrew Tridgell
71cbe28734 r4758: - added async support to the session request code
- added async support to the negprot client code

- removed two unused parameters from smbcli_full_connection() code

- converted smbclient to use smbcli_full_connection() rather than
  reinventing everything itself
2007-10-10 13:08:50 -05:00
Stefan Metzmacher
3c0d16b823 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
2007-10-10 13:08:34 -05:00
Andrew Tridgell
6e7754abd0 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.
2007-10-10 13:08:30 -05:00
Andrew Bartlett
518ca9fb69 r4566: Fix Samba4 to pass it's own RPC-SAMLOGON torture test.
Include RPC-SAMLOGON in the list of tests expected to pass

Remove silly extra loops from the RPC-SAMLOGON test, which mostly just
slowed htings down.

Andrew Bartlett
2007-10-10 13:08:28 -05:00
Andrew Bartlett
4b52409e38 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
2007-10-10 13:08:15 -05:00
Stefan Metzmacher
c981808ed4 r4419: move security_token stuff to the libcli/security/
and debug privileges

metze
2007-10-10 13:07:47 -05:00
Stefan Metzmacher
7fcbd483d4 r4339: - rename auth_guest to auth_anonymous
- don't use static const strings in the server_info

- fix segfault when auth_sam gets "" as username

metze
2007-10-10 13:07:36 -05:00
Andrew Tridgell
3549039d0f r4151: added privilege attribute handling on samdb.
pvfs will now honor some privileges on ACLs, and it will be quite easy
to add the checks for more privileges in the necessary places, by
making calls to sec_privilege_check().
2007-10-10 13:07:19 -05:00
Andrew Tridgell
7b446af09b r4147: converted from NT_USER_TOKEN to struct security_token
this is mostly just a tidyup, but also adds the privilege_mask, which
I will be using shortly in ACL checking.

note that I had to move the definition of struct security_token out of
security.idl as pidl doesn't yet handle arrays of pointers, and the
usual workaround (to use a intermediate structure) would make things
too cumbersome for this structure, especially given we never encode it
to NDR.
2007-10-10 13:06:31 -05:00
Andrew Tridgell
d5bc706140 r4072: - changed the names of some of the well known sids to be more consistent
- added string constants for the important privileges.
2007-10-10 13:06:22 -05:00
Andrew Tridgell
eec698254f r4055: fixed more places to use type safe allocation macros 2007-10-10 13:06:20 -05:00
Andrew Tridgell
80d15fa340 r4052: fixed a bunch of code to use the type safe _p allocation macros 2007-10-10 13:06:18 -05:00
Andrew Tridgell
0928b1f5b6 r4037: fixed a bunch of "might be uninitialised" warnings after enabling -O1 in my compile 2007-10-10 13:06:16 -05:00
Stefan Metzmacher
2783bf393f r4000: DATA_BLOB.data is uint8_t * not void * :-)
(thanks abartlet for telling me)

metze
2007-10-10 13:06:13 -05:00
Stefan Metzmacher
1f03d79712 r3970: fix compiler warning
metze
2007-10-10 13:06:09 -05:00
Jelmer Vernooij
16d905f6b0 r3881: Split up the LIBNDR_GEN subsystem into NDR_* and RPC_NDR_* subsystems.
This reduces the total size of the samba binaries from 119 Mb to 73 Mb.
Next step will be to have the build system obtain some of this information
by itself, so that we don't have to write ~10 lines per interface manually.
2007-10-10 13:06:01 -05:00
Stefan Metzmacher
9ad3837dba r3876: fix compiler warnings
metze
2007-10-10 13:06:00 -05:00
Stefan Metzmacher
b620bdd672 r3810: create a LIB_SECURITY subsystem
- move dom_sid, security_descriptor, security_* funtions to one place
  and rename some of them

metze
2007-10-10 13:05:56 -05:00
Stefan Metzmacher
f5ee40d6ce r3783: - don't use make proto for ldb anymore
- split ldh.h out of samba's includes.h

- make ldb_context and ldb_module private to the subsystem

- use ltdb_ prefix for all ldb_tdb functions

metze
2007-10-10 13:05:52 -05:00
Jelmer Vernooij
3d885562c9 r3744: Support building subsystems as a shared library. Modules don't work yet,
so while this does compile, it does not work yet.
2007-10-10 13:05:50 -05:00
Jelmer Vernooij
0d7bb2c40b r3737: - Get rid of the register_subsystem() and register_backend() functions.
- Re-disable tdbtool (it was building fine on my Debian box but other
					machines were having problems)
2007-10-10 13:05:48 -05:00
Jelmer Vernooij
64826da834 r3733: More build system fixes/features:
- Use .mk files directly (no need for a SMB_*_MK() macro when adding a new SUBSYSTEM, MODULE or BINARY). This allows addition of new modules and subsystems without running configure
 - Add support for generating .dot files with the Samba4 dependency tree (as used by the graphviz and springgraph utilities)
2007-10-10 13:05:47 -05:00
Andrew Tridgell
151dd4593d r3599: fixed a couple of memory errors in the rpc netlogon server
(found with valgrind)
2007-10-10 13:05:37 -05:00
Jelmer Vernooij
7a8244761b r3586: Fix some of the issues with the module init functions.
Both subsystems and modules can now have init functions, which can be
specified in .mk files (INIT_FUNCTION = ...)

The build system will define :
 - SUBSYSTEM_init_static_modules that calls the init functions of all statically compiled modules. Failing to load will generate an error which is not fatal
 - BINARY_init_subsystems that calls the init functions (if defined) for the subsystems the binary depends on

This removes the hack with the "static bool Initialised = " and the
"lazy_init" functions
2007-10-10 13:05:36 -05:00