1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-14 19:24:43 +03:00

222 Commits

Author SHA1 Message Date
Andrew Tridgell
2acc069185 r6342: fixed a bad union assumption that caused ACLs to fail on 64 bit machines
Thanks to lars and agruen for finding this
2007-10-10 13:11:33 -05:00
Andrew Bartlett
c2c8b6abf3 r6313: Much better handling of LogoffAndX when the vuid is invalid (ie, don't
segfault).  This should fix another of the issues that Richard came up
with last week.

Andrew Bartlett
2007-10-10 13:11:30 -05:00
Andrew Bartlett
c67a9370c4 r6312: Metze reminds me this header is no longer required.
Andrew Bartlett
2007-10-10 13:11:30 -05:00
Andrew Bartlett
0cbd11a0f2 r6310: Rename password.c to session.c, and remove the linked list of all
outstanding sessions, as we don't use it.

Andrew Bartlett
2007-10-10 13:11:30 -05:00
Andrew Bartlett
0bba8da460 r6309: Remove this file it is empty and unreferenced. (In preperation for
renaming password.c over the top, as it deals with sessions, not
passwords).

Andrew Bartlett
2007-10-10 13:11:30 -05:00
Andrew Bartlett
3e5775146d r6270: Move the VUID handling to a IDR tree. This should avoid O(n)
behaviour on session setups, and because we no longer need do deal
with the linked list as much, the code is much simpiler too.

We may be able to compleatly remove the tid and vuid linked lists, but
I need to check.

This patch also tries to clean up the VUID handling and session setups
in general.  To avoid security issues, we now have a distinction
between VUIDs allocated for the session setup (to tie togeather the
multiple round trips) and those used after authentication.

Andrew Bartlett
2007-10-10 13:11:29 -05:00
Andrew Tridgell
54c0284679 r6031: don't try to send errors when the socket has been destroyed 2007-10-10 13:11:16 -05:00
Andrew Bartlett
2301a4b38a r6028: A MAJOR update to intergrate the new credentails system fully with
GENSEC, and to pull SCHANNEL into GENSEC, by making it less 'special'.

GENSEC now no longer has it's own handling of 'set username' etc,
instead it uses cli_credentials calls.

In order to link the credentails code right though Samba, a lot of
interfaces have changed to remove 'username, domain, password'
arguments, and these have been replaced with a single 'struct
cli_credentials'.

In the session setup code, a new parameter 'workgroup' contains the
client/server current workgroup, which seems unrelated to the
authentication exchange (it was being filled in from the auth info).

This allows in particular kerberos to only call back for passwords
when it actually needs to perform the kinit.

The kerberos code has been modified not to use the SPNEGO provided
'principal name' (in the mechListMIC), but to instead use the name the
host was connected to as.  This better matches Microsoft behaviour,
is more secure and allows better use of standard kerberos functions.

To achieve this, I made changes to our socket code so that the
hostname (before name resolution) is now recorded on the socket.

In schannel, most of the code from librpc/rpc/dcerpc_schannel.c is now
in libcli/auth/schannel.c, and it looks much more like a standard
GENSEC module.  The actual sign/seal code moved to
libcli/auth/schannel_sign.c in a previous commit.

The schannel credentails structure is now merged with the rest of the
credentails, as many of the values (username, workstation, domain)
where already present there.  This makes handling this in a generic
manner much easier, as there is no longer a custom entry-point.

The auth_domain module continues to be developed, but is now just as
functional as auth_winbind.  The changes here are consequential to the
schannel changes.

