1
0
mirror of https://github.com/samba-team/samba.git synced 2025-06-18 19:17:08 +03:00

228 Commits

Author SHA1 Message Date
Jeremy Allison
19519bca9b 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.
2008-06-02 18:37:16 -07:00
Gerald W. Carter
b78b14c88e Manually merge Steven Danneman's patch for SPNEGO auth to a trusted
Win2008 domain (merged from v3-0-test).

   commit 8dc4e979776aae0ecaa74b51dc1eac78a7631405
   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.
2008-05-23 16:01:45 -05:00
Günther Deschner
a159ec5f1f build: fix the build w/o ldap.
Guenther
2008-05-06 09:48:16 +02:00
Günther Deschner
d077ef64cd Fix client authentication with -P switch in client tools (Bug 5435).
Guenther
2008-05-05 16:59:53 +02:00
Volker Lendecke
a9061e52e1 Move srv_name_slash from cli_state to rpc_pipe_client 2008-04-20 00:14:13 +02:00
Günther Deschner
15ba45e567 Add CLI_FULL_CONNECTION_FALLBACK_AFTER_KERBEROS define.
This allows to switch on the cli->fallback_after_kerberos switch.

Guenther
2008-04-08 14:25:13 +02:00
Volker Lendecke
494b32197f Fix a misleading debug message 2008-04-07 10:20:32 +02:00
Jeremy Allison
1e7e7d86a1 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.
2008-04-04 15:28:14 -07:00
Günther Deschner
352f8440c7 Always uppercase cli->srv_name_slash.
Not that I think it is of any importance...

Guenther
2008-04-04 01:44:43 +02:00
Günther Deschner
6363c383d6 For convenience reasons, always create cli->srv_name_slash in the rpc_client.
Guenther
2008-03-12 16:19:56 +01:00
Volker Lendecke
ffc1c8cc03 Add explicit buf arg to cli_check_sign_mac 2008-02-28 13:12:34 +01:00
Volker Lendecke
db6ae9ed23 Add explicit buf arg to cli_encrypt_message and cli_calculate_sign_mac 2008-02-28 13:12:34 +01:00
Volker Lendecke
621db68f32 Fix typo 2008-02-23 21:40:39 +01:00
Volker Lendecke
eadd15c936 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!
2008-02-11 18:37:58 +01:00
Jeremy Allison
2df0cdaafd Don't leak memory in error path.
Jeremy.
2008-01-23 15:23:16 -08:00
Jeremy Allison
090061b73a Use strchr_m in seaching for '.' in the hostname to make sure we're mb safe.
Jeremy.
2008-01-23 15:00:40 -08:00
Andreas Schneider
5f60ed4af6 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.
2008-01-23 14:57:45 -08:00
Jeremy Allison
d78045601a Add SMB encryption. Still fixing client decrypt but
negotiation works.
Jeremy.
2007-12-26 17:12:36 -08:00
Günther Deschner
763e13315f Use ADS_IGNORE_PRINCIPAL define.
Guenther
2007-12-21 14:13:55 +01:00
Volker Lendecke
7799e18994 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"
2007-12-19 20:48:45 +01:00
Jeremy Allison
d0e33840fb 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.
2007-12-15 23:22:25 -08:00
Jeremy Allison
5c7f7629a9 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.
2007-12-12 09:42:58 -08:00
Jeremy Allison
4c32a22ac5 Don't build rpctorture anymore - not maintained. Just remove.
Remove all vestiges of pstring (except for smbctool as noted
in previous commit).
Jeremy
2007-12-07 12:26:32 -08:00
Jeremy Allison
cc257b71d1 Remove PSTRING_LEN from smbd/ nmbd/.
Remove pstring from libsmb/clidfs.c except for a nasty
hack (that will be removed when pstrings are gone from
client/).
Jeremy.
2007-11-29 17:25:41 -08:00
Jeremy Allison
ba9e2be2b5 Remove the explicit TALLOC_CTX * from cli_struct.
Make us very explicit about how long a talloc ctx
should last.
Jeremy.
2007-11-29 13:24:54 -08:00
Volker Lendecke
329c688e4a Remove a static fstring
I'm not sure why this used to be static, to me it seems that every time this
variable is overwritten. I just don't see how name_status_find() could return
true and not overwrite name. Can someone please review this and potentially
check it in?

Thanks,

