1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-08 21:18:16 +03:00
Commit Graph

79 Commits

Author SHA1 Message Date
Jeremy Allison
ae8f3649f7 r21991: I hate Steve French :-). Add support for encryption
contexts....
Jeremy.
2007-10-10 12:18:58 -05:00
Jeremy Allison
fbc569b530 r21969: Start working on the gss-side of the server negotiation.
Jeremy.
2007-10-10 12:18:54 -05:00
Jeremy Allison
662344d1ec r21926: Fix missing enum specifier pointed out by Don McCall @ HP.
Thanks Don !
Jeremy.
2007-10-10 12:18:49 -05:00
Jeremy Allison
a226645353 r21917: Start to do the gss versions of sign+seal.
Jeremy.
2007-10-10 12:18:48 -05:00
Jeremy Allison
d3f3ced6c8 r21880: Make client and server calls into encryption code symetrical,
depending on encryption context pointer.
Jeremy.
2007-10-10 12:18:43 -05:00
Jeremy Allison
530ac29abf r21876: Start adding in the seal implementation - prototype code
for the server side enc. (doesn't break anything).
I'll keep updating this until I've got NTLM seal working
on both client and server, then add in the gss level
seal.
Jeremy.
2007-10-10 12:18:42 -05:00
Jeremy Allison
1c9e10569c r21768: Fix the client dfs code such that smbclient can
process deep dfs links (ie. links that go to non root
parts of a share). Make the directory handling conanonical
in POSIX and Windows pathname processing.
dfs should not be fully working in client tools. Please
bug me if not.
Jeremy.
2007-10-10 12:18:30 -05:00
Günther Deschner
31f21282cd r18969: Fix typo.
Guenther
2007-10-10 12:14:52 -05:00
Jeremy Allison
425280a1d2 r17800: Start using struct timespec internally for file times
on the wire. This allows us to go to nsec resolution
for systems that support it. It should also now be
easy to add a correct "create time" (birth time)
for systems that support it (*BSD). I'll be watching
the build farm closely after this one for breakage :-).
Jeremy.
2007-10-10 11:38:48 -05:00
Jeremy Allison
9dafb7f48c r16945: Sync trunk -> 3.0 for 3.0.24 code. Still need
to do the upper layer directories but this is what
everyone is waiting for....

Jeremy.
2007-10-10 11:19:14 -05:00
Jeremy Allison
dcef65acb5 r15162: Patch for bug #3668. Windows has a bug with LARGE_READX
where if you ask for exactly 64k bytes it returns 0.
Jeremy.
2007-10-10 11:16:27 -05:00
Gerald Carter
49b8d7d7f5 r10964: BUG 1051: store the directory path so we can send the full name in the unlink call (del tmp\foo) 2007-10-10 11:04:58 -05:00
Gerald Carter
939c3cb5d7 r10656: BIG merge from trunk. Features not copied over
* \PIPE\unixinfo
* winbindd's {group,alias}membership new functions
* winbindd's lookupsids() functionality
* swat (trunk changes to be reverted as per discussion with Deryck)
2007-10-10 11:04:48 -05:00
Gerald Carter
a0ac9a8ffd r7415: * big change -- volker's new async winbindd from trunk 2007-10-10 10:57:08 -05:00
Gerald Carter
e57fd2c5f0 r5518: Add initial msdfs support to smbclient. Currently I can only
cd up and down the tree and get directory listings.

Still have to figure out how to get a directory listing on a
2k dfs root.  Also have to work out some issues with relative paths
that cross dfs mount points.

We're protected from the new code paths when connecting to
a non-dfs root share ( the flag from the tcon&X is stored
in the struct cli_state* )
2007-10-10 10:55:44 -05:00
Jeremy Allison
843e85bcd9 r4970: Fix for bug 2092, allowing fallback after kerberos and allow
gnome vfs to prevent auto-anonymous logon.
Jeremy.
2007-10-10 10:55:10 -05:00
Volker Lendecke
dc294c52e0 r4570: Replace cli->nt_pipe_fnum with an array of NT file numbers, one for each
supported pipe. Netlogon is still special, as we open that twice, one to do
the auth2, the other one with schannel.

