1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-31 17:18:04 +03:00
Commit Graph

255 Commits

Author SHA1 Message Date
Volker Lendecke
7ecaced886 Do not use strlen if not necessary... :-) 2009-02-10 21:55:13 +01:00
Volker Lendecke
810b670b75 Fix Coverity ID 870 2009-02-03 10:22:36 +01:00
Volker Lendecke
c14b7e648b Split up async_req into a generic and a NTSTATUS specific part 2009-02-01 19:05:39 +01:00
Volker Lendecke
0bd92281e4 Make cli_tcon_andx async 2009-01-30 12:47:59 +01:00
Volker Lendecke
7b934c6af3 Make cli_session_setup_guest async 2009-01-30 12:47:59 +01:00
Volker Lendecke
37da26a06e Add the strlen to push to smb_bytes_push_str, return the converted size
The pushed strlen replaces the STR_TERMINATE flag which I personally always
find very confusing.
2009-01-29 21:38:06 +01:00
Volker Lendecke
7f25e0da73 Decouple clistr_pull from struct cli_state->inbuf 2009-01-26 05:39:34 +01:00
Michael Adam
39ec8791f8 s3: make better use of ccache by not including version.h in every C-file.
version.h changes rather frequently. Since it is included via includes.h,
this means each C file will be a cache miss. This applies to the following
situations:

* When building a new package with a new Samba version

* building in a git branch after calling mkversion.sh
  after a new commit (i.e. virtually always)

This patch improves the situation in the following way:

* remove inlude "version.h" from includes.h

* Use samba_version_string() instead of SAMBA_VERSION_STRING
  in files that use no other macro from version.h instead of
  SAMBA_VERSION_STRING.

* explicitly include "version.h" in those files that use more
  macros from "version.h" than just SAMBA_VERSION_STRING.

Michael
2009-01-15 22:56:01 +01:00
Jeremy Allison
907f085296 Remove smbclient globals that bled into clidfs.c. Now we only have
the connections list and authentication structures to worry about.
Jeremy
2009-01-14 16:08:19 -08:00
Stefan Metzmacher
7d9fd64f38 s3:libsmb: handle the smb signing states the same in the krb5 and ntlmssp cases
SMB signing works the same regardless of the used auth mech.

We need to start with the temp signing ("BSRSPYL ")
and the session setup response with NT_STATUS_OK
is the first signed packet.

Now we set the krb5 session key if we got the NT_STATUS_OK
from the server and then recheck the packet.

All this is needed to make the fallback from krb5 to
ntlmssp possible. This commit also resets the cli->vuid
value to 0, if the krb5 auth didn't succeed. Otherwise
the server handles NTLMSSP packets as krb5 packets.

The restructuring of the SMB signing code is needed to
make sure the krb5 code only starts the signing engine
on success. Otherwise the NTLMSSP fallback could not initialize
the signing engine (again).

metze
2009-01-12 13:22:40 +01:00
Volker Lendecke
b4f8996ac7 Simulate the Windows behaviour to fire 445 and after a timeout 139 2009-01-04 16:42:41 +01:00
Volker Lendecke
19b783cce9 Async wrapper for open_socket_out_send/recv 2009-01-04 16:42:40 +01:00
Volker Lendecke
fafb9ecc61 open_socket_out is always used with SOCK_STREAM, remove argument "type" 2009-01-03 19:22:06 +01:00
Volker Lendecke
4abdd3981e Pass "bytes_alignment" up through cli_request_send
This parameter makes smb_spice_chain add padding before the bytes field
2008-12-19 14:53:29 +01:00
Volker Lendecke
f87da49830 Make cli_negprot async 2008-12-19 10:50:52 +01:00
Volker Lendecke
bb8ca0fdbf Make cli_negprot return NTSTATUS instead of bool 2008-12-19 10:28:30 +01:00
Volker Lendecke
96a3d7be31 cli_negprot_send -> cli_negprot_sendsync 2008-12-19 10:28:20 +01:00
Volker Lendecke
be3d999063 Remove a pointless static variable
Every sane compiler will only allocate "*SMBSERVER" once
2008-12-13 19:21:48 +01:00
Volker Lendecke
b04d00744e Micro-Optimize cliconnect.c
In this form, the prots array is fully read-only in the text segment and thus
can be shared between processes.

