amitay/samba.git
10 years agolibrpc/rpc: finally maintain only the object guid
Stefan Metzmacher [Tue, 11 Mar 2014 07:49:07 +0000 (08:49 +0100)]
librpc/rpc: finally maintain only the object guid

This has nothing to do with ndr_syntax_id...

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agolibrpc/rpc: maintain "abstract_syntax" as string option of dcerpc_binding
Stefan Metzmacher [Tue, 4 Feb 2014 12:52:26 +0000 (13:52 +0100)]
librpc/rpc: maintain "abstract_syntax" as string option of dcerpc_binding

This should not be mixed with the object guid! They are different things!

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agos4:librpc/tests: reset the object on the binding created from the tower
Stefan Metzmacher [Mon, 10 Mar 2014 14:52:49 +0000 (15:52 +0100)]
s4:librpc/tests: reset the object on the binding created from the tower

The tower doesn't contain information about the object only about
the abstract syntax.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agos4:torture/raw: fix debug message in torture_raw_qfileinfo_pipe()
Stefan Metzmacher [Thu, 16 Jan 2014 07:23:47 +0000 (08:23 +0100)]
s4:torture/raw: fix debug message in torture_raw_qfileinfo_pipe()

We no longer use dcerpc_pipe_open_smb() there.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agos4:torture/rpc: make use of dcerpc_binding_handle_auth_info() in backupkey.c
Stefan Metzmacher [Wed, 22 Jan 2014 10:19:15 +0000 (11:19 +0100)]
s4:torture/rpc: make use of dcerpc_binding_handle_auth_info() in backupkey.c

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agos4:torture/rpc: make use of dcerpc_binding_handle_auth_info() in lsa.c
Stefan Metzmacher [Wed, 22 Jan 2014 10:19:15 +0000 (11:19 +0100)]
s4:torture/rpc: make use of dcerpc_binding_handle_auth_info() in lsa.c

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agos4:torture/rpc: fix altercontext test against windows
Stefan Metzmacher [Wed, 22 Jan 2014 10:18:35 +0000 (11:18 +0100)]
s4:torture/rpc: fix altercontext test against windows

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agos4:torture/rpc: remove bogus rpc.multibind test
Stefan Metzmacher [Wed, 22 Jan 2014 11:22:30 +0000 (12:22 +0100)]
s4:torture/rpc: remove bogus rpc.multibind test

We can later add a more useful test that tests
security context multiplexing correctly.

And another one that demonstrates that only DCERPC_BIND
must be the first (and only the first) PDU on a connection.
Otherwise DCERPC_ALTER_CONTEXT is used.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agos4:selftest: don't run rpc.multibind anymore
Stefan Metzmacher [Wed, 22 Jan 2014 11:21:50 +0000 (12:21 +0100)]
s4:selftest: don't run rpc.multibind anymore

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agos4:dsdb/repl: make use of dcerpc_binding_handle_is_connected()
Stefan Metzmacher [Wed, 22 Jan 2014 13:14:12 +0000 (14:14 +0100)]
s4:dsdb/repl: make use of dcerpc_binding_handle_is_connected()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agos4:librpc/test: test ipv6 addresses in dcerpc_binding strings
Stefan Metzmacher [Thu, 13 Feb 2014 17:55:48 +0000 (18:55 +0100)]
s4:librpc/test: test ipv6 addresses in dcerpc_binding strings

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agolibrpc/rpc: handle ipv6 addresses without transport in dcerpc_parse_binding()
Stefan Metzmacher [Thu, 13 Feb 2014 17:55:10 +0000 (18:55 +0100)]
librpc/rpc: handle ipv6 addresses without transport in dcerpc_parse_binding()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agolibrpc/rpc: add "schannel" => DCERPC_SCHANNEL as ncacn_option
Stefan Metzmacher [Tue, 11 Mar 2014 15:28:16 +0000 (16:28 +0100)]
librpc/rpc: add "schannel" => DCERPC_SCHANNEL as ncacn_option

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agos4:librpc/tests: add more no transport tests
Stefan Metzmacher [Thu, 13 Feb 2014 17:00:36 +0000 (18:00 +0100)]
s4:librpc/tests: add more no transport tests

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agolib/util: let is_ipaddress_v6() cope with "fe80::1234%3"
Stefan Metzmacher [Thu, 13 Feb 2014 18:51:30 +0000 (19:51 +0100)]
lib/util: let is_ipaddress_v6() cope with "fe80::1234%3"

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agos4:librpc/rpc: correctly map the fault code of alter context to NTSTATUS
Stefan Metzmacher [Thu, 16 Jan 2014 08:22:53 +0000 (09:22 +0100)]
s4:librpc/rpc: correctly map the fault code of alter context to NTSTATUS

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agos4:librpc/rpc: remove unused dcecli_connection->binding_string
Stefan Metzmacher [Thu, 23 Jan 2014 08:48:20 +0000 (09:48 +0100)]
s4:librpc/rpc: remove unused dcecli_connection->binding_string

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agos4:torture/rpc: avoid using dcecli_connection->binding_string
Stefan Metzmacher [Thu, 23 Jan 2014 08:46:55 +0000 (09:46 +0100)]
s4:torture/rpc: avoid using dcecli_connection->binding_string

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agolibrpc/rpc: use dcerpc_binding_set_string_option(b, "endpoint", NULL) to reset the...
Stefan Metzmacher [Tue, 18 Mar 2014 06:07:13 +0000 (07:07 +0100)]
librpc/rpc: use dcerpc_binding_set_string_option(b, "endpoint", NULL) to reset the endpoint

