kai/samba.git
8 years agos3:WHATSNEW.txt: remove the "strict allocate" default value
Stefan Metzmacher [Wed, 13 Apr 2011 18:33:45 +0000 (20:33 +0200)]
s3:WHATSNEW.txt: remove the "strict allocate" default value

commit dc36d75d5fddaa351025e8eb8140f401b66aeb9d
reverted the change to true, because it makes Samba
unusable on systems without Linux and a modern Filesystem.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Wed Apr 13 21:21:10 CEST 2011 on sn-devel-104

8 years agos3-cli_pipe: fix timeout in rpc_pipe_open_tcp_port().
Günther Deschner [Wed, 13 Apr 2011 15:41:36 +0000 (17:41 +0200)]
s3-cli_pipe: fix timeout in rpc_pipe_open_tcp_port().

Make sure we use a timeout of 60 seconds, not 60 milliseconds...

This prevented us from successfully using the ncacn_ip_tcp client in a lot of
places, I guess.

Guenther

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Wed Apr 13 18:59:19 CEST 2011 on sn-devel-104

8 years agos3-util_sock: very brief documentation for open_socket_out().
Günther Deschner [Wed, 13 Apr 2011 15:35:44 +0000 (17:35 +0200)]
s3-util_sock: very brief documentation for open_socket_out().

The most important bit is to document that timeout is in MILLIseconds, not
seconds.

Guenther

8 years agos3: Make send_nt_replies() static
Volker Lendecke [Wed, 13 Apr 2011 13:40:15 +0000 (15:40 +0200)]
s3: Make send_nt_replies() static

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Wed Apr 13 16:25:29 CEST 2011 on sn-devel-104

8 years agotalloc: fix compiler warnings with -Wc++-compat
Stefan Metzmacher [Wed, 13 Apr 2011 11:40:29 +0000 (13:40 +0200)]
talloc: fix compiler warnings with -Wc++-compat

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Wed Apr 13 14:33:23 CEST 2011 on sn-devel-104

8 years agos3: Fix Coverity ID 2470: STRAY_SEMICOLON
Volker Lendecke [Tue, 12 Apr 2011 08:53:36 +0000 (10:53 +0200)]
s3: Fix Coverity ID 2470: STRAY_SEMICOLON

Signed-off-by: Günther Deschner <gd@samba.org>
Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Wed Apr 13 12:57:43 CEST 2011 on sn-devel-104

8 years agos3: Use talloc_tos() in the S3 build
Volker Lendecke [Wed, 13 Apr 2011 06:35:00 +0000 (08:35 +0200)]
s3: Use talloc_tos() in the S3 build

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Wed Apr 13 09:30:55 CEST 2011 on sn-devel-104

8 years agobuild: Bring DYNCONFIG into samba-util library to avoid symbol duplication
Andrew Bartlett [Wed, 13 Apr 2011 05:26:30 +0000 (15:26 +1000)]
build: Bring DYNCONFIG into samba-util library to avoid symbol duplication

When this was depended on directly as a subsystem, it ended up in
multiple libraries.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Wed Apr 13 08:39:35 CEST 2011 on sn-devel-104

8 years agos3-build Remove distinct LOCALEDIR subsystem
Andrew Bartlett [Wed, 13 Apr 2011 05:13:45 +0000 (15:13 +1000)]
s3-build Remove distinct LOCALEDIR subsystem

This is no different to the rest of dynconfig, and so should be dealt
with there.

Andrew Bartlett

8 years agos4-test: added a test for E_deshash()
Andrew Tridgell [Wed, 13 Apr 2011 04:40:27 +0000 (14:40 +1000)]
s4-test: added a test for E_deshash()

this particularly checks the boundary conditions near passwords of
length 14 characters

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Wed Apr 13 07:31:55 CEST 2011 on sn-devel-104

8 years agos3-charcnv: Move convert_string() et al to lib/util/charset
Andrew Bartlett [Tue, 12 Apr 2011 04:01:41 +0000 (14:01 +1000)]
s3-charcnv: Move convert_string() et al to lib/util/charset

This is the first step to this being the common convert_string
implementation.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
8 years agolibcli/auth Use convert_string_error to check LM hash calculation.
Andrew Bartlett [Tue, 12 Apr 2011 01:29:59 +0000 (11:29 +1000)]
libcli/auth Use convert_string_error to check LM hash calculation.

This allows us to know if the LM hash was built correctly or not.

