1
0
mirror of https://github.com/samba-team/samba.git synced 2025-12-12 12:23:50 +03:00
Commit Graph

1688 Commits

Author SHA1 Message Date
Günther Deschner
10e4211755 r15243: Sorry for the breakage:
* Fix the build without kerberos headers
* Fix memleak in the krb5_address handling

Guenther
2007-10-10 11:16:30 -05:00
Günther Deschner
8b2ba11508 r15240: Correctly disallow unauthorized access when logging on with the
kerberized pam_winbind and workstation restrictions are in effect.

The krb5 AS-REQ needs to add the host netbios-name in the address-list.

We don't get the clear NT_STATUS_INVALID_WORKSTATION code back yet from
the edata of the KRB_ERROR but the login at least fails when the local
machine is not in the workstation list on the DC.

Guenther
2007-10-10 11:16:29 -05:00
Volker Lendecke
4fa5dbcc8d r15227: Fix a valgrind error. We are marshalling here, not unmarshalling.
Jeremy, can you check this? This was part of your -O6 on 64bit sweep.

Volker
2007-10-10 11:16:29 -05:00
Jeremy Allison
bea87e2df4 r15216: Fix the build for machines without krb5. Oops, sorry.
Jeremy.
2007-10-10 11:16:29 -05:00
Jeremy Allison
37ab42afbc r15210: Add wrapper functions smb_krb5_parse_name, smb_krb5_unparse_name,
smb_krb5_parse_name_norealm_conv that pull/push from unix charset
to utf8 (which krb5 uses on the wire). This should fix issues when
the unix charset is not compatible with or set to utf8.
Jeremy.
2007-10-10 11:16:28 -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
Jeremy Allison
93ca3eee55 r15129: Separate out mechanism and policy for NTLMSSP auth/sign/seal.
With this change (and setting lanman auth = no in smb.conf)
we have *identical* NTLMSSP flags to W2K3 in SPNEGO auth.
Jeremy
2007-10-10 11:16:25 -05:00
Jeremy Allison
44b0d856ae r15028: Fix logic error checking valid args to POSIX lock
call.
Jeremy.
2007-10-10 11:15:57 -05:00
Jeremy Allison
08e52ead03 r15018: Merge Volker's ipc/trans2/nttrans changes over
into 3.0. Also merge the new POSIX lock code - this
is not enabled unless -DDEVELOPER is defined.
This doesn't yet map onto underlying system POSIX
locks. Updates vfs to allow lock queries.
Jeremy.
2007-10-10 11:15:57 -05:00
Derrell Lipman
203b4911c1 r14664: r13868@cabra: derrell | 2006-03-22 17:04:30 -0500
Implement enhancement request 3505.  Two additional features are added here.
 There is now a method of saving an opaque user data handle in the smbc_
 context, and there is now a way to request that the context be passed to the
 authentication function.  See examples/libsmbclient/testbrowse.c for an example
 of using these features.
2007-10-10 11:15:42 -05:00
Günther Deschner
d45b9abb0e r14645: No idea how this happened, fixing the build.
Guenther
2007-10-10 11:15:41 -05:00
Günther Deschner
38b18f428b r14643: Merge dcerpc_errstr from Samba 4.
Might need to rework prs_dcerpc_status().

Guenther
2007-10-10 11:15:41 -05:00
Günther Deschner
afc519530f r14585: Tighten argument list of kerberos_kinit_password again,
kerberos_kinit_password_ext provides access to more options.