We should always go through just one code path to [re]set a value.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agolibrpc/rpc: let dcerpc_binding_set_transport() also reset the assoc_group_id
Stefan Metzmacher [Tue, 18 Mar 2014 06:07:13 +0000 (07:07 +0100)]
librpc/rpc: let dcerpc_binding_set_transport() also reset the assoc_group_id

This is transport/endpoint specific.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agolibcli/smb: reuse tstream_smbXcli_np_disconnect_send/recv as helper
Stefan Metzmacher [Sun, 16 Mar 2014 10:50:39 +0000 (11:50 +0100)]
libcli/smb: reuse tstream_smbXcli_np_disconnect_send/recv as helper

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agolibcli/smb: add tstream_smbXcli_np_disconnect_cleanup() to handle talloc_free(req)
Stefan Metzmacher [Sun, 16 Mar 2014 10:50:39 +0000 (11:50 +0100)]
libcli/smb: add tstream_smbXcli_np_disconnect_cleanup() to handle talloc_free(req)

If the tevent_req of tstream_smbXcli_np_disconnect_* is explicitly or
implicitly free'ed, we need to make sure we still deliver the
close request to the server! Otherwise the SMB signing sequence gets out of
sync.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agolibcli/smb: make TSTREAM_SMBXCLI_NP_MAX_BUF_SIZE public
Stefan Metzmacher [Wed, 22 Jan 2014 10:29:15 +0000 (11:29 +0100)]
libcli/smb: make TSTREAM_SMBXCLI_NP_MAX_BUF_SIZE public

This should be used to negotiate the may fragment size
of DCERPC connections.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agolibcli/smb: keep references to smbXcli_{conn,session,tcon} in tstream_smbXcli_np
Stefan Metzmacher [Tue, 11 Mar 2014 13:29:46 +0000 (14:29 +0100)]
libcli/smb: keep references to smbXcli_{conn,session,tcon} in tstream_smbXcli_np

This fixes some valgrind errors when the smbXcli_tcon disappears before the
smbXcli_conn.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agos4:torture/rpc: fix error path in torture_leave_domain()
Stefan Metzmacher [Tue, 11 Mar 2014 14:05:37 +0000 (15:05 +0100)]
s4:torture/rpc: fix error path in torture_leave_domain()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agolibrpc: inline CHECK_SYNTAX macro logic
David Disseldorp [Mon, 24 Mar 2014 15:46:10 +0000 (16:46 +0100)]
librpc: inline CHECK_SYNTAX macro logic

The CHECK_SYNTAX macro is currently used to compare ndr_syntax_ids and
return false on mismatch. Macros affecting control flow are evil!

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 Mar 24 21:46:39 CET 2014 on sn-devel-104

10 years agolibrpc: inline VT CHECK macro logic
David Disseldorp [Mon, 24 Mar 2014 15:46:09 +0000 (16:46 +0100)]
librpc: inline VT CHECK macro logic

The CHECK macro is currently used to dump error and return false on
VT condition check failure. Macros affecting control flow are evil!

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agolibrpc: split type specific VT checks into helpers
David Disseldorp [Mon, 24 Mar 2014 15:46:08 +0000 (16:46 +0100)]
librpc: split type specific VT checks into helpers

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agolibrpc: dump correct ndr_syntax_id on VT check failure
David Disseldorp [Mon, 24 Mar 2014 15:46:07 +0000 (16:46 +0100)]
librpc: dump correct ndr_syntax_id on VT check failure

Signed-off-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:build: remove global CLUSTER_SUPPORT define
Stefan Metzmacher [Tue, 21 Jan 2014 13:34:48 +0000 (14:34 +0100)]
s3:build: remove global CLUSTER_SUPPORT define

All ctdb specific code is isolated in samba-cluster-support.so now.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Mon Mar 24 19:08:44 CET 2014 on sn-devel-104

10 years agos3:wscript: only build ctdb_dummy.c if we have no cluster support
Stefan Metzmacher [Tue, 21 Jan 2014 14:26:28 +0000 (15:26 +0100)]
s3:wscript: only build ctdb_dummy.c if we have no cluster support

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agos3:wscript: only fill in CTDB_CFLAGS instead of config.h
Stefan Metzmacher [Tue, 8 Oct 2013 10:56:02 +0000 (12:56 +0200)]
s3:wscript: only fill in CTDB_CFLAGS instead of config.h