NOTE: talloc_tos() is not available in the common code at this time.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
8 years agolib/util/charset Add many more charset tests
Andrew Bartlett [Tue, 12 Apr 2011 00:37:24 +0000 (10:37 +1000)]
lib/util/charset Add many more charset tests

This confirms that the behaviour of the convert_string() API (with the
process-wide iconv handle).

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
8 years agolib/util/charset Add convert_string_error()
Andrew Bartlett [Tue, 12 Apr 2011 00:36:37 +0000 (10:36 +1000)]
lib/util/charset Add convert_string_error()

This adds an interface that matches the source3/ convert string code.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
8 years agolib/util/charset Make ASCII conversion validate it's input
Andrew Bartlett [Tue, 12 Apr 2011 00:35:43 +0000 (10:35 +1000)]
lib/util/charset Make ASCII conversion validate it's input

We should not just strip the high bits off unicode strings being
converted to ASCII, we need to actually fail the conversion.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
8 years agos3-selftest Add workaround for RAP test failure
Andrew Bartlett [Wed, 13 Apr 2011 01:37:33 +0000 (11:37 +1000)]
s3-selftest Add workaround for RAP test failure

The rap.sam test reads 0xFFFFFFFF as a string in the level 2
r->HomeDir attribute, which once we start validating ASCII strings
fails.  This restores a unchecked dos charset for this test only,
until it is determined if the client or server RAP code is at fault.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
8 years agolib/util/charset Rename convert_string test to allow a 'non_handle' test
Andrew Bartlett [Mon, 11 Apr 2011 11:37:01 +0000 (21:37 +1000)]
lib/util/charset Rename convert_string test to allow a 'non_handle' test

A future commit will test (with a subset of tests) the varient of this
function without _handle.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
8 years agolib/util/charset Add more tests for convert_string_error_handle()
Andrew Bartlett [Mon, 11 Apr 2011 11:36:13 +0000 (21:36 +1000)]
lib/util/charset Add more tests for convert_string_error_handle()

This helps define the semantics of this function very clearly,
particularly for partial and invalid inputs.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
8 years agolib/util/charset Preserve 'pull' errors even when converting via UTF16
Andrew Bartlett [Mon, 11 Apr 2011 11:34:21 +0000 (21:34 +1000)]
lib/util/charset Preserve 'pull' errors even when converting via UTF16

When we do not have a direct iconv handle between any two charsets, we
must go iva UTF16.  However, we should still return the same buffer
and error code as if we were able to go direct - including the partial
conversion and the error code.

This is important for locating the invalid multibyte character in the
stream, for example.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
8 years agolib/util/charset Add tests for convert_string_error_handle
Andrew Bartlett [Mon, 11 Apr 2011 10:47:13 +0000 (20:47 +1000)]
lib/util/charset Add tests for convert_string_error_handle

These confirm that the errno is set correctly and that we stop on a
partial multibyte character

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
8 years agolib/util/charset Add expected values for upper/lower case tests
Andrew Bartlett [Mon, 11 Apr 2011 10:46:42 +0000 (20:46 +1000)]
lib/util/charset Add expected values for upper/lower case tests

Signed-off-by: Andrew Tridgell <tridge@samba.org>
8 years agolib/util/charset Fix and add public interface for convert_string_error_handle
Andrew Bartlett [Mon, 11 Apr 2011 10:15:53 +0000 (20:15 +1000)]
lib/util/charset Fix and add public interface for convert_string_error_handle

It makes much more sense for this to match the source3/ interface and
return a bool.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
8 years agos4/torture Fix calls to charcnv functions to always supply converted_size
Andrew Bartlett [Tue, 12 Apr 2011 08:12:20 +0000 (18:12 +1000)]
s4/torture Fix calls to charcnv functions to always supply converted_size

Signed-off-by: Andrew Tridgell <tridge@samba.org>
8 years agolib/util: Make string_replace from s3 common
Andrew Bartlett [Fri, 8 Apr 2011 03:04:26 +0000 (13:04 +1000)]
lib/util: Make string_replace from s3 common

The s4 implementation didn't do multibyte strings, so was only good
for '/' which is known to be safe in all multibyte charsets.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
8 years agolib/util ucs2_align is identical, put it in common
Andrew Bartlett [Fri, 8 Apr 2011 02:55:28 +0000 (12:55 +1000)]
lib/util ucs2_align is identical, put it in common

