1
0
mirror of https://github.com/samba-team/samba.git synced 2025-11-29 16:23:52 +03:00
Commit Graph

9505 Commits

Author SHA1 Message Date
Stefan Metzmacher
e231eba828 r17277: we need to trigger an event when we return directly,
otherwise the callers callback function will not be called
and the caller is hanging forever...

metze
2007-10-10 14:15:05 -05:00
Stefan Metzmacher
699dee70aa r17274: fix typos
metze
2007-10-10 14:10:26 -05:00
Stefan Metzmacher
ed40bb3c16 r17273: add an async version of auth_check_password() on the public
auth interface and implement the sync version as wrapper
to auth_check_password_send/recv()

as next all callers need to be converted to the async interface
and then the modules

metze
2007-10-10 14:10:26 -05:00
Stefan Metzmacher
c49e27d5d0 r17272: move the callback stuff into a substructure
metze
2007-10-10 14:10:26 -05:00
Stefan Metzmacher
5b26cbc342 r17270: split the logic of saying this auth backend wants to handle this
request from the password checking. This will help to make
the password checking hook async later

metze
2007-10-10 14:10:25 -05:00
Stefan Metzmacher
14ecc56343 r17268: change the smb2 session setup to use the new gensec_update_send/recv() api
metze
2007-10-10 14:10:25 -05:00
Stefan Metzmacher
d5638a4faf r17267: - add an async interface for gensec_update() to the public gensec api
- note this is still uses the sync update() hook of the gensec modules
  but it allows me to fix the callers first

Later auth_check_password() will also get an async version,
so that we can later implement an async version of auth_winbind
using async IRPC to the winbind task.

metze
2007-10-10 14:10:25 -05:00
Stefan Metzmacher
e4c28001d3 r17265: some reformatting
metze
2007-10-10 14:10:25 -05:00
Stefan Metzmacher
b091d182fe r17264: - remove unused includes from talloc
- check explicit check for varargs.h as fallback from stdarg.h
  and fail the build if both are not present

metze
2007-10-10 14:10:25 -05:00
Stefan Metzmacher
195754b169 r17263: export talloc_free_children()
metze
2007-10-10 14:10:24 -05:00
Stefan Metzmacher
196803a6c6 r17257: make the size_t is to small error more verbose
(hopefully nobody will ever see this:-)

metze
2007-10-10 14:10:24 -05:00
Stefan Metzmacher
d8952f00c7 r17256: fix 2 crash bugs, which are introduced by making parameters
ref pointers!

I'm sure there're more places and more care is needed when idl files
are changed. Hopefully testing against windows in the build farm
find such bugs in future...

Why is in the client library this no more possible:

NTSTATUS foo([in,out,ref] uint8 *foo);

and then just

r.in.foo = &foo;
status = dcerpc_foo(p, mem_ctx, &r);

and r.out.foo will set to r.in.foo via pidl magic,
that worked some time ago...

metze
2007-10-10 14:10:24 -05:00
Andrew Tridgell
7b05c007ea r17255: fixed BENCH-NBENCH for new smb_raw_find_first() syntax 2007-10-10 14:10:24 -05:00
Stefan Metzmacher
b5c06d5b4c r17253: add configure checks for writev/readv to see how portable they're
metze
2007-10-10 14:10:24 -05:00
Stefan Metzmacher
9190d134c9 r17251: - split out the starttls into its own function
- give an operations error when tls is already on the socket

metze
2007-10-10 14:10:23 -05:00
Andrew Bartlett
dc4500eb90 r17250: Fix comment, the Samba3 winbind protocol uses the host byte order here.
Andrew Bartlett
2007-10-10 14:10:23 -05:00
Stefan Metzmacher
7b136ddf48 r17243: some svcctl idl fixes from <andrzej.hajda@wp.pl>
metze
2007-10-10 14:10:23 -05:00
Stefan Metzmacher
ed5ffc7bfc r17241: substitude @datarootdir@ with old autoconf versions:-)
metze
2007-10-10 14:10:23 -05:00
Stefan Metzmacher
0b16350fa2 r17240: move extended operations to a new file
metze
2007-10-10 14:10:23 -05:00
Jelmer Vernooij
c575dee5c7 r17238: Add datarootdir (required for newer autoconf versions) 2007-10-10 14:10:22 -05:00
Stefan Metzmacher
10cb9c07ac r17237: - keep pointer to the different sockets
- we need this to later:
  - to disallow a StartTLS when TLS is already in use
  - to place the TLS socket between the raw and sasl socket
    when we had a sasl bind before the StartTLS
  - and rfc4513 says that the server may allow to remove the TLS from
    the tcp connection again and reuse raw tcp
  - and also a 2nd sasl bind should replace the old sasl socket

