sfrench/samba-autobuild/.git
9 years agomessaging_dgm: Don't expose the messaging_dgm_context
Volker Lendecke [Wed, 10 Sep 2014 14:13:18 +0000 (16:13 +0200)]
messaging_dgm: Don't expose the messaging_dgm_context

Right now we can only support one messaging_dgm_context per process
anyway, the code has checks for this. I would like to keep it that
way, in the future we will have multiple messaging_context's or
imessaging_context's filtering based upon the dst server_id.

Why this change? messaging_dgm's lockfile contains the
serverid->unique_id. When designing messaging_dgm, I had in mind to
remove the serverid.tdb and replace it with the dgm lockfiles for server
lookup and enumeration. I have a WIP-patchset that gets rid of almost
all users of serverid.tdb. The problem is serverid_exists. Here we don't
have a messaging_context available, and it would be pretty intrusive
to make it so. This problem has plagued us since ctdb was developed,
see for example the comment

/*
 * This is a Samba3 hack/optimization. Routines like process_exists need to
 * talk to ctdbd, and they don't get handed a messaging context.
 */

in messaging_ctdb.c. This patchset removes this problem in a radical way:
Treat the messaging_dgm context as one globally available structure and
be done with it. The ctdb socket could go the same way in the future.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Sun Sep 14 16:29:30 CEST 2014 on sn-devel-104

9 years agomessaging_dgm: Avoid a talloc
Volker Lendecke [Wed, 10 Sep 2014 08:12:23 +0000 (10:12 +0200)]
messaging_dgm: Avoid a talloc

Not really required, but it removes a NULL check

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agomessaging_dgm: Avoid a talloc
Volker Lendecke [Wed, 10 Sep 2014 08:12:23 +0000 (10:12 +0200)]
messaging_dgm: Avoid a talloc

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agomessaging_dgm: messaging_dgm_lockfile_remove does not use tmp_ctx anymore
Volker Lendecke [Wed, 10 Sep 2014 08:00:05 +0000 (10:00 +0200)]
messaging_dgm: messaging_dgm_lockfile_remove does not use tmp_ctx anymore

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agomessaging_dgm: messaging_dgm_lockfile_create does not use tmp_ctx anymore
Volker Lendecke [Wed, 10 Sep 2014 08:00:05 +0000 (10:00 +0200)]
messaging_dgm: messaging_dgm_lockfile_create does not use tmp_ctx anymore

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agomessaging_dgm: Avoid talloc_tos()
Volker Lendecke [Wed, 10 Sep 2014 07:58:00 +0000 (09:58 +0200)]
messaging_dgm: Avoid talloc_tos()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agomessaging_dgm: Reformatting
Volker Lendecke [Tue, 9 Sep 2014 19:46:19 +0000 (21:46 +0200)]
messaging_dgm: Reformatting

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agomessaging_dgm: Remove an unnecessary cast
Volker Lendecke [Tue, 9 Sep 2014 19:45:58 +0000 (21:45 +0200)]
messaging_dgm: Remove an unnecessary cast

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agonamecache: fix uninitialised pointer returns
David Disseldorp [Fri, 12 Sep 2014 11:11:00 +0000 (13:11 +0200)]
namecache: fix uninitialised pointer returns

asprintf_strupper_m() doesn't set *strp on error.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Volker Lendecke <Volker.Lendecke@SerNet.DE>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Sep 13 03:21:39 CEST 2014 on sn-devel-104

9 years agodocs: mention incompatibility between kernel oplocks and streams_xattr
Björn Jacke [Tue, 9 Sep 2014 20:35:08 +0000 (22:35 +0200)]
docs: mention incompatibility between kernel oplocks and streams_xattr

See BUG https://bugzilla.samba.org/show_bug.cgi?id=7537 for details.

Signed-off-by: Bjoern Jacke <bj@sernet.de>
Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Fri Sep 12 18:29:37 CEST 2014 on sn-devel-104

9 years agontvfs: Skip the new smb2.oplock.batch26 test
Volker Lendecke [Fri, 12 Sep 2014 10:11:43 +0000 (10:11 +0000)]
ntvfs: Skip the new smb2.oplock.batch26 test

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Sep 12 14:39:00 CEST 2014 on sn-devel-104

9 years agoAdding new oplock test 'batch26'.
Hemanth Thummala [Thu, 11 Sep 2014 21:15:56 +0000 (14:15 -0700)]
Adding new oplock test 'batch26'.