Signed-off-by: Andrew Tridgell <tridge@samba.org>
8 years agolib/util Move simple string routines into common code.
Andrew Bartlett [Fri, 8 Apr 2011 02:02:40 +0000 (12:02 +1000)]
lib/util Move simple string routines into common code.

Signed-off-by: Andrew Tridgell <tridge@samba.org>
8 years agolib/util/charset Move source3/lib/util_unistr.c to the common code.
Andrew Bartlett [Tue, 12 Apr 2011 06:31:08 +0000 (16:31 +1000)]
lib/util/charset Move source3/lib/util_unistr.c to the common code.

This file (largely) contains functions to deal with UTF16 strings.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
8 years agos3-lib Move strdup_w to it's only user in mangle_hash.c
Andrew Bartlett [Tue, 12 Apr 2011 06:55:16 +0000 (16:55 +1000)]
s3-lib Move strdup_w to it's only user in mangle_hash.c

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
8 years agos3-lib Move isvalid83_w to mangle_hash.c
Andrew Bartlett [Tue, 12 Apr 2011 06:23:17 +0000 (16:23 +1000)]
s3-lib Move isvalid83_w to mangle_hash.c

This means that there is no need for the 'valid.dat' table to be
loaded by anything other than smbd, so the unloader is also removed.

The concept of a 'valid dos character' has been replaced by the hash2
mangle method.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
8 years agos3-lib make static and remove more _w functions
Andrew Bartlett [Tue, 12 Apr 2011 06:16:22 +0000 (16:16 +1000)]
s3-lib make static and remove more _w functions

Signed-off-by: Andrew Tridgell <tridge@samba.org>
8 years agos3-lib Remove unused #define
Andrew Bartlett [Tue, 12 Apr 2011 06:11:13 +0000 (16:11 +1000)]
s3-lib Remove unused #define

Signed-off-by: Andrew Tridgell <tridge@samba.org>
8 years agos3-lib Remove unused skip_unibuf()
Andrew Bartlett [Tue, 12 Apr 2011 06:10:57 +0000 (16:10 +1000)]
s3-lib Remove unused skip_unibuf()

Signed-off-by: Andrew Tridgell <tridge@samba.org>
8 years agos3-lib: Remove unused _w functions.
Andrew Bartlett [Tue, 12 Apr 2011 05:59:51 +0000 (15:59 +1000)]
s3-lib: Remove unused _w functions.

In general we don't manipulate UTF16 strings internally, particularly
as they are also multibyte, so are no easier to work with than UTF8.

Andrew Bartlett

Signed-off-by: Andrew Tridgell <tridge@samba.org>
8 years agos3-lib Correct comment in strlen_w()
Andrew Bartlett [Tue, 12 Apr 2011 05:48:43 +0000 (15:48 +1000)]
s3-lib Correct comment in strlen_w()

Signed-off-by: Andrew Tridgell <tridge@samba.org>
8 years agos3-lib Remove more unused fstring.c functions
Andrew Bartlett [Tue, 12 Apr 2011 05:39:18 +0000 (15:39 +1000)]
s3-lib Remove more unused fstring.c functions

Signed-off-by: Andrew Tridgell <tridge@samba.org>
8 years agos3-charcnv: make pull_ucs2 static
Andrew Bartlett [Tue, 12 Apr 2011 05:25:04 +0000 (15:25 +1000)]
s3-charcnv: make pull_ucs2 static

Signed-off-by: Andrew Tridgell <tridge@samba.org>
8 years agos3-lib: Remove unused pull_ucs2_fstring()
Andrew Bartlett [Tue, 12 Apr 2011 05:22:12 +0000 (15:22 +1000)]
s3-lib: Remove unused pull_ucs2_fstring()

Signed-off-by: Andrew Tridgell <tridge@samba.org>
8 years agobuild: use readelf as a replacement for ldd
Andrew Tridgell [Tue, 12 Apr 2011 11:20:41 +0000 (21:20 +1000)]
build: use readelf as a replacement for ldd

using readelf allows us to do a non-recursive library listing, which
is important to remove false positive symbol duplication

Autobuild-User: Andrew Tridgell <tridge@samba.org>
Autobuild-Date: Wed Apr 13 04:37:33 CEST 2011 on sn-devel-104

8 years agolibds: Make flag_mapping a library
Andrew Bartlett [Fri, 8 Apr 2011 03:18:14 +0000 (13:18 +1000)]
libds: Make flag_mapping a library

This is a tiny library, but otherwise the functions end up in multiple
other libraries.

Andrew Bartlett

