samba.git
9 years agopytalloc: Fix comparison of disparate types
Petr Viktorin [Fri, 6 Mar 2015 17:57:00 +0000 (18:57 +0100)]
pytalloc: Fix comparison of disparate types

When fed Python objects of different types, pytalloc_default_cmp
compared pointers to PyType objects that weren't part of an array,
resulting in undefined behavior.

This makes things a bit better (though it still casts ptrdiff_t to int).

Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agodocs: overhaul the description of "smb encrypt" to include SMB3 encryption.
Michael Adam [Thu, 23 Apr 2015 08:38:15 +0000 (10:38 +0200)]
docs: overhaul the description of "smb encrypt" to include SMB3 encryption.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Apr 24 00:53:20 CEST 2015 on sn-devel-104

9 years agoMake sure we initialize conn to NULL, because a routine we call may give an error...
Richard Sharpe [Thu, 23 Apr 2015 19:36:28 +0000 (12:36 -0700)]
Make sure we initialize conn to NULL, because a routine we call may give an error and not touch conn, and then we get an error when trying to TALLOC_FREE it.

Signed-off-by: Richard Sharpe <rsharpe@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agotorture: Add smb2.notify.rmdir
Volker Lendecke [Mon, 20 Apr 2015 10:44:07 +0000 (10:44 +0000)]
torture: Add smb2.notify.rmdir

We need to cancel a pending FileChangeNotify with DELETE_PENDING if the
directory watched is about to be deleted.

I know I just deleted a bool parameter, but to me torture is different :-)

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): Thu Apr 23 01:36:48 CEST 2015 on sn-devel-104

9 years agosmbd: Cancel pending notifies if the directory goes away
Volker Lendecke [Tue, 21 Apr 2015 08:16:16 +0000 (10:16 +0200)]
smbd: Cancel pending notifies if the directory goes away

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agosmbd: Remove bool arg from set_delete_on_close_lck
Volker Lendecke [Tue, 21 Apr 2015 09:41:45 +0000 (11:41 +0200)]
smbd: Remove bool arg from set_delete_on_close_lck

We now have reset_delete_on_close_lck, this was called with "true"
everywhere now.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agosmbd: Use reset_delete_on_close_lck directly
Volker Lendecke [Tue, 21 Apr 2015 09:38:32 +0000 (11:38 +0200)]
smbd: Use reset_delete_on_close_lck directly

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agosmbd: Introduce reset_delete_on_close_lck
Volker Lendecke [Tue, 21 Apr 2015 09:36:30 +0000 (11:36 +0200)]
smbd: Introduce reset_delete_on_close_lck

Boolean flags passed down make things more complex than necessary...

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos3:smbd: use smbd_reinit_after_fork
Ralph Boehme [Wed, 22 Apr 2015 10:00:10 +0000 (12:00 +0200)]
s3:smbd: use smbd_reinit_after_fork

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos3:smbd: add wrapper around reinit_after_fork
Ralph Boehme [Wed, 22 Apr 2015 09:57:24 +0000 (11:57 +0200)]
s3:smbd: add wrapper around reinit_after_fork

smbd_reinit_after_fork is a simple wrapper around reinit_after_fork that
should be used after forking from the main smbd.

At the moment the only additional step it performs is resetting
am_parent to NULL.

A subsequent commit will make use of this function.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos4-torture: add one more test for witness_RegisterEx() and invalid sharenames.
Günther Deschner [Wed, 22 Apr 2015 11:56:35 +0000 (13:56 +0200)]
s4-torture: add one more test for witness_RegisterEx() and invalid sharenames.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Wed Apr 22 20:21:18 CEST 2015 on sn-devel-104

