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

378 Commits

Author SHA1 Message Date
Andrew Bartlett
9598593bcf Fix most of bug #169.
For a (very) long time, we have had a bug in Samba were an NTLMv2-only
PDC would fail, because it converted the password into NTLM format for
checking.

This patch performs the direct comparison required for interactive
logons to function in this situation.  It also removes the 'auth flags', which
simply where not ever used.

Natrually, this plays with the size of structures, so rebuild, rebuild
rebuild...

Andrew Bartlett
-
Gerald Carter
a7cac639c2 fix overlapping memory bug when copying username -
Gerald Carter
f2eaa14b1e BUG 1165, 1126: Fix bug with secondary groups (security = ads) and winbind use default domain = yes -
Jim McDonough
3e8a9c3584 Add calls to password lockout functions. Should now work against tdbsam only. -
Volker Lendecke
e3a5e2d9c2 Remove bogus check. No functional change, just cosmetics.
Volker
-
Gerald Carter
5134c6bcbc BUG 936: fix bind credentials for schannel binds in smbd (and add a comment to winbindd_cm about this -
Rafal Szczesniak
b5e492b8ea Doxygen comment fix.
rafal
-
Andrew Bartlett
32397c8b01 Change our Domain controller lookup routines to more carefully seperate
DNS names (realms) from NetBIOS domain names.

Until now, we would experience delays as we broadcast lookups for DNS names
onto the local network segments.

Now if DNS comes back negative, we fall straight back to looking up the
short name.

Andrew Bartlett
-
Andrew Bartlett
494781f628 auth/auth_util.c:
- Fill in the 'backup' idea of a domain, if the DC didn't supply one.  This
   doesn't seem to occour in reality, hence why we missed the typo.

lib/charcnv.c:
lib/smbldap.c:
libads/ldap.c:
libsmb/libsmbclient.c:
printing/nt_printing.c:
 - all the callers to pull_utf8_allocate() pass a char ** as the first
   parammeter, so don't make them all cast it to a void **

nsswitch/winbind_util.c:
 - Allow for a more 'correct' view of when usernames should be qualified
   in winbindd.  If we are a PDC, or have 'winbind trusted domains only',
   then for the authentication returns stip the domain portion.
 - Fix valgrind warning about use of free()ed name when looking up our
   local domain.  lp_workgroup() is maniplated inside a procedure that
   uses it's former value.  Instead, use the fact that our local domain is
   always the first in the list.

Andrew Bartlett
-
Andrew Bartlett
48315e8fd2 Move our basic password checking code from inside the authentication
subsystem into a seperate file - ntlm_check.c.

This allows us to call these routines from ntlm_auth.  The purpose of this
exercise is to allow ntlm_auth (when operating as an NTLMSSP server) to
avoid talking to winbind.  This should allow for easier debugging.

ntlm_auth itself has been reorgainised, so as to share more code between
the SPNEGO-wrapped and 'raw' NTLMSSP modes.  A new 'client' NTLMSSP mode
has been added, for use with a Cyrus-SASL module I am writing (based on vl's
work)

Andrew Bartlett
-
Andrew Bartlett
2375abfa00 Refactor our authentication and authentication testing code.
The next move will be to remove our password checking code from the SAM
authentication backend, and into a file where other parts of samba can use
it.

The ntlm_auth changes provide for better use of common code.

Andrew Bartlett
-
Gerald Carter
850e4be29e * add a few useful debug lines
* fix bug involving Win9x clients.  Make sure we
  save the right case for the located username
  in fill_sam_account()
-
Jeremy Allison
3684cffbd2 Final part of fix for #445. Don't add user for machine accounts.
Jeremy.
-
Jeremy Allison
5d9f06bdae Fix for bug #445 (missing unix user on kerberos auth doesn't call add user
script).
Jeremy.
-
Andrew Bartlett
5872c0e26e Patch by emil@disksites.com <Emil Rasamat> to ensure we always always
free() each auth method. (We had relied on the use of talloc() only, despite providing the free() callback)

Andrew Bartlett
-
Andrew Bartlett
f3bbc87b0d Changes all over the shop, but all towards:
- NTLM2 support in the server
 - KEY_EXCH support in the server
 - variable length session keys.

In detail:

 - NTLM2 is an extension of NTLMv1, that is compatible with existing
domain controllers (unlike NTLMv2, which requires a DC upgrade).

 * This is known as 'NTLMv2 session security' *