Volker
2007-11-11 13:14:06 -08:00
Volker Lendecke
814bed029e Remove the silly "user_socket_options" global variable
This is better done with a 'lp_do_parameter(-1, "socket options", ..);
2007-11-09 15:11:54 +01:00
Jeremy Allison
7a1de5b44e Remove more pstring/fstrings.
Jeremy.
2007-11-08 18:50:07 -08:00
Jeremy Allison
d50d14c300 Remove the smb_read_error global variable and replace
it with accessor functions. "One global or pstring a day...." :-).
Jeremy.
2007-11-03 15:12:42 -07:00
Jeremy Allison
2e92418a13 Change all occurrences of zero_addr(&ss,AF_INET) to
zero_addr(&ss). All current uses were always of the
AF_INET form, so simplify the call. If in the future
we need to zero an addr to AF_INET6 this can be
done separately.
Jeremy.
2007-10-27 20:29:36 -07:00
Jeremy Allison
98e154c312 This is a large patch (sorry). Migrate from struct in_addr
to struct sockaddr_storage in most places that matter (ie.
not the nmbd and NetBIOS lookups). This passes make test
on an IPv4 box, but I'll have to do more work/testing on
IPv6 enabled boxes. This should now give us a framework
for testing and finishing the IPv6 migration. It's at
the state where someone with a working IPv6 setup should
(theorecically) be able to type :
smbclient //ipv6-address/share
and have it work.
Jeremy.
2007-10-24 14:16:54 -07:00
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
Jeremy Allison
3f6bd0e1ec Add start of IPv6 implementation. Currently most of this is avoiding
IPv6 in winbindd, but moves most of the socket functions that were
wrongly in lib/util.c into lib/util_sock.c and provides generic
IPv4/6 independent versions of most things. Still lots of work
to do, but now I can see how I'll fix the access check code.
Nasty part that remains is the name resolution code which is
used to returning arrays of in_addr structs.
Jeremy.
2007-10-10 18:25:16 -07:00
Gerald (Jerry) Carter
5c6c8e1fe9 [GLUE] Rsync SAMBA_3_2_0 SVN r25598 in order to create the v3-2-test branch. 2007-10-10 15:34:30 -05:00
Gerald Carter
00a93ed336 r25407: Revert Longhorn join patch as it is not correct for the 3.2 tree.
The translate_name() used by cli_session_setup_spnego() cann rely
Winbindd since it is needed by the join process (and hence before
Winbind can be run).
2007-10-10 12:31:03 -05:00
Gerald Carter
8304ccba73 r25400: Windows 2008 (Longhorn) Interop fixes for AD specific auth2 flags,
and client fixes.  Patch from Todd Stetcher <todd.stetcher@isilon.com>.
2007-10-10 12:31:02 -05:00
Günther Deschner
8300aac494 r24737: Remove older TODO: Convert internal_resolve_name() and friends to NTSTATUS.
Guenther
2007-10-10 12:30:16 -05:00
Jeremy Allison
fa8e66dd8d r24281: Fix bug found by Herb. The vuid entry in the cli_state structure gets
left as nonzero as returned by the failed cli_session_setup_spnego. When we then try
to authenticate as the user in cli_session_setup this returns an
error "Bad userid" (as seen in wireshark).
"We should only leave cli->vuid != 0 on success. Looks like it's
getting set in the cli_session_setup_blob_receive() call and not
cleared again on error."
Jeremy.
2007-10-10 12:29:25 -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
073fdc5a58 r23554: Fix bug #4711 by makeing cli_connect return an NTSTATUS.
Long overdue fix....
Jeremy.
2007-10-10 12:23:28 -05:00
Jeremy Allison
a398bdf08d r22950: Fix the issue Volker reported here :
"Attempt to fix some build farm failures: On port 139 the first
successful packet gives len==0 from the server, so the = in

        if (len <= 0) {

in line 136 of clientgen.c throws a failure."

The irritating thing is that I already had it correct in
SAMBA_3_0_26 and forgot to merge the change across.

len == 0 is a valid return - I messed that up when
converting client_receive_smb() to return a length
rather than a BOOL.

Doh !

Jeremy.
2007-10-10 12:22:11 -05:00
Volker Lendecke
9c5111d8c5 r22929: Attempt to fix some build farm failures: On port 139 the first
successful packet gives len==0 from the server, so the = in

        if (len <= 0) {

in line 136 of clientgen.c throws a failure.

Jeremy, please fix this properly, I'm not merging this to 3_0_26 so that
you can filter it when you merge.

Volker
2007-10-10 12:22:10 -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
Günther Deschner
65a2701f36 r22644: Fix memleak.
Guenther
2007-10-10 12:19:52 -05:00
Jeremy Allison
2d80a96120 r22391: Looks bigger than it is. Make "inbuf" available
to all callers of smb_setlen (via set_message()
calls). This will allow the server to reflect back
the correct encryption context.
Jeremy.
2007-10-10 12:19:30 -05:00
Jeremy Allison
137953226a r22122: Start to fix csc issue with Vista. Make smbd support
the extended 7 word response for tconX rather than the
3 word one we supported previously.
Jeremy.
2007-10-10 12:19:14 -05:00
Stefan Metzmacher
e9f2aa22f9 r22092: - make spnego_parse_auth_response() more generic and
not specific for NTLMSSP
- it's possible that the server sends a mechOID and authdata
  if negResult != SPNEGO_NEG_RESULT_INCOMPLETE, but we still
  force the mechOID to be present if negResult == SPNEGO_NEG_RESULT_INCOMPLETE

metze
2007-10-10 12:19:10 -05:00
Jeremy Allison
ffa3a5c508 r21990: Stop messing with the signing engine just because
we're encrypted. This will make further changes and
spec much more clear.
Jeremy.
2007-10-10 12:18:57 -05:00
Jeremy Allison
1b828f051d r21922: Fixed the build by rather horrid means. I really need
to restructure libsmb/smb_signing.c so it isn't in
the base libs path but lives in libsmb instead (like
smb_seal.c does).
Jeremy.
2007-10-10 12:18:49 -05:00