9 years agos4-torture: fix invalid dereference of binding handle in mgmt test.
Günther Deschner [Tue, 21 Apr 2015 10:07:08 +0000 (12:07 +0200)]
s4-torture: fix invalid dereference of binding handle in mgmt test.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos4-torture: do some additional length checks for the mgmt_inq_princ_name test.
Günther Deschner [Tue, 21 Apr 2015 09:18:30 +0000 (11:18 +0200)]
s4-torture: do some additional length checks for the mgmt_inq_princ_name test.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos4-torture: use torture_assert() macros in mgmt test.
Günther Deschner [Mon, 20 Apr 2015 14:28:25 +0000 (16:28 +0200)]
s4-torture: use torture_assert() macros in mgmt test.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos4-torture: use torture_comment instead of printf in mgmt test.
Günther Deschner [Mon, 20 Apr 2015 14:27:52 +0000 (16:27 +0200)]
s4-torture: use torture_comment instead of printf in mgmt test.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos4-torture: pass down struct torture_context to some more calls in mgmt test.
Günther Deschner [Mon, 20 Apr 2015 13:41:44 +0000 (15:41 +0200)]
s4-torture: pass down struct torture_context to some more calls in mgmt test.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos4-torture: use tctx torture_context argument consistently.
Günther Deschner [Mon, 20 Apr 2015 13:34:34 +0000 (15:34 +0200)]
s4-torture: use tctx torture_context argument consistently.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos4-torture: strip trailing whitespace.
Günther Deschner [Mon, 20 Apr 2015 13:35:14 +0000 (15:35 +0200)]
s4-torture: strip trailing whitespace.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoparam: remove two unused #defines
Michael Adam [Wed, 24 Sep 2014 08:30:17 +0000 (10:30 +0200)]
param: remove two unused #defines

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
Autobuild-User(master): Ira Cooper <ira@samba.org>
Autobuild-Date(master): Wed Apr 22 16:37:12 CEST 2015 on sn-devel-104

9 years agos3:param: remove arg save_defaults from lp_load_with_registry_shares()
Michael Adam [Tue, 21 Apr 2015 13:24:42 +0000 (15:24 +0200)]
s3:param: remove arg save_defaults from lp_load_with_registry_shares()

This is only used in command line contexts, especially for testparm
which relies on safe defaults. The only changed use is in sharesec,
but it does not harm to also safe the defaults there.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
9 years agos3:param: remove arg initialize_globals from lp_load_with_registry_shares()
Michael Adam [Tue, 21 Apr 2015 12:48:42 +0000 (14:48 +0200)]
s3:param: remove arg initialize_globals from lp_load_with_registry_shares()

This is only ever called in client context, and only called once.
So there is no point at all in requesting reinit_globals.
Set it to false.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
9 years agos3:param: rename arg initialize_globals->reinit_globals in lp_load()
Michael Adam [Sat, 20 Sep 2014 02:49:10 +0000 (04:49 +0200)]
s3:param: rename arg initialize_globals->reinit_globals in lp_load()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
9 years agos3:param: rename arg initialize_globals->reinit_globals in lp_load_ex()
Michael Adam [Sat, 20 Sep 2014 02:48:11 +0000 (04:48 +0200)]
s3:param: rename arg initialize_globals->reinit_globals in lp_load_ex()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
9 years agos3:param: fix a comment
Michael Adam [Sat, 20 Sep 2014 02:46:41 +0000 (04:46 +0200)]
s3:param: fix a comment

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
9 years agos3:param: use GLOBAL_SECTION_SNUM in lp_enforce_ad_dc_settings()
Michael Adam [Sat, 20 Sep 2014 02:45:45 +0000 (04:45 +0200)]
s3:param: use GLOBAL_SECTION_SNUM in lp_enforce_ad_dc_settings()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
9 years agos3:param: factor lp_enforce_ad_dc_settings() out of lp_load_ex()
Michael Adam [Sat, 20 Sep 2014 02:42:40 +0000 (04:42 +0200)]
s3:param: factor lp_enforce_ad_dc_settings() out of lp_load_ex()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
9 years agos3:param: in lp_load_initial_only(), make sure to save defaults.
Michael Adam [Wed, 6 Aug 2014 14:20:42 +0000 (16:20 +0200)]
s3:param: in lp_load_initial_only(), make sure to save defaults.