8 years agolib/util make UTIL_TDB a library
Andrew Bartlett [Fri, 8 Apr 2011 02:55:49 +0000 (12:55 +1000)]
lib/util make UTIL_TDB a library

8 years agolibcli/ldap pull LIBCLI_LDAP_MESSAGE and LIBCLI_LDAP_NDR into a library
Andrew Bartlett [Fri, 8 Apr 2011 01:16:45 +0000 (11:16 +1000)]
libcli/ldap pull LIBCLI_LDAP_MESSAGE and LIBCLI_LDAP_NDR into a library

This reduces symbol duplication

Andrew Bartlett

8 years agobuild: speed up SYMBOLCHECK code
Andrew Tridgell [Tue, 12 Apr 2011 01:11:55 +0000 (11:11 +1000)]
build: speed up SYMBOLCHECK code

this uses a nm and ldd cache to speed up the duplicate symbol checking
code

Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>

8 years agos3: For net ads join, create a krb5.conf
Volker Lendecke [Sat, 26 Feb 2011 17:12:49 +0000 (18:12 +0100)]
s3: For net ads join, create a krb5.conf

Signed-off-by: Günther Deschner <gd@samba.org>
Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Tue Apr 12 14:10:05 CEST 2011 on sn-devel-104

8 years agos3: Initialize output in libnet_Join
Volker Lendecke [Sat, 26 Feb 2011 17:12:32 +0000 (18:12 +0100)]
s3: Initialize output in libnet_Join

Signed-off-by: Günther Deschner <gd@samba.org>
8 years agos3: Retry the join with the short name
Volker Lendecke [Sat, 26 Feb 2011 16:53:16 +0000 (17:53 +0100)]
s3: Retry the join with the short name

Signed-off-by: Günther Deschner <gd@samba.org>
8 years agos3-util: separate out cmdline helpers.
Günther Deschner [Fri, 1 Apr 2011 23:00:52 +0000 (01:00 +0200)]
s3-util: separate out cmdline helpers.

Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Tue Apr 12 13:06:27 CEST 2011 on sn-devel-104

8 years agos3: add some forward declarations.
Günther Deschner [Wed, 6 Apr 2011 13:16:53 +0000 (15:16 +0200)]
s3: add some forward declarations.

Guenther

8 years agos3-netapi: use dcerpc_try_samr_connects().
Günther Deschner [Wed, 6 Apr 2011 12:40:50 +0000 (14:40 +0200)]
s3-netapi: use dcerpc_try_samr_connects().

Guenther

8 years agos3-netapi: use libnetapi_get_binding_handle().
Günther Deschner [Wed, 6 Apr 2011 12:35:24 +0000 (14:35 +0200)]
s3-netapi: use libnetapi_get_binding_handle().

Guenther

8 years agos3-netapi: add libnetapi_get_binding_handle().
Günther Deschner [Wed, 6 Apr 2011 12:21:30 +0000 (14:21 +0200)]
s3-netapi: add libnetapi_get_binding_handle().

Guenther

8 years agos3-librpc: let librpc/rpc/dcerpc.h include ndr and generated dcerpc headers.
Günther Deschner [Wed, 30 Mar 2011 23:01:05 +0000 (01:01 +0200)]
s3-librpc: let librpc/rpc/dcerpc.h include ndr and generated dcerpc headers.

Guenther

8 years agos3-rpc_client: move rpc_cli_transport structs and protos to rpc_transport.h
Günther Deschner [Wed, 30 Mar 2011 22:34:28 +0000 (00:34 +0200)]
s3-rpc_client: move rpc_cli_transport structs and protos to rpc_transport.h

Guenther

8 years agos3/selftest Tear down the environment if we fail to connect
Andrew Bartlett [Mon, 11 Apr 2011 23:05:34 +0000 (09:05 +1000)]
s3/selftest Tear down the environment if we fail to connect

This removes the exit(1) that previously didn't tear down the
environment correctly, and instead just fails to set it up, allowing
the rest of the script handle that with more grace.

Andrew Bartlett

Autobuild-User: Andrew Bartlett <abartlet@samba.org>
Autobuild-Date: Tue Apr 12 01:53:37 CEST 2011 on sn-devel-104

8 years agos3-printing: Use become_user_by_session() function.
Andreas Schneider [Fri, 1 Apr 2011 09:55:27 +0000 (11:55 +0200)]
s3-printing: Use become_user_by_session() function.

We create a fake connection here and don't have an vuid. So work with
the session_info directly here.

