1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-12 09:18:10 +03:00
Commit Graph

1294 Commits

Author SHA1 Message Date
Tim Potter
e3cb0cd0d6 Applied Steve Langasek's patch for bug #450. 0001-01-01 00:00:00 +00:00
Jeremy Allison
c816aacefb Fix #442 which Alexander considered a showstopper. Allow us to join mixed
mode domains.
Jeremy.
0001-01-01 00:00:00 +00:00
Gerald Carter
fe585d49cc 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.
0001-01-01 00:00:00 +00:00
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.
0001-01-01 00:00:00 +00:00
Jeremy Allison
ef140d15ea Used cachegrind to track down some bottlenecks.
Removed calls to clobber_region when not compiling with developer as
they were hiding speed problems.
Added fast path to convert_string() when dealing with ascii -> ascii,
ucs2-le to ascii and ascii to ucs2-le with values <= 0x7F. This
gives a speedup of 22% on my nbench tests.
Next I will do this on convert_string_allocate.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
84ae44678a Fix the character set handling properly in nmbd. Also fix bug where
iconv wasn't re-initialised on reading of "charset" parameters. This
caused workgroup name to be set incorrectly if it contained an
extended character.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
ecb8057387 Use correct size (17 not 16) when doing a push_ascii(). Ensure that
wins hook is called with unix charset.
Jeremy.
0001-01-01 00:00:00 +00:00
Gerald Carter
6e82c9fdf9 revert abartet's change that removed the check for CAP_EXTENDED_SECURITY when decidiing whether or not use ntlmv2 in client connections 0001-01-01 00:00:00 +00:00
Jeremy Allison
eb79272743 Ensure nmb_namestr() converts back from CH_DOS to CH_UNIX.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
cfde7477fd Attempt to fix the charcnv issues causing nmbd to crash. If we get a failed
conversion simply copy as is. Also fixed the horrid malloc-twice-copy code
in the convert alloc path.
Jeremy.
0001-01-01 00:00:00 +00:00
Gerald Carter
ae452e51b0 metze's autogenerate patch for version.h 0001-01-01 00:00:00 +00:00
Andrew Bartlett
96b4187963 - Make 'net' use a single funciton for setting the 'use machine account' code.
- Make winbindd try to use kerberos for connections to DCs, so that it can
   access RA=2 servers, particularly for netlogon.
 - Make rpcclient follow the new flags for the NETLOGON pipe
 - Make all the code that uses schannel use the centralised functions for doing so.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
33109fefe7 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
0001-01-01 00:00:00 +00:00
Herb Lewis
398bd14fc6 get rid of more compiler warnings 0001-01-01 00:00:00 +00:00
Volker Lendecke
dc2d2ad467 Add the gss-spnego kerberos server side to ntml_auth. This uses the
same ads_verify_ticket routine that smbd uses, so in the current state
we have to be have the host password in secrets.tdb instead of the
keytab. This means we have to be an ADS member, but it's a start.

Volker
0001-01-01 00:00:00 +00:00
Volker Lendecke
d8ab446859 Fix memleaks.
Currently I'm compiling against MIT Kerberos 1.2.8.

Anthony, you said you have a heimdal installation available. Could you
please compile this stuff with krb and check it with valgrind?

Thanks,

Volker
0001-01-01 00:00:00 +00:00
Herb Lewis
a6a39c61e8 get rid of some sompiler warnings on IRIX 0001-01-01 00:00:00 +00:00
Andrew Bartlett
3547cb3def 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
0001-01-01 00:00:00 +00:00
Volker Lendecke
2a724a7a87 Don't wrap up anything that is not there. Otherwise upper layers
can not figure that we got no ticket.

Volker
0001-01-01 00:00:00 +00:00
Volker Lendecke
9f453f27be Only close anything that is not fid 0. Was very confusing in ethereal...
Volker
0001-01-01 00:00:00 +00:00
Andrew Bartlett
d4a5f4fdf9 As described in http://davenport.sourceforge.net/ntlm.html add NTLM2
authentication.

NTLM2 is a version of NTLM, that involves both a client and server challenge,
and the creating of a new (presuable more secure) session key.

Unfortunetly this is not quite the same as NTLMv2, and we don't know how to
get the session key.  I suggest looking very closely at what MSCHAPv2, and
other MS auth protocols do...

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Volker Lendecke
a4d2dd1d40 Fix client autonegotiate signing.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
ba075ff03a Fallback to not using NTLMv2 is extended security not supported.
Jeremy.
0001-01-01 00:00:00 +00:00
Volker Lendecke
f6d853d36a I think this is the one to check...
Volker
0001-01-01 00:00:00 +00:00
Volker Lendecke
447f130619 Revert the latest fix. Need to investigate further.
Volker
0001-01-01 00:00:00 +00:00
Volker Lendecke
49c4f8a764 Fix a segfault in ntlm_auth when we can't find a domain or hostname.
Volker
0001-01-01 00:00:00 +00:00
Volker Lendecke
62b04d7776 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
0001-01-01 00:00:00 +00:00
Gerald Carter
4d3acce506 fix 2 bugs:
1)  don't ask trusted DC's for a list of trusted domains.  This causes
      us to treat non-transitive ones as if they were transitive.  Not
      needed anyways

  2)  Fix dc lookup bug where we would always try to use DNS to resolve
      the DC's for a domain (even if it was a trusted NT4 domain).
