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

140 Commits

Author SHA1 Message Date
Jeremy Allison
6f56a5be2e r4917: Merge some of Derrell.Lipman@UnwiredUniverse.com obvious fixes.
Added text explaining units in pdbedit time fields.
Jeremy.
(This used to be commit 3d09c15d8f)
2007-10-10 10:55:07 -05:00
Jeremy Allison
5b713a206b r4186: Fix client & server to allow 127k READX calls.
Jeremy.
(This used to be commit 831cb21a87)
2007-10-10 10:53:36 -05:00
Jeremy Allison
0772ddbae1 r3377: Merge in first part of modified patch from Nalin Dahyabhai <nalin@redhat.com>
for bug #1717.The rest of the code needed to call this patch has not yet been
checked in (that's my next task). This has not yet been tested - I'll do this
once the rest of the patch is integrated.
Jeremy.
(This used to be commit 7565019286)
2007-10-10 10:53:05 -05:00
Volker Lendecke
0b9e4a98c8 r2466: Fix memleak found by sean.chandler@verizon.net.
Thanks!

Volker
(This used to be commit 587d863ae8)
2007-10-10 10:52:44 -05:00
Jeremy Allison
41b3720713 r2371: Fix for talking to OS/2 clients (max_mux ignored) by Guenter Kukkukk <guenter.kukkukk@kukkukk.com>.
Bugid #1590.
Jeremy.
(This used to be commit 330025d1a6)
2007-10-10 10:52:41 -05:00
Andrew Bartlett
748e7e4a92 r1612: Fix bug #1571 found by Guenter Kukkukk <guenter.kukkukk@kukkukk.com>
(Botched LANMAN2 session setup code)

Andrew Bartlett
(This used to be commit 3baa4ef6c5)
2007-10-10 10:52:16 -05:00
Andrew Bartlett
8f93b50032 r1487: Remove unused parameter for the client-side signing functions.
Andrew Bartlett
(This used to be commit 6d594d5bb1)
2007-10-10 10:52:12 -05:00
Jeremy Allison
309bbba38b r525: More memory leak fixes from kawasa_r@itg.hitachi.co.jp in error code
paths.
Jeremy.
(This used to be commit 88a97beac4)
2007-10-10 10:51:27 -05:00
Jeremy Allison
ff343c516c r523: Fix from kawasa_r@itg.hitachi.co.jp to initialise blob structs.
Jeremy.
(This used to be commit 6d0bdccaa6)
2007-10-10 10:51:27 -05:00
Andrew Bartlett
85a307bb3e r176: Improve our fallback code for password changes - this would be better
with more correct NTLMSSP support in client and server, but it will do
for now.

Also implement LANMAN password only in the classical session setup code, but
#ifdef'ed out.  In Samba4, I'll make this run-time so we can torture it.

Lanman passwords over 14 dos characters long could be considered
'invalid' (they are truncated) - so SMBencrypt now returns 'False' if
it generates such a password.

Andrew Bartlett
(This used to be commit 565305f7bb)
2007-10-10 10:51:12 -05:00
Herb Lewis
70227784ba fix typo
(This used to be commit 4b737b51a5)
2004-03-31 20:24:10 +00:00
Andrew Bartlett
b65d7d59c2 Revert bogus part of smb signing commit - when Win2k supports singing/SPNEGO,
it does sign the first packet.

Andrew Bartlett
(This used to be commit 4b9c50db85)
2004-03-27 08:51:04 +00:00
Andrew Bartlett
873db3f5fd Based on the detective work of Jianliang Lu <j.lu@tiesse.com>, allow yet
another NTLMv2 combination.

We should allow the NTLMv2 response to be calculated with either the domain
as supplied, or the domain in UPPER case (as we always did in the past).

As a client, we always UPPER case it (as per the spec), but we also
make sure to UPPER case the domain, when we send it.  This should give
us maximum compatability.

Andrew Bartlett
(This used to be commit 1e91cd0cf8)
2004-03-27 07:53:47 +00:00
Andrew Bartlett
e9a7e67e01 Merge from HEAD the SMB signing patch that I developed a couple of weeks
ago.

This patch re-adds support for 'optional' SMB signing.  It also ensures that
we are much more careful about when we enable signing, particularly with
on-the-fly smb.conf reloads.

The client code will now attempt to use smb signing by default, and disable
it if the server doesn't correctly support it.

Andrew Bartlett
(This used to be commit e27b5cbe75)
2004-03-27 07:33:59 +00:00
Jim McDonough
9a8e30d04b Fix bugzilla # 1208
Winbind tickets expired.  We now check the expiration time, and acquire
new tickets.  We couln't rely on renewing them, because if we didn't get
a request before they expired, we wouldn't have renewed them.  Also, there
is a one-week limit in MS on renewal life, so new tickets would have been
needed after a week anyway.   Default is 10 hours, so we should only be
acquiring them that often, unless the configuration on the DC is changed (and
the minimum is 1 hour).
(This used to be commit c2436c433a)
2004-03-24 17:32:55 +00:00
Gerald Carter
56ce613679 updating release notes & merging Derrel Lipman's libsmbclient patch from HEAD
(This used to be commit 5fbfaa687a)
2004-03-19 16:22:47 +00:00
Gerald Carter
b20f1a95a9 * BUG 446
- setup_logging() in smbclient to be interactive (remove the timestamps)
  - Fix bad return value in pull_ucs2( needs more testing to make sure this
    didn't break something else) that caused clistr_pull() to always read
    the same string from the buffer (pull_usc2() could return -1 if the original
    source length was given as -1)
  - increment some debugging messages to avoid printing them out so often
(This used to be commit 79fe75dcdf)
2004-01-15 19:03:18 +00:00
Andrew Bartlett
7d068355aa This merges in my 'always use ADS' patch. Tested on a mix of NT and ADS
domains, this patch ensures that we always use the ADS backend when
security=ADS, and the remote server is capable.

The routines used for this behaviour have been upgraded to modern Samba
codeing standards.

This is a change in behaviour for mixed mode domains, and if the trusted
domain cannot be reached with our current krb5.conf file, we will show
that domain as disconnected.

This is in line with existing behaviour for native mode domains, and for
our primary domain.

As a consequence of testing this patch, I found that our kerberos error
handling was well below par - we would often throw away useful error
values.  These changes move more routines to ADS_STATUS to return
kerberos errors.

Also found when valgrinding the setup, fix a few memory leaks.

While sniffing the resultant connections, I noticed we would query our
list of trusted domains twice - so I have reworked some of the code to
avoid that.

Andrew Bartlett
(This used to be commit 7c34de8096)
2004-01-08 08:19:18 +00:00
Andrew Bartlett
e0ec9d2d56 Make it clearer that the domain here is the domain of the user for
authentication.

Andrew Bartlett
(This used to be commit 7e6cc8f003)
2004-01-08 02:57:42 +00:00
Andrew Bartlett
cc02d8690c Even if the 'device type' is always an ascii string, use push_string to get
it out onto the wire.  Avoids valgrind warnings because the fstrcpy() causes
part of the wire buffer to be 'marked'.

Andrew Bartlett
(This used to be commit 53d802c72a)
2004-01-04 11:05:30 +00:00
Volker Lendecke
82027c1ea2 Preliminary fix for our signing problem with failed NTLMSSP logins. This patch
solves the problem for me here, I can still successfully set up signing using
NTLMSSP against w2k3 and it does not show a signing error anymoe when the
password was wrong.

Jeremy, you might want to take a further look at it as this is not
particularly elegant.

Volker
(This used to be commit f5afaafd61)
2003-12-27 10:11:26 +00:00
Steve French
1f761ad395 Fix incorrect smb flags2 for connections to pre-NT servers (causes smbclient to
fail to OS2 for example)
(This used to be commit 54e2fcb8f4)
2003-12-04 21:26:14 +00:00
Jeremy Allison
026e476258 Client connect signing error messages should be level zero else
they're easy to miss.
Jeremy.
(This used to be commit 7fa89b0937)
2003-12-01 22:55:43 +00:00
Andrew Bartlett
fcbfc7ad06 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...
(This used to be commit f3bbc87b0d)
2003-11-22 13:19:38 +00:00
Jeremy Allison
1555cacd7c Fix #442 which Alexander considered a showstopper. Allow us to join mixed
mode domains.
Jeremy.
(This used to be commit c816aacefb)
2003-09-16 01:27:46 +00:00
Gerald Carter
c913fc0581 address bug #359. Andrew B's patch for implementing client
portion of NTLMv2 key exchange.  Also revert the default for
'client ntlmv2 auth' to no.  This caused no ends of grief in
different cases.

And based on abartlet's mail....

> All I care about at this point is that we use NTLMv2
> in our client code when connecting to a server that
> supports it.

There is *no* way to tell this.  The server can't tell us, because it
doesn't know what it's DC supports.  The DC can't tell us, because it
doesn't know what the trusted DC supports.  One DC might be Win2k, and
the PDC could be an older NT4.
(This used to be commit fe585d49cc)
2003-09-06 19:23:24 +00:00
Gerald Carter
ac5665f204 revert abartet's change that removed the check for CAP_EXTENDED_SECURITY when decidiing whether or not use ntlmv2 in client connections
(This used to be commit 6e82c9fdf9)
2003-08-22 14:24:38 +00:00
Gerald Carter
8bfe26b62d metze's autogenerate patch for version.h
(This used to be commit ae452e51b0)
2003-08-20 17:13:38 +00:00
Andrew Bartlett
83e576c09f Break up 'cli_full_connection' to allow for the session setups to be done
elsewhere in the code.  This will allow us to try kerberos, then another user
then guest in the winbindd code.

Also, re-introduce the seperate, NT1 'guest' session setup code, as I found
some problems with doing guest under NTLMSSP.

Andrew Bartlett
(This used to be commit 33109fefe7)
2003-08-19 17:47:44 +00:00
Andrew Bartlett
172766eea7 Change Samba to always use extended security for it's guest logins, (ie,
NTLMSSP with "" username, NULL password), and add --machine-pass (-P) to
all of Samba's clients.

When connecting to an Active Directory DC, you must initiate the CIFS level
session setup with Kerberos, not a guest login.  If you don't, your machine
account is demoted to NT4.

Andrew Bartlett
(This used to be commit 3547cb3def)
2003-08-14 01:08:00 +00:00
Volker Lendecke
46e0d25b7f Fix client autonegotiate signing.
Jeremy.
(This used to be commit a4d2dd1d40)
2003-08-12 01:15:23 +00:00
Jeremy Allison
102de75a7c Fallback to not using NTLMv2 is extended security not supported.
Jeremy.
(This used to be commit ba075ff03a)
2003-08-11 21:44:19 +00:00
Volker Lendecke
94bbd5c93a Store the server domain from the ntlmssp challenge in the client struct
to be able to ask a LMB for the servers in its workgroup. Against
W2k this only works on port 139....

Volker
(This used to be commit 62b04d7776)
2003-08-10 20:18:05 +00:00
Jeremy Allison
29ca70cd34 Add a command line option (-S on|off|required) to enable signing on client
connections. Overrides smb.conf parameter if set.
Jeremy.
(This used to be commit 879309671d)
2003-07-30 23:49:29 +00:00
Jeremy Allison
4632786cfb W00t! Client smb signing is now working correctly with krb5 and w2k server.
Server code *should* also work (I'll check shortly). May be the odd memory
leak. Problem was we (a) weren't setting signing on in the client krb5 sessionsetup
code (b) we need to ask for a subkey... (c). The client and server need to
ask for local and remote subkeys respectively.
Thanks to Paul Nelson @ Thursby for some sage advice on this :-).
Jeremy.
(This used to be commit 3f9e3b6070)
2003-07-25 23:15:30 +00:00
Tim Potter
7d833de662 More printf portability fixes. Got caught out by some gcc'isms last
time.  )-:
(This used to be commit 59dae1da66)
2003-07-25 04:24:40 +00:00
Tim Potter
77373f1f8e More printf fixes - size_t is long on some architectures.
(This used to be commit ba4d334b82)
2003-07-24 23:46:27 +00:00
Gerald Carter
3a5dc7c2ec 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.
(This used to be commit 9f835b85dd)
2003-07-23 12:33:59 +00:00
Jeremy Allison
6ab5e14494 Refactor signing code to remove most dependencies on 'struct cli'.
Ensure a server can't do a downgrade attack if client signing is mandatory.
Add a lp_server_signing() function and a 'server signing' parameter that
will act as the client one does.
Jeremy
(This used to be commit 203e4bf0bf)
2003-07-16 22:57:56 +00:00
Tim Potter
aed434ea9b Spelling.
(This used to be commit 2750418752)
2003-07-16 05:51:10 +00:00
Jeremy Allison
c44a9d25a2 Added the "required" keyword to the "client signing" parameter to force it
on. Fail if missmatch. Small format tidyups in smbd/sesssetup.c. Preparing
to add signing on server side.
Jeremy.
(This used to be commit c390b3e4cd)
2003-07-15 23:05:57 +00:00
Andrew Bartlett
236702e15c Fix SMB signing when using NTLMSSP...
It's so simple now I know how it works - and it has nothing to do with
NTLMSSP (it's just a slightly different use of the old algorithm). :-).

Note:  This is actually less secure then the non-NTLMSSP code, as there is
no per-session random data included for NTLM logins.  (NTLMv2 is better,
fortunetly).

Andrew Bartlett
(This used to be commit 95ec8317d4)
2003-07-14 10:38:23 +00:00
Andrew Bartlett
456f51bcbe Jeremy requested that I get my NTLMSSP patch into CVS. He didn't request
the schannel code, but I've included that anyway. :-)

This patch revives the client-side NTLMSSP support for RPC named pipes
in Samba, and cleans up the client and server schannel code.  The use of the
new code is enabled by the 'sign', 'seal' and 'schannel' commands in
rpcclient.

The aim was to prove that our separate NTLMSSP client library actually
implements NTLMSSP signing and sealing as per Microsoft's NTLMv1 implementation,
in the hope that knowing this will assist us in correctly implementing
NTLMSSP signing for SMB packets.  (Still not yet functional)

This patch replaces the NTLMSSP implementation in rpc_client/cli_pipe.c with
calls to libsmb/ntlmssp.c.  In the process, we have gained the ability to
use the more secure NT password, and the ability to sign-only, instead of
having to seal the pipe connection.  (Previously we were limited to sealing,
and could only use the LM-password derived key).

Our new client-side NTLMSSP code also needed alteration to cope with our
comparatively simple server-side implementation.  A future step is to replace
it with calls to the same NTLMSSP library.

Also included in this patch is the schannel 'sign only' patch I submitted to
the team earlier.  While not enabled (and not functional, at this stage) the
work in this patch makes the code paths *much* easier to follow.  I have also
included similar hooks in rpccleint to allow the use of schannel on *any* pipe.

rpcclient now defaults to not using schannel (or any other extra per-pipe
authenticiation) for any connection.  The 'schannel' command enables schannel
for all pipes until disabled.

This code is also much more secure than the previous code, as changes to our
cli_pipe routines ensure that the authentication footer cannot be removed
by an attacker, and more error states are correctly handled.

(The same needs to be done to our server)

Andrew Bartlett
(This used to be commit 5472ddc9ea)
2003-07-14 08:46:32 +00:00
Gerald Carter
7a4e38155d cleaning up more build issues. Tested
"--with-ads=no --with-ldap=yes" and "--with-ads=yes && make everything"
(This used to be commit 3e9e4bb7d1)
2003-06-26 05:26:20 +00:00
Gerald Carter
f51d769dd3 large change:
*)  consolidates the dc location routines again (dns
    and netbios)  get_dc_list() or get_sorted_dc_list()
    is the authoritative means of locating DC's again.

    (also inludes a flag to get_dc_list() to define
     if this should be a DNS only lookup or not)

    (however, if you set "name resolve order = hosts wins"
     you could still get DNS queries for domain name IFF
     ldap_domain2hostlist() fails.  The answer?  Fix your DNS
     setup)