Signed-off-by: Hemanth Thummala <hemanth.thummala@gmail.com>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos3: smbd: streams - Ensure share mode validation ignores internal opens (op_mid ...
Volker Lendecke [Tue, 9 Sep 2014 10:53:52 +0000 (10:53 +0000)]
s3: smbd: streams - Ensure share mode validation ignores internal opens (op_mid == 0).

Fixes bug 10797 - smbd panic at find_oplock_types

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

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agoctdb-doc: Add reference to new magepage ctdb-statistics
Amitay Isaacs [Fri, 12 Sep 2014 06:24:09 +0000 (16:24 +1000)]
ctdb-doc: Add reference to new magepage ctdb-statistics

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Fri Sep 12 11:13:56 CEST 2014 on sn-devel-104

9 years agoctdb-doc: Add ctdb-statistics manual page
Amitay Isaacs [Fri, 12 Sep 2014 04:22:00 +0000 (14:22 +1000)]
ctdb-doc: Add ctdb-statistics manual page

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
9 years agoctdb-daemon: Decrement pending calls statistics when calls are deferred
Amitay Isaacs [Fri, 12 Sep 2014 00:50:27 +0000 (10:50 +1000)]
ctdb-daemon: Decrement pending calls statistics when calls are deferred

Deferred calls should not be treated as pending calls since they are
re-processed from the beginning.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
9 years agoctdb-tests: Do not expect real-time priority when running local daemons
Amitay Isaacs [Fri, 12 Sep 2014 01:25:14 +0000 (11:25 +1000)]
ctdb-tests: Do not expect real-time priority when running local daemons

Local daemons are started mainly for testing and usually not as root.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
9 years agoctdb-daemon: Make sure ctdb runs with real-time priority
Amitay Isaacs [Fri, 12 Sep 2014 01:22:36 +0000 (11:22 +1000)]
ctdb-daemon: Make sure ctdb runs with real-time priority

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
9 years agoctdb-locking: Fork lock helper with vfork_with_logging()
Martin Schwenke [Wed, 13 Aug 2014 05:01:54 +0000 (15:01 +1000)]
ctdb-locking: Fork lock helper with vfork_with_logging()

Otherwise errors printed by the lock helper get lost.

lock_helper_args() no longer adds the program name to the list of
arguments, since vfork_with_logging() does that.  Update the lock
helper to handle the extra log_fd parameter passed by
vfork_with_logging() and send stdout/stderr there.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-locking: Add argc parameter to lock_helper_args()
Martin Schwenke [Wed, 13 Aug 2014 04:46:31 +0000 (14:46 +1000)]
ctdb-locking: Add argc parameter to lock_helper_args()

To make this sane, also add an argv parameter and change the return
type to bool.  Anticipating a subsequent change, make the type of argv
match what is needed by vfork_with_logging() and cast it when passing
to execv().  This also means changing the type of the name member of
struct db_namelist.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agomedia_harmony: Fix a crash bug
Volker Lendecke [Thu, 11 Sep 2014 11:33:42 +0000 (11:33 +0000)]
media_harmony: Fix a crash bug

Now that the dust has settled, fix a crash bug that was hidden behind
the warnings...

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri Sep 12 02:45:40 CEST 2014 on sn-devel-104

9 years agomedia_harmony: Fix warnings
Volker Lendecke [Thu, 11 Sep 2014 11:22:52 +0000 (11:22 +0000)]
media_harmony: Fix warnings

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agos3: smbd - open logic fix.
Jeremy Allison [Thu, 11 Sep 2014 17:03:01 +0000 (10:03 -0700)]
s3: smbd - open logic fix.

As we atomically create using O_CREAT|O_EXCL,
then if new_file_created is true, then
file_existed *MUST* have been false (even
if the file was previously detected as being
there.

We use the variable file_existed again in logic
below this statement, so we must set file_existed = false,
if new_file_created returns are true from open_file().

Based on a fix from Michael Adam.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu Sep 11 22:29:22 CEST 2014 on sn-devel-104

9 years agoctdb-locking: Set real-time priority for lock helpers
Amitay Isaacs [Wed, 10 Sep 2014 08:14:24 +0000 (18:14 +1000)]
ctdb-locking: Set real-time priority for lock helpers

To avoid lock helper starvation when userspace robust mutexes are
enabled.

Commit 6f072f85a138f595494dbec137bcf23d1e666acc removed reset_scheduler(),
to avoid resetting scheduler priority.  However, that is not sufficient
because of commit 1be8564e553ce044426dbe7b3987edf514832940, which sets
SCHED_RESET_ON_FORK flag.  With SCHED_RESET_ON_FORK, all CTDB child
processes will automatically have normal scheduling priority.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Thu Sep 11 11:31:10 CEST 2014 on sn-devel-104

9 years agoctdb-daemon: Increment pending calls statistics correctly
Amitay Isaacs [Tue, 9 Sep 2014 09:01:55 +0000 (19:01 +1000)]
ctdb-daemon: Increment pending calls statistics correctly

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
9 years agotorture: Provide enough space for test EA name in raw.eas test
Andrew Bartlett [Tue, 2 Sep 2014 02:38:11 +0000 (14:38 +1200)]
torture: Provide enough space for test EA name in raw.eas test

The issue is that previously bad_ea_name[5] was the last element on
the array, and so when we later did a strlen() on it, we read past the
end of the stack array.  We need bad_ea_name[5] to be the second-last
element, followed by the \0 placed there by the strlcpy().

Found by AddressSanitizer

Change-Id: I871c08200aa2591c612dfa44da92b83132f83d88
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): Thu Sep 11 08:50:16 CEST 2014 on sn-devel-104

9 years agoctdb-build: Remove unnecessary lib/util include path from tests
Martin Schwenke [Wed, 10 Sep 2014 03:57:58 +0000 (13:57 +1000)]
ctdb-build: Remove unnecessary lib/util include path from tests

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): Thu Sep 11 06:22:33 CEST 2014 on sn-devel-104

