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

245 Commits

Author SHA1 Message Date
Andrew Tridgell
c6f4865744 r3481: split out client.h and events.h 2007-10-10 13:05:20 -05:00
Andrew Tridgell
7c4e6ebf05 r3466: split out request.h, signing.h, and smb_server.h 2007-10-10 13:05:17 -05:00
Andrew Tridgell
b97e395c81 r3463: separated out some more headers (asn_1.h, messages.h, dlinklist.h and ioctl.h) 2007-10-10 13:05:17 -05:00
Andrew Tridgell
1087ea830e r3461: another place where "open" was used as a structure element 2007-10-10 13:05:16 -05:00
Andrew Tridgell
4e92e15c4e r3458: more solaris portability fixes, the main one being that we can't use a
structure element called "open" as its a macro on solaris.
2007-10-10 13:05:16 -05:00
Andrew Tridgell
4f33247f1c r3455: some more portability fixes. We nearly compile on solaris again now. 2007-10-10 13:05:15 -05:00
Andrew Tridgell
7b7477ac42 r3453: - split out the auth and popt includes
- tidied up some of the system includes

- moved a few more structures back from misc.idl to netlogon.idl and samr.idl now that pidl
  knows about inter-IDL dependencies
2007-10-10 13:05:13 -05:00
Andrew Tridgell
264ce91810 r3447: more include/system/XXX.h include files 2007-10-10 13:05:12 -05:00
Andrew Tridgell
2e25c71853 r3443: the next stage in the include files re-organisation.
I have created the include/system/ directory, which will contain the
wrappers for the system includes for logical subsystems. So far I have
created include/system/kerberos.h and include/system/network.h, which
contain all the system includes for kerberos code and networking code.
These are the included in subsystems that need kerberos or networking
respectively.

Note that this method avoids the mess of #ifdef HAVE_XXX_H in every C
file, instead each C module includes the include/system/XXX.h file for
the logical system support it needs, and the details are kept isolated
in include/system/

This patch also creates a "struct ipv4_addr" which replaces "struct
in_addr" in our code. That avoids every C file needing to import all
the system networking headers.
2007-10-10 13:05:11 -05:00
Andrew Tridgell
73ea8ee6c2 r3441: some include file cleanups and general housekeeping 2007-10-10 13:05:11 -05:00
Andrew Tridgell
3f902f8d85 r3425: got rid of a bunch of cruft from rewrite.h 2007-10-10 13:05:08 -05:00
Andrew Tridgell
e63edc8171 r3380: - changed the default behaviour of server signing. We now have a default
setting of "server signing = auto", which means to offer signing
  only if we have domain logons enabled (ie. we are a DC). This is a
  better match for what windows clients want, as unfortunately windows
  clients always use signing if it is offered, and when they use signing
  they not only go slower because of the signing itself, they also
  disable large readx/writex support, so they end up sending very small
  IOs for.

- changed the default max xmit again, this time matching longhorn,
  which uses 12288. That seems to be a fairly good compromise value.
2007-10-10 13:05:03 -05:00
Andrew Bartlett
c1b7303c1c r3361: Allow Samba4 (I'm interested in ntlm_auth in particular) to use
Samba3's winbind.  This is also the start of domain membership code in
Samba4, as we now (partially) parse the info3, and use it like Samba3
does.

Andrew Bartlett
2007-10-10 13:05:01 -05:00
Andrew Tridgell
84762a5976 r3355: fixed the old style search code in smb_server to correctly handle
searches that go beyond the negotiated max xmit size
2007-10-10 13:05:00 -05:00
Andrew Tridgell
2dbd2abc5f r3350: fixed a bug with sending multiple replies for the one request, as
happens with trans2, trans and echo. Now that smbd is async we queue
the multiples replies all at once, and now need a way to ensure each
reply gets it own smbsrv_request buffer. I have added
req_setup_secondary() to cope with this.
2007-10-10 13:04:58 -05:00
Andrew Tridgell
938fb44351 r3341: - don't zero the async structure (makes valgrind more useful)
- get rid of req->mid, as it isn't a safe value to use to match
  requests in the server (it is safe in the client code, as we choose
  the mid, but in the server we can't rely on other clients to choose
  the mid carefully)
2007-10-10 13:04:57 -05:00
Stefan Metzmacher
fde64c0dc1 r3336: use a struct ntvfs_async_state to be able to do async chaning of ntvfs modules
the idea is that a passthru module can use ntvfs_async_state_push() before
calling ntvfs_next_*() and in the _send function it calls
ntvfs_async_state_pop() and then call the upper layer send_fn itself

- ntvfs_nbench is now fully async

- the ntvfs_map_*() functions and the trans(2) mapping functions are not converted yet

metze
2007-10-10 13:04:57 -05:00
Andrew Tridgell
30acedb943 r3307: fixed the send side of the smb_server code to be non-blocking. This
means the whole of the SMB handling code is now non-blocking.
2007-10-10 13:04:52 -05:00
Andrew Tridgell
bda978cc2a r3306: the main smb server code now handles non-blocking socket receives. I
haven't marked the socket non-blocking yet as I haven't checked that
the send path is OK for non-blocking.
2007-10-10 13:04:52 -05:00
Andrew Tridgell
a16e4756cd r3304: changed the API to lib/socket/ a little.
The main change is to make socket_recv() take a pre-allocated buffer,
rather than allocating one itself. This allows non-blocking users of
this API to avoid a memcpy(). As a result our messaging code is now
about 10% faster, and the ncacn_ip_tcp and ncalrpc code is also
faster.

The second change was to remove the unused mem_ctx argument from
socket_send(). Having it there implied that memory could be allocated,
which meant the caller had to worry about freeing that memory (if for
example it is sending in a tight loop using the same memory
context). Removing that unused argument keeps life simpler for users.
2007-10-10 13:04:52 -05:00
Andrew Tridgell
7f2c771b0e r3278: - rewrote the client side rpc connection code to use lib/socket/
rather than doing everything itself. This greatly simplifies the
  code, although I really don't like the socket_recv() interface (it
  always allocates memory for you, which means an extra memcpy in this
  code)

