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

95 Commits

Author SHA1 Message Date
Jeremy Allison
f35a266b3c RIP BOOL. Convert BOOL -> bool. I found a few interesting
bugs in various places whilst doing this (places that assumed
BOOL == int). I also need to fix the Samba4 pidl generation
(next checkin).
Jeremy.
2007-10-18 17:40:25 -07:00
Gerald Carter
611fdd95a5 r25401: BUG 4982: Don't delete lanman hashes on invalid logins when
using the "lanman auth = no".  Tested by Guenter Kukkukk.
2007-10-10 12:31:02 -05:00
Andrew Tridgell
b0132e94fc r23784: use the GPLv3 boilerplate as recommended by the FSF and the license text 2007-10-10 12:28:22 -05:00
Jeremy Allison
407e6e695b r23779: Change from v2 or later to v3 or later.
Jeremy.
2007-10-10 12:28:20 -05:00
Jeremy Allison
2ea5a6bd33 r23358: Fix from Justin Maggard <jmaggard@infrant.com> - ensure we don't
expire a password if it's explicitly set as ACB_PWNOTREQ.
Jeremy.
2007-10-10 12:23:09 -05:00
Volker Lendecke
3d3d61687e r22844: Introduce const DATA_BLOB data_blob_null = { NULL, 0, NULL }; and
replace all data_blob(NULL, 0) calls.
2007-10-10 12:22:01 -05:00
Andrew Bartlett
5fe3328e66 r22022: - Clarify the comments
- make sure never to free an uninitialised variable

- ensure to free result on getpwnam_alloc failure

Andrew Bartlett
2007-10-10 12:19:03 -05:00
Andrew Bartlett
e3e0ec25e6 r22020: Make it more clear that both the vuser struct and it's contents are
talloc_free()'ed at the end of a session.

Rework the passwd cache code to use talloc_unlink and
talloc_reference, to more carefully manage the cache.

Andrew Bartlett
2007-10-10 12:19:03 -05:00
Jim McDonough
21abbeaee9 r19058: Implement "user cannot change password", and complete "user must change
password at next logon" code.  The "password last set time" of zero now
means "user must change password", because that's how windows seems to
use it.  The "can change" and "must change" times are now calculated
based on the "last set" time and policies.

We use the "can change" field now to indicate that a user cannot change
a password by putting MAX_TIME_T in it (so long as "last set" time isn't
zero).  Based on this, we set the password-can-change bit in the
faked secdesc.
2007-10-10 12:15:06 -05:00
Jeremy Allison
6c61dc8ed6 r16230: Fix Klocwork #861 and others. localtime and asctime
can return NULL. Ensure we check all returns correctly.
Jeremy.
2007-10-10 11:17:26 -05:00
Volker Lendecke
07c5dcb863 r16204: Fix Klocwork # 14
localtime() can return NULL.

Volker
2007-10-10 11:17:25 -05:00
Volker Lendecke
293b89dfb1 r15476: Transfer the was_mapped flag from user_info to server_info also in auth_sam
and auth_domain. Thanks for Simo to point this out.

Volker
2007-10-10 11:16:52 -05:00
Jeremy Allison
8272a5ab06 r15088: Remove all time() and gettimeofday() calls out of the mainline
packet processing code. Only do these when needed (ie. in the
idle timeout code). We drop an unneccessary global here too.
Jeremy.
2007-10-10 11:16:22 -05:00
Günther Deschner
5b89e8bc24 r13711: * Correctly handle acb_info/acct_flags as uint32 not as uint16.
* Fix a couple of related parsing issues.
* in the info3 reply in a samlogon, return the ACB-flags (instead of
  returning zero)

Guenther
2007-10-10 11:10:25 -05:00
Gerald Carter
6f1afa4acc r13590: * replace all pdb_init_sam[_talloc]() calls with samu_new()
* replace all pdb_{init,fill}_sam_pw() calls with samu_set_unix()
2007-10-10 11:10:16 -05:00
Gerald Carter
19b7593972 r13576: This is the beginnings of moving the SAM_ACCOUNT data structure
to make full use of the new talloc() interface.  Discussed with Volker
and Jeremy.

* remove the internal mem_ctx and simply use the talloc()
  structure as the context.
* replace the internal free_fn() with a talloc_destructor() function
* remove the unnecessary private nested structure
* rename SAM_ACCOUNT to 'struct samu' to indicate the current an
  upcoming changes.  Groups will most likely be replaced with a
  'struct samg' in the future.

Note that there are now passbd API changes.  And for the most
part, the wrapper functions remain the same.

While this code has been tested on tdb and ldap based Samba PDC's
as well as Samba member servers, there are probably still
some bugs.  The code also needs more testing under valgrind to
ensure it's not leaking memory.