Signed-off-by: Jeremy Allison <jra@samba.org>
Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Mon Apr 11 22:56:12 CEST 2011 on sn-devel-104

8 years agos3-smbd: Added a become_user_by_session() function.
Andreas Schneider [Fri, 1 Apr 2011 09:54:49 +0000 (11:54 +0200)]
s3-smbd: Added a become_user_by_session() function.

This uses the provided session_info instead of searching the user via
the vuid. This is useful to work with fake connnection you need to
create if someone connects directly to a rpc service.

Signed-off-by: Jeremy Allison <jra@samba.org>
8 years agos3-smbd: Added a change_to_user_by_session() function.
Andreas Schneider [Tue, 5 Apr 2011 11:54:31 +0000 (13:54 +0200)]
s3-smbd: Added a change_to_user_by_session() function.

Signed-off-by: Jeremy Allison <jra@samba.org>
8 years agos3: Wrap creating the svcctl keys in a transaction
Volker Lendecke [Sat, 9 Apr 2011 16:15:12 +0000 (18:15 +0200)]
s3: Wrap creating the svcctl keys in a transaction

This makes the startup of smbd in make test much quicker and thus more reliable
(cherry picked from commit f1aa38b414e97d8687d0bebf65baa384f75301b4)

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Mon Apr 11 22:09:58 CEST 2011 on sn-devel-104

8 years agos3: Make reg_backend_db.h includable by itself
Volker Lendecke [Sat, 9 Apr 2011 16:13:59 +0000 (18:13 +0200)]
s3: Make reg_backend_db.h includable by itself
(cherry picked from commit 6ba31d3bd29dd11b1b98859f4d8a65d9be7dac60)

8 years agos3: Fix Coverity ID 2472, UNINIT
Volker Lendecke [Fri, 8 Apr 2011 09:07:11 +0000 (11:07 +0200)]
s3: Fix Coverity ID 2472, UNINIT

Signed-off-by: Günther Deschner <gd@samba.org>
Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Mon Apr 11 17:14:35 CEST 2011 on sn-devel-104

8 years agos3: Fix Coverity ID 2473, UNINIT
Volker Lendecke [Fri, 8 Apr 2011 09:07:11 +0000 (11:07 +0200)]
s3: Fix Coverity ID 2473, UNINIT

Signed-off-by: Günther Deschner <gd@samba.org>
8 years agos3: Fix timeout calculation in event_add_to_poll_args
Volker Lendecke [Mon, 11 Apr 2011 11:37:42 +0000 (13:37 +0200)]
s3: Fix timeout calculation in event_add_to_poll_args

In the initial phase nmbd does not yet have timed events. This led to nmbd
not correctly registering its names in make test and certainly everywhere
else.

Autobuild-User: Volker Lendecke <vlendec@samba.org>
Autobuild-Date: Mon Apr 11 14:35:45 CEST 2011 on sn-devel-104

8 years agos3-modules: Fix debug message
Björn Baumbach [Mon, 11 Apr 2011 08:27:58 +0000 (10:27 +0200)]
s3-modules: Fix debug message

Print child descriptor instead of parent.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Mon Apr 11 11:48:42 CEST 2011 on sn-devel-104

8 years agoFix bug 8072 - PANIC: create_file_acl_common frees handle two times.
Jeremy Allison [Fri, 8 Apr 2011 21:24:44 +0000 (14:24 -0700)]
Fix bug 8072 - PANIC: create_file_acl_common frees handle two times.

Caused by premature optimisation storing the parent ACL on the
module handle instead of (correctly) on the file fsp. Previous
code wasn't reentrant safe. This is less optimal but doesn't
crash in the specific case :-).

Jeremy.

Autobuild-User: Jeremy Allison <jra@samba.org>
Autobuild-Date: Sat Apr  9 02:05:15 CEST 2011 on sn-devel-104

8 years agoSubtle change. Microsoft SMB2 tests return different access mask than for SMB1 with...
Jeremy Allison [Fri, 8 Apr 2011 23:18:56 +0000 (16:18 -0700)]
Subtle change. Microsoft SMB2 tests return different access mask than for SMB1 with raw.acls.

8 years agos3:net idmap check: fix output of an invalid record
Michael Adam [Fri, 8 Apr 2011 12:49:43 +0000 (14:49 +0200)]
s3:net idmap check: fix output of an invalid record

Only print the value number for hwm, version and seqnum keys.

Pair-Programmed-With: Gregor Beck <gbeck@sernet.de>

Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Fri Apr  8 17:29:31 CEST 2011 on sn-devel-104

