1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-05 21:57:51 +03:00

188 Commits

Author SHA1 Message Date
Andrew Tridgell
e873d0ff1e support "map to guest" with spnego -
Andrew Tridgell
adf44a9bd0 added trusted realm support to ADS authentication
the method used for checking if a domain is a trusted domain is very
crude, we should really call a backend fn of some sort. For now I'm
using winbindd to do the dirty work.
-
Andrew Bartlett
a8a53c08f7 Ensure that 'use spnego' restricts, rather than just advises our clients.
This means that if a hole is found in the spnego code, we can tell people
to just set 'use spengo' in their config file while we sort it out.

Other than that, preventing 'unusual' behaviour is always a good thing.

Andrew Bartlett
-
Andrew Bartlett
d15ea4fa8e Ensure we fill in the %U for NTLMSSP connections -
Andrew Tridgell
7d94f1b736 added a REALLY gross hack into kerberos_kinit_password so that
winbindd can do a kinit
this will be removed once we have code that gets a tgt
and puts it in a place where cyrus-sasl can see it
-
Andrew Bartlett
8f9ce71781 Make better use of the ads_init() function to get the kerberos relam etc.
This allows us to use automagically obtained values in future, and the value
from krb5.conf now.

Also fix mem leaks etc.

Andrew Bartlett
-
Andrew Tridgell
23ef22f117 fixed some krb5 ifdefs -
Andrew Tridgell
37aa2873e5 fixed another memory leak -
Andrew Tridgell
5abf844203 more memory leak fixes -
Andrew Tridgell
477b6d27fd we can safely give NO_SUCH_USER if the ticket decodes but the local
account doesn't exist
-
Tim Potter
d6318add27 challange -> challenge -
Andrew Tridgell
058a5aee90 added "net join" command
this completes the first stage of the smbd ADS support
-
Andrew Bartlett
8d31eae52a This is another rather major change to the samba authenticaion
subystem.

The particular aim is to modularized the interface - so that we
can have arbitrary password back-ends.

This code adds one such back-end, a 'winbind' module to authenticate
against the winbind_auth_crap functionality.  While fully-functional
this code is mainly useful as a demonstration, because we don't get
back the info3 as we would for direct ntdomain authentication.

This commit introduced the new 'auth methods' parameter, in the
spirit of the 'auth order' discussed on the lists.  It is renamed
because not all the methods may be consulted, even if previous
methods fail - they may not have a suitable challenge for example.

Also, we have a 'local' authentication method, for old-style
'unix if plaintext, sam if encrypted' authentication and a
'guest' module to handle guest logins in a single place.

While this current design is not ideal, I feel that it does
provide a better infrastructure than the current design, and can
be built upon.

The following parameters have changed:
 - use rhosts =

  This has been replaced by the 'rhosts' authentication method,
 and can be specified like 'auth methods = guest rhosts'

 - hosts equiv =

  This needs both this parameter and an 'auth methods' entry
  to be effective.  (auth methods = guest hostsequiv ....)

 - plaintext to smbpasswd =

  This is replaced by specifying 'sam' rather than 'local'
  in the auth methods.

The security = parameter is unchanged, and now provides defaults
for the 'auth methods' parameter.

The available auth methods are:

guest
rhosts
hostsequiv
sam (passdb direct hash access)
unix (PAM, crypt() etc)
local (the combination of the above, based on encryption)
smbserver (old security=server)
ntdomain (old security=domain)
winbind (use winbind to cache DC connections)


Assistance in testing, or the production of new and interesting
authentication modules is always appreciated.

