1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-15 23:24:37 +03:00

66 Commits

Author SHA1 Message Date
Andrew Bartlett
86f61568ea r2041: Fix NTLMSSP RPC sealing, client -> win2k3 server.
The bug (found by tridge) is that Win2k3 is being tighter about the
NTLMSSP flags.  If we don't negotiate sealing, we can't use it.

We now have a way to indicate to the GENSEC implementation mechanisms
what things we want for a connection.

Andrew Bartlett
2007-10-10 12:58:19 -05:00
Stefan Metzmacher
8c9c702bc3 r1999: fix compiler warning
metze
2007-10-10 12:58:16 -05:00
Stefan Metzmacher
bf06f476db r1998: fix compiler warning
metze
2007-10-10 12:58:16 -05:00
Andrew Tridgell
e35bb094c5 r1983: a completely new implementation of talloc
This version does the following:

  1) talloc_free(), talloc_realloc() and talloc_steal() lose their
     (redundent) first arguments

  2) you can use _any_ talloc pointer as a talloc context to allocate
     more memory. This allows you to create complex data structures
     where the top level structure is the logical parent of the next
     level down, and those are the parents of the level below
     that. Then destroy either the lot with a single talloc_free() or
     destroy any sub-part with a talloc_free() of that part

  3) you can name any pointer. Use talloc_named() which is just like
     talloc() but takes the printf style name argument as well as the
     parent context and the size.

The whole thing ends up being a very simple piece of code, although
some of the pointer walking gets hairy.

So far, I'm just using the new talloc() like the old one. The next
step is to actually take advantage of the new interface
properly. Expect some new commits soon that simplify some common
coding styles in samba4 by using the new talloc().
2007-10-10 12:58:14 -05:00
Andrew Tridgell
e53d32c65a r1819: changed "smb ports" to be a LIST parameter type in loadparm (its a classic case for a list) 2007-10-10 12:57:59 -05:00
Andrew Bartlett
cb74d52b56 r1796: Enable server-side SPNEGO, now that I have fixed the server-side SMB
signing code to be able to cope.

Andrew Bartlett
2007-10-10 12:57:57 -05:00
Andrew Bartlett
07e3d2c4cd r1762: Ensure that a user (as opposed to guest) cannot login without SPNEGO,
when we have negotiated SPNEGO.

Andrew Bartlett
2007-10-10 12:57:54 -05:00
Stefan Metzmacher
ddac5e46d4 r1747: don't segfault when the spnego mech only use one call from the client to finish
metze
2007-10-10 12:57:53 -05:00
Andrew Tridgell
2b41de48b2 r1741: fixed padding of setpathinfo in server 2007-10-10 12:57:52 -05:00
Andrew Bartlett
73ee549b8c r1731: Add server-side SPNEGO support to Samba (disabled, until SMB signing
is reworked).

Andrew Bartlett
2007-10-10 12:57:51 -05:00
Andrew Bartlett
66c54fe7eb r1727: SPNEGO session setup replies need to include the blob, even on error
cases, so don't shorten them back to 0 byte data length.

Andrew Bartlett
2007-10-10 12:57:50 -05:00
Andrew Bartlett
30275764d8 r1726: Fix up the comments and indenting.
Andrew Bartlett
2007-10-10 12:57:50 -05:00
Andrew Bartlett
3520af0f3d r1687: Fix bogus requirement for SMB signing on guest connections.
Andrew Bartlett
2007-10-10 12:57:49 -05:00
Andrew Tridgell
96bf4da3ed r1578: the first stage of the async client rewrite.
Up to now the client code has had an async API, and operated
asynchronously at the packet level, but was not truly async in that it
assumed that it could always write to the socket and when a partial
packet came in that it could block waiting for the rest of the packet.

This change makes the SMB client library full async, by adding a
separate outgoing packet queue, using non-blocking socket IO and
having a input buffer that can fill asynchonously until the full
packet has arrived.

The main complexity was in dealing with the events structure when
using the CIFS proxy backend. In that case the same events structure
needs to be used in both the client library and the main smbd server,
so that when the client library is waiting for a reply that the main
server keeps processing packets. This required some changes in the
events library code.

Next step is to make the generated rpc client code use these new
capabilities.
2007-10-10 12:57:42 -05:00
Stefan Metzmacher
0bb50dcf1c r1547: rename 'enum <bla>_level' -> 'enum smb_<bla>_level'
e.g. we now have 'union smb_mkdir' and 'enum smb_mkdir_level' in sync

we may should also rename 'RAW_MKDIR_*' -> 'SMB_MKDIR_*'