Only files in 'samba3-ctdb-client' will see HAVE_CTDB* defines.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agos3:wscript: don't add ctdb include dir globally
Stefan Metzmacher [Tue, 8 Oct 2013 10:11:49 +0000 (12:11 +0200)]
s3:wscript: don't add ctdb include dir globally

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agos3:serverid: use ctdb_serverids_exist_supported() runtime check
Stefan Metzmacher [Tue, 8 Oct 2013 13:31:17 +0000 (15:31 +0200)]
s3:serverid: use ctdb_serverids_exist_supported() runtime check

This is better than a compile time check for
HAVE_CTDB_CONTROL_CHECK_SRVIDS_DECL.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agos3:ctdb_conn: only use ctdb_protocol.h or ctdb_private.h in ctdb_conn.c
Stefan Metzmacher [Tue, 8 Oct 2013 11:35:41 +0000 (13:35 +0200)]
s3:ctdb_conn: only use ctdb_protocol.h or ctdb_private.h in ctdb_conn.c

We don't need them in ctdb_conn.h.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agowafsamba: use cluster_support_features in build_options.c
Stefan Metzmacher [Tue, 21 Jan 2014 13:32:49 +0000 (14:32 +0100)]
wafsamba: use cluster_support_features in build_options.c

This way 'smbd -b' returns the cluster features of the currently used
libsamba-cluster-support.so.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agos3:lib: add cluster_support_[available|features]()
Stefan Metzmacher [Tue, 21 Jan 2014 13:32:30 +0000 (14:32 +0100)]
s3:lib: add cluster_support_[available|features]()

This allows runtime selection of libsamba-cluster-support.so

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agos3:param: move lp_ctdbd_socket() to ctdbd_conn.c
Stefan Metzmacher [Tue, 8 Oct 2013 11:33:49 +0000 (13:33 +0200)]
s3:param: move lp_ctdbd_socket() to ctdbd_conn.c

This allows us to use CTDB_PATH only in ctdbd_conn.c

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agos3:lib: move all ctdb related dummy functions to ctdb_dummy.c
Stefan Metzmacher [Tue, 21 Jan 2014 13:25:32 +0000 (14:25 +0100)]
s3:lib: move all ctdb related dummy functions to ctdb_dummy.c

This gets all dummy functions for the build without CLUSTER_SUPPORT.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agos3:ctdbd_conn: always provide ctdb_serverids_exist()
Stefan Metzmacher [Tue, 8 Oct 2013 13:30:44 +0000 (15:30 +0200)]
s3:ctdbd_conn: always provide ctdb_serverids_exist()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agos3:ctdbd_conn: add ctdb_serverids_exist_supported()
Stefan Metzmacher [Tue, 8 Oct 2013 13:30:16 +0000 (15:30 +0200)]
s3:ctdbd_conn: add ctdb_serverids_exist_supported()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agos3:wscript: create a libsamba-cluster-support.so
Stefan Metzmacher [Tue, 8 Oct 2013 09:52:23 +0000 (11:52 +0200)]
s3:wscript: create a libsamba-cluster-support.so

This collects the ctdb version dependent files,
which allows vendors to provide multiple versions
of libsamba-cluster-support.so each compiled against different
ctdb versions.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agowafsamba: add CONFIG_RESET()
Stefan Metzmacher [Tue, 8 Oct 2013 10:10:54 +0000 (12:10 +0200)]
wafsamba: add CONFIG_RESET()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
10 years agolsa.idl: define lsa.ForestTrustCollisionInfo and ForestTrustCollisionRecord as public...
Alexander Bokovoy [Tue, 18 Mar 2014 17:41:38 +0000 (19:41 +0200)]
lsa.idl: define lsa.ForestTrustCollisionInfo and ForestTrustCollisionRecord as public structs

For Python bindings PIDL wants the struct to be defined as public if we
want to use __ndr_print/pack/unpack.

Define the [public] attribute to ForestTrustCollisionInfo/Record to
allow easier debugging when there is collision in establishing a trust.

This change does not affect C code as NDR functions are always
generated, only not exposed in Python bindings.

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

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Autobuild-User(master): Alexander Bokovoy <ab@samba.org>
Autobuild-Date(master): Mon Mar 24 12:44:50 CET 2014 on sn-devel-104

10 years agoctdb/daemon: Optimise deletion of IPs
Martin Schwenke [Wed, 22 Jan 2014 06:01:19 +0000 (17:01 +1100)]
ctdb/daemon: Optimise deletion of IPs

Previous commits maintained the ordering between
ctdb_remove_orphaned_ifaces() and ctdb_vnn_unassign_iface().  This
meant that ctdb_remove_orphaned_ifaces() needed to steal the orphaned
interfaces and they would be freed later.

Unassign the interface first and things get simpler.
ctdb_remove_orphaned_ifaces() is now self-contained.

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): Sun Mar 23 06:20:43 CET 2014 on sn-devel-104

