obnox/samba/samba-obnox.git
10 years agoparam: remove duplicate lp_ulong function
Garming Sam [Fri, 21 Feb 2014 02:16:26 +0000 (15:16 +1300)]
param: remove duplicate lp_ulong function

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoparam: remove duplicate lp_int function
Garming Sam [Fri, 21 Feb 2014 02:13:58 +0000 (15:13 +1300)]
param: remove duplicate lp_int function

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <abartlet@samba.org>
10 years agoparam: use a single handle_include function between the two loadparms
Garming Sam [Fri, 21 Feb 2014 02:13:28 +0000 (15:13 +1300)]
param: use a single handle_include function between the two loadparms

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoparam: remove unused lp_set_option
Garming Sam [Fri, 21 Feb 2014 00:13:27 +0000 (13:13 +1300)]
param: remove unused lp_set_option

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoparam: use a single command line set_option in the code
Garming Sam [Thu, 20 Feb 2014 23:54:29 +0000 (12:54 +1300)]
param: use a single command line set_option in the code

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoparam: fix a bug where set_cmdline doesn't ignore the whitespace
Garming Sam [Thu, 20 Feb 2014 03:53:28 +0000 (16:53 +1300)]
param: fix a bug where set_cmdline doesn't ignore the whitespace

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoparam: move special charset handlers to lib/param
Garming Sam [Thu, 20 Feb 2014 03:37:16 +0000 (16:37 +1300)]
param: move special charset handlers to lib/param

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoparam: inline init_iconv into handle [dos] charset
Garming Sam [Thu, 20 Feb 2014 03:21:19 +0000 (16:21 +1300)]
param: inline init_iconv into handle [dos] charset

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoparam: add getservicebyname to s3_helpers
Garming Sam [Wed, 19 Feb 2014 05:08:47 +0000 (18:08 +1300)]
param: add getservicebyname to s3_helpers

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoparam: use a single init_copymap method in lib/param
Garming Sam [Thu, 20 Feb 2014 02:00:27 +0000 (15:00 +1300)]
param: use a single init_copymap method in lib/param

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agodocs: add test to docs.py to set parameters to some arbitrary value
Garming Sam [Wed, 5 Mar 2014 22:36:06 +0000 (11:36 +1300)]
docs: add test to docs.py to set parameters to some arbitrary value

This does not currently test enums.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agodocs: change docs.py to test the setting of parameters to defaults
Garming Sam [Wed, 5 Mar 2014 21:12:09 +0000 (10:12 +1300)]
docs: change docs.py to test the setting of parameters to defaults

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoparam: prevent an existing segmentation fault with setting [dos] charset
Garming Sam [Wed, 5 Mar 2014 20:03:30 +0000 (09:03 +1300)]
param: prevent an existing segmentation fault with setting [dos] charset

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoparam: move the declaration of the file_lists structure to a shared header
Garming Sam [Wed, 19 Feb 2014 22:07:28 +0000 (11:07 +1300)]
param: move the declaration of the file_lists structure to a shared header

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoparam: use a single add_to_file_list method
Garming Sam [Wed, 19 Feb 2014 22:01:52 +0000 (11:01 +1300)]
param: use a single add_to_file_list method

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agolib/param: change add_to_file_list to not use a loadparm context
Garming Sam [Wed, 19 Feb 2014 21:58:15 +0000 (10:58 +1300)]
lib/param: change add_to_file_list to not use a loadparm context

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:param: change add_to_file_list to stop using global variables
Garming Sam [Wed, 19 Feb 2014 21:55:28 +0000 (10:55 +1300)]
s3:param: change add_to_file_list to stop using global variables

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoparam: remove unused lp_copy_service
Garming Sam [Wed, 19 Feb 2014 21:38:46 +0000 (10:38 +1300)]
param: remove unused lp_copy_service

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoparam: consolidate handle_copy method between the two loadparms
Garming Sam [Wed, 19 Feb 2014 21:24:00 +0000 (10:24 +1300)]
param: consolidate handle_copy method between the two loadparms

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agolib/param: rename getservicebyname to lpcfg_getservicebyname to avoid conflicts
Garming Sam [Wed, 19 Feb 2014 05:03:57 +0000 (18:03 +1300)]
lib/param: rename getservicebyname to lpcfg_getservicebyname to avoid conflicts

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:param: avoid the use the global variable iServiceIndex in handle_copy
Garming Sam [Wed, 19 Feb 2014 00:53:53 +0000 (13:53 +1300)]
s3:param: avoid the use the global variable iServiceIndex in handle_copy

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoparam: use a single copy_service function in lib/param
Garming Sam [Wed, 19 Feb 2014 00:47:38 +0000 (13:47 +1300)]
param: use a single copy_service function in lib/param

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoparam: duplicate the copy service in lib/param into source3 loadparm
Garming Sam [Wed, 19 Feb 2014 00:38:09 +0000 (13:38 +1300)]
param: duplicate the copy service in lib/param into source3 loadparm