9 years agoctdb-util: Clean up dependencies
Martin Schwenke [Wed, 10 Sep 2014 03:57:12 +0000 (13:57 +1000)]
ctdb-util: Clean up dependencies

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-includes: Remove some unnecessary declarations
Martin Schwenke [Fri, 5 Sep 2014 06:09:34 +0000 (16:09 +1000)]
ctdb-includes: Remove some unnecessary declarations

To accommodate removing file_lines_load() from here, drop the #ifdef
around the declaration in util.h.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agovfs_acl_common: dacl size must be updated
Ralph Boehme [Mon, 8 Sep 2014 18:53:44 +0000 (20:53 +0200)]
vfs_acl_common: dacl size must be updated

Signed-off-by: Ralph Boehme <rb@sernet.de>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Sep 11 03:54:42 CEST 2014 on sn-devel-104

9 years agos3: smbd: Ensure we don't call qsort() with a size of -1.
Jeremy Allison [Mon, 8 Sep 2014 23:16:24 +0000 (16:16 -0700)]
s3: smbd: Ensure we don't call qsort() with a size of -1.

Based on a patch idea from Ken Harris <kharris@mathworks.com>

Fixes bug 10798 - crash in source3/smbd/notify.c

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>
9 years agos3:smbd:open_file: use a more natural check.
Michael Adam [Wed, 10 Sep 2014 19:58:04 +0000 (21:58 +0200)]
s3:smbd:open_file: use a more natural check.

As suggested by Jeremy Allison <jra@samba.org>.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos4:torture:base: slightly more generous timing in the defer_open test
Michael Adam [Tue, 9 Sep 2014 23:03:57 +0000 (01:03 +0200)]
s4:torture:base: slightly more generous timing in the defer_open test

This copes with cases where the server is very busy and
can't provide tortures more tight time scaling..
This is an attepmt to remove the flapping character of this test.

Signed-off-by: Michael Adam <obnox@samba.org>
Revieed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Sep 10 21:51:42 CEST 2014 on sn-devel-104

9 years agos3:smbd: fix a race in open code
Michael Adam [Tue, 9 Sep 2014 22:31:25 +0000 (00:31 +0200)]
s3:smbd: fix a race in open code

The race is when a file vanishes between
existence check and acl check.

In this case, open_file_ncreate() returns
OBJECT_NAME_NOT_FOUND even if the create
was called with disposition OPEN_IF.
But in this case, the file should be created.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agosmbd: Fix a typo
Volker Lendecke [Tue, 9 Sep 2014 10:45:38 +0000 (10:45 +0000)]
smbd: Fix a typo

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agos4:torture: fix multi_smb_test child status tracking.
Michael Adam [Thu, 21 Aug 2014 08:32:00 +0000 (10:32 +0200)]
s4:torture: fix multi_smb_test child status tracking.

The original code in torture_start_procs() lost status of
child status. So the affected test caseses
(defer_open, ntdeny1, bench-torture, and also direct
 torture_start_proxy-user bench-nbench) were not always
able to correctly detect and treat errors in the worker children.

With this patch, torture_create_procs() correctly puts
child result and reason into top level torture_result(),
thereby in particular fixing remaining unexpected errors
in the flapping deferopen test.

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): Wed Sep 10 13:15:17 CEST 2014 on sn-devel-104

9 years agos4:torture:base: add torture_comments to the loop of the deferopen test.
Michael Adam [Wed, 20 Aug 2014 13:42:27 +0000 (15:42 +0200)]
s4:torture:base: add torture_comments to the loop of the deferopen test.