Probably pointless, but I had fun doing it :-)
2008-12-13 19:19:45 +01:00
Volker Lendecke
691cf386fb Slightly simplify cli_session_setup_ntlmssp
Remove three pointless variables
2008-12-07 21:30:35 +01:00
Tim Prouty
1eb743ab8e s3: Change sockaddr util function names for consistency
Also eliminates name conflicts with OneFS system libraries
2008-12-03 10:40:20 -08:00
Volker Lendecke
95873566e3 Do not build the session request if it si not used anyway 2008-11-30 12:31:04 +01:00
Volker Lendecke
88909acb6c fix nonempty blank lines 2008-11-30 12:30:51 +01:00
Volker Lendecke
8637716b4b Make use of smb_bufrem() 2008-11-01 19:41:07 +01:00
Jelmer Vernooij
d6a5476ee7 Use sockaddr_storage only where we rely on the size, use sockaddr
otherwise (to clarify we can also pass in structs smaller than
sockaddr_storage, such as sockaddr_in).
2008-10-23 19:53:15 +02:00
Günther Deschner
d9f1fff5b3 s3: use shared asn1 code.
Guenther
2008-10-22 21:37:36 +02:00
Jeremy Allison
617bf10c66 Fix bug #5675 with a varient of Tim Waugh's patch,
as proposed by James Peach.
Jeremy.
(This used to be commit 5c27ad7583)
2008-08-07 17:55:57 -07:00
Jeremy Allison
1c0a9759b9 Fix bug reported by David Eisner <deisner@gmail.com>. When allocating cli
buffers for large read/write - make sure we take account of the large
read/write SMB headers as well as the buffer space.
Jeremy.
(This used to be commit 19519bca9b)
2008-06-02 18:37:16 -07:00
Gerald W. Carter
4d2f71e53f Manually merge Steven Danneman's patch for SPNEGO auth to a trusted
Win2008 domain (merged from v3-0-test).

   commit 8dc4e97977
   Author: Steven Danneman <sdanneman@isilon.com>
   Date:   Wed May 7 13:34:26 2008 -0700

      spnego SPN fix when contacting trusted domains

      cli_session_setup_spnego() was not taking into consideration the situation
      where we're connecting to a trusted domain, specifically one (like W2K8)
      which doesn't return a SPN in the NegTokenInit.

      This caused two problems:

      1) When guessing the SPN using kerberos_get_default_realm_from_ccache() we
      were always using our default realm, not the realm of the domain we're
      connecting to.

      2) When falling back on NTLMSSP for authentication we were passing the name
      of the domain we're connecting to for use in our credentials when we should be
      passing our own workgroup name.

      The fix for both was to split the single "domain" parameter into
      "user_domain" and "dest_realm" parameters.  We use the "user_domain"
      parameter to pass into the NTLM call, and we used "dest_realm" to create an SPN
      if none was returned in the NegTokenInit2 packet.  If no "dest_realm" is
      provided we assume we're connecting to our own domain and use the credentials
      cache to build the SPN.

      Since we have a reasonable guess at the SPN, I removed the check that defaults
      us directly to NTLM when negHint is empty.
(This used to be commit b78b14c88e)
2008-05-23 16:01:45 -05:00
Günther Deschner
611d79d0ed build: fix the build w/o ldap.
Guenther
(This used to be commit a159ec5f1f)
2008-05-06 09:48:16 +02:00
Günther Deschner
4d8836ab96 Fix client authentication with -P switch in client tools (Bug 5435).
Guenther
(This used to be commit d077ef64cd)
2008-05-05 16:59:53 +02:00
Volker Lendecke
9048cafbea Move srv_name_slash from cli_state to rpc_pipe_client
(This used to be commit a9061e52e1)
2008-04-20 00:14:13 +02:00
Günther Deschner
e49200c1a2 Add CLI_FULL_CONNECTION_FALLBACK_AFTER_KERBEROS define.
This allows to switch on the cli->fallback_after_kerberos switch.