Guenther
2007-10-10 11:15:38 -05:00
Günther Deschner
aae8f8ae7a r14506: Remove remaining references to a KCM credential cache type.
Guenther
2007-10-10 11:15:35 -05:00
Jeremy Allison
6de5e9ae46 r14418: Try and fix Coverity #39 and #40 by making the
implicit function contract explicit.
Jeremy.
2007-10-10 11:15:29 -05:00
Jeremy Allison
7ada96a1cf r14355: Try and fix Coverity #158 by making the pointer
aliasing clearer. This isn't a bug but a code
clarification.
Jeremy.
2007-10-10 11:15:26 -05:00
Jim McDonough
1043e0d90c r14279: Fix coverity #86, 87, 88, 89:
Free grp_sid and owner_sid before returning.  Also, only allow one group
or owner.
2007-10-10 11:15:23 -05:00
Volker Lendecke
97789ec8fc r14241: Fix Coverity bug # 146 2007-10-10 11:15:19 -05:00
Volker Lendecke
019dff53f9 r14236: Fix Coverity bug # 90 2007-10-10 11:15:19 -05:00
Volker Lendecke
26d471c02c r14235: Fix Coverity bug # 91 2007-10-10 11:15:19 -05:00
Volker Lendecke
8a8d9057d9 r14234: Fix Coverity bug # 93 2007-10-10 11:15:19 -05:00
Volker Lendecke
26377b63a3 r14218: Fix Coverity Bug # 2 2007-10-10 11:15:17 -05:00
Alexander Bokovoy
6b52423033 r14158: Fix coverity CID #147 -- do not dereference pointers before checking their existence 2007-10-10 11:15:14 -05:00
Volker Lendecke
5007f53eb5 r14133: Fix Coverity bug # 140 2007-10-10 11:15:12 -05:00
Volker Lendecke
b824245c4e r14022: Fix Coverity bug # 92 2007-10-10 11:11:06 -05:00
Volker Lendecke
6dc79e6b12 r13991: Fix Coverity bug # 69 2007-10-10 11:11:03 -05:00
Volker Lendecke
86f62484dd r13987: Fix Coverity bug # 74. This tool is good...
Thanks,

Volker
2007-10-10 11:11:03 -05:00
Jeremy Allison
1d710d06a2 r13915: Fixed a very interesting class of realloc() bugs found by Coverity.
realloc can return NULL in one of two cases - (1) the realloc failed,
(2) realloc succeeded but the new size requested was zero, in which
case this is identical to a free() call.

The error paths dealing with these two cases should be different,
but mostly weren't. Secondly the standard idiom for dealing with
realloc when you know the new size is non-zero is the following :

 tmp = realloc(p, size);
 if (!tmp) {
    SAFE_FREE(p);
    return error;
 } else {
    p = tmp;
 }

However, there were *many* *many* places in Samba where we were
using the old (broken) idiom of :

 p = realloc(p, size)
 if (!p) {
    return error;
 }

which will leak the memory pointed to by p on realloc fail.

This commit (hopefully) fixes all these cases by moving to
a standard idiom of :

 p = SMB_REALLOC(p, size)
 if (!p) {
    return error;
 }

Where if the realloc returns null due to the realloc failing
or size == 0 we *guarentee* that the storage pointed to by p
has been freed. This allows me to remove a lot of code that
was dealing with the standard (more verbose) method that required
a tmp pointer. This is almost always what you want. When a
realloc fails you never usually want the old memory, you
want to free it and get into your error processing asap.

For the 11 remaining cases where we really do need to keep the
old pointer I have invented the new macro SMB_REALLOC_KEEP_OLD_ON_ERROR,
which can be used as follows :

 tmp = SMB_REALLOC_KEEP_OLD_ON_ERROR(p, size);
 if (!tmp) {
    SAFE_FREE(p);
    return error;
 } else {
    p = tmp;
 }

SMB_REALLOC_KEEP_OLD_ON_ERROR guarentees never to free the
pointer p, even on size == 0 or realloc fail. All this is
done by a hidden extra argument to Realloc(), BOOL free_old_on_error
which is set appropriately by the SMB_REALLOC and SMB_REALLOC_KEEP_OLD_ON_ERROR
macros (and their array counterparts).

It remains to be seen what this will do to our Coverity bug count :-).

Jeremy.
2007-10-10 11:10:59 -05:00
Jeremy Allison
61901a3f10 r13893: Fix for Coverity issue CID #164. The first one that I don't
think is a direct bug, but some code that needs clarification :-).
Jeremy.
2007-10-10 11:10:59 -05:00
Jeremy Allison
46e1098092 r13889: Fix resource leak on error path. Coverity bug CID #73.
Jeremy.
2007-10-10 11:10:58 -05:00
Derrell Lipman
bb3b15e631 r13763: r13223@cabra: derrell | 2006-02-28 20:48:23 -0500
Add the missing comment about needing to save the new share name.
2007-10-10 11:10:52 -05:00
Derrell Lipman
ad0a725ef5 r13761: r13221@cabra: derrell | 2006-02-28 20:40:56 -0500
When only allowing one connection per server, the cache needs to track which
 share is currently connected, or we never know whether a tdis()/tcon() for the
 new share is required.