This is to be able to better tell what went wrong if something
went wrong. This is currently one of the main flapping tests.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agos4:torture:base: move i++ down in loop in run_deferopen()
Michael Adam [Wed, 20 Aug 2014 21:46:32 +0000 (23:46 +0200)]
s4:torture:base: move i++ down in loop in run_deferopen()

This is where it belongs, and it prepares
subsequent patches.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoctdb-util: Make tdb_wrap self-sufficient - it doesn't need includes.h
Martin Schwenke [Tue, 9 Sep 2014 02:58:13 +0000 (12:58 +1000)]
ctdb-util: Make tdb_wrap self-sufficient - it doesn't need includes.h

It should use finer grained includes like replace.h and
ctdb_logging.h.

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): Wed Sep 10 04:03:20 CEST 2014 on sn-devel-104

9 years agoctdb-build: Tests don't include lib/util/*.c, link ctdb-util instead
Martin Schwenke [Fri, 15 Aug 2014 06:15:37 +0000 (16:15 +1000)]
ctdb-build: Tests don't include lib/util/*.c, link ctdb-util instead

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-build: Drop lib/util from includes
Martin Schwenke [Tue, 19 Aug 2014 03:27:33 +0000 (13:27 +1000)]
ctdb-build: Drop lib/util from includes

In is unnecessary and can accidentally cause lib/util/time.h to be
found instead of /usr/include/time.h.  The only things depending on it
were bare includes of db_wrap.h and a bare include of dlinklist.h,
which are both gone now.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-util: Rename db_wrap to tdb_wrap and make it a build subsystem
Martin Schwenke [Fri, 15 Aug 2014 05:46:33 +0000 (15:46 +1000)]
ctdb-util: Rename db_wrap to tdb_wrap and make it a build subsystem

This makes it consistent with Samba, to ease transition.

Update unit test code to link to with tdb_wrap instead of including
db_wrap.c.

There are some potential whitespace fixes in this commit that have
been ignored.  CTDB's lib/tdb_wrap will be deleted after the
transition to Samba's lib/tdb_wrap, so there's no point polishing it
too much.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-build: Make ctdb-util a wscript build subsystem
Martin Schwenke [Sun, 17 Aug 2014 04:29:32 +0000 (14:29 +1000)]
ctdb-build: Make ctdb-util a wscript build subsystem

This makes it look similar to samba-util, easing the transition.

Fold ctdb-util-misc into ctdb-util, since Samba doesn't separate them.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-logging: Move variable debug_extra from debug.*
Martin Schwenke [Sat, 16 Aug 2014 06:17:02 +0000 (16:17 +1000)]
ctdb-logging: Move variable debug_extra from debug.*

debug_extra is CTDB-specific.  Moving it will help with the
transitions to Samba's updated debug.[ch].

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-logging: Factor out ctdb_logging.h from includes.h
Martin Schwenke [Tue, 9 Sep 2014 03:52:07 +0000 (13:52 +1000)]
ctdb-logging: Factor out ctdb_logging.h from includes.h

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-build: Add extra includes to help recursive utility compilation
Martin Schwenke [Thu, 4 Sep 2014 01:37:15 +0000 (11:37 +1000)]
ctdb-build: Add extra includes to help recursive utility compilation

Subsequent commits will introduce recursive compilation of utilities.
Unfortunately the include file structure requires some global includes
to be found, so make this work.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-recoverd: Change include of dlinklist.h to contain directory
Martin Schwenke [Fri, 15 Aug 2014 06:18:05 +0000 (16:18 +1000)]
ctdb-recoverd: Change include of dlinklist.h to contain directory

This makes it consistent with the rest of the code and avoids problems
when some variant of lib/util isn't in the include path.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-tools: Move definition of timeval_delta() to tools/ctdb.c
Martin Schwenke [Fri, 15 Aug 2014 05:53:03 +0000 (15:53 +1000)]
ctdb-tools: Move definition of timeval_delta() to tools/ctdb.c

This function is only used in this file.  Samba's lib/util doesn't
have timeval_delta(), so staging a clean transition.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-daemon: Drop the argument to fault_setup()
Martin Schwenke [Fri, 15 Aug 2014 05:55:20 +0000 (15:55 +1000)]
ctdb-daemon: Drop the argument to fault_setup()

Samba's version doesn't accept an argument, so this aids a smooth
transition.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-util: Add extra max_size argument to file_lines_load()
Martin Schwenke [Fri, 15 Aug 2014 06:11:45 +0000 (16:11 +1000)]
ctdb-util: Add extra max_size argument to file_lines_load()