Change-Id: I9ddd9ba9c05ab226a335d261554dd1587f7e59fc
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agolib/param: fix copy service to correctly free the memory used by P_LIST
Garming Sam [Tue, 18 Feb 2014 23:58:36 +0000 (12:58 +1300)]
lib/param: fix copy service to correctly free the memory used by P_LIST

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoparam: improve copy_service to use the correct talloc parents
Garming Sam [Tue, 18 Feb 2014 02:38:11 +0000 (15:38 +1300)]
param: improve copy_service to use the correct talloc parents

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoparam: remove unused init_service
Garming Sam [Tue, 18 Feb 2014 02:06:41 +0000 (15:06 +1300)]
param: remove unused init_service

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:param: remove the double initialization in add_a_service
Garming Sam [Tue, 18 Feb 2014 01:38:10 +0000 (14:38 +1300)]
s3:param: remove the double initialization in add_a_service

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoparam: remove instance of lp_parm_ptr to be consistent with lib/param
Garming Sam [Tue, 18 Feb 2014 01:22:18 +0000 (14:22 +1300)]
param: remove instance of lp_parm_ptr to be consistent with lib/param

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:param: attempt to fix up some const warnings
Garming Sam [Tue, 18 Feb 2014 01:13:24 +0000 (14:13 +1300)]
s3:param: attempt to fix up some const warnings

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agolib/param: remove some const warnings from using lists
Garming Sam [Tue, 18 Feb 2014 00:27:43 +0000 (13:27 +1300)]
lib/param: remove some const warnings from using lists

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agolib/param: remove duplicated copy service in lpcfg_add_a_service
Garming Sam [Tue, 18 Feb 2014 00:26:22 +0000 (13:26 +1300)]
lib/param: remove duplicated copy service in lpcfg_add_a_service

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoparam: make lib/param copy_service use set_param_opt
Garming Sam [Mon, 17 Feb 2014 23:25:35 +0000 (12:25 +1300)]
param: make lib/param copy_service use set_param_opt

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoparam: move set_param_opt to lib/param
Garming Sam [Mon, 17 Feb 2014 23:06:57 +0000 (12:06 +1300)]
param: move set_param_opt to lib/param

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-on: https://gerrit.samba.org/109
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoparam: use correct memory contexts for parametric options
Garming Sam [Mon, 17 Feb 2014 22:18:12 +0000 (11:18 +1300)]
param: use correct memory contexts for parametric options

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-on: https://gerrit.samba.org/107
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoparam: remove lp_string_is_valid_boolean
Garming Sam [Mon, 17 Feb 2014 21:24:59 +0000 (10:24 +1300)]
param: remove lp_string_is_valid_boolean

This call is never made in the code and should in fact crash if it was ever called with a valid boolean

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-on: https://gerrit.samba.org/106
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoparam: consolidate handle_realm between the two loadparms
Garming Sam [Mon, 17 Feb 2014 20:41:39 +0000 (09:41 +1300)]
param: consolidate handle_realm between the two loadparms

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-on: https://gerrit.samba.org/105
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoparam: attempt to consolidate handle_logfile between the two loadparms
Garming Sam [Mon, 17 Feb 2014 03:38:59 +0000 (16:38 +1300)]
param: attempt to consolidate handle_logfile between the two loadparms

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-on: https://gerrit.samba.org/104
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoparam: change assignment of lp_string in s3_helpers to be consistent with the other...
Garming Sam [Mon, 17 Feb 2014 03:35:29 +0000 (16:35 +1300)]
param: change assignment of lp_string in s3_helpers to be consistent with the other functions

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-on: https://gerrit.samba.org/103
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoparam: attempt to consolidate handle_debug_level between the two loadparms
Garming Sam [Mon, 17 Feb 2014 03:33:55 +0000 (16:33 +1300)]
param: attempt to consolidate handle_debug_level between the two loadparms

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-on: https://gerrit.samba.org/102
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoparam: allow special functions to be common across the two loadparms
Garming Sam [Wed, 19 Feb 2014 04:19:40 +0000 (17:19 +1300)]
param: allow special functions to be common across the two loadparms