The client interface is completely unchanged for those who only use a single
pie. cli->pipe_idx is used as the index for everything except the "real"
client rpc calls, which have been explicitly converted in my last commit. Next
step is to get winbind to just use a single smb connection for multiple pipes.

Volker
2007-10-10 10:53:47 -05:00
Jeremy Allison
831cb21a87 r4186: Fix client & server to allow 127k READX calls.
Jeremy.
2007-10-10 10:53:36 -05:00
Jeremy Allison
cf84c0fe1a r1154: Change default setting for case sensitivity to "auto". If set to auto
then is the client supports it (current clients supported are Samba and
CIFSVFS - detected by the negprot strings "Samba", "POSIX 2" and a bare
"NT LM 0.12" string) then the setting of the per packet flag smb_flag
FLAG_CASELESS_PATHNAMES is taken into account per packet. This allows
the linux CIFS client to use Samba in a case sensitive manner.
Additional command in smbclient "case_sensitive", toggles the
flag in subsequent packets.
Docs to follow.
Jeremy.
2007-10-10 10:51:57 -05:00
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...
0001-01-01 00:00:00 +00:00
Jeremy Allison
203e4bf0bf 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
0001-01-01 00:00:00 +00:00
Jeremy Allison
c390b3e4cd 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.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
5472ddc9ea 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
0001-01-01 00:00:00 +00:00
Volker Lendecke
eaef0d8aef This is the netlogon schannel client code. Try a
rpcclient -S pdc -U% -c "samlogon user password"

and it should work with the schannel. Needs testing against platforms
different from NT4SP6.

Volker
0001-01-01 00:00:00 +00:00
Andrew Bartlett
1c87be7a3d Merge from HEAD:
A much better SMB signing module, that allows for mulitple signing algorithms
and correctly backs down from signing when the server cannot sign the reply.

This also attempts to enable SMB signing on NTLMSSP connections, but I don't
know what NTLMSSP flags to set yet.

This would allow 'client use signing' to be set by default, for server
compatability.  (A seperate option value should be provided for mandetory
signing, which would not back down).

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Andrew Bartlett
50f0ca752e Merge from HEAD:
signed/unsigned (mostly i counters)

a little bit of const.

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Jeremy Allison
33b11d5eb5 Change size parameters from signed to unsigned to fix up warnings.
Jeremy.
0001-01-01 00:00:00 +00:00
Andrew Bartlett
837680ca51 Merge from HEAD client-side authentication changes:
- new kerberos code, allowing the account to change it's own password
   without special SD settings required
 - NTLMSSP client code, now seperated from cliconnect.c
 - NTLMv2 client code
 - SMB signing fixes

Andrew Bartlett
0001-01-01 00:00:00 +00:00
Jeremy Allison
8dcbfa4e77 Fix client reporting of 64 bit files.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
d8d351eb01 Cope with rw errors and timeout to peer.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
28d2eb9343 Added error string for server timeout on client call.
Jeremy.
0001-01-01 00:00:00 +00:00
Gerald Carter
65e7b5273b sync'ing up for 3.0alpha20 release 0001-01-01 00:00:00 +00:00
Andrew Tridgell
03ac082dcb updated the 3.0 branch from the head branch - ready for alpha18 0001-01-01 00:00:00 +00:00
Tim Potter
3fb3bc0a15 Removed some random crap that isn't used anymore. 0001-01-01 00:00:00 +00:00
Tim Potter
6a58c9bd06 Removed version number from file header.
Changed "SMB/Netbios" to "SMB/CIFS" in file header.
0001-01-01 00:00:00 +00:00
Martin Pool
37ae84f782 struct cli_state remembers the pipe name that it's talking to, if any,
so that we can print it in later debug messages.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
911c57403b prevent a memory leak of cli structures 0001-01-01 00:00:00 +00:00
Andrew Bartlett
c28956d860 oops, I forgot to include the header file 0001-01-01 00:00:00 +00:00
Andrew Tridgell
3f919b4360 a quick fix to get rpcclient working again. This just disables
NTLMSSP in cli_establish_connection()