This is part of a migration to Samba's lib/util.  CTDB always passes 0
(i.e. no max_size) so use a simple assert() to enforce this, rather
than changing a lot of code that will be discarded anyway.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-client: Rename static function server_id_equal()
Martin Schwenke [Fri, 15 Aug 2014 06:12:43 +0000 (16:12 +1000)]
ctdb-client: Rename static function server_id_equal()

Otherwise it conflicts with the same function provided by Samba's
lib/util.  Using the Samba one drags in too many dependencies, so
rename the CTDB version to avoid a declaration clash when CTDB starts
including samba_util.h.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-util: Remove declaration of non-existent ctdb_fault_setup()
Martin Schwenke [Sat, 16 Aug 2014 06:43:23 +0000 (16:43 +1000)]
ctdb-util: Remove declaration of non-existent ctdb_fault_setup()

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-common: Move hex_decode_talloc() to the lock helper
Martin Schwenke [Wed, 6 Aug 2014 06:36:58 +0000 (16:36 +1000)]
ctdb-common: Move hex_decode_talloc() to the lock helper

This is the only place it is used.

After migrating to Samba's lib/util, the lock helper can be changed to
use strhex_to_data_blob().

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-build: Fix includes for SAMBA_BINARY()s
Martin Schwenke [Mon, 25 Aug 2014 04:00:45 +0000 (14:00 +1000)]
ctdb-build: Fix includes for SAMBA_BINARY()s

No need for "..", since the correct thing is generated.  Add "include"
and "include/internal" where missing.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-build: Don't try to set lib64 directory automatically in build
Martin Schwenke [Tue, 2 Sep 2014 06:18:01 +0000 (16:18 +1000)]
ctdb-build: Don't try to set lib64 directory automatically in build

Just install into lib/ and let packagers decide on this policy, since
it can vary between distributions.  Update our packaging files
accordingly.

A secondary matter is that things are incorrectly installed into
lib64/ when building with 32-bit userspace on a 64-bit kernel.  If
this is done then it should depend on the architecture of the
compiler.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-build: Make ctdb-client depend on ctdb-util and ctdb-util-misc
Martin Schwenke [Mon, 18 Aug 2014 05:45:29 +0000 (15:45 +1000)]
ctdb-build: Make ctdb-client depend on ctdb-util and ctdb-util-misc

The client code uses both of these, so might as well depend on it.
That way code that depends on ctdb-client transitively get the
dependencies.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-build: Allow configure and Makefile to find waf in tarball
Martin Schwenke [Tue, 19 Aug 2014 01:59:03 +0000 (11:59 +1000)]
ctdb-build: Allow configure and Makefile to find waf in tarball

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-common: Add some missing #includes
Martin Schwenke [Thu, 4 Sep 2014 03:33:58 +0000 (13:33 +1000)]
ctdb-common: Add some missing #includes

To avoid warnings when using --enable-developer, which uses
-Wmissing-prototypes.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-daemon: Move some inline declarations to header file
Martin Schwenke [Thu, 4 Sep 2014 03:31:15 +0000 (13:31 +1000)]
ctdb-daemon: Move some inline declarations to header file

To avoid warnings when using --enable-developer, which uses
-Wmissing-prototypes.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-tests: Add missing declarations caused by #define magic
Martin Schwenke [Thu, 4 Sep 2014 03:30:09 +0000 (13:30 +1000)]
ctdb-tests: Add missing declarations caused by #define magic

Some declarations get lost because they basically get #define-d away,
so they need to be repeated after the #undef-s.  Also, some functions
are introduced due the #define-s.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-tests: Mark some functions as static
Martin Schwenke [Thu, 4 Sep 2014 03:28:34 +0000 (13:28 +1000)]
ctdb-tests: Mark some functions as static

To avoid warnings when using --enable-developer, which uses
-Wmissing-prototypes.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-util: Remove util/strlist.c and references to str_util_*()
Martin Schwenke [Thu, 4 Sep 2014 02:34:46 +0000 (12:34 +1000)]
ctdb-util: Remove util/strlist.c and references to str_util_*()

They're not used in CTDB.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb: Fix some "declarations after code" problems
Martin Schwenke [Thu, 4 Sep 2014 01:21:24 +0000 (11:21 +1000)]
ctdb: Fix some "declarations after code" problems

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agoctdb-util: Variables should be declared extern in headers
Martin Schwenke [Thu, 4 Sep 2014 01:20:28 +0000 (11:20 +1000)]
ctdb-util: Variables should be declared extern in headers

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
9 years agodocs-xml: Bump version up to 4.2.
Karolin Seeger [Mon, 8 Sep 2014 19:34:35 +0000 (21:34 +0200)]
docs-xml: Bump version up to 4.2.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Tue Sep  9 15:33:54 CEST 2014 on sn-devel-104