This is the initial loading of the config in the daemons (and some tools).
So we should save the defaults here. This should especially take into account
some dynamic defaults like log file and maybe some changed values
handed in via the command line.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
9 years agos3:param: make lp_load() static
Michael Adam [Thu, 18 Sep 2014 02:19:10 +0000 (04:19 +0200)]
s3:param: make lp_load() static

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
9 years agovfstest: use lp_load_with_shares() in cmd_conf
Michael Adam [Thu, 18 Sep 2014 02:16:56 +0000 (04:16 +0200)]
vfstest: use lp_load_with_shares() in cmd_conf

Note this calls lp_load slightly differently.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
9 years agos3:param: use lp_load_no_reinit() in lp_load_for_s4_ctx()
Michael Adam [Wed, 17 Sep 2014 22:29:28 +0000 (00:29 +0200)]
s3:param: use lp_load_no_reinit() in lp_load_for_s4_ctx()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
9 years agos3:param: add lp_load_no_reinit()
Michael Adam [Wed, 17 Sep 2014 22:28:50 +0000 (00:28 +0200)]
s3:param: add lp_load_no_reinit()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
9 years agos3:torture:msg: use lp_load()-wrapper lp_load_global()
Michael Adam [Tue, 9 Sep 2014 21:22:50 +0000 (23:22 +0200)]
s3:torture:msg: use lp_load()-wrapper lp_load_global()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
9 years agos4:torture:libnetapi: use lp_load_global() instead of lp_load()
Michael Adam [Wed, 30 Jul 2014 22:42:01 +0000 (00:42 +0200)]
s4:torture:libnetapi: use lp_load_global() instead of lp_load()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
9 years agos3:param: remove "add_ipc" parameter from lp_load_with_registry_shares().
Michael Adam [Wed, 30 Jul 2014 15:47:32 +0000 (17:47 +0200)]
s3:param: remove "add_ipc" parameter from lp_load_with_registry_shares().

This is not called from the server (which loads registry shares lazily),
so add_ipc is always false...

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
9 years agos3:param: remove "global_only" parameter from lp_load_with_registry_shares().
Michael Adam [Wed, 30 Jul 2014 15:30:22 +0000 (17:30 +0200)]
s3:param: remove "global_only" parameter from lp_load_with_registry_shares().

There is no point in choosing global_only when forcing to load
all shares from registry at the same time...

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
9 years agos3:auth: use lp_load_with_shares() in auth3_check_password()
Michael Adam [Wed, 30 Jul 2014 15:00:36 +0000 (17:00 +0200)]
s3:auth: use lp_load_with_shares() in auth3_check_password()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
9 years agos3:auth: use lp_load_with_shares() in auth3_generate_session_info_pac()
Michael Adam [Wed, 30 Jul 2014 14:59:50 +0000 (16:59 +0200)]
s3:auth: use lp_load_with_shares() in auth3_generate_session_info_pac()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
9 years agonsswitch/wins: use lp_load_global() wrapper of lp_load().
Michael Adam [Wed, 30 Jul 2014 14:57:06 +0000 (16:57 +0200)]
nsswitch/wins: use lp_load_global() wrapper of lp_load().

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
9 years agos3:smbd: use lp_load_with_shares() in reload_services().
Michael Adam [Wed, 30 Jul 2014 14:53:59 +0000 (16:53 +0200)]
s3:smbd: use lp_load_with_shares() in reload_services().

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
9 years agos3:param: let lp_load_global_no_reinit() call lp_load() instead of lp_load_ex()
Michael Adam [Wed, 30 Jul 2014 14:52:06 +0000 (16:52 +0200)]
s3:param: let lp_load_global_no_reinit() call lp_load() instead of lp_load_ex()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
9 years agos3:param: add wrapper lp_load_with_shares().
Michael Adam [Wed, 30 Jul 2014 14:50:48 +0000 (16:50 +0200)]
s3:param: add wrapper lp_load_with_shares().