- fixed several bugs in the socket_ipv4.c code, in particular client
  side code used a non-blocking connect but didn't handle EINPROGRESS,
  so it had no chance of working. Also fixed the error codes, using
  map_nt_error_from_unix()

- cleaned up and expanded map_nt_error_from_unix()

- changed interpret_addr2() to not take a mem_ctx. It makes absolutely
  no sense to allocate a fixed size 4 byte structure like this. Dozens
  of places in the code were also using interpret_addr2() incorrectly
  (precisely because the allocation made no sense)
2007-10-10 13:04:49 -05:00
Andrew Tridgell
f1c5be396b r3256: get rid of the unused session_claim() and session_yield() calls 2007-10-10 13:04:47 -05:00
Andrew Tridgell
86b5118c2a r3255: - fixed 2 uninitialised data errors found with valgrind
- fixed offset of setup words in nttrans reply
2007-10-10 13:04:47 -05:00
Andrew Tridgell
977bc87d18 r3243: read the high offset count in SMBreadx in the server 2007-10-10 13:04:45 -05:00
Andrew Tridgell
70be45de05 r3234: in SMBreadx, if the client asks for exactly 65535 bytes then don't try
to align the buffer, as that would make the read reply not fit
2007-10-10 13:04:43 -05:00
Andrew Tridgell
560300c002 r3202: return a old DOS error code ERRSRV:ERRbaduid for a bad vuid. This means we now pass the BASE-VUID test. 2007-10-10 13:04:40 -05:00
Andrew Bartlett
5bdf391b3b r3186: Use the properties of the new talloc() system to handle the auth
session info and server info structures.

Andrew Bartlett
2007-10-10 13:04:38 -05:00
Jelmer Vernooij
d560dcbdb8 r3136: - Allow specifying socket type when adding smbd service
- Make sure a epm_tower struct is completely initialized
- Some more minor fixes
2007-10-10 13:02:25 -05:00
Andrew Tridgell
3ea9445226 r3134: use struct idr_context * in tid allocation 2007-10-10 13:02:25 -05:00
Andrew Tridgell
e11b000319 r3084: mincnt and maxcnt were the wrong way around in readbraw server code 2007-10-10 13:01:57 -05:00
Andrew Tridgell
3457c1836c r3081: several updates to ntvfs and server side async request handling in
preparation for the full share modes and ntcreatex code that I am
working on.

highlights include:

 - changed the way a backend determines if it is allowed to process a
   request asynchronously. The previous method of looking at the
   send_fn caused problems when an intermediate ntvfs module disabled
   it, and the caller then wanted to finished processing using this
   function. The new method is a REQ_CONTROL_MAY_ASYNC flag in
   req->control_flags, which is also a bit easier to read

 - fixed 2 bugs in the readbraw server code. One related to trying to
   answer a readbraw with smb signing (which can't work, and crashed
   our signing code), the second related to error handling, which
   attempted to send a normal SMB error packet, when readbraw must
   send a 0 read reply (as it has no header)

 - added several more ntvfs_generic.c generic mapping functions. This
   means that backends no longer need to implement such esoteric
   functions as SMBwriteunlock() if they don't want to. The backend
   can just request the mapping layer turn it into a write followed by
   an unlock. This makes the backends considerably simpler as they
   only need to implement one style of each function for lock, read,
   write, open etc, rather than the full host of functions that SMB
   provides. A backend can still choose to implement them
   individually, of course, and the CIFS backend does that.

 - simplified the generic structures to make them identical to the
   principal call for several common SMB calls (such as
   RAW_WRITE_GENERIC now being an alias for RAW_WRITE_WRITEX).

 - started rewriting the pvfs_open() code in preparation for the full
   ntcreatex semantics.

 - in pvfs_open and ipc_open, initially allocate the open file
   structure as a child of the request, so on error we don't need to
   clean up. Then when we are going to succeed the open steal the
   pointer into the long term backend context. This makes for much
   simpler error handling (and fixes some bugs)

 - use a destructor in the ipc backend to make sure that everthing is
   cleaned up on receive error conditions.

 - switched the ipc backend to using idtree for fnum allocation

 - in the ntvfs_generic mapping routines, use a allocated secondary
   structure not a stack structure to ensure the request pointer
   remains valid even if the backend replies async.