metze
2007-10-10 14:10:22 -05:00
Stefan Metzmacher
f2196bf9b6 r17230: don't overwrite the error with NT_STATUS_NO_MEMORY
metze
2007-10-10 14:10:22 -05:00
Stefan Metzmacher
3711b968ad r17227: don't call a function which takes some nonoptional args
with NULL.

metze
2007-10-10 14:10:22 -05:00
Stefan Metzmacher
e8db1fb558 r17226: add some comments about ldap binds and pending requests
metze
2007-10-10 14:10:22 -05:00
Andrew Bartlett
4827a6b171 r17225: Fix the build by fixing the spelling of START-TLS.
Andrew Bartlett
2007-10-10 14:10:21 -05:00
Andrew Bartlett
9bd66d4c95 r17224: Accept the start-tls extended request. Getting OpenLDAP to recognise
our certificate, and proceed with the connection is left as an
exercise for the reader...

Andrew Bartlett
2007-10-10 14:10:21 -05:00
Andrew Bartlett
68ddc4921f r17223: In some protocols it is not possible to negoitate off some features,
without the agreement of the peer.  This can cause problems, because
one side things sealing is disabled, while the other thinks it is
enabled.

Andrew Bartlett
2007-10-10 14:10:20 -05:00
Andrew Bartlett
003e2ab93c r17222: Change the function prototypes for the GENSEc and TLS socket creation
routines to return an NTSTATUS.  This should help track down errors.

Use a bit of talloc_steal and talloc_unlink to get the real socket to
be a child of the GENSEC or TLS socket.

Always return a new socket, even for the 'pass-though' case.

Andrew Bartlett
2007-10-10 14:10:20 -05:00
Andrew Bartlett
7c5a25a423 r17221: Add some integer wrap parinoia to data_blob_append().
Andrew Bartlett
2007-10-10 14:10:20 -05:00
Andrew Bartlett
83dd22accf r17215: Prepare the SASL socket before actually settting it. This allows
errors to be reported corectly, rather than just dropping the socket.

Andrew Bartlett
2007-10-10 14:10:19 -05:00
Simo Sorce
e0af5cf51d r17210: I wonder how I missed this, build farm caught it. 2007-10-10 14:10:19 -05:00
Simo Sorce
15b8fafb99 r17209: Add dependency over the new share configuration module into smbd
Should fix some build farm machine
2007-10-10 14:10:19 -05:00
Simo Sorce
d4c2b89350 r17208: Add a away to test the ldb module.
Actually you can't test both classic and ldb together, but you can replace the standard
script/tests/mktestsetup.sh file with this one and run make test to see share_ldb in action
2007-10-10 14:10:19 -05:00
Simo Sorce
df1da91d4f r17207: Add the ldb based shares configuration module 2007-10-10 14:10:19 -05:00
Simo Sorce
a89cc346b9 r17206: Add a modular API for share configuration.
Commit the classic backwards compatible module which is the default one
2007-10-10 14:10:18 -05:00
Volker Lendecke
0c05f571a0 r17205: Even if this makes me look foolish, at least start to scratch on the surface
of spoolss. If snum is to be removed, then we should make at least the attempt
to walk parts of the code before and after the changes.

This walks GetPrinterInfo level 0-7.

Volker
2007-10-10 14:10:18 -05:00
Andrew Bartlett
5d7c9c12cb r17197: This patch moves the encryption of bulk data on SASL negotiated security
contexts from the application layer into the socket layer.

This improves a number of correctness aspects, as we now allow LDAP
packets to cross multiple SASL packets.  It should also make it much
easier to write async LDAP tests from windows clients, as they use SASL
by default.  It is also vital to allowing OpenLDAP clients to use GSSAPI
against Samba4, as it negotiates a rather small SASL buffer size.