Most common pattern with shares, including IPC,
but not forcing immediate loading of all registry shares.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
9 years agos3:param: let lp_load_global() call lp_load(), not lp_load_ex().
Michael Adam [Wed, 30 Jul 2014 14:47:40 +0000 (16:47 +0200)]
s3:param: let lp_load_global() call lp_load(), not lp_load_ex().

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
9 years agos3:lsasd: use lp_load() wrapper lp_load_global()
Michael Adam [Wed, 30 Jul 2014 14:43:05 +0000 (16:43 +0200)]
s3:lsasd: use lp_load() wrapper lp_load_global()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
9 years agos3:spoolss: use lp_load() wrapper lp_load_global().
Michael Adam [Wed, 30 Jul 2014 14:41:22 +0000 (16:41 +0200)]
s3:spoolss: use lp_load() wrapper lp_load_global().

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
9 years agoConvert all uses of uint8/16/32 to uint8/16/32_t in the libads code.
Richard Sharpe [Sat, 18 Apr 2015 15:40:14 +0000 (08:40 -0700)]
Convert all uses of uint8/16/32 to uint8/16/32_t in the libads code.

Signed-off-by: Richard Sharpe <rsharpe@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Apr 22 06:22:29 CEST 2015 on sn-devel-104

9 years agosmbd: Save a few lines of C :-)
Volker Lendecke [Sat, 18 Apr 2015 09:28:36 +0000 (09:28 +0000)]
smbd: Save a few lines of C :-)

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos3-unix_msg: remove socket file after closing socket fd
Youzhong Yang [Mon, 20 Apr 2015 13:42:42 +0000 (09:42 -0400)]
s3-unix_msg: remove socket file after closing socket fd

This is needed on Solaris.

It fixes https://bugzilla.samba.org/show_bug.cgi?id=11217

Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Apr 22 03:43:30 CEST 2015 on sn-devel-104

9 years agos3:smbd: update comment to correctly reflect MS-SMB2
Ralph Boehme [Fri, 17 Apr 2015 07:12:59 +0000 (09:12 +0200)]
s3:smbd: update comment to correctly reflect MS-SMB2

Signed-off-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Apr 22 01:04:02 CEST 2015 on sn-devel-104

9 years agos3:smbd: missing tevent_req_nterror
Ralph Boehme [Thu, 16 Apr 2015 20:28:25 +0000 (22:28 +0200)]
s3:smbd: missing tevent_req_nterror

The error code path in case fsp == NULL misses a call
tevent_req_nterror().

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos3:lib: use talloc_get_type_abort
Ralph Boehme [Tue, 21 Apr 2015 16:58:09 +0000 (18:58 +0200)]
s3:lib: use talloc_get_type_abort

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Tue Apr 21 22:14:07 CEST 2015 on sn-devel-104

9 years agolib: Fix CID 1107218 Resource leak
Volker Lendecke [Tue, 31 Mar 2015 19:24:45 +0000 (21:24 +0200)]
lib: Fix CID 1107218 Resource leak

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agotevent: Fix CID 1035381 Unchecked return value
Volker Lendecke [Tue, 31 Mar 2015 19:15:53 +0000 (21:15 +0200)]
tevent: Fix CID 1035381 Unchecked return value

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agolib: Fix a few CIDs for Resource Leak
Volker Lendecke [Tue, 31 Mar 2015 07:34:54 +0000 (09:34 +0200)]
lib: Fix a few CIDs for Resource Leak

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoctdb: Fix the O3 developer build
Volker Lendecke [Tue, 21 Apr 2015 08:34:54 +0000 (10:34 +0200)]
ctdb: Fix the O3 developer build

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoAdd refentryinfo date.
Jelmer Vernooij [Sat, 18 Apr 2015 21:18:48 +0000 (21:18 +0000)]
Add refentryinfo date.

This causes the talloc.3 build to be reproducible. We're trying to
make all builds in Debian reproducible - see
https://wiki.debian.org/ReproducibleBuilds/About for reasoning.

Change-Id: I9bd64d1783abfb33211cbc9dc9c2bbf6db047f3e
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sun Apr 19 03:05:53 CEST 2015 on sn-devel-104