Andrew Bartlett
-
Andrew Tridgell
1cbc18ae73 add a hook to save the krb5 PAC -
Tim Potter
5c486bd28a Spelling fixes. -
Andrew Bartlett
a82c863857 Code duplication is bad. So add an add_signiture() function and just refernce
that.
-
Andrew Bartlett
9590144915 Kill off 'restrict anonymous' becouse it is useless in its current form.
To be replaced with a real restriction in consultation with jra.  (Hence why
I've not touched loadparm.c).

Andrew Bartlett
-
Andrew Bartlett
8e708332ed This change updates lp_guestaccount() to be a *global* paramater, rather than
per-share.  I beleive that almost all the things that this could have done on
a per-share basis can be done with other tools, like 'force user'.

Almost all the user's of this paramater used it as a global anyway...

While this is one step at a time, I hope it will allow me to considerably
simplfy the make_connection() code, particularly for the user-level security
case.

This already removes an absolute truckload of extra attempted password lookups
on the guest account.

Andrew Bartlett
-
Andrew Tridgell
72c1af6f8d fix the tree so it compiles again
grumble, mumble, ...
-
Andrew Bartlett
62f4e4bd0a Change to guest logon code.
This changes the way we process guest logons - we now treat them as normal
logons, but set the 'guest' flag.  In particular this is needed becouse Win2k
will do an NTLMSSP login with username "", therefore missing our previous guest
connection code - this is getting a pain to do as a special case all over the
shop.

Tridge:  We don't seem to be setting a guest bit for NTLMSSP, in either the
anonymous or authenticated case, can you take a look at this?

Also some cleanups in the check_password() code that should make some of the
debugs clearer.

Various other minor cleanups:

 - change the session code to just take a vuser, rather than having to do a
   vuid lookup on vuser.vuid

 - Change some of the global_client_caps linking

 - Better debug in authorise_login(): show the vuid.

Andrew Bartlett
-
Andrew Bartlett
7131fe3be4 anonymous logins are guest logins, so mark them as such. (Otherwise they can
browse non-guest shares).
-
Andrew Bartlett
4db8d70ad7 Move the test for non-SPNEGO session setups when using SPNEGO, becouse its a
perfectly vailid behaviour for guest logins.
-
Andrew Bartlett
514c91b16b Various post AuthRewrite cleanups, fixups and tidyups.
Zero out some of the plaintext passwords for paranoia

Fix up some of the other passdb backends with the change to *uid_t rather than
uid_t.

Make some of the code in srv_netlog_nt.c clearer, is passing an array around,
so pass its lenght in is definition, not as a seperate paramater.

Use sizeof() rather than magic numbers, it makes things easier to read.

Cope with a PAM authenticated user who is not in /etc/passwd - currently by
saying NO_SUCH_USER, but this can change in future.

Andrew Bartlett
-
Andrew Bartlett
8dc4f2e44b This should fix up the compile with krb5.
This needs to use the auth interface at some stage, but for now this will do.
-
Andrew Bartlett
f70fb819b2 This is a farily large patch (3300 lines) and reworks most of the AuthRewrite
code.

In particular this assists tpot in some of his work, becouse it provides the
connection between the authenticaion and the vuid generation.

Major Changes:
	- Fully malloc'ed structures.
	  - Massive rework of the code so that all structures are made and destroyed
	    using malloc and free, rather than hanging around on the stack.
	- SAM_ACCOUNT unix uids and gids are now pointers to the same, to allow them
	   to be declared 'invalid' without the chance that people might get ROOT by
	   default.

	- kill off some of the "DOMAIN\user" lookups.  These can be readded at a more
	  appropriate place (probably domain_client_validate.c) in the future. They
	  don't belong in session setups.

	- Massive introduction of DATA_BLOB structures, particularly for passwords.

	- Use NTLMSSP flags to tell the backend what its getting, rather than magic
	  lenghths.

	- Fix winbind back up again, but tpot is redoing this soon anyway.

	- Abstract much of the work in srv_netlog_nt back into auth helper functions.

This is a LARGE change, and any assistance is testing it is appriciated.

Domain logons are still broken (as far as I can tell) but other functionality
seems
intact.

Needs testing with a wide variety of MS clients.

Andrew Bartlett
-
Andrew Bartlett
190898586f Spnego on the 'server' end of security=server just does not work, so set the
flags so we just do a 'normal' session setup.

Also add some parinoia code to detect when sombody attempts to do a 'normal'
session setup when spnego had been negoitiated.

Andrew Bartlett
-
Herb Lewis
51cb4411df get rid of compiler warnings (casts and delete unused variables) -
Andrew Tridgell
672df66296 - fixed link order of krb5 libs
- accept a wide range of principal names in session setup
-
Jeremy Allison
b668d7d656 Ok, I know it's a language thing and it shouldn't matter.... but a kerberos
name is a "principal", not a principle. English majors will complain :-).
Jeremy.
-
Andrew Tridgell
3dbb48b188 change smbd to use HOST/hostname principle form until I work out how
to use the other form in netjoin

smb_wct is a char, not a word
-
Andrew Tridgell
8286e5307c fixed the spnego detection code in session setup
this gets share mode working again
-
Andrew Tridgell
b3caf21090 crude fix for anonymous session setup with extended security
negotiated
-
Andrew Tridgell
fd3a3daef3 better krb5 error handling (thanks andrewb!) -
Andrew Tridgell
e0c99e1f37 finished auth when we get a valid kerberos ticket
smbd now works with kerberos authentication if you use a MIT KDC and
smbclient. Next step is to make it work with a windows client
-
Andrew Tridgell
353c290f05 the beginnings of kerberos support in smbd. It doesn't work yet, but
it should give something for others to hack on and possibly find what
I'm doing wrong.
-
Andrew Tridgell
b9e1f05393 removed some debug code -
Andrew Tridgell
b74fda69bf added basic NTLMSSP support in smbd. This is still quite rough, and
loses things like username mapping. I wanted to get this in then
discuss it a bit to see how we want to split up the existing
session setup code
-
Andrew Tridgell
38a43d75e2 split session setup code out of reply.c in preparation for adding
NTLMSSP and kerberos support in smbd
-