Currently, each of the functions are declared in both and redefined using macros
when they are unused. This change should allow only a single function to exist.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-on: https://gerrit.samba.org/101
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoparam: Add an lp_string_set function
Garming Sam [Mon, 17 Feb 2014 02:55:35 +0000 (15:55 +1300)]
param: Add an lp_string_set function

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-on: https://gerrit.samba.org/100
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:loadparm: fix intermediate string allocations to use talloc
Garming Sam [Wed, 19 Feb 2014 03:20:57 +0000 (16:20 +1300)]
s3:loadparm: fix intermediate string allocations to use talloc

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoparam: change the talloc context attached to globals structure in s3 loadparm to...
Garming Sam [Thu, 27 Feb 2014 02:20:06 +0000 (15:20 +1300)]
param: change the talloc context attached to globals structure in s3 loadparm to a pool

With many allocations being made, with many empty strings in loadparm, it should be more
effective to use a talloc pool instead of a normal talloc context.

The numbers chosen are based around a simple testparm instance.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-on: https://gerrit.samba.org/157
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoparam: remove string_init and inline it into string_set
Garming Sam [Wed, 26 Feb 2014 23:14:57 +0000 (12:14 +1300)]
param: remove string_init and inline it into string_set

In making this change, the special case has been removed for empty strings.

The use of empty strings causes various issues with trying to mix s4 and s3 code.

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-on: https://gerrit.samba.org/156
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:loadparm: change memory allocations to use talloc
Garming Sam [Thu, 13 Feb 2014 23:46:41 +0000 (12:46 +1300)]
s3:loadparm: change memory allocations to use talloc

(talloc memory paternity fix to handle_debug_list() and
lp_parm_const_string_service() added by abartlet)

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoparam: remove unnecessary temporary service in handle copy
Garming Sam [Tue, 18 Feb 2014 02:06:53 +0000 (15:06 +1300)]
param: remove unnecessary temporary service in handle copy

Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agomessaging: Nobody uses G_LOCK_RETRY anymore
Volker Lendecke [Tue, 6 May 2014 07:57:31 +0000 (09:57 +0200)]
messaging: Nobody uses G_LOCK_RETRY anymore

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue May  6 23:01:22 CEST 2014 on sn-devel-104

10 years agobuild: find blkcnt_t size via array
Gustavo Zacarias [Mon, 21 Apr 2014 13:18:18 +0000 (10:18 -0300)]
build: find blkcnt_t size via array

Using the same trick as commit 0d9bb86293c9d39298786df095c73a6251b08b7e
find blkcnt_t size via an array so that it can be determined via build
rather than running it.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Tue May  6 20:37:16 CEST 2014 on sn-devel-104

10 years agobuild: tweak SIZEOF utmp->ut_line
Gustavo Zacarias [Mon, 21 Apr 2014 13:18:17 +0000 (10:18 -0300)]
build: tweak SIZEOF utmp->ut_line

Set the critical parameter of CHECK_SIZEOF utmp->ut_line to False since
it's used to find out if utmp support should be enabled.
This is necessary with the introduction of the cross-compile aware
CHECK_SIZEOF.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
10 years agobuild: make wafsamba CHECK_SIZEOF cross-compile friendly
Gustavo Zacarias [Mon, 21 Apr 2014 13:18:16 +0000 (10:18 -0300)]
build: make wafsamba CHECK_SIZEOF cross-compile friendly

Use the same trick as commit 0d9bb86293c9d39298786df095c73a6251b08b7e
We do the same array trick iteratively starting from 1 (byte) by powers
of 2 up to 32.