0001-01-01 00:00:00 +00:00
Jeremy Allison
68590b9e22 RPC fix from Ronan Waide <waider@waider.ie>. Tested with rpcecho.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
b43ce1ff61 An oplock break reply from the client causes the sequence number to be
updated by 2 if there is no open reply outstanding, else by one....
Yes - this makes no sense....
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
85907f02ce Turns out I had my packet sequences wrong for oplock break code.
I was storing the mid of the oplock break - I should have been
storing the mid from the open. There are thus 2 types of deferred
packet sequence returns - ones that increment the sequence number
(returns from oplock causing opens) and ones that don't (change notify
returns etc). Running with signing forced on does lead to some
interesting tests :-).
Jeremy.
0001-01-01 00:00:00 +00:00
Volker Lendecke
4e9eed1273 Changes to make gss-spnego ntlmssp client work against W2k AD.
Now I know where the mechListMIC changes came from: Ethereal ;-)

Volker
0001-01-01 00:00:00 +00:00
Tim Potter
73d02e3a2b Fix unused variable warning. 0001-01-01 00:00:00 +00:00
Jeremy Allison
69c56ee8bc Fix oplock break detection code on incoming oplock break responses. This
fixes signing for oplocks.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
9a8ffc239c Ensure we don't leak any sign records on cancel of pending requests.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
270bf20fe3 Only look for mid sign records on incoming packets for oplock break replies.
Otherwise we find spurious mid sign records on reply_ntcancel calls (they cancel
by mid). That took a *lot* of tracking down. I still need to remove the mid
records from the sign state on reply_ntcancel to avoid leaking memory....
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
3a789cb7f0 More fixes for client and server side signing. Ensure sequence numbers
are updated correctly on returning an error for server trans streams.
Ensure we turn off client trans streams on error.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
844898dbd8 Leave the packet sequence checkers enabled whilst I track down a smbclient -> smbd
sequence number problem.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
901544b29b Add the same signing code to the server. Ensure we use identical session
numbers and MIDs when in trans/trans2/nttrans code.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
2093a3130d Correct fix (removed the earlier band-aid) for what I thought was a signing
bug with w2k. Turns out that when we're doing a trans/trans2/nttrans call
the MID and send_sequence_number and reply_sequence_number must remain constant.
This was something we got very wrong in earlier versions of Samba. I can now
get a directory listing from WINNT\SYSTEM32 with the older earlier parameters
for clilist.c
This still needs to be fixed for the server side of Samba, client appears to
be working happily now (I'm doing a signed smbtar download of an entire W2K3
image to test this :-).
Jeremy.
0001-01-01 00:00:00 +00:00
Jim McDonough
c9b209be2b Update my copyrights according to my agreement with IBM 0001-01-01 00:00:00 +00:00
Jeremy Allison
43fbc18fdc Final fix for the bug tridge found. Only push locks onto a blocking lock
queue if the posix lock failed with EACCES or EAGAIN (this means another
lock conflicts). Else return an error and don't queue the request.
Jeremy.
0001-01-01 00:00:00 +00:00
Volker Lendecke
bc39c9b57f Fix off-by-one found by valgrind.
Volker
0001-01-01 00:00:00 +00:00
Volker Lendecke
6c252440fb This fixes an error I must have made when playing with spnego.c found
by aliguori: NegTokenInit.mechListMIC is an Octet String.

Second: add a free_spnego_data function.

Both thanks to aliguori.

Volker
0001-01-01 00:00:00 +00:00
Jeremy Allison
7c58673a10 Turn the 'doing_signing' variable on - fix bug where it was only being set
on when signing was mandatory.
Jeremy.
0001-01-01 00:00:00 +00:00
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.
0001-01-01 00:00:00 +00:00
Jeremy Allison
677d3a3c4c Fix bug we discovered in W2K client signing on secondary trans2 packets.
Use W2K parameters. tpot please re-test smbclient with your problem
directory.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
b8f6b83646 Eliminate valgrind error when client gets bad sig on list. Some reformatting.
Jeremy.
0001-01-01 00:00:00 +00:00
Volker Lendecke
45cef8f66e This adds gss-spnego to ntlm_auth. It contains some new spnego support
from Jim McDonough. It is to enable cyrus sasl to provide the
gss-spnego support. For a preliminary patch to cyrus sasl see

http://samba.sernet.de/cyrus-gss-spnego.diff

Volker
0001-01-01 00:00:00 +00:00
Andrew Bartlett
2c395a3904 Fix comment 0001-01-01 00:00:00 +00:00