9 years agolibads: Fix CID 1272956 Fixing wrong if condition
Anoop C S [Wed, 15 Apr 2015 11:04:35 +0000 (16:34 +0530)]
libads: Fix CID 1272956 Fixing wrong if condition

Signed-off-by: Anoop C S <achiraya@redhat.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Apr 18 01:33:04 CEST 2015 on sn-devel-104

9 years agorpc_server/srvsvc: Fix CID 241162 Logically dead code
Anoop C S [Wed, 15 Apr 2015 10:26:42 +0000 (15:56 +0530)]
rpc_server/srvsvc: Fix CID 241162 Logically dead code

Signed-off-by: Anoop C S <achiraya@redhat.com>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
9 years agos3: locking: Add a memcache based lock cache.
Jeremy Allison [Wed, 15 Apr 2015 17:36:00 +0000 (10:36 -0700)]
s3: locking: Add a memcache based lock cache.

Based on an idea by Volker to optimize cpu usage when
parsing struct share_mode_data entries.

Add a 64-bit sequence number to the share mode entry,
and after the entry is stored back in the db, cache
the in-memory version using talloc reparenting into the
memcache. The memcache key used is the same struct file_id
used as the key into the locking db.

On read, check if the locking db version sequence number
matches the in-memory cache, and if so reparent the
memcache version back onto the required memory context.

Saves all the ndr decoding when multiple accesses to the
same lock entry happen in succession.

Design also improved by Metze and Ira.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Apr 17 22:38:34 CEST 2015 on sn-devel-104

9 years agolib: memcache. Add a new talloc cache type - SHARE_MODE_LOCK_CACHE.
Jeremy Allison [Thu, 2 Apr 2015 18:19:22 +0000 (11:19 -0700)]
lib: memcache. Add a new talloc cache type - SHARE_MODE_LOCK_CACHE.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
9 years agovfs_fruit: also map characters below 0x20
Björn Jacke [Wed, 15 Apr 2015 19:48:27 +0000 (21:48 +0200)]
vfs_fruit: also map characters below 0x20

we need to map 0x01-0x1F to 0xF001-0xF01F as 0x01-0x1F are win32 illegal
characters.

see https://support.microsoft.com/en-us/kb/kbview/117258

Even if the MS KB article writes "invalid ntfs characters" they are actually
not illegal in ntfs, just in the win32 API.

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

Signed-off-by: Bjoern Jacke <bj@sernet.de>
Reviewed-by: Ralf Böhme <slow@samba.org>
Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Fri Apr 17 20:00:48 CEST 2015 on sn-devel-104

9 years agoctdb: Coverity fix for CID 1125630
Rajesh Joseph [Thu, 16 Apr 2015 06:25:53 +0000 (11:55 +0530)]
ctdb: Coverity fix for CID 1125630

Due to usage of CTDB_NO_MEMORY macro,
some of the resources are not freed in failure cases.

Signed-off-by: Rajesh Joseph <rjoseph@redhat.com>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Fri Apr 17 16:49:05 CEST 2015 on sn-devel-104

9 years agoctdb: Coverity fix for CID 1125625
Rajesh Joseph [Thu, 16 Apr 2015 06:55:28 +0000 (12:25 +0530)]
ctdb: Coverity fix for CID 1125625

Memory allocated by ctdb_sys_find_ifname is not
freed by the caller.

Signed-off-by: Rajesh Joseph <rjoseph@redhat.com>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3-passdb: fix memleak in pdb_default_get_trusted_domain().
Günther Deschner [Mon, 30 Mar 2015 10:32:20 +0000 (12:32 +0200)]
s3-passdb: fix memleak in pdb_default_get_trusted_domain().

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
9 years agodocs: Update vfs_gpfs manpage for the removed fileset quota check
Christof Schmitt [Tue, 7 Apr 2015 20:43:41 +0000 (13:43 -0700)]
docs: Update vfs_gpfs manpage for the removed fileset quota check

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Apr 17 03:26:34 CEST 2015 on sn-devel-104

9 years agovfs_gpfs: Remove vfs_gpfs_get_quotas
Christof Schmitt [Mon, 6 Apr 2015 22:07:59 +0000 (15:07 -0700)]
vfs_gpfs: Remove vfs_gpfs_get_quotas