The new 'critical' option is used to make the invocation die or not
according to each test.
The default is True since normally it's expected to find a proper
result and should error out if not.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
10 years agobuild: unify and fix endian tests
Gustavo Zacarias [Mon, 21 Apr 2014 13:18:15 +0000 (10:18 -0300)]
build: unify and fix endian tests

Unify the endian tests out of lib/ccan/wscript into wafsamba since
they're almost cross-compile friendly.
While at it fix them to be so by moving the preprocessor directives out
of main scope since that will fail.
And keep the WORDS_BIGENDIAN, HAVE_LITTLE_ENDIAN and HAVE_BIG_ENDIAN
defines separate because of different codebases.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
10 years agobyteorder: do not assume PowerPC is big-endian
David Disseldorp [Mon, 5 May 2014 11:42:36 +0000 (13:42 +0200)]
byteorder: do not assume PowerPC is big-endian

byteorder.h currently uses reverse-indexing ASM instructions for little
endian multi-byte storage/retrieval on PowerPC. With Power8 this is an
incorrect assumption, as it can be big or little endian.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10590

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
10 years agodsdb: Do not permit nested event loops when in a transaction, use a nested event...
Andrew Bartlett [Thu, 17 Apr 2014 03:39:56 +0000 (15:39 +1200)]
dsdb: Do not permit nested event loops when in a transaction, use a nested event context

It is never safe to execute arbitary code inside a transaction - we
need to get in and get out, not run other events for the rest of the
server.

This patch avoids that by creating a private event loop during
transactions, so no unexpected operations fire, and returning the
original one when we finish it.

If an event fires during an LDB transaction, an unrelated operation
can occur during the transaction, and if the transaction were to be
cancelled, there would be a silent rollback (despite the client having
been indicated success).

Additionally, other processes could be called via IRPC that need to
operate on the database but are locked out due to the ongoing
transaction.

Andrew Bartlett

BUG: https://bugzilla.samba.org/show_bug.cgi?id=10582
Change-Id: I22322fc006e61d7291da17cdf6431416ebb7b30f
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue May  6 13:36:20 CEST 2014 on sn-devel-104

10 years agodsdb: Rename private_data to rootdse_private_data in rootdse
Andrew Bartlett [Thu, 17 Apr 2014 03:38:14 +0000 (15:38 +1200)]
dsdb: Rename private_data to rootdse_private_data in rootdse

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10582

Change-Id: I349a2be67333ada86c19cd6d2ed283cd5bbeb2aa
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agoMinor typo fix in source3/wscript.
Jose A. Rivera [Mon, 5 May 2014 12:29:57 +0000 (07:29 -0500)]
Minor typo fix in source3/wscript.

Signed-off-by: Jose A. Rivera <jarrpa@redhat.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon May  5 22:41:19 CEST 2014 on sn-devel-104

10 years agoFix an empty if statement.
Jose A. Rivera [Mon, 5 May 2014 11:46:58 +0000 (06:46 -0500)]
Fix an empty if statement.

Primarily following the precedent set by other uses of composite_is_ok(), but
also making sure nothing tries to use c after this point if it is in fact not
ok.

Signed-off-by: Jose A. Rivera <jarrpa@redhat.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoctdb-daemon: Move a ZERO_STRUCT() to a better place
Martin Schwenke [Fri, 28 Mar 2014 05:18:17 +0000 (16:18 +1100)]
ctdb-daemon: Move a ZERO_STRUCT() to a better place

It might as well be near where it is used.  Add a comment explaining
it.

Also add/update comments at the top of the RELEASE_IP and TAKEOVER_IP
loops to explain what is happening.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Mon May  5 06:20:39 CEST 2014 on sn-devel-104

10 years agoctdb-eventscripts: Add check for invalid policy routing configuration
Martin Schwenke [Thu, 16 Jan 2014 03:48:39 +0000 (14:48 +1100)]
ctdb-eventscripts: Add check for invalid policy routing configuration

The range
CTDB_PER_IP_ROUTING_TABLE_ID_LOW..CTDB_PER_IP_ROUTING_TABLE_ID_HIGH
should not include 253-255.  Otherwise policy routing may overwrite
the default system routing tables.

