1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-22 05:57:43 +03:00

1125 Commits

Author SHA1 Message Date
Jeremy Allison
a6cb7af9ba Make SMB_FILE_ACCESS_INFORMATION call work correctly.
Jeremy.
-
Jeremy Allison
fb4249e7d1 Make us bug-for-bug compatible with W2K3 - to get delete on close semantics
on an initial open the desired_access field *must* contain DELETE_ACCESS,
simply having it map from a GENERIC_ALL won't do. Fixes delete on close test.
Jeremy.
-
Tim Potter
90ae366744 AIX has already has a function called msleep(). Bugzilla #1098. -
Jeremy Allison
4920f9bd66 More paranoia checks.
Jeremy.
-
Jeremy Allison
35bbc818ad Paranoia fixes :-).
Jeremy.
-
Jeremy Allison
e7a25c1e2e Fix for possible crash bug from Sebastian Krahmer (SuSE).
Jeremy.
-
Andrew Bartlett
33cdb2bd18 (merge from 3.0)
Remove more unused portions of the 'password cache'.

Andrew Bartlett
-
Andrew Bartlett
c29c28e4cf (merge from 3.0)
Remove more unused functions - this time parts of the 'password cache'.

Andrew Bartlett
-
Andrew Bartlett
af8248e67b (merge from 3.0)
Remove unused utility function.

Andrew Bartlett
-
Andrew Bartlett
5335b9d5eb (merge from 3.0)
Make get_dc_list static - we only ask for a sorted list externally.

Andrew Bartlett
-
Jeremy Allison
be60768e64 Fix up name canonicalization (needed for krb5 keytab support later).
Remove source_env handler (no longer used in any codepath).
Jeremy.
-
Andrew Bartlett
8063b8b6c2 (merge from 3.0)
This adds client-side support for the unicode/SAMR password change scheme.

As well as avoiding DOS charset issues, this scheme returns useful error
codes, that we can map back via the pam interface.

This patch also cleans up the interfaces used for password buffers, to
avoid duplication of code.

Andrew Bartlett
-
Andrew Bartlett
40cc86d4b3 (merge from 3.0)
Fix the initialisation vectors for NTLM2, so that they at least make sense,
even if they don't work yet.

Andrew Bartlett
-
Jeremy Allison
b84d249e67 Fix for a signing bug when the mid wraps.
Found by Fran Fabrizio <fran@cis.uab.edu>.
Add to the *start* of the list not the end of the list.
This ensures that the *last* send sequence with this mid
is returned by preference.
This can happen if the mid wraps and one of the early
mid numbers didn't get a reply and is still lurking on
the list.
Jeremy.
-
Gerald Carter
f452585073 * 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
-
Gerald Carter
93fed3074f * allow dns lookups to be disabled for DOMAIN#1c (and #1b)
names
* fix some a mispelled variable name
-
Gerald Carter
c98399e3c9 sync HEAD with recent changes in 3.0 -
Gerald Carter
2279e98cb8 fix some warnings from the Sun compiler; also merge some of abartlet's error code changes form 3.0 -
Andrew Bartlett
f7d39c7877 Merge NTLMSSP fixes from 3.0 to HEAD.
Andrew Bartlett
-
Andrew Bartlett
4c3bd0a99e (merge from 3.0)
Change our Domain controller lookup routines to more carefully seperate
DNS names (realms) from NetBIOS domain names.

Until now, we would experience delays as we broadcast lookups for DNS names
onto the local network segments.

Now if DNS comes back negative, we fall straight back to looking up the
short name.

Andrew Bartlett
-
Andrew Bartlett
326becbde2 (merge from 3.0)
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
-
Andrew Bartlett
acacd27ba2 (merge from 3.0)
auth/auth_util.c:
 - Fill in the 'backup' idea of a domain, if the DC didn't supply one.  This
   doesn't seem to occour in reality, hence why we missed the typo.

lib/charcnv.c:
lib/smbldap.c:
libads/ldap.c:
libsmb/libsmbclient.c:
printing/nt_printing.c:
 - all the callers to pull_utf8_allocate() pass a char ** as the first
   parammeter, so don't make them all cast it to a void **

nsswitch/winbind_util.c:
 - Allow for a more 'correct' view of when usernames should be qualified
   in winbindd.  If we are a PDC, or have 'winbind trusted domains only',
   then for the authentication returns stip the domain portion.
 - Fix valgrind warning about use of free()ed name when looking up our
   local domain.  lp_workgroup() is maniplated inside a procedure that
   uses it's former value.  Instead, use the fact that our local domain is
   always the first in the list.

--