The only removed function at this point is the RPC-LOGIN test
(simulating the load of a WinXP login), which needs much more work to
clean it up (it contains copies of too much code from all over the
torture suite, and I havn't been able to penetrate its 'structure').

Andrew Bartlett
2007-10-10 13:11:15 -05:00
Andrew Bartlett
50af206477 r5899: Fix spelling.
Andrew Bartlett
2007-10-10 13:11:07 -05:00
Andrew Tridgell
bf43c9bdcf r5308: trimmed back a lot of the old macros from smb_macros.h 2007-10-10 13:09:40 -05:00
Andrew Tridgell
bb1ab11d8e r5294: - added a separate NBT-WINS test for WINS operations (register, refresh, release and query)
- change the iface_n_*() functions to return a "const char *" instead of a "struct ipv4_addr"
  I think that in general we should move towards "const char *" for
  all IP addresses, as this makes IPv6 much easier, and is also easier
  to debug. Andrew, when you get a chance, could you fix some of the
  auth code to use strings for IPs ?

- return a NTSTATUS error on bad name queries and node status instead
  of using rcode. This makes the calling code simpler.

- added low level name release code in libcli/nbt/

- use a real IP in the register and wins nbt torture tests, as w2k3
  WINS server silently rejects some operations that don't come from the
  IP being used (eg. it says "yes" to a release, but does not in fact
  release the name)
2007-10-10 13:09:37 -05:00
Andrew Tridgell
7f54c8a339 r5197: moved events code to lib/events/ (suggestion from metze) 2007-10-10 13:09:30 -05:00
Andrew Tridgell
236403cc4d r5195: most events don't need the time of the event, so save a gettimeofday() call
and just use timeval_current() when its actually needed
2007-10-10 13:09:30 -05:00
Andrew Tridgell
90535bab95 r5193: make sure we mark the event dead when we free it on a dead connection 2007-10-10 13:09:29 -05:00
Andrew Tridgell
d7b4b6de51 r5185: make all the events data structures private to events.c. This will
make it possible to add optimisations to the events code such as
keeping the next timed event in a sorted list, and using epoll for
file descriptor events.

I also removed the loop events code, as it wasn't being used anywhere,
and changed timed events to always be one-shot (as adding a new timed
event in the event handler is so easy to do if needed)
2007-10-10 13:09:29 -05:00
Andrew Tridgell
cf6a46c3cb r5102: This is a major simplification of the logic for controlling top level
servers in smbd. The old code still contained a fairly bit of legacy
from the time when smbd was only handling SMB connection. The new code
gets rid of all of the smb_server specific code in smbd/, and creates
a much simpler infrastructures for new server code.

Major changes include:

 - simplified the process model code a lot.

 - got rid of the top level server and service structures
   completely. The top level context is now the event_context. This
   got rid of service.h and server.h completely (they were the most
   confusing parts of the old code)

 - added service_stream.[ch] for the helper functions that are
   specific to stream type services (services that handle streams, and
   use a logically separate process per connection)

 - got rid of the builtin idle_handler code in the service logic, as
   none of the servers were using it, and it can easily be handled by
   a server in future by adding its own timed_event to the event
   context.

 - fixed some major memory leaks in the rpc server code.

 - added registration of servers, rather than hard coding our list of
   possible servers. This allows for servers as modules in the future.

 - temporarily disabled the winbind code until I add the helper
   functions for that type of server

 - added error checking on service startup. If a configured server
   fails to startup then smbd doesn't startup.

 - cleaned up the command line handling in smbd, removing unused options
2007-10-10 13:09:22 -05:00
Andrew Tridgell
ec32b22ed5 r5037: got rid of all of the TALLOC_DEPRECATED stuff. My apologies for the
large commit. I thought this was worthwhile to get done for
consistency.
2007-10-10 13:09:15 -05:00
Andrew Tridgell
b06b8dd2f4 r4927: parse the NBT session request in the smb server. This gets rid of that
annoying "not parsing session request" message on each SMB connection
2007-10-10 13:09:06 -05:00
Andrew Tridgell
e54a97f8a6 r4819: its just not my day today .... 2007-10-10 13:08:59 -05:00
Andrew Tridgell
080d0518bc r4777: added a smb_composite_sesssetup() async composite function. This
encapsulates all the different session setup methods, including the
multi-pass spnego code.

I have hooked this into all the places that previously used the
RAW_SESSSETUP_GENERIC method, and have removed the old
RAW_SESSSETUP_GENERIC code from clisession.c and clitree.c. A nice
side effect is that these two modules are now very simple again, back
to being "raw" session setup handling, which was what was originally
intended.

I have also used this to replace the session setup code in the
smb_composite_connect() code, and used that to build a very simple
replacement for smbcli_tree_full_connection().

As a result, smbclient, smbtorture and all our other SMB connection
code now goes via these composite async functions. That should give
them a good workout!
2007-10-10 13:08:53 -05:00
Stefan Metzmacher
9ea9e1ced5 r4730: remove unused struct elements
part of this went in in the last commit...

metze
2007-10-10 13:08:49 -05:00
Stefan Metzmacher
d5fa02746c r4728: split up server_services into:
- stream_socket services
  the smb, ldap and rpc service which sets up a srtam socket end then
  waits for connections
and
- task services
  which this you can create a seperate task that do something
  (this is also going through the process_model subsystem
  so with -M standard a new process for this created
  with -M thread a new thread ...

I'll add datagram services later when we whave support for datagram sockets in lib/socket/

see the next commit as an example for service_task's

metze
2007-10-10 13:08:49 -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
Stefan Metzmacher
f85ebd1e8e r4684: the smbsrv code should not know about rpc stuff
just vfs_ipc

metze
2007-10-10 13:08:43 -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
76d905d12e r4611: - renamed add_socket() to smb_add_socket() as that is less confusing
- removed the spurious call to set_blocking() in the smb server setup.
2007-10-10 13:08:33 -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
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
5cd74c22e9 r4383: in order to cope with overfilled buffers on trans2 findfirst we need to use 32 bit offsets and lengths
in trans2 fill code, even though the packets themselves can only use 16 bit lengths. This prevents
the overflow detection code from failing due to 16 bit length wrap.
2007-10-10 13:07:41 -05:00
Andrew Tridgell
44ca3f41cc r4382: check for bad tid in SMBtdis 2007-10-10 13:07:40 -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
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
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
Andrew Tridgell
99b0dac229 r4284: fixed a problem with very large EA lists and OS/2 clients. These
checks on allocations need to go in a lot more places, but at least
this is a start.
2007-10-10 13:07:32 -05:00
Andrew Tridgell
25189b8fbf r4263: added support for the trans2 RAW_SEARCH_EA_LIST information
level. This is quite a strange level that we've never seen before, but
is used by the os2 workplace shell.

note w2k screws up this level when unicode is negotiated, so it only
passes the RAW-SEARCH test when you force non-unicode
2007-10-10 13:07:29 -05:00
Andrew Tridgell
0b76d405a7 r4261: added the RAW_FILEINFO_EA_LIST trans2 qfileinfo and qpathinfo
level. Interestingly, this level did now show up on our trans2 scanner
previously as we didn't have the FLAGS2_EXTENDED_ATTRIBUTES bit set in
the client code. Now that we set that bit, new levels appear in
windows servers.
2007-10-10 13:07:29 -05:00
Andrew Tridgell
b26828bef5 r4243: a sniff from kukks showed that the ea_set interface in trans2 setfileinfo allows
for multiple EAs to be set at once. This fixes all the ea code to allow for that.
2007-10-10 13:07:28 -05:00
Andrew Tridgell
bc0209058b r4232: added server support for multi-part SMBtrans requests, while
maintaining the async nature of the server. This is done with a
SMBtrans request queue for partially completed requests.

The smb signing issues with this get a little tricky, but it now seems
to work fine
2007-10-10 13:07:28 -05:00
Andrew Tridgell
c987125348 r4214: possibly fix the "no-EAs" bug from OS/2 2007-10-10 13:07:27 -05:00
Andrew Tridgell
7d981c29c2 r4182: fixed trans2 mkdir, allowing mkdir with an initial EA list 2007-10-10 13:07:23 -05:00
Andrew Tridgell
a56d95ad89 r4173: - new t2open code, that can cope with "create with EAs". Many thanks
to kukks on #samba-technical for the sniffs that allowed me to work
  this out

- much simpler ntvfs open generic mapping code

- added t2open create with EA torture test to RAW-OPEN test
2007-10-10 13:07:22 -05:00
Andrew Tridgell
13c7794e02 r4159: fixed error return for writebraw 2007-10-10 13:07:20 -05:00
Andrew Tridgell
c232e21218 r4146: an attempted fix for a OS/2 rename problem found by kukks - seems OS/2
is v senstive to SMB flags2 bits
2007-10-10 13:06:30 -05:00
Andrew Tridgell
71e0c7b2eb r4145: make sure we don't set the 32-bit error codes flag unless the client
can handle it, even for success packets (this bug was harmless, but
can be confusing in ethereal with old clients)
2007-10-10 13:06:30 -05:00
Andrew Tridgell
30c58b046d r4109: fixed an uninitialised socket write found by kukks 2007-10-10 13:06:27 -05:00
Andrew Tridgell
49c8df5648 r4101: ignore secondary session requests to cope with a OS/2 bug reported by
Guenter Kukkukk
2007-10-10 13:06:26 -05:00
Tim Potter
24d9f97bd6 r4099: Spelling fixes. 2007-10-10 13:06:26 -05:00
Andrew Tridgell
33e4cee17d r4095: smbsrv_terminate_connection() doesn't exit() in single processor mode, so after we
call it we need to return, and not continue processing packets
2007-10-10 13:06:25 -05:00
Stefan Metzmacher
6f3eb7bc03 r4079: implement the gensec_have_feature() correctly by asking
the backend what is actually in use

metze
2007-10-10 13:06:23 -05:00
Stefan Metzmacher
ab2c2f27e1 r4070: move some defines from asn_1.h to the places they belong to
metze
2007-10-10 13:06:22 -05:00