1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-04 17:47:26 +03:00

756 Commits

Author SHA1 Message Date
Andrew Tridgell
71cbe28734 r4758: - added async support to the session request code
- added async support to the negprot client code

- removed two unused parameters from smbcli_full_connection() code

- converted smbclient to use smbcli_full_connection() rather than
  reinventing everything itself
2007-10-10 13:08:50 -05:00
Andrew Tridgell
468f8ebbfd r4757: added the ability of the clisocket level of libcli to handle async
socket connections. This was complicated by a few factors:

 - it meant moving the event context from clitransport to clisocket,
   so lots of structures changed

 - we need to asynchronously handle connection to lists of port
   numbers, not just one port number. The code internally tries each
   port in the list in turn, without ever blocking

 - the man page on how connect() is supposed to work asynchronously
   doesn't work in practice (now why doesn't this surprise me?). The
   getsockopt() for SOL_ERROR is supposed to retrieve the error, but
   in fact the next (unrelated) connect() call on the same socket also
   gets an error, though not the right error. To work around this I
   need to tear down the whole socket between each attempted port. I
   hate posix.

Note that clisocket.c still does a blocking name resolution call in
smbcli_sock_connect_byname(). That will be fixed when we add the async
NBT resolution code.

Also note that I arranged things so that every SMB connection is now
async internally, so using plain smbclient or smbtorture tests all the
async features of this new code.
2007-10-10 13:08:50 -05:00
Andrew Tridgell
cae7748d67 r4755: the recent change in the definition of lp_passwordserver() breaks this
old code, so I'm just removing it, as it needs replacing anyway
2007-10-10 13:08:50 -05:00
Andrew Tridgell
4f6055b4fb r4754: tidied up the composite function infrastructure to make it easier to
have composite functions that are not made up of functions that
operate on smbcli_request structures.
2007-10-10 13:08:50 -05:00
Stefan Metzmacher
8308da6ce4 r4726: - use the name tcon and tid instead of conn and cnum
- make use of talloc destructors

metze
2007-10-10 13:08:48 -05:00
Andrew Tridgell
ef4dbc443d r4710: added a smb_composite_savefile() function, and expanded the test suite a little 2007-10-10 13:08:46 -05:00
Stefan Metzmacher
9db0d19413 r4701: remove debugs
metze
2007-10-10 13:08:45 -05:00
Andrew Tridgell
516f68fb05 r4700: first attempt at a composite async function, smb_composite_loadfile(),
which combineds ntcreatex, readx and close into a single call that
behaves just like a normal libcli async call.
2007-10-10 13:08:45 -05:00
Andrew Bartlett
a062ac122c r4692: Make the client SPNEGO code bail out in a couple more cases.
Andrew Bartlett
2007-10-10 13:08:44 -05:00
Andrew Bartlett
ded3303352 r4682: A LDB-based secrets implementation in Samba4.
This uses LDB (a local secrets.ldb and the global samdb) to fill out
the secrets from an LSA perspective.

Some small changes to come, but the bulk of the work is now done.

A re-provision is required after this change.

Andrew Bartlett
2007-10-10 13:08:42 -05:00
Andrew Bartlett
2e16f3a8d3 r4658: (grr, commited wrong file last time).
We really should have a seperate structure for this (the ARCFOUR
sbox), but for now, get the declaration right.

Andrew Bartlett
2007-10-10 13:08:39 -05:00
Stefan Metzmacher
b6543a6e30 r4650: - make more use of bitmap and enum's
- move some structs out of misc.idl

metze
2007-10-10 13:08:39 -05:00
Andrew Bartlett
c6fcb33a88 r4641: Push a few more details into the schannel ldb, and into the
credentials struct it maintains.

Clearly much of this will be replaced with some system to pass and
store the session_info, as that is the 'right way' to handle this.

Andrew Bartlett
2007-10-10 13:08:38 -05:00
Andrew Bartlett
43e3516fc0 r4635: Fix NTLMSSP to return NT_STATUS_OK when it has constructed the auth
token in the client (the final token in the negotiation).

Consequential fixes in the SPNEGO code, which now uses the out.length
as the indicator of 'I need to send something to the other side'.

Merge the NTLM and SPNEGO DCE-RPC authentication routines in the client.

Fix the RPC-MULTIBIND test consequent to this merge.

Andrew Bartlett
2007-10-10 13:08:37 -05:00
Stefan Metzmacher
3c0d16b823 r4620: - add interface functions to the auth subsystem so that callers doesn't need to
use function pointers anymore
- make the module init much easier
- a lot of cleanups

don't try to read the diff in auth/ better read the new files

it passes test_echo.sh and test_rpc.sh

abartlet: please fix spelling fixes

metze
2007-10-10 13:08:34 -05:00
Andrew Tridgell
dd1c54add8 r4618: - tidied up the alter_context client code a bit
- there is no alter_nak or alter_ack packet, its all done in an
  alter_response