8 years agos3-net: "idmap check" ignore __db_sequence_number__
Gregor Beck [Fri, 8 Apr 2011 12:53:25 +0000 (14:53 +0200)]
s3-net: "idmap check" ignore __db_sequence_number__

Signed-off-by: Michael Adam <obnox@samba.org>
8 years agotalloc/testsuite: avoid memory leak reported by valgrind
Stefan Metzmacher [Mon, 4 Apr 2011 13:53:46 +0000 (15:53 +0200)]
talloc/testsuite: avoid memory leak reported by valgrind

metze

Signed-off-By: Andrew Tridgell <tridge@samba.org>
Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Fri Apr  8 10:15:41 CEST 2011 on sn-devel-104

8 years agotalloc/testsuite: test more talloc_pool related things
Stefan Metzmacher [Thu, 31 Mar 2011 17:50:47 +0000 (19:50 +0200)]
talloc/testsuite: test more talloc_pool related things

metze

Signed-off-By: Andrew Tridgell <tridge@samba.org>
8 years agotalloc: include valgrind headers if available
Stefan Metzmacher [Mon, 4 Apr 2011 14:28:31 +0000 (16:28 +0200)]
talloc: include valgrind headers if available

metze

Signed-off-By: Andrew Tridgell <tridge@samba.org>
8 years agotalloc: add TC_INVALIDATE_POOL marco
Stefan Metzmacher [Mon, 4 Apr 2011 13:08:20 +0000 (15:08 +0200)]
talloc: add TC_INVALIDATE_POOL marco

metze

Signed-off-By: Andrew Tridgell <tridge@samba.org>
8 years agotalloc: add TC_UNDEFINE_GROW_CHUNK() marco
Stefan Metzmacher [Mon, 4 Apr 2011 11:29:47 +0000 (13:29 +0200)]
talloc: add TC_UNDEFINE_GROW_CHUNK() marco

metze

Signed-off-By: Andrew Tridgell <tridge@samba.org>
8 years agotalloc: add TC_INVALIDATE_SHRINK_CHUNK() marco
Stefan Metzmacher [Mon, 4 Apr 2011 11:28:11 +0000 (13:28 +0200)]
talloc: add TC_INVALIDATE_SHRINK_CHUNK() marco

This invalidates the unused bytes if we shrink memory.

metze

Signed-off-By: Andrew Tridgell <tridge@samba.org>
8 years agotalloc: add TC_INVALIDATE_FULL_CHUNK() macro
Stefan Metzmacher [Mon, 4 Apr 2011 09:47:57 +0000 (11:47 +0200)]
talloc: add TC_INVALIDATE_FULL_CHUNK() macro

This makes it easier to mark a talloc pointer as
invalid.

metze

Signed-off-By: Andrew Tridgell <tridge@samba.org>
8 years agotalloc: use VALGRIND_MAKE_MEM_UNDEFINED() before memmove()
Stefan Metzmacher [Mon, 4 Apr 2011 14:46:21 +0000 (16:46 +0200)]
talloc: use VALGRIND_MAKE_MEM_UNDEFINED() before memmove()

metze

Signed-off-By: Andrew Tridgell <tridge@samba.org>
8 years agotalloc: optimize talloc_free() and talloc_realloc() for talloc pools
Stefan Metzmacher [Thu, 31 Mar 2011 14:58:46 +0000 (16:58 +0200)]
talloc: optimize talloc_free() and talloc_realloc() for talloc pools

metze

Signed-off-By: Andrew Tridgell <tridge@samba.org>
8 years agotalloc: add TC_POOL_FIRST_CHUNK() macro
Stefan Metzmacher [Thu, 31 Mar 2011 14:56:18 +0000 (16:56 +0200)]
talloc: add TC_POOL_FIRST_CHUNK() macro

metze

Signed-off-By: Andrew Tridgell <tridge@samba.org>
8 years agotalloc: add TC_POOL_SPACE_LEFT() macro
Stefan Metzmacher [Thu, 31 Mar 2011 14:51:40 +0000 (16:51 +0200)]
talloc: add TC_POOL_SPACE_LEFT() macro

metze

Signed-off-By: Andrew Tridgell <tridge@samba.org>
8 years agotalloc: add TC_ALIGN16() macro
Stefan Metzmacher [Thu, 31 Mar 2011 14:55:00 +0000 (16:55 +0200)]
talloc: add TC_ALIGN16() macro

