1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
Commit Graph

34 Commits

Author SHA1 Message Date
Andrew Tridgell
ddc10d4d37 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)
(This used to be commit 89b74b5354)
2007-10-10 13:08:25 -05:00
Andrew Tridgell
b02c5abfb4 r4262: a sniff from kukks showed that the FILE_ATTRIBUTE_NORMAL handling in
pvfs was not correct. This should fix a xcopy bug on OS/2.
(This used to be commit 7251f1fcdd)
2007-10-10 13:07:29 -05:00
Andrew Tridgell
26c6b4c70b r3449: more include file reduction
the ldb part isn't ideal, I will have to think of a better solution
(This used to be commit 6b1f86aea8)
2007-10-10 13:05:13 -05:00
Andrew Tridgell
98f9d5cdf6 r3210: split lib/replace.o into a separate build subsystem LIBREPLACE, and
make the ldb tools depend on it. This should help the build of the ldb
tools on platforms without strnlen() or strndup()
(This used to be commit e6ddb9d8f3)
2007-10-10 13:04:41 -05:00
Andrew Bartlett
31e96d8def r3073: Fix bug in the handling of null-terminated ASCII strings in RPC.
Because we didn't count the null terminator, we would not move past it
in the packet.

Andrew Bartlett
(This used to be commit 8b38bffc70)
2007-10-10 13:01:55 -05:00
Andrew Tridgell
94c18cd1a3 r2932: character expansion in strlower_m or strupper_m is considered fatal
(as it could cause a overflow). Print a message giving the character
values involved in the expansion so it can be debugged if it happens.
(This used to be commit 2a6f59f376)
2007-10-10 12:59:49 -05:00
Andrew Tridgell
7b7619e0ba r2871: - got rid of the last bits of non-threadsafe data in util_str.o
- switch the fallback case tables to use talloc

- moved the used-once octal_string() inline in loadparm.c
(This used to be commit b04202eaac)
2007-10-10 12:59:40 -05:00
Andrew Tridgell
7d32679e96 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;
}
(This used to be commit 814881f0e5)
2007-10-10 12:59:39 -05:00
Andrew Tridgell
5b44130afa 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.
(This used to be commit 8dc23821c9)
2007-10-10 12:59:20 -05:00
Andrew Tridgell
797d80879c r2632: a new approach to handling const errors. We have had huge numbers of
const warnings for a long time, and no real way to approach a
solution. Some of them are unavoidable due to the way the C standard
works (for example, any function that provides strchr() like
functionality _must_ produce a const warning)

I will be converting a bunch of places that currently produce const
warnings to use the discard_const_p(). Some of these will be
unavoidable const problems, some of them will be ones we will fix up
over time. At least this change means we will no longer be swamped
with const warnings, and we will easily be able to see when new
problems emerge.
(This used to be commit fec3288ad6)
2007-10-10 12:59:14 -05:00
Andrew Tridgell
5c94fcab92 r2577: - I recently found out that charaters below 0x3F are guaranteed not to
occur as secondary bytes in any multi-byte character set. This
  allows for a very simple optimisation in strchr_m() and
  strrchr_m(). It might be a good idea to pick this up for Samba3.

- the horrible toktocliplist() is only used in clitar.c, so move it
  there, to prevent anyone else from being tempted to use it.
(This used to be commit 663b7b75dd)
2007-10-10 12:59:07 -05:00
Andrew Bartlett
9a9dcc7250 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).
(This used to be commit dfecb01506)
2007-10-10 12:59:05 -05:00
Andrew Tridgell
1ec841d33e r2454: fixed the accelerated StrCaseCmp() so it compares in the right order
(This used to be commit 4b795cbf12)
2007-10-10 12:58:54 -05:00
Andrew Tridgell
f2815e8412 r2437: implemented a suggestion from abartlet that if we cannot convert
strings to UTF16 in StrCaseCmp() that we fall back to a simpler
comparison.
(This used to be commit 2fa6ab9fe3)
2007-10-10 12:58:53 -05:00
Andrew Tridgell
9c69372fb2 r2430: got rid of StrnCaseCmp and added an accelerated version of StrCaseCmp()
for places where known ascii strings are being compared we should just
use strncasecmp() and other standard library functions (with
replacements via lib/replace.c if needed)
(This used to be commit 869b757bba)
2007-10-10 12:58:51 -05:00
Andrew Tridgell
694ac65faa r2003: got rid of next_token_nr(), which involved some horrible globals
and nasy pointer tricks.