Add some corresponding tests.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-eventscripts: Update comment in 11.routing
Martin Schwenke [Wed, 15 Jan 2014 03:16:52 +0000 (14:16 +1100)]
ctdb-eventscripts: Update comment in 11.routing

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-eventscripts: Don't check if $iface is empty
Martin Schwenke [Thu, 27 Mar 2014 05:31:54 +0000 (16:31 +1100)]
ctdb-eventscripts: Don't check if $iface is empty

This is the loop variable.  It can't be empty, especially given the
way the list is built.  This must have survived from an earlier
version of the script.

Given that there are whitespace changes associated with the above,
clean-up the "virtio_net" avoidance check so that it reads less like
line-noise.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agopoll_funcs: Fix a comment typo
Volker Lendecke [Sun, 4 May 2014 16:44:33 +0000 (18:44 +0200)]
poll_funcs: Fix a comment typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Sun May  4 22:19:53 CEST 2014 on sn-devel-104

10 years agoldb: make the successful ldb_transaction_start() message clearer
Andrew Bartlett [Wed, 16 Apr 2014 21:33:26 +0000 (09:33 +1200)]
ldb: make the successful ldb_transaction_start() message clearer

Change-Id: I00d0705484c3b53f55c4a8ec2953e92329b7408e
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sat May  3 10:20:52 CEST 2014 on sn-devel-104

10 years agos3:passdb: improve a debug message in pdb_default_sid_to_id()
Michael Adam [Wed, 30 Apr 2014 10:14:46 +0000 (12:14 +0200)]
s3:passdb: improve a debug message in pdb_default_sid_to_id()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agos3:passdb: fix and improve debug message in pdb_default_sid_to_id().
Michael Adam [Wed, 30 Apr 2014 10:10:01 +0000 (12:10 +0200)]
s3:passdb: fix and improve debug message in pdb_default_sid_to_id().

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agos4:samr: allow builtin groups for samr_OpenGroup.
Michael Adam [Tue, 29 Apr 2014 11:31:42 +0000 (13:31 +0200)]
s4:samr: allow builtin groups for samr_OpenGroup.

This fixes nsswitch getgrgid for builtins.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agoselftest: Add tests for dbcheck detection and removal of partial objects
Andrew Bartlett [Thu, 3 Apr 2014 21:40:35 +0000 (10:40 +1300)]
selftest: Add tests for dbcheck detection and removal of partial objects

To avoid listing all the provision snapshots, we use a broader blacklist for waf dist
and a whitelist for dbcheck-oldrelease.sh

Andrew Bartlett

Change-Id: Iab0ff4be0b4287dc128a49302836a6f0f7b39678
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agodsdb: Make it harder to corrupt the database by requiring DBCHECK or RELAX for final...
Andrew Bartlett [Thu, 3 Apr 2014 01:50:05 +0000 (14:50 +1300)]
dsdb: Make it harder to corrupt the database by requiring DBCHECK or RELAX for final object deletion

This kind of deletion can cause us to then replicate back a partial
object.  We allow dbcheck to directly remove totally corrupt objects
(missing an objectclass) by specifying both DBCHECK and RELAX, and the
tombstone sweep after 180 days is done with the RELAX control.

Andrew Bartlett

Change-Id: Ic21f68e507ba9b65e035ca568430e35e2d001c7d
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agos3: Always cache idmapping results of pdb backend.
Alexander Werth [Fri, 25 Apr 2014 11:53:48 +0000 (13:53 +0200)]
s3: Always cache idmapping results of pdb backend.

And don't cache in the pdb_ldap module on the id_to_sid calls.

Signed-off-by: Alexander Werth <alexander.werth@de.ibm.com>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Sat May  3 04:14:05 CEST 2014 on sn-devel-104

10 years agowaf: fetch and use some exit codes of called processes
Björn Baumbach [Fri, 25 Apr 2014 20:05:54 +0000 (22:05 +0200)]
waf: fetch and use some exit codes of called processes

Without this patch for example "make ctags" reports "Success",
also if ctags fails or is not available.

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agosamba-tool ldapcmp: fix a typo
Björn Baumbach [Mon, 25 Nov 2013 14:29:09 +0000 (15:29 +0100)]
samba-tool ldapcmp: fix a typo

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agos3: smbd: Remove open_file_fchmod().
Jeremy Allison [Thu, 1 May 2014 18:11:20 +0000 (11:11 -0700)]
s3: smbd: Remove open_file_fchmod().