metze
2007-10-10 12:57:41 -05:00
Andrew Bartlett
35b83eb329 r1521: Updates to our SMB signing code.
- This causes our client and server code to use the same core code,
  with the same debugs etc.
- In turn, this will allow the 'mandetory/fallback' signing algorithms
  to be shared, and only written once.

Updates to the SPNEGO code
- Don't wrap an empty token to the server, if we are actually already finished.

Andrew Bartlett
2007-10-10 12:57:39 -05:00
Stefan Metzmacher
0e1f5e66d3 r1514: close stuff from the server_connection not in the
close_connection fn of a specific service

metze
2007-10-10 12:57:37 -05:00
Andrew Tridgell
5dd71be8d9 r1508: simple fix for broken server side signing. This may need more work for
SPNEGO, but I'll leave andrew to tackle that.
2007-10-10 12:57:36 -05:00
Andrew Tridgell
6f2a335cd6 r1507: fixed the handling of SMB chaining with the new server structure. You
must think carefully about packet chaining when dealing with any
authentication or SMB parsing issues. The particular problem here was
that a chained tconX didn't get the req->session setup after an
initial sesstion setup call, so the tconx used a bogus VUID.
2007-10-10 12:57:36 -05:00
Stefan Metzmacher
f276378157 r1499: combine struct user_struct and struct smbsrv_user
to a struct smbsrv_session that the same as cli_session for the client

we need a gensec_security pointer there
(spnego support will follow)

prefix some related functions with smbsrv_

metze
2007-10-10 12:57:36 -05:00
Stefan Metzmacher
bbe5e00715 r1486: commit the start of the generic server infastructure
the idea is to have services as modules (smb, dcerpc, swat, ...)

the process_model don't know about the service it self anymore.

TODO:
- the smbsrv should use the smbsrv_send function
- the service subsystem init should be done like for other modules
- we need to have a generic socket subsystem, which handle stream, datagram,
  and virtuell other sockets( e.g. for the ntvfs_ipc module to connect to the dcerpc server
  , or for smb or dcerpc or whatever to connect to a server wide auth service)
- and other fixes...

NOTE: process model pthread seems to be broken( but also before this patch!)

metze
2007-10-10 12:57:35 -05:00
Stefan Metzmacher
2758c26ac9 r1479: print out domain too 2007-10-10 12:57:34 -05:00
Volker Lendecke
08140cc1a8 r1470: Get the smb_trans2 structure out of the rap_cli_call struct.
Initial attempt at RAP server infrastructure. Look at rap_server.c for the
dummy functions that are supposed to implement the core functionality.

ipc_rap.c contains all the data shuffling. _rap_shareenum and _rap_serverenum2
in ipc_rap.c are (I think) regular enough to be auto-generated.

I did not test all the corner cases yet, but nevertheless I would like some
comments on the general style.

Volker

P.S: samba-3 smbclient now doesn't freak out anymore, although the results are
not entirely correct :-)
2007-10-10 12:57:33 -05:00
Stefan Metzmacher
ee711c71fe r1337: use sess->nt1. in sesssetup_nt1 :-)
metze
2007-10-10 12:56:51 -05:00
Stefan Metzmacher
32e307857c r1336: check the vuid in old style sessionsetup too
metze
2007-10-10 12:56:50 -05:00
Andrew Bartlett
07fd885fd4 r1294: A nice, large, commit...
This implements gensec for Samba's server side, and brings gensec up
to the standards of a full subsystem.

This means that use of the subsystem is by gensec_* functions, not
function pointers in structures (this is internal).  This causes
changes in all the existing gensec users.

Our RPC server no longer contains it's own generalised security
scheme, and now calls gensec directly.

Gensec has also taken over the role of auth/auth_ntlmssp.c

An important part of gensec, is the output of the 'session_info'
struct.  This is now reference counted, so that we can correctly free
it when a pipe is closed, no matter if it was inherited, or created by
per-pipe authentication.

The schannel code is reworked, to be in the same file for client and
server.

ntlm_auth is reworked to use gensec.

The major problem with this code is the way it relies on subsystem
auto-initialisation.  The primary reason for this commit now.is to
allow these problems to be looked at, and fixed.