Call get_gpfs_quota directly from vfs_gpfs_disk_free_quota to get user
and group quotas.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agovfs_gpfs: Remove check for fileset quota
Christof Schmitt [Mon, 6 Apr 2015 21:56:11 +0000 (14:56 -0700)]
vfs_gpfs: Remove check for fileset quota

Querying the fileset id requires additional GPFS API calls and also
opening a directory, which might have other side effects. A better
option would be configuring the file system with --filesetdf, then the
fileset quota is automatically reflected in the free space information
reported from gpfs.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agoChange all uses of uint16/uint32/uint64 to uintXX_t in smb.h.
Richard Sharpe [Tue, 14 Apr 2015 14:02:37 +0000 (07:02 -0700)]
Change all uses of uint16/uint32/uint64 to uintXX_t in smb.h.

Signed-off-by: Richard Sharpe <rsharpe@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Apr 16 23:44:00 CEST 2015 on sn-devel-104

9 years agowinbind: Avoid a few talloc_tos() in winbindd_cache.c
Volker Lendecke [Tue, 14 Apr 2015 10:17:20 +0000 (10:17 +0000)]
winbind: Avoid a few talloc_tos() in winbindd_cache.c

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agowinbind: Use tdb_parse_record in wcache_fetch_seqnum
Volker Lendecke [Tue, 14 Apr 2015 10:06:55 +0000 (10:06 +0000)]
winbind: Use tdb_parse_record in wcache_fetch_seqnum

This removes a malloc use

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos3: smbd: Make sure we do not pass paths with ./ on the front to VFS routines.
Richard Sharpe [Wed, 15 Apr 2015 20:53:09 +0000 (13:53 -0700)]
s3: smbd: Make sure we do not pass paths with ./ on the front to VFS routines.

Signed-off-by: Richard Sharpe <rsharpe@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Apr 16 07:30:30 CEST 2015 on sn-devel-104

9 years agoChange the registry subsystem to use uint32_t from uint32. Also change session.h.
Richard Sharpe [Tue, 14 Apr 2015 14:50:28 +0000 (07:50 -0700)]
Change the registry subsystem to use uint32_t from uint32. Also change session.h.

Signed-off-by: Richard Sharpe <rsharpe@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Apr 16 00:37:28 CEST 2015 on sn-devel-104

9 years agospoolss: cache_key handle allocation failures early
David Disseldorp [Wed, 15 Apr 2015 13:48:06 +0000 (15:48 +0200)]
spoolss: cache_key handle allocation failures early

On cache_key allocation failure, set_printer_hnd_name() currently
stumbles through the rest of the function, and includes extra logic to
handle a NULL key later on.
Handling the allocation failure early makes sense, and also allows for
the NULL key checks to be removed.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Wed Apr 15 18:55:50 CEST 2015 on sn-devel-104

9 years agotorture: Free the temporary memory context
Andreas Schneider [Tue, 14 Apr 2015 08:56:53 +0000 (10:56 +0200)]
torture: Free the temporary memory context

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Apr 15 11:20:22 CEST 2015 on sn-devel-104

9 years agotorture: Correctly invalidate the memory ccache.
Andreas Schneider [Mon, 13 Apr 2015 13:37:58 +0000 (15:37 +0200)]
torture: Correctly invalidate the memory ccache.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agoautobuild: Add options to set mail host and send e-mail with logs
Andrew Bartlett [Tue, 14 Apr 2015 05:18:02 +0000 (17:18 +1200)]
autobuild: Add options to set mail host and send e-mail with logs

This helps when running the script in a cloud instance as
it is cheapest to shut it down once run

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Apr 15 08:41:37 CEST 2015 on sn-devel-104

9 years agoautobuild: Do not consider IDL.pm and Expr.pm changes to make a build bad
Andrew Bartlett [Tue, 14 Apr 2015 00:19:56 +0000 (12:19 +1200)]
autobuild: Do not consider IDL.pm and Expr.pm changes to make a build bad