No longer used (hurrah!).

Bug 10564 - Lock order violation and file lost

https://bugzilla.samba.org/show_bug.cgi?id=10564

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri May  2 23:47:38 CEST 2014 on sn-devel-104

10 years agos3: smbd: change file_set_dosmode() to use get_file_handle_for_metadata() instead...
Jeremy Allison [Thu, 1 May 2014 18:07:44 +0000 (11:07 -0700)]
s3: smbd: change file_set_dosmode() to use get_file_handle_for_metadata() instead of open_file_fchmod().

get_file_handle_for_metadata() is a new function that
finds an existing open handle (fsp->fh->fd != -1) for
a given dev/ino if there is one available, and uses
INTERNAL_OPEN_ONLY with WRITE_DATA access if not.

Allows open_file_fchmod() to be removed next.

Bug 10564 - Lock order violation and file lost

https://bugzilla.samba.org/show_bug.cgi?id=10564

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Volker Lendecke <vl@samba.org>
10 years agos3: smbd : Ensure file_new doesn't call into smbXsrv_open_create() for INTERNAL_OPEN_...
Jeremy Allison [Thu, 1 May 2014 18:01:03 +0000 (11:01 -0700)]
s3: smbd : Ensure file_new doesn't call into smbXsrv_open_create() for INTERNAL_OPEN_ONLY.

This causes deadlocks which cause smbd to crash if the locking
database has already been locked for a compound operation we
need to be atomic (as in the file rename case).

Ensure INTERNAL_OPEN_ONLY opens are synonymous with req==NULL.

INTERNAL_OPEN_ONLY opens leave a NO_OPLOCK record in
the share mode database, so they can be detected by other
processes for share mode violation purposes (because
they're doing an operation on the file that may include
reads or writes they need to have real state inside the
locking database) but have an fnum of FNUM_FIELD_INVALID
and a local share_file_id of zero, as they will never be
seen on the wire.

Ensure validate_my_share_entries() ignores
INTERNAL_OPEN_ONLY records (share_file_id == 0).

Bug 10564 - Lock order violation and file lost

https://bugzilla.samba.org/show_bug.cgi?id=10564

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Volker Lendecke <vl@samba.org>
10 years agos3 : smbd : Protect all possible code paths from fsp->op == NULL.
Jeremy Allison [Thu, 1 May 2014 17:58:51 +0000 (10:58 -0700)]
s3 : smbd : Protect all possible code paths from fsp->op == NULL.

In changes to come this will be possible for an INTERNAL_OPEN_ONLY.
The protection was already in place for some code paths, this
makes the coverage compete.

Bug 10564 - Lock order violation and file lost

https://bugzilla.samba.org/show_bug.cgi?id=10564

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
10 years agosmbd: Fix compile warning in dmapi.c
Christof Schmitt [Thu, 1 May 2014 20:50:19 +0000 (13:50 -0700)]
smbd: Fix compile warning in dmapi.c

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Change-Id: I69297d91ab8c857204e1f78cafb210b9a05f3b77

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri May  2 03:41:31 CEST 2014 on sn-devel-104

10 years agodbcheck: Directly call dn.get_rdn_{val,name}() for clarity and consistency
Andrew Bartlett [Tue, 29 Apr 2014 21:38:34 +0000 (09:38 +1200)]
dbcheck: Directly call dn.get_rdn_{val,name}() for clarity and consistency

When looking for incorrect name values, this improves the previous
code by avoiding one more manual parse step, and uses less cryptic
variable names.

Andrew Bartlett

Change-Id: Iff8e571a6359a67bf173f729dc12b8787292b3cb
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
10 years agos4:repl_meta_data: fix array assignment in replmd_process_linked_attribute()
Stefan Metzmacher [Thu, 3 Apr 2014 14:03:19 +0000 (16:03 +0200)]
s4:repl_meta_data: fix array assignment in replmd_process_linked_attribute()