metze

Signed-off-By: Andrew Tridgell <tridge@samba.org>
8 years agotalloc: use TC_HDR_SIZE instead of sizeof(struct talloc_chunk)
Stefan Metzmacher [Thu, 31 Mar 2011 13:18:55 +0000 (15:18 +0200)]
talloc: use TC_HDR_SIZE instead of sizeof(struct talloc_chunk)

As this includes the padding to 16 bytes.

metze

Signed-off-By: Andrew Tridgell <tridge@samba.org>
8 years agoldb:ldb/common/ldb_modules.c - change the request counter type to be "unsigned"
Matthias Dieter Wallnöfer [Fri, 8 Apr 2011 06:30:41 +0000 (08:30 +0200)]
ldb:ldb/common/ldb_modules.c - change the request counter type to be "unsigned"

Just for consistency since all other LDB counters are unsigned as well.

And also the debug output specifier has been chosen to be "%u" - so it
really should be unsigned.

Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Fri Apr  8 09:17:47 CEST 2011 on sn-devel-104

8 years agoldb:ldb/common/ldb_modules.c - trivial - fix integer output specifiers
Matthias Dieter Wallnöfer [Fri, 8 Apr 2011 06:29:51 +0000 (08:29 +0200)]
ldb:ldb/common/ldb_modules.c - trivial - fix integer output specifiers

8 years agos3:net rpc trust: fix two C++ implicit void * cast warnings
Michael Adam [Thu, 7 Apr 2011 14:54:12 +0000 (16:54 +0200)]
s3:net rpc trust: fix two C++ implicit void * cast warnings

Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Thu Apr  7 17:52:28 CEST 2011 on sn-devel-104

8 years agos3:passdb:pdb_ipa: fix a C++ implicit void * cast warnings
Michael Adam [Thu, 7 Apr 2011 14:54:12 +0000 (16:54 +0200)]
s3:passdb:pdb_ipa: fix a C++ implicit void * cast warnings

8 years agos3:net idmap check: fix a couple of c++ implicit void * cast warnings
Michael Adam [Thu, 7 Apr 2011 14:54:12 +0000 (16:54 +0200)]
s3:net idmap check: fix a couple of c++ implicit void * cast warnings

8 years agopackaging(RHEL-CTDB): fix configure.rpm (honour additional cmdline parameters)
Michael Adam [Wed, 6 Apr 2011 15:53:14 +0000 (17:53 +0200)]
packaging(RHEL-CTDB): fix configure.rpm (honour additional cmdline parameters)

8 years agoldb:ldb_msg.c - make "ldb_msg_find_attr_as_*" more robust against invalid values
Matthias Dieter Wallnöfer [Wed, 6 Apr 2011 07:57:51 +0000 (09:57 +0200)]
ldb:ldb_msg.c - make "ldb_msg_find_attr_as_*" more robust against invalid values

- Integer handling was modeled after validate code from "schema_syntax.c".
- Double handling was modeled similar, but with a dynamic buffer.
  I don't know if there is a maximum literal length for double values but an
  allocation shouldn't a problem here since doubles are rare.
- String handlind is enhanced with a terminating "0" test for safety.

Reviewed-by: abartlet + metze
Autobuild-User: Matthias Dieter Wallnöfer <mdw@samba.org>
Autobuild-Date: Thu Apr  7 16:38:57 CEST 2011 on sn-devel-104

8 years agoldb:ldb_msg_check_sanity - clean it up from unneeded stuff
Matthias Dieter Wallnöfer [Thu, 7 Apr 2011 08:11:46 +0000 (10:11 +0200)]
ldb:ldb_msg_check_sanity - clean it up from unneeded stuff

8 years agodsdb:schema/schema_syntax.c - correctly check error code of "ldb_string_utc_to_time"
Matthias Dieter Wallnöfer [Mon, 4 Apr 2011 19:34:12 +0000 (21:34 +0200)]
dsdb:schema/schema_syntax.c - correctly check error code of "ldb_string_utc_to_time"

This one doesn't set ERRNO. An error happens if the result is "0".

Reviewed-by: abartlet
8 years agodsdb:schema/schema_syntax.c - add some empty value checks on validate functions
Matthias Dieter Wallnöfer [Mon, 4 Apr 2011 19:33:11 +0000 (21:33 +0200)]
dsdb:schema/schema_syntax.c - add some empty value checks on validate functions

They are needed since the check in "ldb_msg_sanity_check" will be removed.