This allows a different yapp to be installed on the build host without failing
the whole autobuild

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
9 years agoImprove output of check-clean-tree.sh script
Andrew Bartlett [Tue, 14 Apr 2015 00:00:36 +0000 (12:00 +1200)]
Improve output of check-clean-tree.sh script

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
9 years ago.gitignore: Ignore pidl/MYMETA.json
Andrew Bartlett [Tue, 14 Apr 2015 00:03:43 +0000 (12:03 +1200)]
.gitignore: Ignore pidl/MYMETA.json

This is generated by newer versions of MakeMaker

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
9 years agoautobuild: Do not wait when running just one target
Andrew Bartlett [Mon, 13 Apr 2015 23:59:57 +0000 (11:59 +1200)]
autobuild: Do not wait when running just one target

This avoids having to remember to specify AUTOBUILD_RANDOM_SLEEP_OVERRIDE manually

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
9 years agoFix incorrect order of arguments in error string
Roel van Meer [Tue, 14 Apr 2015 14:59:13 +0000 (16:59 +0200)]
Fix incorrect order of arguments in error string

Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <rb@sernet.de>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Apr 15 05:57:25 CEST 2015 on sn-devel-104

9 years agoAdd DCERPC flag to call unbind hooks without destroying the connection itself upon...
Julien Kerihuel [Mon, 6 Apr 2015 09:26:58 +0000 (11:26 +0200)]
Add DCERPC flag to call unbind hooks without destroying the connection itself upon termination of a connection with outstanding pending calls.

Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Apr 14 20:39:34 CEST 2015 on sn-devel-104

9 years agospoolss: purge the printer name cache on name change
David Disseldorp [Tue, 31 Mar 2015 23:03:13 +0000 (01:03 +0200)]
spoolss: purge the printer name cache on name change

Currently the name cache is only cleared on printer deletion. This means
that if a printer undergoes a name change, the old name remains in the
cache and can be subsequently used incorrecly if another printer takes
the same name as the old.

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

Reported-by: Franz Pförtsch <franz.pfoertsch@brose.com>
Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Apr 14 05:37:50 CEST 2015 on sn-devel-104

9 years agos3: libsmbclient: After getting attribute server, ensure main srv pointer is still...
Jeremy Allison [Tue, 31 Mar 2015 21:40:23 +0000 (14:40 -0700)]
s3: libsmbclient: After getting attribute server, ensure main srv pointer is still valid.

Bug #11186: Crash seen in libsmbclient due to free of server structure during SMBC_getxattr() call

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Tue Apr 14 02:58:43 CEST 2015 on sn-devel-104

9 years agowitness: add WITNESS_UNSPECIFIED_VERSION to IDL.
Günther Deschner [Mon, 13 Apr 2015 11:05:59 +0000 (13:05 +0200)]
witness: add WITNESS_UNSPECIFIED_VERSION to IDL.

This version is seen in witness_GetInterfaceList replies from Windows Server
2012 R2.

Guenther

Signed-off-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Mon Apr 13 15:44:42 CEST 2015 on sn-devel-104

9 years agos4-torture: skip witness_AsyncNotify test for now.
Günther Deschner [Thu, 2 Apr 2015 11:19:59 +0000 (13:19 +0200)]
s4-torture: skip witness_AsyncNotify test for now.

We need to use real async calls in this test and add some clusapi commands so we
can remotely modify the cluster to actually trigger notifications.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos4-torture: add witness torture rpc testsuite.
Günther Deschner [Fri, 16 Jan 2015 12:49:46 +0000 (13:49 +0100)]
s4-torture: add witness torture rpc testsuite.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agosrvsvc: add cluster specific share types to IDL.
Günther Deschner [Mon, 23 Feb 2015 14:34:35 +0000 (15:34 +0100)]
srvsvc: add cluster specific share types to IDL.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos4-torture: add witness torture ndr testsuite.
Günther Deschner [Fri, 16 Jan 2015 12:43:01 +0000 (13:43 +0100)]
s4-torture: add witness torture ndr testsuite.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agolibrpc: further fixes for witness.idl.
Gregor Beck [Tue, 4 Feb 2014 14:43:39 +0000 (15:43 +0100)]
librpc: further fixes for witness.idl.