9 years agoWHATSNEW: Start release notes for Samba 4.2.0rc1.
Karolin Seeger [Mon, 8 Sep 2014 19:27:13 +0000 (21:27 +0200)]
WHATSNEW: Start release notes for Samba 4.2.0rc1.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
9 years agos3:smbd: fix a comment typo
Ralph Boehme [Mon, 8 Sep 2014 10:54:32 +0000 (12:54 +0200)]
s3:smbd: fix a comment typo

Signed-off-by: Ralph Boehme <rb@sernet.de>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
9 years agosmbd: Move make_dir_struct() to reply.c
Volker Lendecke [Mon, 8 Sep 2014 10:41:19 +0000 (12:41 +0200)]
smbd: Move make_dir_struct() to reply.c

This routine has nothing to do with dptr handling, it is SMB1 marshalling
called only from reply_search().

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
9 years agos3:smbd: close the connection if the client doesn't start with a SMB1 Negprot or...
Stefan Metzmacher [Mon, 18 Aug 2014 22:15:34 +0000 (00:15 +0200)]
s3:smbd: close the connection if the client doesn't start with a SMB1 Negprot or old messaging call.

The case where the client starts with a SMB2 Negprot is already handled
in smbd_smb2_request_dispatch().

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Sep  9 13:02:21 CEST 2014 on sn-devel-104

9 years agoRevert "buildtools: Rename perl vendorarch configure option."
Michael Adam [Thu, 4 Sep 2014 10:45:48 +0000 (12:45 +0200)]
Revert "buildtools: Rename perl vendorarch configure option."

This reverts commit 04685ff4eed9535769d6a5feee7353f1796a4389.

We are reverting buildtools/wafadmin/Tools/perl.py back to upstream state.
Everything special is now in buildtools/wafsamba/samba_perl.py.

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

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Sep  9 03:07:20 CEST 2014 on sn-devel-104

9 years agoRevert "buildtools: Add perl vendorlib configure option."
Michael Adam [Thu, 4 Sep 2014 10:45:40 +0000 (12:45 +0200)]
Revert "buildtools: Add perl vendorlib configure option."

This reverts commit 48f0183dbeddd7bdf333a40fe0d3e1c7e7fe00f2.

We are reverting buildtools/wafadmin/Tools/perl.py back to upstream state.
Everything special is now in buildtools/wafsamba/samba_perl.py.

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

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoRevert "wafsamba: If perl can't provide defaults, define them."
Michael Adam [Thu, 4 Sep 2014 10:45:32 +0000 (12:45 +0200)]
Revert "wafsamba: If perl can't provide defaults, define them."

This reverts commit 0ba276ebad57d75a769e22414f94acbe8c177d97.

We are reverting buildtools/wafadmin/Tools/perl.py back to upstream state.
Everything special is now in buildtools/wafsamba/samba_perl.py.

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

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agoRevert "wafsamba: Fail with error message if perl doesn't provide valid dirs."
Michael Adam [Thu, 4 Sep 2014 10:45:21 +0000 (12:45 +0200)]
Revert "wafsamba: Fail with error message if perl doesn't provide valid dirs."

This reverts commit 2637890ef42a238093f0f3cbdda0d621d5f9b2e2.

We are reverting buildtools/wafadmin/Tools/perl.py back to upstream state.
Everything special is now in buildtools/wafsamba/samba_perl.py.

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

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
9 years agopidl/wscript: remove --with-perl-* options
Stefan Metzmacher [Tue, 26 Aug 2014 19:33:05 +0000 (21:33 +0200)]
pidl/wscript: remove --with-perl-* options

These are not needed anymore as we have useful defaults now.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
9 years agotorture: basic FSCTL_SET_ZERO_DATA tests
David Disseldorp [Tue, 2 Sep 2014 18:07:20 +0000 (20:07 +0200)]
torture: basic FSCTL_SET_ZERO_DATA tests

Attempt to punch holes in a file using FSCTL_SET_ZERO_DATA. Check that
the resulting data is zeroed. Also confirm that when the file is marked
sparse, the zeroed range is no longer allocated.
Finally, check that removing the sparse flag causes any holes to be
unsparsed.

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): Mon Sep  8 21:40:34 CEST 2014 on sn-devel-104