10 years agoctdb/daemon: Make delete IP wait until the IP is released
Martin Schwenke [Wed, 22 Jan 2014 02:30:47 +0000 (13:30 +1100)]
ctdb/daemon: Make delete IP wait until the IP is released

reloadips really expects deleted IPs to be released before completing.
Otherwise the recovery daemon starts failing the local IP check.  The
races that follow can cause a node to be banned.

To make the error handling simple, do the actual deletion in
release_ip_callback().

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-tests: Improve tickle tests
Martin Schwenke [Fri, 28 Feb 2014 04:54:05 +0000 (15:54 +1100)]
ctdb-tests: Improve tickle tests

It is hard to diagnose failures in the NFS tickle test because there's
no way of telling if the test node doesn't have the tickle or if it
didn't get propagated.

Factor out check_tickles() into local.bash and give it some
parameters.

Have the NFS test call it first to ensure the tickle has been
registered.  Then use new function check_tickles_all() to ensure the
tickle has been propagated to all nodes.  Give this a bit of extra
time (double the timeout) just in case we're racing with the update.

Add a useful comment to the CIFS test so that I stop asking myself how
the test could ever have worked reliably.  :-)

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

10 years agoctdb-eventscripts: Fix regression in IP add/delete functions
Martin Schwenke [Fri, 14 Mar 2014 02:14:18 +0000 (13:14 +1100)]
ctdb-eventscripts: Fix regression in IP add/delete functions

Commit 176ae6c704528c021fcc34a41878584f43a00119 caused these functions
to exit on failure.  This is incorrect and broke NAT gateway.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-daemon: Do not disable monitoring when running eventscripts
Martin Schwenke [Tue, 4 Mar 2014 04:06:11 +0000 (15:06 +1100)]
ctdb-daemon: Do not disable monitoring when running eventscripts

This is racy and cbffbb7c2f406fc1d8ebad3c531cc2757232690e makes it
unnecessary.

The eventscript code still knows that monitor events are special
compared to other events.  However, the general concept of monitoring
is no longer tangled up with running scripts.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-eventscripts: Attach to persistent ctdb.tdb in "startup" event
Martin Schwenke [Sun, 2 Mar 2014 18:50:14 +0000 (05:50 +1100)]
ctdb-eventscripts: Attach to persistent ctdb.tdb in "startup" event

"statd-callout notify" currently complains until an add-client or
del-client is done.

Given that we might use ctdb.tdb for something else in the future it
makes sense attach to it in the "startup" event.  This could be done
in the background but it should be so lightweight that a timeout will
indicate serious problems.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-daemon: Fix tickle updates to recently started nodes
Martin Schwenke [Thu, 13 Mar 2014 05:53:15 +0000 (16:53 +1100)]
ctdb-daemon: Fix tickle updates to recently started nodes

Commit 0723fedcedd4a97870f7b1224945f1587363c9bf added a cheap
implemention of ctdb_control_startup() that simply flags the recipient
node as needing to send updates for each IP when the tickle update
loop next fires.  Commit 026996550d726836091ff5ebd1ebf925bf237bb0
ensures that a node only sends tickle updates once being flagged to do
so.

CTDB_CONTROL_STARTUP is broadcast to all nodes, so this is a good
start.  However, the tickle updates are only broadcast to connected
nodes.  A recently started node may not yet be considered to be
connected because the keepalive monitoring loop may not yet have
marked the node as connected.  This means that the tickle update loop
races with the keepalive monitoring loop.  If the tickle update loop
wins then updates will not be sent to the recently started node.

The simplest improvement is to stop the tickle update from depending
on whether a node is connected or not.  So instead of broadcasting
tickle updates to connected nodes, they are broadcast to all nodes.
Since no reply is expected, this should work just fine.

While looking at this code, ctdb_ctrl_set_tcp_tickles() is named like
a client function.  It isn't a client function.  Also, 2 of the
arguments are ignored.  So rename this function to
ctdb_send_set_tcp_tickles_for_ip() and remove the ignored arguments.

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

10 years agoctdb-tools-ctdb: Parse IP addresses when reading a list from a file
Martin Schwenke [Mon, 3 Mar 2014 02:20:06 +0000 (13:20 +1100)]
ctdb-tools-ctdb: Parse IP addresses when reading a list from a file

This way this logic is centralised.  It also means that the IP address
comparisons in the NAT gateway code are IPv6 safe.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-tools-ctdb: Remove redundant filtering of trailing empty lines
Martin Schwenke [Mon, 3 Mar 2014 05:23:42 +0000 (16:23 +1100)]
ctdb-tools-ctdb: Remove redundant filtering of trailing empty lines

There is a check for empty lines in the loop just below.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-tools-ctdb: Use DLIST_ADD_END() to avoid reversing the list
Martin Schwenke [Mon, 3 Mar 2014 02:04:25 +0000 (13:04 +1100)]
ctdb-tools-ctdb: Use DLIST_ADD_END() to avoid reversing the list

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-tools-ctdb: Factor out function read_pnn_node_file()
Martin Schwenke [Mon, 3 Mar 2014 01:57:30 +0000 (12:57 +1100)]
ctdb-tools-ctdb: Factor out function read_pnn_node_file()