- auto-allocated the contex_ids

- tried to fix up the dcom code to work again with
  alter_context. Jelmer, please take a look :)
2007-10-10 13:08:34 -05:00
Andrew Tridgell
4004c69937 r4616: the first phase in the addition of proper support for
dcerpc_alter_context and multiple context_ids in the dcerpc client
library.

This stage does the following:

 - split "struct dcerpc_pipe" into two parts, the main part being "struct dcerpc_connection", which
   contains all the parts not dependent on the context, and "struct dcerpc_pipe" which has
   the context dependent part. This is similar to the layering in libcli_*() for SMB

 - disable the current dcerpc_alter code. I've used a #warning until i
   get the 2nd phase finished. I don't know how portable #warning is, but
   it won't be long before I add full alter context support anyway, so it won't last long

 - cleanup the allocation of dcerpc_pipe structures. The previous code
   was quite awkward.
2007-10-10 13:08:34 -05:00
Andrew Tridgell
6e7754abd0 r4591: - converted the other _p talloc functions to not need _p
- added #if TALLOC_DEPRECATED around the _p functions

- fixes the code that broke from the above

while doing this I fixed quite a number of places that were
incorrectly using the non type-safe talloc functions to use the type
safe ones. Some were even doing multiplies for array allocation, which
is potentially unsafe.
2007-10-10 13:08:30 -05:00
Andrew Tridgell
f4337c988c r4589: forgot to commit the new NT_STATUS_RPC_PROTSEQ_NOT_SUPPORTED error code 2007-10-10 13:08:30 -05:00
Andrew Bartlett
5598cda08b r4565: Make the order of the initialisation more sensible.
Andrew Bartlett
2007-10-10 13:08:28 -05:00
Andrew Tridgell
89b74b5354 r4549: got rid of a lot more uses of plain talloc(), instead using
talloc_size() or talloc_array_p() where appropriate.

also fixed a memory leak in pvfs_copy_file() (failed to free a memory
context)
2007-10-10 13:08:25 -05:00
Andrew Tridgell
e6c81d7c9f r4547: - added talloc_new(ctx) macro that is a neater form of the common talloc(ctx, 0) call.
- cleaned up some talloc usage in various files

I'd like to get to the point that we have no calls to talloc(), at
which point we will rename talloc_p() to talloc(), to encourage
everyone to use the typesafe functions.
2007-10-10 13:08:20 -05:00
Andrew Bartlett
a742ea1e12 r4531: Include the OID locally, as it seems to be hard to get the includes
right.

Andrew Bartlett
2007-10-10 13:08:18 -05:00
Andrew Bartlett
c7acea9d5a r4530: Start adding a bit of Doxygen compatible documentation comments to GENSEC.
Andrew Bartlett
2007-10-10 13:08:18 -05:00
Andrew Bartlett
18850c66b7 r4504: Setting
.enabled = True

on modules we know are good (and we want on be default) seems neater.

Andrew Bartlett
2007-10-10 13:08:16 -05:00
Andrew Bartlett
43558eaf76 r4500: Allow GENSEC modules to be disabled by setting a flag on their module
definition, not by hardcoded reference in loadparm.c

Andrew Bartlett
2007-10-10 13:08:15 -05:00
Andrew Bartlett
4b52409e38 r4499: Almost make our Samba4 server pass the RPC-SAMLOGON torture test.
I just need to fix a couple of NTLMv2 issues before we can fully pass,
and put this in test_rpc.sh, as a 'should pass' test.

Andrew Bartlett
2007-10-10 13:08:15 -05:00
Andrew Bartlett
9ff8b2b4d1 r4494: Allow gensec_gssapi to use the SPNEGO mech provided by Heimdal (off by
default at this point), and include the GSSAPI OIDs in our source, per
advice by lha that this is easier than getting the includes right.

Andrew Bartlett
2007-10-10 13:08:12 -05:00
Andrew Bartlett
2b0605dbae r4470: Try not to have GSSAPI built unless we detected krb5. We should split
these tests out a bit, but for now it's an indicator we can use.

Andrew Bartlett
2007-10-10 13:07:55 -05:00
Andrew Bartlett
14b650c85d r4460: Add a new GENSEC module: gensec_gssapi
(disabled by default, set parametric option: gensec:gssapi=yes to enable).

This module backs directly onto GSSAPI, and allows us to sign and seal
GSSAPI/Krb5 connections in particular.  This avoids me reinventing the
entire GSSAPI wheel.

Currently a lot of things are left as default - we will soon start
specifiying OIDs as well as passwords (it uses the keytab only at the
moment).  Tested with our LDAP-* torture tests against Win2k3.

My hope is to use this module to access the new SPNEGO implementation
in Heimdal, to avoid having to standards-verify our own.