But it's a start......
2007-10-10 11:10:15 -05:00
Gerald Carter
06b83fe350 r13541: we have to wrap pen_enum_group_memberships() in become/unbecome_root()
blocks.  This fixes the problem I had with missing groups in the
net_samlogon() reply from a Samba PDC.
2007-10-10 11:10:11 -05:00
Gerald Carter
17e63ac4ed r13316: Let the carnage begin....
Sync with trunk as off r13315
2007-10-10 11:06:23 -05:00
Jim McDonough
9b34f2d0f4 r11886: Fix 3187: logon hours restrictions were off corresponding to our offset from
GMT.  Use gmtime() instead of localtime() in the calc, but still use
localtime() in displaying it.
2007-10-10 11:05:33 -05:00
Jeremy Allison
d1caef8663 r11573: Adding Andrew Bartlett's patch to make machine account
logons work if the client gives the MSV1_0_ALLOW_SERVER_TRUST_ACCOUNT
or MSV1_0_ALLOW_WORKSTATION_TRUST_ACCOUNT flags. This changes
the auth module interface to 2 (from 1). The effect of this is
that clients can access resources as a machine account if they
set these flags. This is the same as Windows (think of a VPN
where the vpn client authenticates itself to a VPN server
using machine account credentials - the vpn server checks
that the machine password was valid by performing a machine
account check with the PDC in the same was as it would a
user account check. I may add in a restriction (parameter)
to allow this behaviour to be turned off (as it was previously).
That may be on by default.
Andrew Bartlett please review this change carefully.
Jeremy.
2007-10-10 11:05:20 -05:00
Jeremy Allison
c63ad85b8c r9252: 2 type fixes from Luke Mewburn <lukem@NetBSD.org>. Bugid #2934.
Jeremy.
2007-10-10 11:00:29 -05:00
Herb Lewis
efea76ac71 r6225: get rid of warnings from my compiler about nested externs 2007-10-10 10:56:30 -05:00
Jeremy Allison
6f5ea963ab r5655: Added support for Novell NDS universal password. Code donated by
Vince Brimhall <vbrimhall@novell.com> - slight tidyup by me to
use Samba conventions.
Vince - thanks a *lot* for this code - please test to make sure
I haven't messed anything up.
Jeremy.
2007-10-10 10:55:54 -05:00
Gerald Carter
8bff048650 r5562: * bump version to 3.0.12pre2
* change special character in gd's valid workstation
  check to a '+' to be more in line with the characters
  used by valid users
2007-10-10 10:55:47 -05:00
Günther Deschner
8f143b6800 r5528: Expand the invalid-workstation-scheme. Workstation-Names with leading
'@'-sign are expanded on-the-fly as posix-groups of workstations. This
allows optional, more flexible login-control in larger networks.

Guenther
2007-10-10 10:55:45 -05:00
Günther Deschner
1eabfa050b r4972: Fix a warning and some debugging-outputs.
Guenther
2007-10-10 10:55:10 -05:00
Jeremy Allison
f454821ff5 r1780: Remove the UTC comment as it isn't.
Jeremy.
2007-10-10 10:52:20 -05:00
Jeremy Allison
9ce273ed66 r1778: Fix based on code from Richard Renard <rrenard@idealx.com> to
enforce logon hours. ldap fixes to follow.
Jeremy.
2007-10-10 10:52:20 -05:00
Jeremy Allison
7c4666e56c r1414: Memory leak fixes found by valgrind whilst checking the password history code.
Error code paths were not freeing up some memory.
Jeremy.
2007-10-10 10:52:11 -05:00
Andrew Bartlett
724e8d3f33 r69: Global rename of 'nt_session_key' -> 'user_session_key'. The session key could
be anything, and may not be based on anything 'NT'.  This is also what microsoft
calls it.
2007-10-10 10:51:06 -05:00
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
-
Jim McDonough
3e8a9c3584 Add calls to password lockout functions. Should now work against tdbsam only. -
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
-
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
46e66ee950 Andrew Bartlett patch to cope with Exchange 5.5 cleartext pop password auth.
Jeremy.
-
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.
-
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. -
Tim Potter
a9a3339b2d Spelling. -
Gerald Carter
52166faee7 * rename samstrict auth method to sam
* rename original sam auth method to sam_ignoredomain
* remove samstrict_dc auth method (now covered by 'sam')
* fix wbinfo -a '...' and getent passwd bugs when running
  winbindd on a samba PDC (reported by Volker)
-
Jelmer Vernooij
e1a8e9b7f3 Add some static. Patch by Stefan Metzmacher <metze@metzemix.de> -
Tim Potter
eda8973068 Spelling. -
Andrew Bartlett
e0bd4d2844 Add samstrict_dc from metze (been sitting in HEAD for way to long waiting for
me to review it).

This patch works well for a DC running with trusted domains, becouse it lets
you check the local SAM first, but only for this domain's users.

Andrew Bartlett
-
Tim Potter
865c112756 spelling -
Volker Lendecke
e4e44cf3b1 When we have a NT4SP0 PDC trust us, we first have to check the
password. On NT4, NT_STATUS_NOLOGON_INTERDOMAIN_TRUST_ACCOUNT means
the password was correct. So the PDC believed that he had his trust
account correctly added. Later the auth2 naturally failed.

BTW, setting up an interdom trust account is not what I would call
well documented and easy to handle... Working on that now :-)

Volker
-
Andrew Bartlett
0c355c274a Cleanups. My NTLMv2 changes also changed the preference from using an implicit
structure-memcpy for DATA_BLOB parameters to using a pointer to that DATA_BLOB.

auth_sam calls some of these functions, so I've cleaned it all up to use this
format now.

Also clean up some debug statements to make them easier to read.

Andrew Bartlett
-
Andrew Bartlett
b4ecdb2e58 Make sure we always have some client data, not just the hash. An NTLMv2 or
LMv2 response less than 24 bytes is just silly.

Andrew Bartlett
-
Jelmer Vernooij
bc4b51bcb2 Use NTSTATUS as return value for smb_register_*() functions and init_module()
function. Patch by metze with some minor modifications.
-
Jelmer Vernooij
c7a1de090d Add support for the new modules system to auth/ (merge from HEAD) -