Factor it from read_nodes_file().  Use it there and in
read_natgw_nodes_file().

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-tests: Add "ctdb listnodes" and "ctdb xpnn" stub tests
Martin Schwenke [Mon, 17 Mar 2014 02:42:35 +0000 (13:42 +1100)]
ctdb-tests: Add "ctdb listnodes" and "ctdb xpnn" stub tests

Tests for xpnn need to implement a stub for ctdb_sys_have_ip().  The
cheapest way of doing this is to read a fake nodemap using the
existing code and check if the IP of the "current" node is the one
being asked about.  However, the fake state initialisation isn't
currently available to without_daemon commands because it is meant to
represent daemon state.  However, it can be made available by moving
the relevant code into a new stub for tevent_context_init().  The stub
still needs to initialise a tevent context - this can be done by
calling a lower level function.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-tools-ctdb: Read NAT gateway nodes from a separate function
Martin Schwenke [Mon, 3 Mar 2014 01:45:23 +0000 (12:45 +1100)]
ctdb-tools-ctdb: Read NAT gateway nodes from a separate function

Now it gets easier to refactor.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-tools-ctdb: Add and use function filter_nodemap_by_natgw_nodes()
Martin Schwenke [Mon, 3 Mar 2014 00:41:32 +0000 (11:41 +1100)]
ctdb-tools-ctdb: Add and use function filter_nodemap_by_natgw_nodes()

Add another filter function, like the ones for capabilities and flags
to, for filtering by NAT gateway nodes.  This makes the main
natgw_list function more readable.

Note that this drops the early filtering of disconnected nodes, so
they will now be listed in a NAT gateway group.  This makes sense.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-tools-ctdb: Update LVS commands to use filter_nodemap_by_flags()
Martin Schwenke [Wed, 19 Feb 2014 07:45:18 +0000 (18:45 +1100)]
ctdb-tools-ctdb: Update LVS commands to use filter_nodemap_by_flags()

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-tools-ctdb: Update LVS commands to use filter_nodemap_by_capabilities()
Martin Schwenke [Wed, 19 Feb 2014 06:12:08 +0000 (17:12 +1100)]
ctdb-tools-ctdb: Update LVS commands to use filter_nodemap_by_capabilities()

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-tools-ctdb: Fixes for "lvs" and "lvsmaster" commands
Martin Schwenke [Fri, 28 Feb 2014 09:16:34 +0000 (20:16 +1100)]
ctdb-tools-ctdb: Fixes for "lvs" and "lvsmaster" commands

The index of the nodes array in nodemap isn't the PNN.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-tools-ctdb: Generalise find_natgw() -> filter_nodemap_by_flags()
Martin Schwenke [Tue, 18 Feb 2014 06:11:53 +0000 (17:11 +1100)]
ctdb-tools-ctdb: Generalise find_natgw() -> filter_nodemap_by_flags()

Instead of just finding the first node that doesn't have any flags in
flag_mask set, change it into a function that filters a nodemap to
exclude nodes with the given flags.

This makes the NATGW code simpler but also provides a function that
can be used in other code.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-tools-ctdb: Update natgwlist to filter nodes by NATGW capability
Martin Schwenke [Tue, 18 Feb 2014 04:52:37 +0000 (15:52 +1100)]
ctdb-tools-ctdb: Update natgwlist to filter nodes by NATGW capability

Check capabilities once to build a filtered node list instead of
repeatedly checking capabilities

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-tests: New natgwlist tests where nodes capability not set
Martin Schwenke [Tue, 18 Feb 2014 01:29:44 +0000 (12:29 +1100)]
ctdb-tests: New natgwlist tests where nodes capability not set

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-tests: Update ctdb stub LVS tests and add some new ones
Martin Schwenke [Tue, 18 Feb 2014 01:12:06 +0000 (12:12 +1100)]
ctdb-tests: Update ctdb stub LVS tests and add some new ones

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-tests: Support fake capabilities in CTDB tool stub
Martin Schwenke [Tue, 18 Feb 2014 00:34:11 +0000 (11:34 +1100)]
ctdb-tests: Support fake capabilities in CTDB tool stub

... and add a test to make sure it works.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-tests: Remove old, unused copy of a CTDB tool unit test
Martin Schwenke [Tue, 18 Feb 2014 00:02:49 +0000 (11:02 +1100)]
ctdb-tests: Remove old, unused copy of a CTDB tool unit test

This looks to have got left behind a long time ago when things got
moved around...

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-tools-ctdb: Don't close stderr when running without_daemon commands
Martin Schwenke [Mon, 17 Mar 2014 02:28:14 +0000 (13:28 +1100)]
ctdb-tools-ctdb: Don't close stderr when running without_daemon commands