2007-10-10 13:01:57 -05:00
Andrew Tridgell
834b09929b r3064: - use UINT8_MAX and UINT16_MAX instead of hex values for idr_get_new() limits
- change idr_get_new() to use > instead of >= in the limit check
2007-10-10 13:01:55 -05:00
Tim Potter
b572be00b3 r3060: Replace magic number with a C99 constant. 2007-10-10 13:01:55 -05:00
Andrew Tridgell
8856f010e9 r3059: completely get rid of the MAX_CONNECTIONS limit, as a idle tree
connect is very cheap now.
2007-10-10 13:01:55 -05:00
Andrew Tridgell
4220914179 r3057: - moved the idtree.c code into lib/
- converted the tid handling to use a idtree instead of bitmaps
2007-10-10 13:01:54 -05:00
Andrew Tridgell
cccd59009d r3054: use talloc_zero_array_p() in a couple of places 2007-10-10 13:01:54 -05:00
Andrew Tridgell
814881f0e5 r2857: this commit gets rid of smb_ucs2_t, wpstring and fpstring, plus lots of associated functions.
The motivation for this change was to avoid having to convert to/from
ucs2 strings for so many operations. Doing that was slow, used many
static buffers, and was also incorrect as it didn't cope properly with
unicode codepoints above 65536 (which could not be represented
correctly as smb_ucs2_t chars)

The two core functions that allowed this change are next_codepoint()
and push_codepoint(). These functions allow you to correctly walk a
arbitrary multi-byte string a character at a time without converting
the whole string to ucs2.

While doing this cleanup I also fixed several ucs2 string handling
bugs. See the commit for details.

The following code (which counts the number of occuraces of 'c' in a
string) shows how to use the new interface:

size_t count_chars(const char *s, char c)
{
	size_t count = 0;

	while (*s) {
		size_t size;
		codepoint_t c2 = next_codepoint(s, &size);
		if (c2 == c) count++;
		s += size;
	}

	return count;
}
2007-10-10 12:59:39 -05:00
Andrew Tridgell
5f5b04196c r2797: don't free the server_info before using it for anonymous connections 2007-10-10 12:59:35 -05:00
Andrew Tridgell
ee065ae7f9 r2784: - fixed alignment of ascii directory listings
- fixed minimum parameter size for ascii qpathinfo call
2007-10-10 12:59:32 -05:00
Andrew Tridgell
9a04664531 r2783: got rid of the unused remote architecture detection code 2007-10-10 12:59:32 -05:00
Stefan Metzmacher
3ff03b5cb2 r2751: this is a new ntvfs design which tries to solve:
- the stacking of modules
- finding the modules private data
- hide the ntvfs details from the calling layer
- I set NTVFS_INTERFACE_VERSION 0 till we are closer to release
  (because we need to solve some async problems with the module stacking)

metze
2007-10-10 12:59:30 -05:00
Andrew Tridgell
8dc23821c9 r2671: we're getting too many errors caused by the talloc_realloc() API not
taking a context (so when you pass a NULL pointer you end up with
memory in a top level context). Fixed it by changing the API to take a
context. The context is only used if the pointer you are reallocing is
NULL.
2007-10-10 12:59:20 -05:00
Andrew Tridgell
278cef77f0 r2669: convert make_user_info() and associated functions from malloc to talloc 2007-10-10 12:59:19 -05:00
Andrew Tridgell
1ff41bbcae r2664: fixed the final server leak for normal operation. We now get a clean report from --leak-check 2007-10-10 12:59:19 -05:00
Andrew Tridgell
c315d6ac1c r2660: - converted the libcli/raw/ library to use talloc_increase_ref_count()
rather than manual reference counts

- properly support SMBexit in the cifs and posix backends

- added a logoff method to all backends

With these changes the RAW-CONTEXT test now passes against the posix backend
2007-10-10 12:59:18 -05:00
Andrew Tridgell
18632ec565 r2658: fixed a couple of error codes found with RAW-CONTEXT 2007-10-10 12:59:17 -05:00
Andrew Tridgell
50d5c638a3 r2657: if we are already fully authenticated in session setup then the vuid is ignored 2007-10-10 12:59:17 -05:00
Andrew Tridgell
230e1cd777 r2648: - use a destructor on struct server_connection to simplify the
connection termination cleanup, and to ensure that the event
  contexts are properly removed for every process model

- gave auth_context the new talloc treatment, which removes another
  source of memory leaks.
2007-10-10 12:59:16 -05:00
Andrew Tridgell
2dc334a328 r2646: - use a talloc destructor to ensure that sockets from the new socket
library are closed on abnormal termination

- convert the service.h structures to the new talloc methods
2007-10-10 12:59:16 -05:00
Andrew Tridgell
f12ee2f241 r2629: convert gensec to the new talloc model
by making our gensec structures a talloc child of the open connection
we can be sure that it will be destroyed when the connection is
dropped.
2007-10-10 12:59:14 -05:00