Change-Id: I10357236108f68ab749ba0e1f07558302c573887
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agodbchecker: verify and fix broken dn values
Stefan Metzmacher [Thu, 13 Mar 2014 22:12:39 +0000 (23:12 +0100)]
dbchecker: verify and fix broken dn values

With older Samba versions (4.0.x) the following could happen:

- On account was created on DC1
- It was replicated to DC2
- The connection between the dcs is offline
- The account gets modified on DC2
- The account gets deleted on DC1
- The connection becomes online again
- DC1 replicates the modification from DC2,
  this resets the dn to the original value.
  'name' and 'cn' are correct (with '\nDEL${GUID}'),
  but 'dn' is wrong.
- DC2 replicates the deletion from DC1.
  this doesn't include a changed dn as DC1
  had a bug.
  'name' is correct (with '\nDEL${GUID}'),
  but 'cn' and 'dn' are wrong.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10536
Change-Id: Ia70a6c12e0ff0d4c2c8100cb1d8f3c6422b65591
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agodbchecker: make the deleted objects container detection more generic
Stefan Metzmacher [Thu, 13 Mar 2014 22:12:39 +0000 (23:12 +0100)]
dbchecker: make the deleted objects container detection more generic

Change-Id: I282ad887c41412e25fdf73476e405f4e88e0b239
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agoldb: change version to 1.1.17 save-diskspace-tags/ldb-1.1.17
Stefan Metzmacher [Tue, 29 Apr 2014 07:37:54 +0000 (09:37 +0200)]
ldb: change version to 1.1.17

This adds some pyldb methods for ldb.Dn.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agoldb:pyldb: add some more helper functions for LdbDn
Stefan Metzmacher [Tue, 29 Apr 2014 07:35:31 +0000 (09:35 +0200)]
ldb:pyldb: add some more helper functions for LdbDn

This adds [g|s]et_component[|_name|_value]() and get_rdn_[name|value]().

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agoldb:pyldb: fix doc string for set_extended_component()
Stefan Metzmacher [Tue, 29 Apr 2014 07:34:48 +0000 (09:34 +0200)]
ldb:pyldb: fix doc string for set_extended_component()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agoldb:pyldb: add some const to PyObject_FromLdbValue()
Stefan Metzmacher [Tue, 29 Apr 2014 07:32:45 +0000 (09:32 +0200)]
ldb:pyldb: add some const to PyObject_FromLdbValue()

PyString_FromStringAndSize() makes a copy of the value...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agoctdb: Fix a comment typo
Volker Lendecke [Fri, 7 Feb 2014 13:11:19 +0000 (14:11 +0100)]
ctdb: Fix a comment typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Apr 30 21:05:09 CEST 2014 on sn-devel-104

10 years agotorture3: Add a test deleting a different req
Volker Lendecke [Tue, 29 Apr 2014 12:27:03 +0000 (14:27 +0200)]
torture3: Add a test deleting a different req

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Apr 30 17:09:59 CEST 2014 on sn-devel-104

10 years agotorture3: Add local-messaging-read1
Volker Lendecke [Tue, 29 Apr 2014 12:25:14 +0000 (14:25 +0200)]
torture3: Add local-messaging-read1

This covers deleting and re-adding a request in a callback

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agomessaging3: Fix messaging_read_send/recv
Volker Lendecke [Tue, 29 Apr 2014 12:14:24 +0000 (14:14 +0200)]
messaging3: Fix messaging_read_send/recv

messaging_read_send/recv was okay for just one handler in the queue. For
multiple handlers it was pretty broken.

A handler that deletes itself as part of the callback (pretty typical use
case...) drops the message for a subsequent handler that responds to the same
message type. In messaging_dispatch_rec we walk the array, however
messaging_read_cleanup has already changed the array. tevent_req_defer_callback
does not help here: It only defers the callback, it does not defer the cleanup
function.

This also happens when a callback deletes a different handler

A handler that re-installs itself in the callback might get a message twice.

This patch changes the code such that only messaging_dispatch_rec adds records
to msg_ctx->waiters, new waiters are put into a staging area first
(msg_ctx->new_waiters). Also messaging_read_cleanup does not move anything
around in msg_ctx->waiters, it only nulls out itself. messaging_dispatch_rec is
changed to cope with this.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agomessaging3: Make "presult" optional in messaging_read_recv
Volker Lendecke [Tue, 29 Apr 2014 12:12:26 +0000 (14:12 +0200)]
messaging3: Make "presult" optional in messaging_read_recv