Signed-off-by: Gregor Beck <gbeck@sernet.de>
Reviewed-by: Guenther Deschner <gd@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos4:torture/winbind: add torture:winbindd_domain_without_prefix option
Stefan Metzmacher [Sat, 28 Mar 2015 09:04:30 +0000 (10:04 +0100)]
s4:torture/winbind: add torture:winbindd_domain_without_prefix option

We should not assume that names in the domain
specified by 'torture:winbindd_netbios_domain' have no DOMAIN\ prefix.

On an AD DC we prefix all principals.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Apr  9 19:35:38 CEST 2015 on sn-devel-104

9 years agos4:torture/local: add more torture_assert() checks
Stefan Metzmacher [Sun, 29 Mar 2015 09:21:16 +0000 (11:21 +0200)]
s4:torture/local: add more torture_assert() checks

We need to make sure we return when torture_assert_passwd_equal()
or torture_assert_group_equal() fails.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agoselftest/Samba4: use 'testallowed account' instead of 'test allowed'
Stefan Metzmacher [Sun, 29 Mar 2015 09:15:29 +0000 (11:15 +0200)]
selftest/Samba4: use 'testallowed account' instead of 'test allowed'

local.nss test might print lines starting with 'test allowed:...'
and that confused the subunit parser.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agoselftest/knownfail: remove unused ^samba4.winbind.struct.show_sequence\(ad_dc\) line
Stefan Metzmacher [Sat, 28 Mar 2015 09:07:41 +0000 (10:07 +0100)]
selftest/knownfail: remove unused ^samba4.winbind.struct.show_sequence\(ad_dc\) line

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
9 years agorpcclient: Fix the timeout command
Andreas Schneider [Tue, 7 Apr 2015 14:12:18 +0000 (16:12 +0200)]
rpcclient: Fix the timeout command

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Apr  9 16:57:15 CEST 2015 on sn-devel-104

9 years agofss: Fix CID 1293354 Wrong operator used
Volker Lendecke [Wed, 8 Apr 2015 14:46:44 +0000 (16:46 +0200)]
fss: Fix CID 1293354 Wrong operator used

Not used right now, but prevent future confusion.

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): Wed Apr  8 19:36:36 CEST 2015 on sn-devel-104

9 years agowaf: Fix systemd detection
Andreas Schneider [Tue, 7 Apr 2015 14:30:30 +0000 (16:30 +0200)]
waf: Fix systemd detection

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Apr  8 15:06:26 CEST 2015 on sn-devel-104

9 years agoctdb-tests: Use ctdb_node_list_to_map() in tool stubs
Martin Schwenke [Sat, 21 Feb 2015 19:37:41 +0000 (06:37 +1100)]
ctdb-tests: Use ctdb_node_list_to_map() in tool stubs

Drop copy of old ctdb_control_nodemap().

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): Tue Apr  7 10:20:41 CEST 2015 on sn-devel-104

9 years agoctdb-common: Move ctdb_node_list_to_map() to utilities
Martin Schwenke [Fri, 20 Feb 2015 01:34:25 +0000 (12:34 +1100)]
ctdb-common: Move ctdb_node_list_to_map() to utilities

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-daemon: Factor out new function ctdb_node_list_to_map()
Martin Schwenke [Fri, 20 Feb 2015 01:31:37 +0000 (12:31 +1100)]
ctdb-daemon: Factor out new function ctdb_node_list_to_map()

Change ctdb_control_getnodemap() to use this.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-tools: Drop the recovery from "reloadnodes"
Martin Schwenke [Wed, 4 Feb 2015 01:06:56 +0000 (12:06 +1100)]
ctdb-tools: Drop the recovery from "reloadnodes"

A recovery is not required: when deleting a node it should already be
disconnected and when adding a node it will also be disconnected.  The
new sanity checks in "reloadnodes" ensure that these assumptions are
met.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>