1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-05 21:57:51 +03:00

113 Commits

Author SHA1 Message Date
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
Andrew Tridgell
76d0b8206c r2627: use the new talloc capabilities in a bunch more places in the rpc
server code. This fixes a number of memory leaks I found when testing
with valgrind and smbtorture, as the cascading effect of a
talloc_free() ensures that anything derived from the top level object
is destroyed on disconnect.
2007-10-10 12:59:13 -05:00
Andrew Tridgell
3f7741f178 r2618: before we had refererence counts in talloc I added a hack in the
server side request structure to prevent a structing being freed in
some circumstances. This change replaces this with the much more
robust mechanism of talloc_increase_ref_count().
2007-10-10 12:59:12 -05:00
Andrew Tridgell
28a647f681 r2616: the cascading nature of talloc_free() can lead to some surprises. In
this case the bug was that server_terminate_connection() destroys the
server context, which in turn cascades down to destroy all current
request contexts, so we musn't then try to destroy the request
structure a second time.
2007-10-10 12:59:12 -05:00
Andrew Tridgell
9e1eb58e4b r2590: fixed one of the server security memory leaks. There are more :( 2007-10-10 12:59:10 -05:00
Andrew Tridgell
058b2fd99e r2581: added "hosts allow" and "hosts deny" checking in smbd. I needed this
as my box keeps getting hit by viruses spreading on my companies
internal network, which screws up my debug log badly (sigh).

metze, I'm not sure if you think access.c should go in the socket
library or not. It is closely tied to the socket functions, but you
may prefer it separate.

The access.c code is a port from Samba3, but with some cleanups to
make it (slighly) less ugly.
2007-10-10 12:59:07 -05:00
Andrew Tridgell
f84c0af35c r2561: completely redid the ntvfs module chaining code, You can now do something like:
ntvfs handler = nbench posix

and the nbench pass-thru module will be called before the posix
module. The chaining logic is now much saner, and less racy, with each
level in the chain getting its own private pointer rather than relying
on save/restore logic in the pass-thru module.

The only pass-thru module we have at the moment is the nbench one
(which records all traffic in a nbench compatibe format), but I plan
on soon writing a "unixuid" pass-thru module that will implement the
setegid()/setgroups()/seteuid() logic for standard posix uid
handling. This separation of the posix backend from the uid handling
should simplify the code, and make development easier.

I also modified the nbench module so it can do multiple chaining, so
if you want to you can do:

   ntvfs module = nbench nbench posix

and it will save 2 copies of the log file in /tmp. This is really only
useful for testing at the moment until we have more than one pass-thru
module.
2007-10-10 12:59:06 -05:00
Andrew Bartlett
dfecb01506 r2552: Character set conversion and string handling updates.
The intial motivation for this commit was to merge in some of the
bugfixes present in Samba3's chrcnv and string handling code into
Samba4.  However, along the way I found a lot of unused functions, and
decided to do a bit more...

The strlen_m code now does not use a fixed buffer, but more work is
needed to finish off other functions in str_util.c.  These fixed
length buffers hav caused very nasty, hard to chase down bugs at some
sites.

The strupper_m() function has a strupper_talloc() to replace it (we
need to go around and fix more uses, but it's a start).  Use of these
new functions will avoid bugs where the upper or lowercase version of
a string is a different length.

I have removed the push_*_allocate functions, which are replaced by
calls to push_*_talloc.  Likewise, pstring and other 'fixed length'
wrappers are removed, where possible.

I have removed the first ('base pointer') argument, used by push_ucs2,
as the Samba4 way of doing things ensures that this is always on an
even boundary anyway.  (It was used in only one place, in any case).
2007-10-10 12:59:05 -05:00
Andrew Bartlett
a132082249 r2550: survive our own BASE-NEGNOWAIT torture test.
Andrew Bartlett
2007-10-10 12:59:05 -05:00
Andrew Bartlett
2e197f05ff r2544: (missed from the last commit)
smb_conn->socket has gone away, and the packet count is now in the
main structure.

Andrew Bartlett
2007-10-10 12:59:04 -05:00
Andrew Bartlett
d8fd19a202 r2542: I really don't like the 'substitute' code, and I particularly don't
like it in the mainline code (outside the smb.conf magic).

We will need to have a more useful 'helper' routine for this, but for
now we at least get a reliable IP address.

Also remove the unused 'socket' structure in the smb server - it seems
to have been replaced by the socket library.

Andrew Bartlett
2007-10-10 12:59:04 -05:00
Andrew Bartlett
cd2f97530b r2541: Add a TODO: This is one place we can grab the remote netbios name.
Andrew Bartlett
2007-10-10 12:59:04 -05:00
Andrew Tridgell
04f68f481c r2521: fixed two uninitialised data errors found with valgrind when
negotiating a old style session setup (eg. LANMAN1)
2007-10-10 12:59:01 -05:00
Andrew Tridgell
4e4859c06b r2520: - finished implementing the server side of the old style search requests 2007-10-10 12:59:01 -05:00
Andrew Tridgell
9710f24b1f r2503: the RAW-SEARCH test now mostly passes against the posix backend 2007-10-10 12:58:59 -05:00
Andrew Tridgell
71480271ad r2469: complete overhaul of the old-style RAW_SEARCH_ calls (the OS/2 and
original core level calls). The old code was completely wrong in many respects.

also fixed the EA_SIZE level in the server

extended the RAW-SEARCH test suite to test the new code properly
2007-10-10 12:58:56 -05:00
Andrew Tridgell
9a708e2281 r2460: fixed the spnego code that I recently broke 2007-10-10 12:58:55 -05:00
Andrew Tridgell
93d444e6fd r2455: don't use the uninitialised sess structure when auth fails 2007-10-10 12:58:54 -05:00
Stefan Metzmacher
fba1637710 r2449: use a blocking fd for smbsrv code
metze
2007-10-10 12:58:54 -05:00
Stefan Metzmacher
2fd577d241 r2447: let the server code use the new lib/socket/ stuff
metze
2007-10-10 12:58:54 -05:00
Stefan Metzmacher
1854907da8 r2326: remove definition and usage of struct socket_context
metze
2007-10-10 12:58:44 -05:00
Stefan Metzmacher
45b77064bf r2320: add my copyright
metze
2007-10-10 12:58:43 -05:00
Andrew Bartlett
b8fe29dc7a r2288: Remove the claim/yield connection code - this will need to be redone
in a more samba4 style at some point (along with the session code).

Andrew Bartlett
2007-10-10 12:58:39 -05:00
Andrew Tridgell
c455a3a61d r2250: removed unnecessary mem_ctx 2007-10-10 12:58:34 -05:00
Andrew Tridgell
21ef338cbb r2249: got rid of some more mem_ctx elements in structures 2007-10-10 12:58:34 -05:00
Tim Potter
6c1a72c5d6 r2247: talloc_destroy -> talloc_free 2007-10-10 12:58:34 -05:00
Andrew Tridgell
756f28ac95 r2159: converted samba4 over to UTF-16.
I had previously thought this was unnecessary, as windows doesn't use
standards compliant UTF-16, and for filesystem operations treats bytes
as UCS-2, but Bjoern Jacke has pointed out to me that this means we
don't correctly store extended UTF-16 characters as UTF-8 on
disk. This can be seen with (for example) the gothic characters with
codepoints above 64k.

This commit also adds a LOCAL-ICONV torture test that tests the first
1 million codepoints against the system iconv library, and tests 5
million random UTF-16LE buffers for identical error handling to the
system iconv library.

the lib/iconv.c changes need backporting to samba3
2007-10-10 12:58:27 -05:00
Andrew Tridgell
9fdbe60230 r2046: fixed two server packet format errors found with the RAW-* tests 2007-10-10 12:58:20 -05:00
Andrew Tridgell
a6cc0bedad r2045: fixed a date format push in SMBsearch 2007-10-10 12:58:20 -05:00
Andrew Tridgell
d17e088ebb r2044: fixed two unin 2007-10-10 12:58:20 -05:00
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