Callers might not be interested in the rec, just the fact that something
arrived

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agotorture3: Add a bit more coverage to messaging_read
Volker Lendecke [Tue, 29 Apr 2014 12:10:04 +0000 (14:10 +0200)]
torture3: Add a bit more coverage to messaging_read

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agomessaging3: Fix formatting
Volker Lendecke [Tue, 29 Apr 2014 12:08:29 +0000 (14:08 +0200)]
messaging3: Fix formatting

This went over the 80-char limit

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3: smbd : Fix wildcard unlink to fail if we get an error rather than trying to continue.
Jeremy Allison [Tue, 29 Apr 2014 23:59:55 +0000 (16:59 -0700)]
s3: smbd : Fix wildcard unlink to fail if we get an error rather than trying to continue.

This can break smbd if we end up leaving a SHARING_VIOLATION
retry record on the queue.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
10 years agowinbind: Allow winbindd to be run from inside "samba"
Andrew Bartlett [Fri, 28 Mar 2014 01:35:21 +0000 (14:35 +1300)]
winbind: Allow winbindd to be run from inside "samba"

Change-Id: I6b90a9b62ba5821e0feedb23cd20642078ba0ca6
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Apr 29 05:28:39 CEST 2014 on sn-devel-104

10 years agokerberos: Remove un-used event context argument from smb_krb5_init_context()
Andrew Bartlett [Thu, 17 Apr 2014 10:35:33 +0000 (22:35 +1200)]
kerberos: Remove un-used event context argument from smb_krb5_init_context()

The event context here was only specified in the server or admin-tool
context, which does not do network communication, so this only caused
a talloc_reference() and never any useful result.

The actual network communication code sets an event context directly
before making the network call.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Apr 28 02:24:57 CEST 2014 on sn-devel-104

10 years agodsdb: Specify no event context to smb_krb5_init_context() in dsdb
Andrew Bartlett [Thu, 17 Apr 2014 09:48:30 +0000 (21:48 +1200)]
dsdb: Specify no event context to smb_krb5_init_context() in dsdb

These routines parse principals and generate keys only, no network
communication is done.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agoautorid: Add allocation from above in alloc range for well known sids
Michael Adam [Fri, 11 Apr 2014 17:14:41 +0000 (19:14 +0200)]
autorid: Add allocation from above in alloc range for well known sids

This way, we achieve a better determinism for the id mappings
of the well knowns without wasting a separate range.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri Apr 25 17:52:10 CEST 2014 on sn-devel-104

10 years agoautorid: use dbwrap_trans_do() in idmap_autorid_sid_to_id_alloc()
Michael Adam [Thu, 24 Apr 2014 11:34:40 +0000 (13:34 +0200)]
autorid: use dbwrap_trans_do() in idmap_autorid_sid_to_id_alloc()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agoautorid: add high_id to range config and fill it where we also fill range->low_id.
Michael Adam [Fri, 11 Apr 2014 19:31:48 +0000 (21:31 +0200)]
autorid: add high_id to range config and fill it where we also fill range->low_id.

This corresponds to low_id for convenience and allows
for computations without going back to the global config.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agoautorid: reserve 500 IDs at the top of the ALLOC range.
Michael Adam [Mon, 7 Apr 2014 15:24:31 +0000 (17:24 +0200)]
autorid: reserve 500 IDs at the top of the ALLOC range.

The wellknowns are now allocated into this sub-range.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agoautorid: reverse order of arguments of idmap_autorid_sid_to_id_alloc()
Michael Adam [Fri, 11 Apr 2014 19:06:26 +0000 (21:06 +0200)]
autorid: reverse order of arguments of idmap_autorid_sid_to_id_alloc()

for consistency

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agoautorid: introduce idmap_autorid_domsid_is_for_alloc()
Michael Adam [Fri, 11 Apr 2014 16:56:21 +0000 (18:56 +0200)]
autorid: introduce idmap_autorid_domsid_is_for_alloc()

Currently, this checks if the sid is a wellknown domain sid.
But the code reads more nicely and more domains might be added
in the future.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>