Andrew Bartlett
2007-10-10 13:07:53 -05:00
Andrew Bartlett
9923c3bc1b r4459: GENSEC refinements:
In developing a GSSAPI plugin for GENSEC, it became clear that the API
needed to change:
 - GSSAPI exposes only a wrap() and unwrap() interface, and determines
   the location of the signature itself.
 - The 'have feature' API did not correctly function in the recursive
   SPNEGO environment.

As such, NTLMSSP has been updated to support these methods.

The LDAP client and server have been updated to use the new wrap() and
unwrap() methods, and now pass the LDAP-* tests in our smbtorture.
(Unfortunely I still get valgrind warnings, in the code that was
previously unreachable).

Andrew Bartlett
2007-10-10 13:07:53 -05:00
Andrew Tridgell
9f0bf657ae r4446: attempt to fix the build - andrew, can you check I've done this right? 2007-10-10 13:07:51 -05:00
Andrew Bartlett
e15dbee006 r4441: gensec_krb5 update:
- Use more of the clikrb5.c wrapper calls

 - Don't use the session keytab if we kinit for the user.

Andrew Bartlett
2007-10-10 13:07:50 -05:00
Stefan Metzmacher
02861f6305 r4435: add another error code
metze
2007-10-10 13:07:49 -05:00
Stefan Metzmacher
74e65680fa r4431: add WERR_NET_NAME_NOT_FOUND
metze
2007-10-10 13:07:48 -05:00
Andrew Tridgell
81630d3014 r4429: the owner of a file always gets SEC_STD_DELETE 2007-10-10 13:07:48 -05:00
Stefan Metzmacher
c981808ed4 r4419: move security_token stuff to the libcli/security/
and debug privileges

metze
2007-10-10 13:07:47 -05:00
Andrew Tridgell
b9284c16dc r4413: login failure doesn't warrant a level 1 debug (its filling my logs during torture tests) 2007-10-10 13:07:45 -05:00
Andrew Tridgell
e4ee8b776b r4404: check for SEC_ACE_FLAG_INHERIT_ONLY in the "maximum allowed" logic 2007-10-10 13:07:43 -05:00
Andrew Tridgell
fdb38c8e4b r4388: - allow ACE flags to be specified in security_descriptor_create()
- added a test for all combinations of the inheritance ACE flags and how
  they are propogated to child directories and files
2007-10-10 13:07:41 -05:00
Andrew Bartlett
13aa88ed65 r4386: Grr, fix copy-and-paste bug.
Andrew Bartlett
2007-10-10 13:07:41 -05:00
Andrew Bartlett
722f59c7c8 r4385: Set the correct target service.
Andrew Bartlett
2007-10-10 13:07:41 -05:00
Andrew Tridgell
b3b8958a18 r4364: - added support for testing of chained SMB operations in smbtorture
- added test for chained OpenX/ReadX, simulating the OS/2 workplace shell

- fixed a bug in handling chained fnum in openx and ntcreatex in the server

(yes, I'm on holiday, but this bug was annoying me ....)
2007-10-10 13:07:38 -05:00
Stefan Metzmacher
78b2af77e9 r4361: fix the build
metze
2007-10-10 13:07:38 -05:00
Andrew Bartlett
1933cd12fb r4358: At metze's request, the Christmas elves have removed gensec_end in
favor of talloc_free().

Andrew Bartlett
2007-10-10 13:07:37 -05:00
Andrew Bartlett
9c9055603e r4357: Return a more sensible error code if a NULL (as opposed to the valid
"") username is asked for.

Andrew Bartlett
2007-10-10 13:07:37 -05:00
Andrew Bartlett
87dad5ec53 r4356: Allow anonymous connections to use NTLMSSP. The silly bugs that
prevented this are gone.

Andrew Bartlett
2007-10-10 13:07:37 -05:00
Andrew Bartlett
278bf1a61a r4355: More work from the elves on Christmas eve:
- Update Samba4's kerberos code to match the 'salting' changes in
   Samba3 (and many other cleanups by jra).

 - Move GENSEC into the modern era of talloc destructors.  This avoids
   many of the memory leaks in this code, as we now can't somehow
   'forget' to call the end routine.
  - This required fixing some of the talloc hierarchies.

 - The new krb5 seems more sensitive to getting the service name
   right, so start actually setting the service name on the krb5 context.

Andrew Bartlett
2007-10-10 13:07:37 -05:00
Stefan Metzmacher
532641a700 r4338: reuse netlogon structs in the krb5 PAC
that simplifies the code a lot...

also add a note: we should fail the krb5 auth if there's no
PAC present (when heimdal is ready for that:-)

metze
2007-10-10 13:07:36 -05:00
Stefan Metzmacher
1ceeb77fc7 r4326: fix memory leak
metze
2007-10-10 13:07:35 -05:00