What we really need to do is kill off the pwd_cache code. It is horrible,
and assumes the challenge comes in the negprot reply.
0001-01-01 00:00:00 +00:00
Andrew Tridgell
076aa97bee added NTLMSSP authentication to libsmb. It seems to work well so I have enabled it by default if the server supports it. Let me know if this breaks anything. Choose kerberos with the -k flag to smbclient, otherwise it will use SPNEGO/NTLMSSP/NTLM 0001-01-01 00:00:00 +00:00
Andrew Tridgell
d330575856 initial kerberos/ADS/SPNEGO support in libsmb and smbclient. To
activate you need to:

- install krb5 libraries
- run configure
- build smbclient
- run kinit to get a TGT
- run smbclient with the -k option to choose kerberos auth
0001-01-01 00:00:00 +00:00
Andrew Tridgell
eb668b54af added a little smbtorture test for dumping the unicode table of a
server. This is just a framework right now - I want this to eventually
replace the win32 test code from monyo

The interesting this about this test is that it shows up a really
horrible performance bug in our stat cache code. I'll see if I can fix
it.
0001-01-01 00:00:00 +00:00
Tim Potter
589aaa5fb1 Removed nt_error field from cli_state as it was not used anywhere. 0001-01-01 00:00:00 +00:00
Andrew Tridgell
3d4a3bfacd added a oplock break handler hook to the client code, this allows for more complete testing of oplocks from smbtorture and would also be essential if a client app ever really did want to use oplocks properly 0001-01-01 00:00:00 +00:00
Andrew Tridgell
95c9e4e0ba to use the same macros in the client and server rename the CLISTR_
macros to STR_
0001-01-01 00:00:00 +00:00
Andrew Tridgell
e7ccb9be6d made some LANMAN1 wildcard progress
it now handles -M LANMAN1 -f '.x' -m '?x' nicely
0001-01-01 00:00:00 +00:00
Andrew Tridgell
cdf0316610 added support for a CLISTR_ASCII flag so we can use a uniform
interface for ascii-only fields
0001-01-01 00:00:00 +00:00
Andrew Tridgell
e1a04e621f initial client side unicode support (needed for netapp filer)
I've currently got this code disabled by default as it is
incomplete. You enable it by setting a USE_UNICODE environment
variable. Once the support is complete this check will be removed and
the CAP_UNICODE capability bit will be the sole determination of
whether the client library code uses unicode

right now I have converted session_setup and tconx. I will do more fns
over the next few days.

see clistr.c for the new client side string interface. Luckily it
tends to make the code smaller and neater while adding unicode
support.
0001-01-01 00:00:00 +00:00
Jeremy Allison
213cd0b519 Ok - fixed a bug in our levelII oplock code. We need to break a level II on
a byte range lock (write lock only, but Win2k breaks on read lock also so I
do the same) - if you think about why, this is obvious. Also fixed our client
code to do level II oplocks, if requested, and fixed the code where we would
assume the client wanted level II if it advertised itself as being level II
capable - it may not want that.
Jeremy.
0001-01-01 00:00:00 +00:00
Jeremy Allison
0ff2ce543e Ok - this is a *BIG* change - but it fixes the problems with static strings
in the RPC code. This change was prompted by trying to save a long (>256)
character comment in the printer properties page.

The new system associates a TALLOC_CTX with the pipe struct, and frees
the pool on return of a complete PDU.

A global TALLOC_CTX is used for the odd buffer allocated in the BUFFERxx
code, and is freed in the main loop.

This code works with insure, and seems to be free of memory leaks and
crashes (so far) but there are probably the occasional problem with
code that uses UNISTRxx structs on the stack and expects them to contain
storage without doing a init_unistrXX().

This means that rpcclient will probably be horribly broken.
A TALLOC_CTX also needed associating with the struct cli_state also,
to make the prs_xx code there work.

The main interface change is the addition of a TALLOC_CTX to the
prs_init calls - used for dynamic allocation in the prs_XXX calls.

Now this is in place it should make dynamic allocation of all RPC
memory on unmarshall *much* easier to fix.

Jeremy.
0001-01-01 00:00:00 +00:00