9 years agotorture: add file zero-range checker
David Disseldorp [Tue, 2 Sep 2014 18:07:19 +0000 (20:07 +0200)]
torture: add file zero-range checker

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agotorture: malformed FSCTL_QUERY_ALLOCATED_RANGES tests
David Disseldorp [Tue, 2 Sep 2014 18:07:18 +0000 (20:07 +0200)]
torture: malformed FSCTL_QUERY_ALLOCATED_RANGES tests

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agotorture: basic FSCTL_QUERY_ALLOCATED_RANGES test
David Disseldorp [Tue, 2 Sep 2014 18:07:17 +0000 (20:07 +0200)]
torture: basic FSCTL_QUERY_ALLOCATED_RANGES test

Add a test and helper function for FSCTL_QUERY_ALLOCATED_RANGES
requests.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agotorture: split pattern write into helper function
David Disseldorp [Tue, 2 Sep 2014 18:07:16 +0000 (20:07 +0200)]
torture: split pattern write into helper function

This allows for patterned writes after file creation, as needed for
sparse file integrity testing.

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agotorture: test oversize FSCTL_SET_SPARSE request
David Disseldorp [Tue, 2 Sep 2014 18:07:15 +0000 (20:07 +0200)]
torture: test oversize FSCTL_SET_SPARSE request

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
9 years agotorture: Correctly initialize array size
Volker Lendecke [Sun, 7 Sep 2014 19:09:32 +0000 (21:09 +0200)]
torture: Correctly initialize array size

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10800
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Mon Sep  8 16:41:51 CEST 2014 on sn-devel-104

9 years agosamba-tool: fix reply when zero day pwd expiry is set
Björn Jacke [Mon, 8 Sep 2014 08:53:40 +0000 (10:53 +0200)]
samba-tool: fix reply when zero day pwd expiry is set

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

Signed-off-by: Bjoern Jacke <bj@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Mon Sep  8 14:15:51 CEST 2014 on sn-devel-104

9 years agos3: smbd: smb2-sessionsetup. Fix use after free when the sessionsetup request state...
Jeremy Allison [Thu, 4 Sep 2014 09:08:08 +0000 (02:08 -0700)]
s3: smbd: smb2-sessionsetup. Fix use after free when the sessionsetup request state is freed before struct smbXsrv_session struct.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Sep  8 09:52:23 CEST 2014 on sn-devel-104

9 years agowinbindd: Do not use group_list->out.resume_index after free
Andrew Bartlett [Tue, 2 Sep 2014 22:21:01 +0000 (10:21 +1200)]
winbindd: Do not use group_list->out.resume_index after free

Found by AddressSanitizer

Change-Id: I59009144b28c390ddb80b7b3fbb4007dfd16db0e
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
9 years agowinbindd: Do not use user_list->out.resume_index after free
Andrew Bartlett [Tue, 2 Sep 2014 05:03:34 +0000 (17:03 +1200)]
winbindd: Do not use user_list->out.resume_index after free

Found by AddressSanitizer

Change-Id: I9f8b95b65de788994a7404fa8889fce45ccb3a30
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
9 years agotorture: allow us to correctly use sizeof(buf) in raw.open tests
Andrew Bartlett [Tue, 2 Sep 2014 02:28:04 +0000 (14:28 +1200)]
torture: allow us to correctly use sizeof(buf) in raw.open tests

This changes the sizeof(buf) from sizeof(void *), 8 on 64-bit machines, to sizeof("test") (eg 5).

Found by AddressSanitizer

Andrew Bartlett

Change-Id: I01f18b35c041f3b16be9f6da8ae5d1917d7e24d9
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
9 years agos3-lib: Do not walk past the end of the dos_to_ntstatus_map array
Andrew Bartlett [Mon, 1 Sep 2014 23:25:07 +0000 (11:25 +1200)]
s3-lib: Do not walk past the end of the dos_to_ntstatus_map array

Found by AddressSanitizer

Change-Id: Ic8b3e2599713c37b11324f9ec2d01891f0f287b9
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
9 years agoUse correct size for test string, sizeof() was of the pointer
Andrew Bartlett [Mon, 1 Sep 2014 22:48:34 +0000 (10:48 +1200)]
Use correct size for test string, sizeof() was of the pointer

Found by AddressSanitizer

Change-Id: Ifc9883d958f253df903775544010c0228a102f0f
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
9 years agopassdb: Avoid use-after-free when setting a plaintext password
Andrew Bartlett [Mon, 1 Sep 2014 22:47:57 +0000 (10:47 +1200)]
passdb: Avoid use-after-free when setting a plaintext password

The issue here is that pdb_set_plaintext_passwd() re-used the memory from pdb_get_pw_history() as input

We need to free this after we copy and set it.

Found by AddressSanitizer

Andrew Bartlett

Change-Id: I4e148e23ccbbe5444c969ff8f91709791c7696bb
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
9 years agos4-auth: Use sizeof() rather than a fixed constant in memcmp() call
Andrew Bartlett [Mon, 1 Sep 2014 21:48:08 +0000 (09:48 +1200)]
s4-auth: Use sizeof() rather than a fixed constant in memcmp() call