This patch mirrors the earlier work done to move TLS into the socket
layer.

Unusual in this pstch is the extra read callback argument I take.  As
SASL is a layer on top of a socket, it is entirely possible for the
SASL layer to drain a socket dry, but for the caller not to have read
all the decrypted data.  This would leave the system without an event
to restart the read (as the socket is dry).

As such, I re-invoke the read handler from a timed callback, which
should trigger on the next running of the event loop.  I believe that
the TLS code does require a similar callback.

In trying to understand why this is required, imagine a SASL-encrypted
LDAP packet in the following formation:

+-----------------+---------------------+
| SASL  Packet #1 | SASL Packet #2      |
----------------------------------------+
| LDAP Packet #1       | LDAP Packet #2 |
----------------------------------------+

In the old code, this was illegal, but it is perfectly standard
SASL-encrypted LDAP.  Without the callback, we would read and process
the first LDAP packet, and the SASL code would have read the second SASL
packet (to decrypt enough data for the LDAP packet), and no data would
remain on the socket.

Without data on the socket, read events stop.  That is why I add timed
events, until the SASL buffer is drained.

Another approach would be to add a hack to the event system, to have it
pretend there remained data to read off the network (but that is ugly).

In improving the code, to handle more real-world cases, I've been able
to remove almost all the special-cases in the testnonblock code.  The
only special case is that we must use a deterministic partial packet
when calling send, rather than a random length.  (1 + n/2).  This is
needed because of the way the SASL and TLS code works, and the 'resend
on failure' requirements.

Andrew Bartlett
2007-10-10 14:10:18 -05:00
Andrew Bartlett
d79bfbe87d r17196: Clarify that SSL is used for LDAP as well as SWAT.
Andrew Bartlett
2007-10-10 14:10:18 -05:00
Simo Sorce
523e8f3ed4 r17195: Start thinking how to implement extended operations.
Ad supports three extended operations:
- start tls
- dynamic objects
- fast binds

none of these are a priority.
2007-10-10 14:10:18 -05:00
Simo Sorce
a6709196ca r17193: Remove ancient stuff never really used 2007-10-10 14:10:17 -05:00
Simo Sorce
d3f8b813b3 r17189: Add the new LDAP rfc series 2007-10-10 14:10:17 -05:00
Volker Lendecke
0236f3b41a r17187: Beginnings of a little lsa walker for Samba3, if only to prevent the
regression we had in 3.0.23...

Volker
2007-10-10 14:10:17 -05:00
Simo Sorce
c6aa60c7e6 r17186: "async" word abuse clean-up part 2 2007-10-10 14:10:17 -05:00
Simo Sorce
25fc735404 r17185: Oh, I wanted to do this for sooo long time.
Finally acknowledge that ldb is inherently async and does not have a dual personality anymore
Rename all ldb_async_XXX functions to ldb_XXX except for ldb_async_result, it is now ldb_reply
to reflect the real function of this structure.

Simo.
2007-10-10 14:10:16 -05:00
Stefan Metzmacher
f47b7bb656 r17176: remove off_t from talloc. size_t is large enough to hold
the max amount of memory of one process

metze
2007-10-10 14:10:16 -05:00
Andrew Bartlett
f3b6e57b23 r17174: Enable gnutls code, which requires the HAVE_GNUTLS CPP macro.
Andrew Bartlett
2007-10-10 14:10:16 -05:00
Andrew Bartlett
e96638bc74 r17173: Check for oversize output, not oversize input, and fix the GSSAPI mech
to work (it broke it in the previous commit).

Andrew Bartlett
2007-10-10 14:10:16 -05:00
Andrew Bartlett
cbbe99d9c1 r17171: Add a gensec function to determine the maximum negotiated buffer size,
and the maximum amount of user data that may be fitted into that.

This is used in the new SASL code, to correctly honour SASL buffer sizes.

Andrew Bartlett
2007-10-10 14:10:15 -05:00
Andrew Bartlett
d304760d3d r17170: Catch some more out-of-memory cases, and provide some clues when
chasing down bad signatures that may be due to data truncation.

Andrew Bartlett
2007-10-10 14:10:15 -05:00
Andrew Bartlett
9d866a030e r17169: Test LDAP with testnonblock.
Andrew Bartlett
2007-10-10 14:10:15 -05:00