(This is not yet implemented on the RPC pipes however, so there may
well still be issues for PDC setups, particuarly around password
changes.  We do not fully understand the sign/seal implications of
NTLM2 on RPC pipes.)

This requires modifications to our authentication subsystem, as we
must handle the 'challege' input into the challenge-response algorithm
being changed.  This also needs to be turned off for
'security=server', which does not support this.

- KEY_EXCH is another 'security' mechanism, whereby the session key
actually used by the server is sent by the client, rather than being
the shared-secret directly or indirectly.

- As both these methods change the session key, the auth subsystem
needed to be changed, to 'override' session keys provided by the
backend.

- There has also been a major overhaul of the NTLMSSP subsystem, to merge the 'client' and 'server' functions, so they both operate on a single structure.  This should help the SPNEGO implementation.

- The 'names blob' in NTLMSSP is always in unicode - never in ascii.
Don't make an ascii version ever.

- The other big change is to allow variable length session keys.  We
have always assumed that session keys are 16 bytes long - and padded
to this length if shorter.  However, Kerberos session keys are 8 bytes
long, when the krb5 login uses DES.

 * This fix allows SMB signging on machines not yet running MIT KRB5 1.3.1. *

- Add better DEBUG() messages to ntlm_auth, warning administrators of
misconfigurations that prevent access to the privileged pipe.  This
should help reduce some of the 'it just doesn't work' issues.

- Fix data_blob_talloc() to behave the same way data_blob() does when
passed a NULL data pointer.  (just allocate)


REMEMBER to make clean after this commit - I have changed plenty of data structures...
-
Jeremy Allison
e61324cc6a Patch from Andrew Bartlett <abartlet@samba.org> for security=server core
dump if server goes away.
Jeremy.
-
Volker Lendecke
6b457d0c5c Skip over the winbind separator when looking up a user.
Volker
-
Gerald Carter
efe257bce2 run krb5 logins through the username map if the winbindd lookup fails; bug 698 -
Jeremy Allison
46e66ee950 Andrew Bartlett patch to cope with Exchange 5.5 cleartext pop password auth.
Jeremy.
-
Jeremy Allison
d7e35dfb92 Put strcasecmp/strncasecmp on the banned list (except for needed calls
in iconv.c and nsswitch/). Using them means you're not thinking about multibyte at
all and I really want to discourage that.
Jeremy.
-
Gerald Carter
62ed2598b3 more 2.2.x compatibility fixes - allow user looksup in the kerb5
sesssetup to fall back to 'user' instaed of failing is REA.LM\user
doesn't exist.