Reviewed-by: abartlet
8 years agos4:objectclass LDB module - "ldb_msg_sanity_check" call not really needed
Matthias Dieter Wallnöfer [Mon, 4 Apr 2011 12:04:18 +0000 (14:04 +0200)]
s4:objectclass LDB module - "ldb_msg_sanity_check" call not really needed

This call should only be performed at the beginning of a request.
"ldb_msg_sanity_check" checks for DN validity (which should already have been
done at the beginning of the request) and empty attributes (which should
be done by the "objectclass_attrs" LDB module).

Hence it is superflous here.

Reviewed-by: abartlet
8 years agoldb:ldbadd/modify tool - return error code when at least one operation has failed
Matthias Dieter Wallnöfer [Mon, 4 Apr 2011 10:59:30 +0000 (12:59 +0200)]
ldb:ldbadd/modify tool - return error code when at least one operation has failed

This is required to better detect failures and should raise the
compatiblity to "ldapadd"/"ldapmodify".

Reviewed-by: abartlet
8 years agoldb:tests - "init.ldif" - deactivate empty "seeAlso" attribute
Matthias Dieter Wallnöfer [Thu, 7 Apr 2011 08:13:45 +0000 (10:13 +0200)]
ldb:tests - "init.ldif" - deactivate empty "seeAlso" attribute

8 years agoldb:ldb/common/ldb_modules.c - always use LDB error codes if possible
Matthias Dieter Wallnöfer [Mon, 4 Apr 2011 08:43:39 +0000 (10:43 +0200)]
ldb:ldb/common/ldb_modules.c - always use LDB error codes if possible

The callers do compare against LDB error codes - hence don't give back
"-1".

Reviewed-by: Tridge + abartlet
8 years agoldb:common/*.c - check for some OOM conditions
Matthias Dieter Wallnöfer [Mon, 4 Apr 2011 08:26:47 +0000 (10:26 +0200)]
ldb:common/*.c - check for some OOM conditions

Reviewed-by: abartlet
8 years agos4:objectclass LDB module - fix a comment - add a ")"
Matthias Dieter Wallnöfer [Mon, 4 Apr 2011 12:06:45 +0000 (14:06 +0200)]
s4:objectclass LDB module - fix a comment - add a ")"

Reviewed-by: abartlet
8 years agoselftest:Samba4: setup DC_* variables in provision_rpc_proxy()
Stefan Metzmacher [Fri, 25 Mar 2011 11:33:33 +0000 (12:33 +0100)]
selftest:Samba4: setup DC_* variables in provision_rpc_proxy()

The "rpc_proxy" should behave like "member", just with a different
configuration.

metze

Autobuild-User: Stefan Metzmacher <metze@samba.org>
Autobuild-Date: Thu Apr  7 15:52:25 CEST 2011 on sn-devel-104

8 years agos4-smbtorture: fix lsa forest trust test.
Günther Deschner [Thu, 7 Apr 2011 10:05:58 +0000 (12:05 +0200)]
s4-smbtorture: fix lsa forest trust test.

lsa_lsaRSetForestTrustInformation takes a policy handle obtained from
lsaopenpolicy/lsaopenpolicy2 and not a trusted domain handle
(MS-LSAD 3.1.4.7.16 LsarSetForestTrustInformation (Opnum 74)).

Sumit, please check.

Guenther

Autobuild-User: Günther Deschner <gd@samba.org>
Autobuild-Date: Thu Apr  7 14:52:52 CEST 2011 on sn-devel-104

8 years agolsa: use lsa_TrustedAccessMask in some more places in the lsa IDL.
Günther Deschner [Thu, 7 Apr 2011 09:47:44 +0000 (11:47 +0200)]
lsa: use lsa_TrustedAccessMask in some more places in the lsa IDL.

Guenther

8 years agos3-net: document "idmap check"
Gregor Beck [Thu, 7 Apr 2011 09:00:41 +0000 (11:00 +0200)]
s3-net: document "idmap check"

Signed-off-by: Michael Adam <obnox@samba.org>
Autobuild-User: Michael Adam <obnox@samba.org>
Autobuild-Date: Thu Apr  7 13:58:13 CEST 2011 on sn-devel-104

8 years agos3-net: fix the usage output of "net idmap check"
Gregor Beck [Thu, 7 Apr 2011 09:00:41 +0000 (11:00 +0200)]
s3-net: fix the usage output of "net idmap check"

Signed-off-by: Michael Adam <obnox@samba.org>