2007-10-10 11:10:52 -05:00
Gerald Carter
70e7c9de9d r13676: have to return a value from a non-void function 2007-10-10 11:10:22 -05:00
Gerald Carter
249dba0386 r13671: fix return value in (void)fn() 2007-10-10 11:10:22 -05:00
Jeremy Allison
3de0d9af69 r13669: Get rid of poor errno mapping table. Bounce through NTSTATUS instead.
DO NOT MERGE FOR 3.0.21c PLEASE.
Jeremy.
2007-10-10 11:10:22 -05:00
Jeremy Allison
e81227d044 r13664: Fix the cli_error codes to always detect a socket error.
This code needs a tidyup and common code with libsmb/errormap.c
merging. Should fix the winbindd crash Jerry found (I hope).
Jeremy.
2007-10-10 11:10:22 -05:00
Jeremy Allison
7de1ee1861 r13614: First part of the bugfix for #3510 - net join fails
against server with schannel disabled. Second part
will come tomorrow (fixing net_rpc_join_ok()).
Jeremy.
2007-10-10 11:10:19 -05:00
Gerald Carter
b65be8874a r13571: Replace all calls to talloc_free() with thye TALLOC_FREE()
macro which sets the freed pointer to NULL.
2007-10-10 11:10:14 -05:00
Jeremy Allison
ea82958349 r13553: Fix all our warnings at -O6 on an x86_64 box.
Jeremy.
2007-10-10 11:10:13 -05:00
Jeremy Allison
a2fb436fc5 r13539: Add 128 bit creds processing client and server. Thanks to Andrew Bartlett's
Samba4 code.
Jeremy.
2007-10-10 11:10:11 -05:00
Jeremy Allison
80f4868944 r13519: Fix the credentials chaining across netlogon pipe disconnects.
I mean it this time :-).
Jeremy.
2007-10-10 11:10:09 -05:00
Jeremy Allison
654bb9853b r13502: Fix error messages for usershares when smbd is not
running. More generic error return cleanup in libsmb/
needs doing (everything returning NTSTATUS not BOOL).
Jeremy
2007-10-10 11:10:07 -05:00
Günther Deschner
c0d91f9d19 r13495: Derell, I'm removing that double setup_logging(), just a typo.
Guenther
2007-10-10 11:10:06 -05:00
Jeremy Allison
4204794cc7 r13489: Fix #3496 from jason@ncac.gwu.edu. Variable set but never used.
Jeremy.
2007-10-10 11:10:06 -05:00
Volker Lendecke
c15f1d553f r13477: Fix code before declaration 2007-10-10 11:10:05 -05:00
Jeremy Allison
b9b8cd1752 r13473: Back port r13470, r13471, r13472 from Samba4. Thanks Andrew:
-----------------------------------
Thanks to a report from VL:

We were causing mayhem by weakening the keys at the wrong point in time.

I think this is the correct place to do it.  The session key for SMB
signing, and the 'smb session key' (used for encrypting password sets)
is never weakened.

The session key used for bulk data encryption/signing is weakened.

This also makes more sense, when we look at the NTLM2 code.

Andrew Bartlett
-----------------------------------
With more 'try all options' testing, I found this 'simple' but in the
NTLM2 signing code.

Andrew Bartlett
-----------------------------------
After Volker's advise, try every combination of parameters.  This
isn't every parameter on NTLMSSP, but it is most of the important
ones.

This showed up that we had the '128bit && LM_KEY' case messed up.
This isn't supported, so we must look instead at the 56 bit flag.

Andrew Bartlett
-----------------------------------

We should now try retesting with NT4. This should be standalone
enough to port into a SAMBA_3_0_RELEASE branch fix.

Jeremy.
2007-10-10 11:10:05 -05:00
Jeremy Allison
5b3c2e63c7 r13407: Change the credentials code to be more like the Samba4 structure,
makes fixes much easier to port. Fix the size of dc->sess_key to
be 16 bytes, not 8 bytes - only store 8 bytes in the inter-smbd
store in secrets.tdb though. Should fix some uses of the dc->sess_key
where we where assuming we could read 16 bytes.
Jeremy.
2007-10-10 11:09:59 -05:00
Jeremy Allison
205db6968a r13396: Add in userinfo26, re-enable userinfo25 - took the knowledge
from Samba4 on how to decode the 532 byte password buffers.
Getting closer to passing samba4 RPC-SCHANNEL test.
Jeremy.
2007-10-10 11:09:59 -05:00
Jeremy Allison
2aed5b3640 r13331: No I didn't have to change the interface version...
Jeremy.
2007-10-10 11:06:25 -05:00
Jeremy Allison
dbe2572d1c r13329: Fix libsmbsharemodes.so to work with the stored delete token.
Less trouble than I thought plus it didn't need an interface
change (thank goodness !).
Jeremy.
2007-10-10 11:06:25 -05:00