Jerry rightly complained that we can't assume that the first domain is
our primary domain - new domains are added to the front of the list. :-(

Use a much more reliable 'flag test' instead.  (note:  changes winbind
structures, make clean).

--

Forgot to commit this for the 'get our primary domain' change.

Andrew Bartlett
-
Andrew Bartlett
2f196bb31a (merge from 3.0)
Move our basic password checking code from inside the authentication
subsystem into a seperate file - ntlm_check.c.

This allows us to call these routines from ntlm_auth.  The purpose of this
exercise is to allow ntlm_auth (when operating as an NTLMSSP server) to
avoid talking to winbind.  This should allow for easier debugging.

ntlm_auth itself has been reorgainised, so as to share more code between
the SPNEGO-wrapped and 'raw' NTLMSSP modes.  A new 'client' NTLMSSP mode
has been added, for use with a Cyrus-SASL module I am writing (based on vl's
work)

Andrew Bartlett
-
Andrew Bartlett
77b3515981 (merge from 3.0)
Shutting down the connection closes outstanding sessions, so we don't need
to do it twice...

Amdrew Bartlett
-
Volker Lendecke
8a82060e3a 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
-
Jeremy Allison
3e6abeffe1 Add in comments explaining NTLMv2 selection. Use lm session key if that's
all there is.
Jeremy.
-
Jeremy Allison
6cd0f6e7c0 Tidyup debug message in ntlmssp code. Add brackets around dodgy if statement.
Jeremy
-
Gerald Carter
14558c942b Make sure we correctly generate the lm session key.
This fixes a problem joining a Samba domain from a
vanilla win2k client that doesn't set the
NTLMSSP_NEGOTIATE_NTLM2 flag.

Reported on samba ml as "decode_pw: incorrect password length"
when handling a samr_set_userinfo(23 or 24) RPC.
-
Jeremy Allison
08b6b1e43c Make intent to return only one address clear.
Jeremy.
-
Andrew Bartlett
e97f1eb62a Merge from 3.0:
source/libsmb/ntlmssp.c:
Picked up by the build farm - despite all my efforts, security=server was
broken by my NTLM2 commit.  This should correctly cause the NTLM2 case
not to be negotiated when 'security=server' is in effect.

testsuide/build_farm/runlist:
Without 'non unix accounts' we can't test security=domain on the build farm.

source/rpc_server/srv_samr_nt.c:
Match Win2k and return 'invalid parameter' for creating of a new account with
account flags of 0.

Andrew Bartlett
-
Jeremy Allison
b5f32a0869 Client connect signing error messages should be level zero else
they're easy to miss.
Jeremy.
-
Jeremy Allison
fd71acd1ff Fix spurious error msg. when seq=0.
Jeremy.
-
Jeremy Allison
e5bb3fdf4c Ensure we use the same mid for the secondary trans requests, W2K3
does this.
Jeremy.
-
Jeremy Allison
c662e2dbc4 Better fix for client signing bug. Ensure we don't malloc/free trans signing
state info each packet.
Jeremy.
-
Jeremy Allison
315f25fc17 Fix signing bug with secondary client trans requests. Turns out the last
packet is the one that matters for checking the signing replies. Need to
check the server code does this correctly too....
Bug #832 reported by Volker.
Jeremy.
-
Andrew Bartlett
ba94e4a1ab Merge from 3.0:
- NTLM2 fixes, don't force NTLM2
 - Don't use NTLM2 for RPC, it doesn't work yet
 - Add comments to winbindd_pam.c
 - Merge 64 bit fixes and better debug messages in winbindd.c

Andrew Bartlett
-
Jeremy Allison
2a00d538da If signing starts successfully, don't just turn it off automatically if
it fails later. Only turn it off automatically if it fails at the start.
Jeremy.
-
Jeremy Allison
ab5db8873e When server signing is set to "auto", if the client doesn't sign just
ignore it. Only fail if signing is set to "required".
Jeremy.
-
Andrew Bartlett
1287cf5f92 Merge from 3.0:
Add support for variable-length session keys in our client code.

This means that we now support 'net rpc join' with KRB5 (des based)
logins.  Now, you need to hack 'net' to do that, but the principal is
important...

When we add kerberos to 'net rpc', it should be possible to still do
user management and the like over RPC.

-

Add server-side support for variable-length session keys (as used by
DES based krb5 logins).

Andrew Bartlett
-
Andrew Bartlett
57a895aaab (merge from 3.0)
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...

Andrew Bartlett
-
Gerald Carter
52c1973f39 debug and swat fixes from 3.0 -
Tim Potter
a6cc763333 Merge of 64-bit printf warning fixes. -
Jeremy Allison
13d32f561b Fix coredump in cli_get_backup_list.
Jeremy.
-
Tim Potter
e32826980e Merge from 3.0:
Revision 1.50.2.12:

    Put in a work-around for ENOTSUP not being defined on OpenBSD.

  Revision 1.50.2.10-11

    Apply latest of Derrell Lippman's changes to libsmbclient.

    Commit Derrell's changes to libsmbclient plus a small change to
    configure.in to see if SGI and other platforms will build.
-
Tim Potter
c0585399ac Merge from 3.0:
Revision 1.2.2.5:

    Remove some unused variables uncovered by the build farm.
-
Jeremy Allison
124a8ddae6 Fixes to check for wraps which could cause coredumps.
Jeremy.
-
Volker Lendecke
73fc6da6cf Merge from 3_0:
According to Ethereal we have a 32-Bit quantity here. And with SSVAL valgrind
reports an unitialized read which is obviously correct. And I hate valgrind
errors ;-)

Volker
-
Richard Sharpe
8e3d2708c5 Apply the changes to libsmbclient that derrell has contributed. Fix some
of the problems with this.

From: Derrell.Lipman@unwireduniverse.com
-
Jeremy Allison
5c050a735f Put strcasecmp/strncasecmp on the banned list (except for needed calls
in iconv.c and nsswitch/). Using them means you're not thinking about multibyte at
all and I really want to discourage that.
Jeremy.
-
Jeremy Allison
8458f4c52f Fix for bug #64, Win9x Nexus tools not working against Samba3.0. Missing
map in errormap for ERROR_MORE_DATA -> ERRDOS, ERRmoredata.
Jeremy.
-