also fix include line in smb_acls.h as requested by metze
-
Gerald Carter
1737b36e91 make sure to call get_user_groups() with the full winbindd name for a user if he;she has one; bug 406 -
Jeremy Allison
abf54b58e9 Tidy up some formatting. Get ready for allowing bad password lockout. (based
on a patch posted from Richard Renard <rrenard@idealx.com>.
Jeremy.
-
Jeremy Allison
f35e9a8b90 More tuning from cachegrind. Change most trim_string() calls to trim_char(0,
as that's what they do. Fix string_replace() to fast-path ascii.
Jeremy.
-
Jeremy Allison
d405a93a9d Fix bug found by tridge in 2.2.x. Ensure that %U substitution is
restored on next valid packet if a logon fails. This has relevence
if people are using su.exe within logon scripts !
Jeremy.
-
Herb Lewis
398bd14fc6 get rid of more compiler warnings -
Gerald Carter
3c537c906f fix for BUG #267 (problem with supplementary groups).
Use winbindd to get the group list if possible since we already
know it from netsamlogon_cache.tdb. More effecient than letting
libc call getgrent() to get seconary groups.

Tested by Ken Cross.
-
Gerald Carter
20b6e64da2 need to be able to connect to a domain member as a local account; don't always map to the domain name -
Jeremy Allison
879309671d Add a command line option (-S on|off|required) to enable signing on client
connections. Overrides smb.conf parameter if set.
Jeremy.
-
Jeremy Allison
2eac65ebe7 Correctly detect an "add user script" - check that *lp_adduser_script() != '\0',
not lp_adduser_script() != NULL.
Jeremy.
-
Tim Potter
59dae1da66 More printf portability fixes. Got caught out by some gcc'isms last
time.  )-:
-
Tim Potter
ba4d334b82 More printf fixes - size_t is long on some architectures. -
Jeremy Allison
eff74a1fcc Server side NTLM signing works - until the first async packet. Working on this
next....
Jeremy.
-
Gerald Carter
9f835b85dd convert snprintf() calls using pstrings & fstrings
to pstr_sprintf() and fstr_sprintf() to try to standardize.
lots of snprintf() calls were using len-1; some were using
len.  At least this helps to be consistent.
-
Volker Lendecke
228fe54f0d Fix memleak -
Richard Sharpe
3b5ddd8e1f Fix a small typo in a comment and pretty it up a bit. -
Gerald Carter
0463045cc7 moving more code around.
* move rid allocation into IDMAP.  See comments in _api_samr_create_user()
  * add winbind delete user/group functions

I'm checking this in to sync up with everyone.  But I'm going to split
the add a separate winbindd_allocate_rid() function for systems
that have an 'add user script' but need idmap to give them a RID.
Life would be so much simplier without 'enable rid algorithm'.
The current RID allocation is horrible due to this one fact.
Tested idmap_tdb but not idmap_ldap yet.  Will do that tomorrow.

Nothing has changed in the way a samba domain is represented, stored,
or search in the directory so things should be ok with previous installations.

going to bed now.
-
Gerald Carter
1111bc7b0c Large set of changes to add UNIX account/group management
to winbindd.  See README.idmap-and-winbind-changes for details.
-
Gerald Carter
4acdfc5c94 standlone servers don't have any trusted domains -
Gerald Carter
43f21078ec fix bone head mistake when setting the uid in the server_info struct. -
Tim Potter
3a1f4f5ea5 Initialise the uid and gid values to a safe default in make_server_info() -
Gerald Carter
6a84297da5 fix temporary bug so people can test 3.0 again; make sure to initialize the uid for the server_info struct -
Tim Potter
a9a3339b2d Spelling. -
Gerald Carter
c4762aa3bc temporarily disable a sanity check to prevent winbindd from deadlocking
on a Samba PDC.  Will be re-enabled after winbind_passdb is done.
-
Gerald Carter
8266dffab4 and so it begins....
* remove idmap_XX_to_XX calls from smbd.  Move back to the
  the winbind_XXX and local_XXX calls used in 2.2

* all uid/gid allocation must involve winbindd now

* move flags field around in winbindd_request struct

* add WBFLAG_QUERY_ONLY option to winbindd_sid_to_[ug]id()
  to prevent automatic allocation for unknown SIDs

* add 'winbind trusted domains only' parameter to force a domain member
  server to use matching users names from /etc/passwd for its domain
  (needed for domain member of a Samba domain)

* rename 'idmap only' to 'enable rid algorithm' for better clarity
  (defaults to "yes")

code has been tested on

  * domain member of native mode 2k domain
  * ads domain member of native mode 2k domain
  * domain member of NT4 domain
  * domain member of Samba domain
  * Samba PDC running winbindd with trusts

Logons tested using 2k clients and smbclient as domain users
and trusted users. Tested both 'winbind trusted domains only = [yes|no]'

This will be a long week of changes.  The next item on the list is
winbindd_passdb.c & machine trust accounts not in /etc/passwd (done
via winbindd_passdb)
-
Andrew Bartlett
32e455a714 This changes our Unix primary GID behaviour back to what most people expect:
Samba will now use the user's UNIX primary group, as the primary group when
dealing with the filesystem.  The NT primary group is ignored in unix.

For the NT_TOKEN, the primary group is the NT priamry group, and the unix
primary group is added to the NT_TOKEN as a supplementary group.

This should fix bug #109, but will need to be revisited when we get a full
NT group database.

Also in this commit:
 - Fix debug statements in service.c
 - Make idmap_ldap show if it's adding, or modifying an existing DN
 - Make idmap_ldap show both the error message and error string
-
Andrew Bartlett
6c48309cda Add some debug statments to our vampire code - try to make it easier to track
down failures.

Add a 'auto-add on modify' feature to guestsam

Fix some segfault bugs on no-op idmap modifications, and on new idmappings that
do not have a DN to tack onto.

Make the 'private data' a bit more robust.

Andrew Bartlett
-
Andrew Bartlett
7cfa1e7c4a PAM should operate on the Unix username, not the NT username (which might not
have the domain\ qualification).

Andrew Bartlett
-
Jeremy Allison
da5ee2b765 Fixed strlower changes I missed. Pointed out by metze.
Jeremy
-