Guenther
(This used to be commit 15ba45e567)
2008-04-08 14:25:13 +02:00
Volker Lendecke
aa41d74843 Fix a misleading debug message
(This used to be commit 494b32197f)
2008-04-07 10:20:32 +02:00
Jeremy Allison
1a64916775 When using plaintext ucs2 passwords clistr_push calls ucs2_align, which causes
the space taken by the unicode password to be one byte too
long (as we're on an odd byte boundary here). Reduce the
count by 1 to cope with this. Fixes smbclient against NetApp
servers which can't cope. Fix from
bryan.kolodziej@allenlund.com in bug #3840.
Jeremy.
(This used to be commit 1e7e7d86a1)
2008-04-04 15:28:14 -07:00
Günther Deschner
69b23a39cd Always uppercase cli->srv_name_slash.
Not that I think it is of any importance...

Guenther
(This used to be commit 352f8440c7)
2008-04-04 01:44:43 +02:00
Günther Deschner
5e86a172a5 For convenience reasons, always create cli->srv_name_slash in the rpc_client.
Guenther
(This used to be commit 6363c383d6)
2008-03-12 16:19:56 +01:00
Volker Lendecke
b9f7dd2909 Add explicit buf arg to cli_check_sign_mac
(This used to be commit ffc1c8cc03)
2008-02-28 13:12:34 +01:00
Volker Lendecke
4b5169f590 Add explicit buf arg to cli_encrypt_message and cli_calculate_sign_mac
(This used to be commit db6ae9ed23)
2008-02-28 13:12:34 +01:00
Volker Lendecke
a5e43bc817 Fix typo
(This used to be commit 621db68f32)
2008-02-23 21:40:39 +01:00
Volker Lendecke
b4dd60efa9 Add a missing return
If I'm not completely blind, we should return here. Not doing it here seems not
to be a major flaw, as far as I can see we're only missing the error code. This
might account for some of the very unhelpful NT_STATUS_UNSUCCESSFUL error
messages people see during joins.

All with stake in Samba client, please check!
(This used to be commit eadd15c936)
2008-02-11 18:37:58 +01:00
Jeremy Allison
ffc84a1044 Don't leak memory in error path.
Jeremy.
(This used to be commit 2df0cdaafd)
2008-01-23 15:23:16 -08:00
Jeremy Allison
fe8a8f47e0 Use strchr_m in seaching for '.' in the hostname to make sure we're mb safe.
Jeremy.
(This used to be commit 090061b73a)
2008-01-23 15:00:40 -08:00
Andreas Schneider
cfe7b54e96 Fix Windows 2008 (Longhorn) join.
During 'net ads join' the cli->desthost is a hostname (e.g.
rupert.galaxy.site). Check if we have a hostname and use only the
first part, the machine name, of the string.
(This used to be commit 5f60ed4af6)
2008-01-23 14:57:45 -08:00
Jeremy Allison
afc93255d1 Add SMB encryption. Still fixing client decrypt but
negotiation works.
Jeremy.
(This used to be commit d78045601a)
2007-12-26 17:12:36 -08:00
Günther Deschner
574354a7ec Use ADS_IGNORE_PRINCIPAL define.
Guenther
(This used to be commit 763e13315f)
2007-12-21 14:13:55 +01:00
Volker Lendecke
5f1d36ce9a Fix debug messages
When warning that "client plaintext auth" is not enabled where the server
requested them we should not talk about "client use plaintext auth"
(This used to be commit 7799e18994)
2007-12-19 20:48:45 +01:00
Jeremy Allison
5dbc4a23bc Added patch originally by Andreas Schneider <anschneider@suse.de>
to cause us to behave like Vista when looking for remote
machine principal. Modified by me.
Jeremy.
(This used to be commit d0e33840fb)
2007-12-15 23:22:25 -08:00
Jeremy Allison
e3e16928c0 Allow cliconnect to loop through multiple ip addresses
for a server. We should have been doing this for a while,
but it's more critical with IPv6.
Original patch fixed up by James.
Jeremy.
(This used to be commit 5c7f7629a9)
2007-12-12 09:42:58 -08:00
Jeremy Allison
acf15ae730 Don't build rpctorture anymore - not maintained. Just remove.
Remove all vestiges of pstring (except for smbctool as noted
in previous commit).
Jeremy
(This used to be commit 4c32a22ac5)
2007-12-07 12:26:32 -08:00