this involved fixing some of the internals of smbclient
(This used to be commit 126fec6169)
2007-10-10 12:58:16 -05:00
Andrew Tridgell
b83ba93eae 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().
(This used to be commit e35bb094c5)
2007-10-10 12:58:14 -05:00
Andrew Tridgell
ada86316e5 r1820: added a strcmp_safe() that handles NULL pointers. Needed for the
search torture test, as some servers return really bad entries.
(This used to be commit c900ebb3ac)
2007-10-10 12:57:59 -05:00
Simo Sorce
d01bc8a91e r1758: Move and enhance the add_string_to_array function as per volker job on trunk
(This used to be commit 606caddeb9)
2007-10-10 12:57:54 -05:00
Andrew Bartlett
f929ee3e4e r1422: StrnCaseCmp now needs to be non-static.
Andrew Bartlett
(This used to be commit 6709c7010d)
2007-10-10 12:56:55 -05:00
Andrew Bartlett
bf598954f7 r1198: Merge the Samba 3.0 ntlm_auth, including the kerberos and SPENGO parts.
I have moved the SPNEGO and Kerberos code into libcli/auth, and intend
to refactor them into the same format as NTLMSSP.

Andrew Bartlett
(This used to be commit 58da78a746)
2007-10-10 12:56:44 -05:00
Andrew Tridgell
42eadaf3d9 r1048: - moved the schannel definitions into a separate schannel.idl
- added server side support for schannel type 23. This allows WinXP to establish a schannel connection
  to Samba4 as an ADS DC

- added client side support for schannel type 23, but disabled it as currently the client
  code has now way of getting the fully qualified domain name (which is needed)

- report dcerpc faults in the server code in the log
(This used to be commit 55e0b014fe)
2007-10-10 12:56:34 -05:00
Stefan Metzmacher
fa2e9ec311 r960: convert 'unsigned int' to uint_t in the most places
metze
(This used to be commit 18062d2ed9)
2007-10-10 12:56:23 -05:00
Stefan Metzmacher
45e93c19ef r943: change samba4 to use 'uint8_t' instead of 'unsigned char'
metze
(This used to be commit b5378803fd)
2007-10-10 12:56:21 -05:00
Stefan Metzmacher
f88bf54c7f r889: convert samba4 to use [u]int16_t instead of [u]int16
metze
(This used to be commit af6f1f8a01)
2007-10-10 12:56:16 -05:00
Andrew Bartlett
5b0ab386cb r874: This patch is a pile of work on NTLMSSP:
Samba's NTLMSSP code is now fully talloc based, which should go a long
way to cleaning up the memory leaks in this code.  This also avoids a
lot of extra copies of data, as we now allocate the 'return' blobs on
a caller-supplied context.

I have also been doing a lot of work towards NTLM2 signing and
sealing.  I have this working for sealing, but not for the verifier
(MD5 integrity check on the stream) which is still incorrect.

(I can aim a rpcecho sinkdata from a Win2k3 box to my server, and the
data arrives intact, but the signature check fails.  It does however
match the test values I have...).

The new torture test is cludged in - when we get a unit test suite
back, I'll happliy put it in the 'right' place....

Andrew Bartlett
(This used to be commit 399e2e2b11)
2007-10-10 12:56:14 -05:00
Andrew Tridgell
f7a7192eff r827: remove a few more unused functions that we are unlikely to use again
(This used to be commit 121dd9ba00)
2007-10-10 12:53:53 -05:00
Andrew Tridgell
938eef5beb removed some unused functions
(This used to be commit 09d17d705a)
2003-12-16 12:59:20 +00:00
Tim Potter
c32a03ad12 Removed unused variable.
(This used to be commit 40ccaeefed)
2003-11-23 11:05:31 +00:00
Tim Potter
c071301a77 Add a strlen_m_term() function for returning the length of a string
including the termination.  Using value(strlen_m((r->name)+1)*2) gives
the wrong answer for the NULL string.
(This used to be commit 7ae329e663)
2003-11-23 10:50:52 +00:00
Andrew Tridgell
d4dfcda78e * fixed level2 of QueryUserInfo
* added per-field testing of SetUserInfo

 * fixed strlen_m()
(This used to be commit 26238b0f8a)
2003-11-20 10:29:54 +00:00
Andrew Tridgell
bcfbaa312a run LookupDomain on each domain returned from EnumDomains in samr
(This used to be commit 947b9f8ced)
2003-11-15 07:51:19 +00:00
Andrew Tridgell
de10237719 more fixes from the IRIX compiler (thanks herb!)
(This used to be commit 02d068ba7d)
2003-08-15 18:54:44 +00:00
Andrew Tridgell
ef2e26c91b first public release of samba4 code
(This used to be commit b0510b5428)
2003-08-13 01:53:07 +00:00