1
0
mirror of https://github.com/samba-team/samba.git synced 2025-10-28 03:33:13 +03:00
Commit Graph

25 Commits

Author SHA1 Message Date
Andrew Tridgell
10188869ef r3454: moved a few more things out if includes.h into the include/system/ include files.
this brings us down to about 11k lines of headers included with
includes.h, while still retaining the speed of building with pch
2007-10-10 13:05:13 -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
73ea8ee6c2 r3441: some include file cleanups and general housekeeping 2007-10-10 13:05:11 -05:00
Andrew Tridgell
5921587ec2 r3323: more warning reductions 2007-10-10 13:04:55 -05:00
Stefan Metzmacher
3bbda7475a r3102: typo
metze
2007-10-10 13:02:21 -05:00
Stefan Metzmacher
61de2229e2 r3101: some minor fixes
metze
2007-10-10 13:02:21 -05:00
Stefan Metzmacher
958aa8de63 r3100: support 'bin/smbclient //w2k3-101/c$ -U \\administrator@w2k3.vmnet1.vm.base'
we need to send an empty string as userdomain in this case.
fix bug #1317 in the client side

metze
2007-10-10 13:02:21 -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
c60ff99c31 r2674: I have realised that talloc() should have its context marked const, as
a const pointer really means that "the data pointed to by this pointer
won't change", and that is certainly true of talloc(). The fact that
some behind-the-scenes meta-data can change doesn't matter from the
point of view of const.

this fixes a number of const warnings caused by const data structures
being passed as talloc contexts. That will no longer generate a
warning.

also changed the talloc leak reporting option from --leak-check to
--leak-report, as all it does is generate a report on exit. A new
--leak-report-full option has been added that shows the complete tree
of memory allocations, which is is quite useful in tracking things down.

NOTE: I find it quite useful to insert talloc_report_full(ptr, stderr)
calls at strategic points in the code while debugging memory
allocation problems, particularly before freeing a major context (such
as the connection context). This allows you to see if that context has
been accumulating too much data, such as per-request data, which
should have been freed when the request finished.
2007-10-10 12:59:20 -05:00
Andrew Tridgell
96d33d36a5 r2640: valgrind does a great job on some types of memory leaks, but is slow
and can't properly handle leaks of doubly linked lists which we use a
lot (as the memory is always reachable). Even with --show-reachable
its hard to track leaks down sometimes.

I realised that talloc does have the necessary information to track
these, and by using the cascading property of the new talloc it can
report on leaks in a much more succinct fashion than valgrind can.

I have added a new samba option --leak-check that applies to all Samba
tools. When enabled it prints a leak report summarising all top level
contexts that are present when the program exits. A typical report
looks like this:

talloc report on 'null_context' (total 1071 bytes in 52 blocks)
        iconv(CP850,UTF8)              contains     43 bytes in   3 blocks
        UNNAMED                        contains     24 bytes in   1 blocks
        UNNAMED                        contains     24 bytes in   1 blocks
        dcesrv_init                    contains    604 bytes in  26 blocks
        server_service                 contains    120 bytes in   6 blocks
        UNNAMED                        contains     24 bytes in   1 blocks
        UNNAMED                        contains     24 bytes in   1 blocks
        server_service                 contains    104 bytes in   4 blocks
        server_context                 contains     12 bytes in   2 blocks
        iconv(UTF8,UTF-16LE)           contains     46 bytes in   3 blocks
        iconv(UTF-16LE,UTF8)           contains     46 bytes in   3 blocks

the numbers are recursive summaries for all the memory hanging off each context.

this option is not thread safe when used, but the code is thread safe
if the option is not given, so I don't think thats a problem.
2007-10-10 12:59:15 -05:00
Andrew Tridgell
360a6b530e r2302: added a '--option' option, allowing any global or default option in
smb.conf to be set on the command line. For example, you can use:

  smbtorture --option 'unicode=false'
or
  smbtorture --option 'netbios name=myname'
2007-10-10 12:58:41 -05:00
Andrew Tridgell
89acbf4f02 r2272: fixed another couple of errors in the popt option arrays 2007-10-10 12:58:36 -05:00
Andrew Tridgell
126fec6169 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
2007-10-10 12:58:16 -05:00
Andrew Tridgell
d07dbdb22a r1972: cmdline_auth_info does not need to be declared global 2007-10-10 12:58:14 -05:00
Stefan Metzmacher
ffb87ebc33 r1957: add cmdline_set_* functions
and let smbclient use the cmdline _* functions

metze
2007-10-10 12:58:13 -05:00
Stefan Metzmacher
d14a01533c r1949: provide functions to access the username, userdomain and userpassword
now you're prompted when cmdline_get_userpassword() is called
and the password is not yet known

metze
2007-10-10 12:58:13 -05:00
Stefan Metzmacher
ecf6be894f r1912: move popt_common.h
metze
2007-10-10 12:58:10 -05:00
Stefan Metzmacher
1fc0100e44 r1911: merge a few popt parameters from 3.0 move some to better places
and deal with users DOMAIN and lp_workgroup() of the local workstation

metze
2007-10-10 12:58:10 -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
c78a2ddb28 r665: merge over the new build system from my tmp branch
to the main SAMBA_4_0 tree.

NOTE: that it's not completely ready, but it's functional:-)

metze
2007-10-10 12:53:36 -05:00
Stefan Metzmacher
bfd7fd21c8 - creat the LIBCMDLINE subsystem
including readline and popt

- creat the CONFIG subsystem
  including param/* dynconfig.* and passdb/secrets.*

metze
-
Stefan Metzmacher
24dc237e10 merge the version.h autogeneration stuff from 3.0
metze
-
Andrew Tridgell
3d48fa8f37 don't use c++ comments -
Andrew Tridgell
8fe4058711 added -m for 'max protocol' as a standard option -
Andrew Tridgell
b0510b5428 first public release of samba4 code -