It looks like the original without_daemon code still tried to
establish a client connection to the daemon.  Closing stderr looks to
be a cheap way of hiding the errors when this failed.

However, later cleanups avoid the client connection altogether, so do
not close stderr.  Now debug output from without_daemon commands
actually appears.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb/pmda: Fix metric identifiers
David Disseldorp [Thu, 20 Mar 2014 13:23:01 +0000 (14:23 +0100)]
ctdb/pmda: Fix metric identifiers

The commit "pmda: Use upstream assigned PCP domain id" updated the
Performance Metrics Namespace (pmns) file, without changing the
corresponding metric identifiers used by the agent.

This change fixes the agent metric identifier values to match the pmns
definitions.

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): Sat Mar 22 00:07:31 CET 2014 on sn-devel-104

10 years agosmbd: Remove unused "share_mode_data->id"
Volker Lendecke [Thu, 20 Mar 2014 13:58:19 +0000 (14:58 +0100)]
smbd: Remove unused "share_mode_data->id"

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): Fri Mar 21 21:22:24 CET 2014 on sn-devel-104

10 years agosmbd: Keep "the_lock"s file id separately
Volker Lendecke [Thu, 20 Mar 2014 13:57:19 +0000 (14:57 +0100)]
smbd: Keep "the_lock"s file id separately

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agosmbd: Avoid checking the_lock->id for fresh locks
Volker Lendecke [Thu, 20 Mar 2014 13:53:14 +0000 (14:53 +0100)]
smbd: Avoid checking the_lock->id for fresh locks

If we just fetched the lock, this check will always be true.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agosmbd: Explicitly pass "file_id" to rename_share_filename
Volker Lendecke [Thu, 20 Mar 2014 13:36:11 +0000 (14:36 +0100)]
smbd: Explicitly pass "file_id" to rename_share_filename

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agosmbd: Use fsp->file_id in open_file_ntcreate
Volker Lendecke [Thu, 20 Mar 2014 13:45:42 +0000 (14:45 +0100)]
smbd: Use fsp->file_id in open_file_ntcreate

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agosmbd: Explicitly pass "file_id" to schedule_defer_open
Volker Lendecke [Thu, 20 Mar 2014 13:36:11 +0000 (14:36 +0100)]
smbd: Explicitly pass "file_id" to schedule_defer_open

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agosmbd: Explicitly pass "file_id" to rename_open_files
Volker Lendecke [Thu, 20 Mar 2014 13:36:11 +0000 (14:36 +0100)]
smbd: Explicitly pass "file_id" to rename_open_files

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agodfs_server: randomize the server redirect set
Arvid Requate [Thu, 20 Mar 2014 21:49:08 +0000 (22:49 +0100)]
dfs_server: randomize the server redirect set

comply with [MS-DFSC] section 3.2.1.1

Signed-off-by: Arvid Requate <requate@univention.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agos3: smbd: Ensure we always go via getgroups_unix_user() when creating an NT token.
Jeremy Allison [Thu, 20 Mar 2014 19:39:10 +0000 (12:39 -0700)]
s3: smbd: Ensure we always go via getgroups_unix_user() when creating an NT token.

This has to be done in every code path that creates
an NT token, as remote users may have been added to
the local /etc/group database. Tokens created merely
from the info3 structs (via the DC or via the krb5 PAC)
won't have these local groups.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
10 years agobuild: Exclude source4/selftest/provisions/release-4-1-0rc3 from the tarball
Andrew Bartlett [Mon, 3 Mar 2014 01:26:36 +0000 (14:26 +1300)]
build: Exclude source4/selftest/provisions/release-4-1-0rc3 from the tarball

Change-Id: Id4ddaabb91363174d2fbef09e823f53b13912a51
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): Fri Mar 21 10:06:04 CET 2014 on sn-devel-104

10 years agodbcheck: Ensure dbcheck can operate with --attrs set
Andrew Bartlett [Thu, 27 Feb 2014 02:17:35 +0000 (15:17 +1300)]
dbcheck: Ensure dbcheck can operate with --attrs set

This also includes a test to ensure we do not regress on this point.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agos3-rpc_server: Fix handling of fragmented rpc requests.
Andreas Schneider [Thu, 20 Mar 2014 13:45:01 +0000 (14:45 +0100)]
s3-rpc_server: Fix handling of fragmented rpc requests.

We need to call pipe_init_outgoing_data() as the first thing in
process_complete_pdu(). Otherwise the caller may use uninitialized
memory and tries to write a response into the socket.

The problem happens only if a real socket is used, which means
in all cases for master and only with external rpc daemons in v4-0
and v4-1.