Change-Id: I2807cf2af9e4c3282e6ff54a6dd8e90f34e9481f
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
9 years agoselftest: Show filename or script we had trouble reading
Andrew Bartlett [Mon, 1 Sep 2014 05:13:39 +0000 (17:13 +1200)]
selftest: Show filename or script we had trouble reading

Change-Id: I12c26e807ab0d65031347bc3be609b2e87dcabb5
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
9 years agotorture: fix whitespace/tab mixup in internal_torture_run_test()
Michael Adam [Wed, 20 Aug 2014 13:25:17 +0000 (15:25 +0200)]
torture: fix whitespace/tab mixup in internal_torture_run_test()

No diff visible with "git show|diff -w".

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Mon Sep  8 04:21:52 CEST 2014 on sn-devel-104

9 years agoscript/autobuild.py: remove explicit --with-perl-*-install-dir options
Stefan Metzmacher [Tue, 26 Aug 2014 19:32:17 +0000 (21:32 +0200)]
script/autobuild.py: remove explicit --with-perl-*-install-dir options

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Sep  5 22:09:47 CEST 2014 on sn-devel-104

9 years agopidl: remove superfluous "use lib ...".
Michael Adam [Mon, 25 Aug 2014 21:58:48 +0000 (23:58 +0200)]
pidl: remove superfluous "use lib ...".

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

Signed-off-by: Michael Adam <obnox@samba.org>
9 years agopidl: fix the perl module search path (use lib ...) when installing pidl.
Michael Adam [Mon, 25 Aug 2014 21:57:23 +0000 (23:57 +0200)]
pidl: fix the perl module search path (use lib ...) when installing pidl.

This way, pidl can also run with modules installed under the $prefix.

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

Signed-off-by: Michael Adam <obnox@samba.org>
9 years agowafsamba: add perl_fixup parameter to INSTALL_FILES
Michael Adam [Thu, 17 Jul 2014 14:54:54 +0000 (16:54 +0200)]
wafsamba: add perl_fixup parameter to INSTALL_FILES

This fixes the search path for modules when installing
a perl "binary" by replacing a line 'use lib "$RealBin/lib";'
which works for the build directory with the appropriate
"use lib" line.

This is a step in allowing to install perl modules under the
prefix directory again.

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

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
9 years agos3:build: don't detect perl in source3/wscript again.
Michael Adam [Wed, 27 Aug 2014 20:19:38 +0000 (22:19 +0200)]
s3:build: don't detect perl in source3/wscript again.

This is done in the top level now.

Signed-off-by: Michael Adam <obnox@samba.org>
9 years agopidl/wscript: don't check for perl again.
Michael Adam [Wed, 3 Sep 2014 23:38:14 +0000 (01:38 +0200)]
pidl/wscript: don't check for perl again.

This is done at the toplevel now.

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

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
9 years agobuild: do full SAMBA_CHECK_PERL() check in configure
Michael Adam [Mon, 25 Aug 2014 23:31:17 +0000 (01:31 +0200)]
build: do full SAMBA_CHECK_PERL() check in configure

...instead of only checking for the perl binary

This autodetects PERL_LIB_INSTALL_DIR and removes the
need of the --with-perl-lib-install-dir when using a --prefix!=/usr.

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

Signed-off-by: Michael Adam <obnox@samba.org>
9 years agowafsamba: add samba_perl.py with SAMBA_CHECK_PERL() higher level check.
Michael Adam [Mon, 25 Aug 2014 23:29:57 +0000 (01:29 +0200)]
wafsamba: add samba_perl.py with SAMBA_CHECK_PERL() higher level check.

This checks for the perl binary, sets PERL and PERL_SPECIFIED
as well es the PERL_ARCH_INSTALL_DIR and PERL_LIB_INSTALL_DIR.

We want to avoid installing the perl modules outside the prefix.
I.e. generally,the perl modules should be installed
under "$prefix/share/perl5".

This improves the fixes for bug #10472.

The new strategy for automatically setting the paths is this:

- if the prefix equals perl's vendorprefix, then
  - PERL_LIB_INSTALL_DIR is set to perl's vendorlib dir
  - PERL_ARCH_INSTALL_DIR is set to perl's vendorarch dir
- otherwise:
  - PERL_LIB_INSTALL_DIR is set to ${DATADIR}/perl5
    (usually ${PREFIX}/share/perl5)
  - PERL_ARCH_INSTALL_DIR is set to ${LIBDIR}/perl5
    (usually ${PREFIX}/lib/perl5)

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

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