There are problems with the new code:
- I've tested it with smbtorture, but currently don't have VMware and
  valgrind working (this I'll fix soon).
- The SPNEGO code is client-only at this point.
- We still do not do kerberos.

Andrew Bartlett
2007-10-10 12:56:49 -05:00
Andrew Bartlett
9002584c02 r1293: Indent
Andrew Bartlett
2007-10-10 12:56:49 -05:00
Stefan Metzmacher
60f823f201 r1291: rename struct smbsrv_context to smbsrv_connection
because this is the connection state per transport layer (tcp)
connection

I also moved the substructs directly into smbsrv_connection,
because they don't need a struct name and we should allway pass the complete
smbsrv_connection struct into functions

metze
2007-10-10 12:56:49 -05:00
Stefan Metzmacher
7b4ad993ad r1281: move include/context.h to smb_server/smb_server.h
metze
2007-10-10 12:56:49 -05:00
Stefan Metzmacher
a85d2db582 r1280: rename struct request_context to smbsrv_request
metze
2007-10-10 12:56:48 -05:00
Stefan Metzmacher
99473fab4b r1279: rename struct tcon_context to smbsrv_tcon
metze
2007-10-10 12:56:48 -05:00
Stefan Metzmacher
a9ba29e00f r1278: rename struct user_context to smbsrv_user
metze
2007-10-10 12:56:48 -05:00
Stefan Metzmacher
0712f9f307 r1277: rename struct server_context to smbsrv_ontext
because I need server_context fot the generic server infastructure

metze
2007-10-10 12:56:48 -05:00
Tim Potter
de5984c956 r1268: varient -> variant 2007-10-10 12:56:46 -05:00
Stefan Metzmacher
10dd848729 r1233: -move smb related code to smb_server/*
-move process_model code to smbd/process_model.c
-remove some used code

metze
2007-10-10 12:56:46 -05:00
Andrew Tridgell
0e557fe857 r1165: fixed handling of SMBtrans replies that should return STATUS_BUFFER_OVERFLOW when more data is present. 2007-10-10 12:56:42 -05:00
Andrew Bartlett
5d39d7497f r1123: Make all lp_ string functions return 'const char *'.
Fix other 'const' warnings in the torture code.

Andrew Bartlett
2007-10-10 12:56:38 -05:00
Andrew Tridgell
be75cdc1bf r1044: don't use sub_get_remote_machine() 2007-10-10 12:56:34 -05:00
Andrew Bartlett
d199697014 r1019: Push the auth subsystem away from using typedef, and over to the 'all
goodness and light' struct ;-)

Break apart the auth subsystem's return strucutres, into the parts
that a netlogon call cares about, and the parts that are for a local
session.  This is the 'struct session_info' and it will almost
completly replace the current information stored on a vuid, but be
generic to all login methods (RPC over TCP, for example).

Andrew Bartlett
2007-10-10 12:56:28 -05:00
Stefan Metzmacher
57151e80eb r962: convert 'unsigned' and 'unsigned int' to uint_t
metze
2007-10-10 12:56:23 -05:00
Stefan Metzmacher
18062d2ed9 r960: convert 'unsigned int' to uint_t in the most places
metze
2007-10-10 12:56:23 -05:00
Stefan Metzmacher
b5378803fd r943: change samba4 to use 'uint8_t' instead of 'unsigned char'
metze
2007-10-10 12:56:21 -05:00
Andrew Tridgell
69a2942f79 r898: - remove some unused macros
- remove unused lib/smbpasswd.c

- don't set the pkt size twice when doing SMB signing
2007-10-10 12:56:18 -05:00
Stefan Metzmacher
2986c5f08c r890: convert samba4 to use [u]int8_t instead of [u]int8
metze
2007-10-10 12:56:16 -05:00
Stefan Metzmacher
af6f1f8a01 r889: convert samba4 to use [u]int16_t instead of [u]int16
metze
2007-10-10 12:56:16 -05:00
Stefan Metzmacher
0e5517d937 r884: convert samba4 to use [u]int32_t instead of [u]int32
metze
2007-10-10 12:56:15 -05:00
Andrew Tridgell
9a9244a1c6 r873: converted samba4 to use real 64 bit integers instead of
structures. This was suggested by metze recently.

I checked on the build farm and all the machines we have support 64
bit ints, and support the LL suffix for 64 bit constants. I suspect
some won't support strtoll() and related functions, so we will
probably need replacements for those.
2007-10-10 12:56:14 -05:00
Stefan Metzmacher
8f59daba0d r861: remove the next round of unused stuff
metze
2007-10-10 12:56:13 -05:00
Stefan Metzmacher
7f2e8a2b84 r847: convert SMB SERVER SUBSYSTEM to a config.mk file
metze
2007-10-10 12:53:55 -05:00
Andrew Tridgell
8e5ddf5e8e r818: added server side SMB signing to Samba4 2007-10-10 12:53:52 -05:00