The problem looks like this in the logs.

    [2014/03/20 14:49:35.531663, 10, pid=7309, effective(0, 0), real(0, 0), class=rpc_srv] ../source3/rpc_server/srv_pipe.c:1627(process_complete_pdu)
      Processing packet type 0
    [2014/03/20 14:49:35.531695, 10, pid=7309, effective(0, 0), real(0, 0), class=rpc_srv] ../source3/rpc_server/srv_pipe.c:1472(dcesrv_auth_request)
      Checking request auth.
    [2014/03/20 14:49:35.531738, 10, pid=7309, effective(0, 0), real(0, 0)] ../source3/rpc_server/rpc_server.c:521(named_pipe_packet_process)
      Sending 1 fragments in a total of 0 bytes
    [2014/03/20 14:49:35.531769, 10, pid=7309, effective(0, 0), real(0, 0)] ../source3/rpc_server/rpc_server.c:526(named_pipe_packet_process)
      Sending PDU number: 0, PDU Length: 4294967228
    [2014/03/20 14:49:35.531801,  2, pid=7309, effective(0, 0), real(0, 0)] ../source3/rpc_server/rpc_server.c:565(named_pipe_packet_done)
      Writev failed!
    [2014/03/20 14:49:35.531845,  2, pid=7309, effective(0, 0), real(0, 0)] ../source3/rpc_server/rpc_server.c:595(named_pipe_packet_done)
      Fatal error(Message too long). Terminating client(127.0.0.1) connection!

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

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Guenther Deschner <gd@samba.org
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Thu Mar 20 18:30:17 CET 2014 on sn-devel-104

10 years agos4-torture: add some tests for pre-allocated buffers in enumprinterdrivers call.
Günther Deschner [Thu, 20 Mar 2014 14:57:10 +0000 (15:57 +0100)]
s4-torture: add some tests for pre-allocated buffers in enumprinterdrivers call.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agos4-torture: add test_EnumPrinterDrivers_buffers function.
Günther Deschner [Thu, 20 Mar 2014 14:56:13 +0000 (15:56 +0100)]
s4-torture: add test_EnumPrinterDrivers_buffers function.

This will allow to test the enumdriver call with pre-allocated buffer.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agos3: smbd: Fileserving share access checks.
Jeremy Allison [Mon, 17 Mar 2014 21:35:00 +0000 (14:35 -0700)]
s3: smbd: Fileserving share access checks.

Git commit 86d1e1db8e2747e30c89627cda123fde1e84f579
fixed share_access not being reset between users,
by changing make_connection_snum() to call a common
function check_user_share_access() in the same way
that change_to_user() (which can be called on any
incoming packet) does.

Unfortunately that bugfix was incorrect and
broke "force user" and "force group" as it
called check_user_share_access() inside
make_connection_snum() using the conn->session_info
pointer instead of the vuser->session_info pointer.

conn->session_info represents the token to use
when actually accessing the file system, and so
is modified by force user and force group.

conn->session_info represents the "pristine"
token of the user logging in, and is never modified
by force user and force group.

Samba 3.6.x checked the share access based on
the "pristine" token of the user logging in,
not the token modified by force user and force group.
This change restores the expected behavior.

Fixes bug #9878 - force user does not work as expected

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Tested-by: Gerhard Wiesinger <lists@wiesinger.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Mar 18 19:19:31 CET 2014 on sn-devel-104

10 years agotdb: change version to 1.2.13.
Michael Adam [Tue, 18 Mar 2014 12:05:42 +0000 (13:05 +0100)]
tdb: change version to 1.2.13.

* internal code cleanups
* always open internal TDBs with incompatible hash
* avoid reallocations in locking code
* systematize output format in tdbtool dump
* reduce freelist contention when allocating new records
  - try to find dead records also in other chains
  - don't do blocking locks on the freelist

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): Tue Mar 18 15:42:48 CET 2014 on sn-devel-104

10 years agotdb: Reduce freelist contention
Volker Lendecke [Tue, 18 Mar 2014 07:04:42 +0000 (08:04 +0100)]
tdb: Reduce freelist contention

In a metadata-intensive benchmark we have seen the locking.tdb freelist to be
one of the central contention points. This patch removes most of the contention
on the freelist. Ages ago we already reduced freelist contention by using the
even much older DEAD records: If TDB_VOLATILE is set, don't directly put
deleted records on the freelist, but just mark a few of them just as DEAD. The
next new record can them re-use that space without consulting the freelist.

This patch builds upon the DEAD records: If we need space and the freelist is
busy, instead of doing a blocking wait on the freelist, start looking into
other chains for DEAD records and steal them from there. This way every hash
chain becomes a small freelist. Just wander around the hash chains as long as
the freelist is still busy.

With this patch and the tdb mutex patch (following hopefully some time soon)
you can see a heavily busy clustered smbd run without locking.tdb futex
syscalls.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agotdb: Make "tdb_purge_dead" internally public
Volker Lendecke [Tue, 18 Mar 2014 07:03:16 +0000 (08:03 +0100)]
tdb: Make "tdb_purge_dead" internally public

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agotdb: Make "tdb_find_dead" internally public
Volker Lendecke [Tue, 18 Mar 2014 07:01:40 +0000 (08:01 +0100)]
tdb: Make "tdb_find_dead" internally public

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agotdb: Add "last_ptr" to tdb_find_dead
Volker Lendecke [Tue, 18 Mar 2014 07:00:45 +0000 (08:00 +0100)]
tdb: Add "last_ptr" to tdb_find_dead