*)  enabled DOMAIN<0x1c> lookups to be funneled through
    resolve_hosts resulting in a call to ldap_domain2hostlist()
    if lp_security() == SEC_ADS

*)  enables name cache for winbind ADS backend

*)  enable the negative connection cache for winbind
    ADS backend

*)  removes some old dead code

*)  consolidates some duplicate code

*)  moves the internal_name_resolve() to use an IP/port pair
    to deal with SRV RR dns replies.  The namecache code
    also supports the IP:port syntax now as well.

*)  removes 'ads server' and moves the functionality back
    into 'password server' (which can support "hostname:port"
    syntax now but works fine with defaults depending on
    the value of lp_security())
(This used to be commit d7f7fcda42)
2003-06-25 17:41:05 +00:00
Andrew Bartlett
e4bc8f08c3 Enforce 'client plaintext auth', 'client lanman auth' and 'client ntlmv2 auth'.
(this now causes things like the LANMAN protocol and contacting servers with 'encrypt passwords = no' set to fail, if configured)

'client ntlmv2 auth' (a BOOL) forces both plaintext and lanman off, and is the
most secure setting for compatible hosts.

Perhaps we should change this to 'client minimum auth'?

Andrew Bartlett
(This used to be commit e1fb681e4c)
2003-06-08 12:49:31 +00:00
Gerald Carter
c52ee09afe fix for UNICODE plaintext passwords (bug #59) and fix smbclient to send the unicode plain text password if negoitated
(This used to be commit e7d635af80)
2003-05-21 16:12:07 +00:00
Tim Potter
402fbc518a spelling
(This used to be commit 865c112756)
2003-05-14 00:46:43 +00:00
Andrew Bartlett
d06f95ca78 Finally get NTLMv2 working on the client!
With big thanks to tpot for the ethereal disector, and for the base code
behind this, we now fully support NTLMv2 as a client.

In particular, we support it with direct domain logons (tested with ntlm_auth
--diagnostics), with 'old style' session setups, and with NTLMSSP.

In fact, for NTLMSSP we recycle one of the parts of the server's reply directly...

(we might need to parse for unicode issues later).

In particular, a Win2k domain controller now supplies us with a session key
for this password, which means that doman joins, and non-spnego SMB signing
are now supported with NTLMv2!

Andrew Bartlett
(This used to be commit 9f6a26769d)
2003-05-09 14:42:20 +00:00
Andrew Bartlett
423bd582f4 Allow the NTLMv2 functions to spit out both possible varients on the session
key, so we can test it in ntlm_auth.

I suspect the 'lm' version doesn't exist, but it's easy to change back.

Andrew Bartlett
(This used to be commit 5efd95622c)
2003-05-05 05:15:54 +00:00