Will be used soon to unlink a dead record from a chain

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agotdb: Move adding tailer space to tdb_find_dead
Volker Lendecke [Tue, 18 Mar 2014 06:52:59 +0000 (07:52 +0100)]
tdb: Move adding tailer space to tdb_find_dead

This aligns the tdb_find_dead API with the tdb_allocate API and thus makes it a
bit easier to understand, at least for me.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agotdb: Do a best fit search for dead records
Volker Lendecke [Tue, 18 Mar 2014 06:46:38 +0000 (07:46 +0100)]
tdb: Do a best fit search for dead records

Hash chains are (or can be made) short enough that a full search for the
best-fitting dead record is feasible. The freelist can become much longer,
there we don't do the full search but accept records which are too large.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agotdb: Don't purge records to a blocked freelist
Volker Lendecke [Mon, 17 Mar 2014 05:47:11 +0000 (06:47 +0100)]
tdb: Don't purge records to a blocked freelist

If the freelist is heavily contended, we should avoid accessing it

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agotdb: Fix a tdb corruption
Volker Lendecke [Sun, 16 Mar 2014 20:08:32 +0000 (20:08 +0000)]
tdb: Fix a tdb corruption

tdb_purge_dead can change the next pointer of "rec" if we purge the record
right behind the current record to be deleted. Just overwrite the magic,
not the whole record with stale data.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agodsdb: Further assert that we always have an objectClass and an rDN
Andrew Bartlett [Fri, 28 Feb 2014 04:49:12 +0000 (17:49 +1300)]
dsdb: Further assert that we always have an objectClass and an rDN

We must have these two elements in a replPropertyMetaData for it to be
valid.

We may have to relax this for new partition creation, but for now we
want to find and isolate the database corruption.

The printing of the LDIF is moved above the checks to make it easier
to diagnoise the failures when further reproduced.

Based initially on a patch originally by Arvid Requate <requate@univention.de>

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Change-Id: I5f583d89e6d4c5e8e2d9667f336a0e8fd8347b25
Reviewed-on: https://gerrit.samba.org/164
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Mar 17 06:44:17 CET 2014 on sn-devel-104

10 years agowintest: Try harder to make wintest force the telnet server to start
Andrew Bartlett [Tue, 29 Oct 2013 21:21:00 +0000 (10:21 +1300)]
wintest: Try harder to make wintest force the telnet server to start

We try and force the server to start, and we try to force the
TelnetClients group to exist

Change-Id: I192f0aaaf283b77065ecc671ca2b59a69781d744
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-on: https://gerrit.samba.org/36
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Mar 14 14:51:20 CET 2014 on sn-devel-104

10 years agoldapsrv: Pass struct ldb_result * rather than void *
Andrew Bartlett [Mon, 2 Dec 2013 02:47:42 +0000 (15:47 +1300)]
ldapsrv: Pass struct ldb_result * rather than void *

Change-Id: Ic521cbfcf922cfe9e14c89116c097b777a86af40
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-on: https://gerrit.samba.org/35
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agodocs: Add gpfs:recalls parameter to vfs_gpfs manpage
Christof Schmitt [Thu, 13 Mar 2014 16:26:44 +0000 (09:26 -0700)]
docs: Add gpfs:recalls parameter to vfs_gpfs manpage

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Fri Mar 14 12:49:56 CET 2014 on sn-devel-104

10 years agos3:modules/vfs_gpfs add gpfs:recalls option
Christian Ambach [Wed, 20 Mar 2013 14:16:37 +0000 (15:16 +0100)]
s3:modules/vfs_gpfs add gpfs:recalls option

When this option is set to no, an attempt to open an offline file will
be rejected with access denied.  This helps preventing recall storms
triggered by careless applications like Finder and Explorer.

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
10 years agodsdb: Ensure to sort replPropertyMetaData as UNSIGNED, not SIGNED quantities
Andrew Bartlett [Fri, 28 Feb 2014 09:59:06 +0000 (22:59 +1300)]
dsdb: Ensure to sort replPropertyMetaData as UNSIGNED, not SIGNED quantities

enum is an int, and therefore signed.  Some attributes have the high bit set.

Andrew Bartlett

Change-Id: I39a5499b7c6bbb763e15977d802cda8c69b94618
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-on: https://gerrit.samba.org/163
Reviewed-by: Kamen Mazdrashki <kamenim@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Mar 14 10:16:41 CET 2014 on sn-devel-104

10 years agokdc: Use correct KDC include path when building against the system heimdal
Andrew Bartlett [Thu, 20 Feb 2014 21:20:52 +0000 (10:20 +1300)]
kdc: Use correct KDC include path when building against the system heimdal

This ensures we notice any API changes at compile time.

Andrew Bartlett

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>