metze/samba/wip.git
10 years agos3-net: add a new "net ads kerberos pac save" tool.
Günther Deschner [Tue, 11 Mar 2014 17:16:40 +0000 (18:16 +0100)]
s3-net: add a new "net ads kerberos pac save" tool.

Use "filename=string" to define a file where to save the unencrypted PAC to.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Wed Mar 12 13:02:59 CET 2014 on sn-devel-104

10 years agos3-net: modify the current "net ads kerberos pac" command.
Günther Deschner [Tue, 11 Mar 2014 17:14:39 +0000 (18:14 +0100)]
s3-net: modify the current "net ads kerberos pac" command.

Rename it to "net ads kerberos pac dump" and add a "type=num" option to allow
dumping of individial pac buffer types. Ommitting type= or using type=0 will
dump the whole PAC structure on stdout.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agos3-kerberos: let kerberos_return_pac() return a PAC container.
Günther Deschner [Tue, 11 Mar 2014 17:07:11 +0000 (18:07 +0100)]
s3-kerberos: let kerberos_return_pac() return a PAC container.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agos3-kerberos: return a full PAC in kerberos_return_pac().
Günther Deschner [Fri, 21 Feb 2014 17:56:04 +0000 (18:56 +0100)]
s3-kerberos: return a full PAC in kerberos_return_pac().

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agos3-net: allow to provide custom local_service in "net ads kerberos pac".
Günther Deschner [Tue, 11 Mar 2014 15:34:36 +0000 (16:34 +0100)]
s3-net: allow to provide custom local_service in "net ads kerberos pac".

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agos3-net: change the way impersonation principals are used in "net ads kerberos pac".
Günther Deschner [Mon, 10 Mar 2014 14:11:18 +0000 (15:11 +0100)]
s3-net: change the way impersonation principals are used in "net ads kerberos pac".

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agoauth/kerberos: fix a typo.
Günther Deschner [Mon, 3 Mar 2014 11:14:51 +0000 (12:14 +0100)]
auth/kerberos: fix a typo.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agos3-libads: pass down local_service to kerberos_return_pac().
Günther Deschner [Fri, 17 Jan 2014 13:29:03 +0000 (14:29 +0100)]
s3-libads: pass down local_service to kerberos_return_pac().

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agoCVE-2013-6442: s3:smbcacls - ensure we don't lose an existing ACL when setting owner...
Jeremy Allison [Wed, 18 Dec 2013 21:56:18 +0000 (13:56 -0800)]
CVE-2013-6442: s3:smbcacls - ensure we don't lose an existing ACL when setting owner or group owner.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10327
Bug 10327 - CVE-2013-6442: smbcacls --chown | --chgrp dacl regression

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(master): Tue Mar 11 22:55:54 CET 2014 on sn-devel-104

10 years agogencache: Add gencache values to memcache
Volker Lendecke [Mon, 10 Mar 2014 14:41:32 +0000 (15:41 +0100)]
gencache: Add gencache values to memcache

gencache_parse calling tdb shows up in profiles when we do a lot of open/close
traffic with large ACLs. For every file we convert unix ids to sids, and in the
domain member case this goes through gencache.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Mar 11 19:56:47 CET 2014 on sn-devel-104

10 years agovfs_catia: add chmod()
Ralph Boehme [Mon, 10 Mar 2014 16:14:38 +0000 (17:14 +0100)]
vfs_catia: add chmod()

Clients using UNIX extensions need chmod() to go through catia.

Signed-off-by: Ralph Boehme <rb@sernet.de>
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): Tue Mar 11 13:39:17 CET 2014 on sn-devel-104

10 years agoAdd usable stream name defines
Ralph Boehme [Mon, 13 Jan 2014 13:03:45 +0000 (14:03 +0100)]
Add usable stream name defines

Add stream name defines that are usable with Samba's way of storing
stream names internally.

Signed-off-by: Ralph Boehme <rb@sernet.de>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
10 years agoFix a typo
Ralph Boehme [Fri, 14 Feb 2014 16:38:25 +0000 (17:38 +0100)]
Fix a typo

Signed-off-by: Ralph Boehme <rb@sernet.de>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Simo Sorce <idra@samba.org>
10 years agosamba-tool: make provision check for bind version
Garming Sam [Thu, 19 Dec 2013 02:06:51 +0000 (15:06 +1300)]
samba-tool: make provision check for bind version

(small corrections and TODO added following Jelmer's review by abartlet)
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Change-Id: Iba9a709641dad9f2ae05df0b26ac4cd2ebfc84f0
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sun Mar  9 02:52:50 CET 2014 on sn-devel-104

10 years agobuild: Make order of arguments clearer by explicitly making the list of functions...
Andrew Bartlett [Thu, 6 Mar 2014 23:05:19 +0000 (12:05 +1300)]
build: Make order of arguments clearer by explicitly making the list of functions to look for a python list

Change-Id: I19bbd3b34548258201dabdc0ec8dc049e28d0049
Reviewed-by: David Disseldorp <ddiss@samba.org>
Tested-by: Thomas Schulz <schulz@adi.com>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Sat Mar  8 05:53:08 CET 2014 on sn-devel-104

10 years agobuild: Do not rely on sys.platform for ACL tests, combine UnixWare and Solaris ACL...
Andrew Bartlett [Wed, 5 Mar 2014 02:06:02 +0000 (15:06 +1300)]
build: Do not rely on sys.platform for ACL tests, combine UnixWare and Solaris ACL tests

This avoids issues with whatever sys.platform may return, fixes the
order of arguments to the CHECK_FUNCS_IN call, and only runs after
Linux-style POSIX ACL detection fails.

Andrew Bartlett

Change-Id: I930dff1e03c1cd1ceb8f3a35823ceb805694b66a
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Tested-by: Thomas Schulz <schulz@adi.com>
10 years agoFor FSRVP use textual error messages instead of hex error codes
Noel Power [Thu, 6 Mar 2014 11:57:45 +0000 (11:57 +0000)]
For FSRVP use textual error messages instead of hex error codes

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-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  8 03:52:44 CET 2014 on sn-devel-104

10 years agoAdd missing FSRVP_E_UNSUPPORTED_CONTEXT constant
Noel Power [Thu, 6 Mar 2014 14:02:26 +0000 (14:02 +0000)]
Add missing FSRVP_E_UNSUPPORTED_CONTEXT constant

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3-kerberos: remove unused kdc_name from create_local_private_krb5_conf_for_domain().
Günther Deschner [Fri, 7 Mar 2014 13:47:31 +0000 (14:47 +0100)]
s3-kerberos: remove unused kdc_name from create_local_private_krb5_conf_for_domain().

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Fri Mar  7 18:43:57 CET 2014 on sn-devel-104

10 years agos3-kerberos: remove print_kdc_line() completely.
Günther Deschner [Mon, 13 Jan 2014 14:59:26 +0000 (15:59 +0100)]
s3-kerberos: remove print_kdc_line() completely.

Just calling print_canonical_sockaddr() is sufficient, as it already deals with
ipv6 as well. The port handling, which was only done for IPv6 (not IPv4), is
removed as well. It was pointless because it always derived the port number from
the provided address which was either a SMB (usually port 445) or LDAP
connection. No KDC will ever run on port 389 or 445 on a Windows/Samba DC.
Finally, the kerberos libraries that we support and build with, can deal with
ipv6 addresses in krb5.conf, so we no longer put the (unnecessary) burden of
resolving the DC name on the kerberos library anymore.

Guenther

Signed-off-by: Günther Deschner <gd@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
10 years agos4:lib/socket: simplify iface_list_wildcard() and its callers
Stefan Metzmacher [Thu, 27 Feb 2014 09:28:23 +0000 (10:28 +0100)]
s4:lib/socket: simplify iface_list_wildcard() and its callers

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10464
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Change-Id: Ib317d71dea01fc8ef6b6a26455f15a8a175d59f6
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Mar  7 02:18:17 CET 2014 on sn-devel-104

10 years agos4:lib/socket: use the same logic in iface_list_wildcard() as in smbd
Stefan Metzmacher [Thu, 27 Feb 2014 09:18:35 +0000 (10:18 +0100)]
s4:lib/socket: use the same logic in iface_list_wildcard() as in smbd

If we have ipv6 support we should listen on "::" too.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10464
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Change-Id: I8ce185d5070280149bee9fd33010443be9031089
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
10 years agopidl-waf: Only install Yapp::Driver if it is not available.
Andreas Schneider [Fri, 28 Feb 2014 15:00:54 +0000 (16:00 +0100)]
pidl-waf: Only install Yapp::Driver if it is not available.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Thu Mar  6 23:30:47 CET 2014 on sn-devel-104

10 years agopidl-waf: Check for system perl(Parse::Yapp::Driver).
Andreas Schneider [Fri, 28 Feb 2014 14:59:45 +0000 (15:59 +0100)]
pidl-waf: Check for system perl(Parse::Yapp::Driver).

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agopidl-waf: Add a function to check for a system perl module.
Andreas Schneider [Fri, 28 Feb 2014 14:59:41 +0000 (15:59 +0100)]
pidl-waf: Add a function to check for a system perl module.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agopidl-waf: Do not glob to install pidl modules.
Andreas Schneider [Fri, 28 Feb 2014 14:55:46 +0000 (15:55 +0100)]
pidl-waf: Do not glob to install pidl modules.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agopidl-waf: Install pidl modules to the perl vendorlib directory.
Andreas Schneider [Fri, 28 Feb 2014 14:53:10 +0000 (15:53 +0100)]
pidl-waf: Install pidl modules to the perl vendorlib directory.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agopidl-waf: Remove unused variable pidl_src.
Andreas Schneider [Fri, 28 Feb 2014 14:54:09 +0000 (15:54 +0100)]
pidl-waf: Remove unused variable pidl_src.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agoautobuild: Set perl vendorlib direcotry.
Andreas Schneider [Wed, 5 Mar 2014 15:27:15 +0000 (16:27 +0100)]
autobuild: Set perl vendorlib direcotry.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agobuildtools: Add perl vendorlib configure option.
Andreas Schneider [Fri, 28 Feb 2014 14:50:02 +0000 (15:50 +0100)]
buildtools: Add perl vendorlib configure option.

After this patch has been pushed, we need to change autobuild to compile
with this option or we will not be able to install pidl.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agobuildtools: Rename perl vendorarch configure option.
Andreas Schneider [Fri, 28 Feb 2014 14:47:45 +0000 (15:47 +0100)]
buildtools: Rename perl vendorarch configure option.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agoRevert "pidl: Install pidl files corrently."
Andreas Schneider [Fri, 28 Feb 2014 14:46:01 +0000 (15:46 +0100)]
Revert "pidl: Install pidl files corrently."

This reverts commit cee11cfa4544425099268cd32393169afb4bb107.

Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agoRevert "waf: Add option to specify perl vendor dir."
Andreas Schneider [Fri, 28 Feb 2014 14:45:51 +0000 (15:45 +0100)]
Revert "waf: Add option to specify perl vendor dir."

This reverts commit 9b200555fec2e33da9521db388d1839375aa8d83.

Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agoRevert "pidl: Make perl(Parse:Yapp:Driver) installation optional."
Andreas Schneider [Fri, 28 Feb 2014 14:45:35 +0000 (15:45 +0100)]
Revert "pidl: Make perl(Parse:Yapp:Driver) installation optional."

This reverts commit f0030c619bcf22dbe9eed54b2c0dc9c61f564838.

Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
10 years agoctdb-vacuum: fix delete list counts in delete_marshall_traverse_first
Michael Adam [Fri, 21 Feb 2014 22:43:17 +0000 (23:43 +0100)]
ctdb-vacuum: fix delete list counts in delete_marshall_traverse_first

when bumping skipped, decrement left, so the sum is correct

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Amitay Isaacs <amitay@samba.org>
Autobuild-Date(master): Thu Mar  6 03:32:33 CET 2014 on sn-devel-104

10 years agoctdb-vacuum: fix possible cause for delelete_list processing counts left records > 0
Michael Adam [Wed, 19 Feb 2014 23:58:17 +0000 (00:58 +0100)]
ctdb-vacuum: fix possible cause for delelete_list processing counts left records > 0

We need to have left records == 0 at the end of the delete list processing.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-vacuum: systematize counters into various structs
Michael Adam [Wed, 19 Feb 2014 23:32:08 +0000 (00:32 +0100)]
ctdb-vacuum: systematize counters into various structs

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-vacuum: remove unused counter vdata->total
Michael Adam [Wed, 19 Feb 2014 23:29:47 +0000 (00:29 +0100)]
ctdb-vacuum: remove unused counter vdata->total

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-vacuum: make ctdb_process_delete_list() void
Michael Adam [Sun, 16 Feb 2014 00:08:18 +0000 (01:08 +0100)]
ctdb-vacuum: make ctdb_process_delete_list() void

The overall return code was not really used anyways.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-vacuum: make ctdb_process_vacuum_fetch_lists() void.
Michael Adam [Sat, 15 Feb 2014 23:37:43 +0000 (00:37 +0100)]
ctdb-vacuum: make ctdb_process_vacuum_fetch_lists() void.

This constantly returns 0 anyways.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-vacuum: make ctdb_vacuum_traverse_db() void.
Michael Adam [Sat, 15 Feb 2014 23:35:34 +0000 (00:35 +0100)]
ctdb-vacuum: make ctdb_vacuum_traverse_db() void.

Failure in traversal of the DB should not
prevent further processing.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-vacuum: don't stop in process_vacuum_fetch_lists when sending to one node fails.
Michael Adam [Sat, 15 Feb 2014 23:26:00 +0000 (00:26 +0100)]
ctdb-vacuum: don't stop in process_vacuum_fetch_lists when sending to one node fails.

We should try to continue vacuuming as much as possible.
Failure to send records to one lmaster doesn't mean the
others will fail too.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-vacuum: catch and log errors to traverse the delete list in ctdb_process_delete_...
Michael Adam [Sat, 15 Feb 2014 17:06:09 +0000 (18:06 +0100)]
ctdb-vacuum: catch and log errors to traverse the delete list in ctdb_process_delete_list()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-vacuum: catch and log error of traverse in ctdb_process_delete_queue()
Michael Adam [Sat, 15 Feb 2014 16:59:22 +0000 (17:59 +0100)]
ctdb-vacuum: catch and log error of traverse in ctdb_process_delete_queue()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-vacuum: use tdb_parse_record instead of tdb_fetch in delete_marshall_traverse_fi...
Michael Adam [Sat, 15 Feb 2014 12:03:51 +0000 (13:03 +0100)]
ctdb-vacuum: use tdb_parse_record instead of tdb_fetch in delete_marshall_traverse_first()

Spare malloc and free.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-vacuum: simplify delete_marshall_traverse_first: use tdb_null
Michael Adam [Sat, 15 Feb 2014 12:01:33 +0000 (13:01 +0100)]
ctdb-vacuum: simplify delete_marshall_traverse_first: use tdb_null

we know anyways the record to store is empty at this point.
So skip pointer calculations.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-vacuum: remove VacuumLimit criterion for triggering a repack
Michael Adam [Fri, 14 Feb 2014 21:05:21 +0000 (22:05 +0100)]
ctdb-vacuum: remove VacuumLimit criterion for triggering a repack

With the new vacuuming, we consider it an error if there are
records left for deletion after processing the various lists.
All records that can be deleted should have been deleted by
tdb_delete calls.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-vacuum: treat value 0 of tunable VacuumLimit as turning off repacking
Michael Adam [Wed, 12 Feb 2014 16:41:28 +0000 (17:41 +0100)]
ctdb-vacuum: treat value 0 of tunable VacuumLimit as turning off repacking

I.e. no number of records found to delete will trigger the
repacking.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-vacuum: add consistency check for counts at end of process_delete_list()
Michael Adam [Fri, 14 Feb 2014 21:02:41 +0000 (22:02 +0100)]
ctdb-vacuum: add consistency check for counts at end of process_delete_list()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-vacuum: log error if records are left for deletion after ctdb_process_delete_list()
Michael Adam [Fri, 14 Feb 2014 21:01:38 +0000 (22:01 +0100)]
ctdb-vacuum: log error if records are left for deletion after ctdb_process_delete_list()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-vacuum: use tdb_parse_record instead of tdb_fetch in delete_record_traverse()
Michael Adam [Fri, 14 Feb 2014 20:50:59 +0000 (21:50 +0100)]
ctdb-vacuum: use tdb_parse_record instead of tdb_fetch in delete_record_traverse()

Spare malloc and free.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-vacuum: update comment for ctdb_process_delete_queue
Michael Adam [Fri, 14 Feb 2014 17:48:02 +0000 (18:48 +0100)]
ctdb-vacuum: update comment for ctdb_process_delete_queue

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-vacuum: rename ctdb_vacuum_db_fast --> ctdb_process_delete_queue
Michael Adam [Fri, 14 Feb 2014 17:47:25 +0000 (18:47 +0100)]
ctdb-vacuum: rename ctdb_vacuum_db_fast --> ctdb_process_delete_queue

This describes more precisely what this does.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-vacuum: update comment for ctdb_vacuum_traverse_db
Michael Adam [Fri, 14 Feb 2014 17:46:49 +0000 (18:46 +0100)]
ctdb-vacuum: update comment for ctdb_vacuum_traverse_db

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-vacuum: rename ctdb_vacuum_db_full --> ctdb_vacuum_traverse_db
Michael Adam [Fri, 14 Feb 2014 17:42:37 +0000 (18:42 +0100)]
ctdb-vacuum: rename ctdb_vacuum_db_full --> ctdb_vacuum_traverse_db

This describes more precisely what it actually is, nowadays.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-vacuum: change full db traverse vacuuming to fill delete queue
Michael Adam [Fri, 14 Feb 2014 17:38:31 +0000 (18:38 +0100)]
ctdb-vacuum: change full db traverse vacuuming to fill delete queue

This lets the "fast vacuum" delete queue traverse do the actual work.

On the positive side, we note that this lets the "full vacuuming"
treat the records that have never been migrated with data correctly.
These had previously been added to the delete list for complicated
cross-node deletion instead of directly deleting them.

On the other hand side, there might be a slight overhead
since the records are read again in the delete queu traverse,
but this is OK because this change is in preparation of
untangling the db traverse altogether from the vacuum run,
making it independent.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-vacuum: run the fast vacuum after the db traverse
Michael Adam [Fri, 14 Feb 2014 17:27:14 +0000 (18:27 +0100)]
ctdb-vacuum: run the fast vacuum after the db traverse

This in preparation of modifying the db traverse to
fill the delete_queue that is processed by the fast
vacuum run, instead of filling the same lists as the
fast vacuum run for further processing.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-vacuum: rename private->private_data in repack_traverse
Michael Adam [Fri, 14 Feb 2014 17:08:20 +0000 (18:08 +0100)]
ctdb-vacuum: rename private->private_data in repack_traverse

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-vacuum: rename private->private_data in vacuum_traverse
Michael Adam [Fri, 14 Feb 2014 17:07:55 +0000 (18:07 +0100)]
ctdb-vacuum: rename private->private_data in vacuum_traverse

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-vacuum: extract check for full vacuum run out of ctdb_vacuum_db_full()
Michael Adam [Fri, 14 Feb 2014 17:03:02 +0000 (18:03 +0100)]
ctdb-vacuum: extract check for full vacuum run out of ctdb_vacuum_db_full()

This is more consistent.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-vacuum: add consistency check for counts to ctdb_vacuum_db_fast()
Michael Adam [Fri, 14 Feb 2014 16:58:01 +0000 (17:58 +0100)]
ctdb-vacuum: add consistency check for counts to ctdb_vacuum_db_fast()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-vacuum: use tdb_parse_record instead of tdb_fetch in delete_queue_traverse()
Michael Adam [Fri, 14 Feb 2014 14:28:22 +0000 (15:28 +0100)]
ctdb-vacuum: use tdb_parse_record instead of tdb_fetch in delete_queue_traverse()

this spares malloc and free

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-vacuum: simplify delete_record_traverse() - free treats NULL
Michael Adam [Fri, 14 Feb 2014 14:35:01 +0000 (15:35 +0100)]
ctdb-vacuum: simplify delete_record_traverse() - free treats NULL

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-vacuum: simplify delete_queue_traverse() - free treats NULL pointers.
Michael Adam [Fri, 14 Feb 2014 14:34:23 +0000 (15:34 +0100)]
ctdb-vacuum: simplify delete_queue_traverse() - free treats NULL pointers.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-vacuum: reduce indentation in delete_queue_traverse
Michael Adam [Fri, 14 Feb 2014 14:30:08 +0000 (15:30 +0100)]
ctdb-vacuum: reduce indentation in delete_queue_traverse

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-vacuum: treat value 0 of tunable RepackLimit as turned off.
Michael Adam [Wed, 12 Feb 2014 16:40:31 +0000 (17:40 +0100)]
ctdb-vacuum: treat value 0 of tunable RepackLimit as turned off.

I.e. when RepackLimit is set to 0, no size of the freelist
should trigger a repack in vacuuming.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-vacuum: fix treatment of remaining records and statistics in delete_record_trave...
Michael Adam [Fri, 14 Feb 2014 00:55:39 +0000 (01:55 +0100)]
ctdb-vacuum: fix treatment of remaining records and statistics in delete_record_traverse()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-vacuum: cast freelist_size in comparison.
Michael Adam [Wed, 12 Feb 2014 16:38:56 +0000 (17:38 +0100)]
ctdb-vacuum: cast freelist_size in comparison.

At this point, it is >= 0 anyways.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agoctdb-vacuum: improve output of delete list statistics
Michael Adam [Thu, 13 Feb 2014 23:53:23 +0000 (00:53 +0100)]
ctdb-vacuum: improve output of delete list statistics

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
10 years agos3:smb2_server: avoid talloc_zero_array() in smbd_smb2_request_setup_out()
Stefan Metzmacher [Wed, 4 Dec 2013 14:32:45 +0000 (15:32 +0100)]
s3:smb2_server: avoid talloc_zero_array() in smbd_smb2_request_setup_out()

In the common case with just one request, we can use a preallocated
req->out.vector.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Mar  6 00:59:29 CET 2014 on sn-devel-104

10 years agos3:smb2_server: don't assume that req->out.vector is always a valid talloc pointer
Stefan Metzmacher [Wed, 4 Dec 2013 14:28:11 +0000 (15:28 +0100)]
s3:smb2_server: don't assume that req->out.vector is always a valid talloc pointer

We use 'req' instead as it has the same lifetime.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:smb2_server: avoid talloc_zero_array() in smbd_smb2_request_error_ex()
Stefan Metzmacher [Wed, 4 Dec 2013 14:24:29 +0000 (15:24 +0100)]
s3:smb2_server: avoid talloc_zero_array() in smbd_smb2_request_error_ex()

It is only important that the content of info->data stays alive
for the lifetime of the request, but the DATA_BLOB structure itself
can be on the stack, while passing it as 'dyn' to smbd_smb2_request_done_ex().

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:smb2_server: optimize smbd_smb2_generate_outbody() for the common case
Stefan Metzmacher [Wed, 4 Dec 2013 14:05:34 +0000 (15:05 +0100)]
s3:smb2_server: optimize smbd_smb2_generate_outbody() for the common case

Use a preallocated buffer for the first response in the compound chain.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:smb2_write: make use of smbd_smb2_generate_outbody()
Stefan Metzmacher [Wed, 4 Dec 2013 13:59:07 +0000 (14:59 +0100)]
s3:smb2_write: make use of smbd_smb2_generate_outbody()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:smb2_tcon: make use of smbd_smb2_generate_outbody()
Stefan Metzmacher [Wed, 4 Dec 2013 13:59:07 +0000 (14:59 +0100)]
s3:smb2_tcon: make use of smbd_smb2_generate_outbody()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:smb2_setinfo: make use of smbd_smb2_generate_outbody()
Stefan Metzmacher [Wed, 4 Dec 2013 13:59:07 +0000 (14:59 +0100)]
s3:smb2_setinfo: make use of smbd_smb2_generate_outbody()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:smb2_sesssetup: make use of smbd_smb2_generate_outbody()
Stefan Metzmacher [Wed, 4 Dec 2013 13:59:07 +0000 (14:59 +0100)]
s3:smb2_sesssetup: make use of smbd_smb2_generate_outbody()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:smb2_read: make use of smbd_smb2_generate_outbody()
Stefan Metzmacher [Wed, 4 Dec 2013 13:59:07 +0000 (14:59 +0100)]
s3:smb2_read: make use of smbd_smb2_generate_outbody()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:smb2_notify: make use of smbd_smb2_generate_outbody()
Stefan Metzmacher [Wed, 4 Dec 2013 13:59:07 +0000 (14:59 +0100)]
s3:smb2_notify: make use of smbd_smb2_generate_outbody()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:smb2_negprot: make use of smbd_smb2_generate_outbody()
Stefan Metzmacher [Wed, 4 Dec 2013 13:59:07 +0000 (14:59 +0100)]
s3:smb2_negprot: make use of smbd_smb2_generate_outbody()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:smb2_lock: make use of smbd_smb2_generate_outbody()
Stefan Metzmacher [Wed, 4 Dec 2013 13:59:07 +0000 (14:59 +0100)]
s3:smb2_lock: make use of smbd_smb2_generate_outbody()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:smb2_keepalive: make use of smbd_smb2_generate_outbody()
Stefan Metzmacher [Wed, 4 Dec 2013 13:59:07 +0000 (14:59 +0100)]
s3:smb2_keepalive: make use of smbd_smb2_generate_outbody()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:smb2_ioctl: make use of smbd_smb2_generate_outbody()
Stefan Metzmacher [Wed, 4 Dec 2013 13:59:07 +0000 (14:59 +0100)]
s3:smb2_ioctl: make use of smbd_smb2_generate_outbody()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:smb2_getinfo: make use of smbd_smb2_generate_outbody()
Stefan Metzmacher [Wed, 4 Dec 2013 13:59:07 +0000 (14:59 +0100)]
s3:smb2_getinfo: make use of smbd_smb2_generate_outbody()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:smb2_flush: make use of smbd_smb2_generate_outbody()
Stefan Metzmacher [Wed, 4 Dec 2013 13:59:07 +0000 (14:59 +0100)]
s3:smb2_flush: make use of smbd_smb2_generate_outbody()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:smb2_find: make use of smbd_smb2_generate_outbody()
Stefan Metzmacher [Wed, 4 Dec 2013 13:59:07 +0000 (14:59 +0100)]
s3:smb2_find: make use of smbd_smb2_generate_outbody()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:smb2_create: make use of smbd_smb2_generate_outbody()
Stefan Metzmacher [Wed, 4 Dec 2013 13:59:07 +0000 (14:59 +0100)]
s3:smb2_create: make use of smbd_smb2_generate_outbody()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:smb2_close: make use of smbd_smb2_generate_outbody()
Stefan Metzmacher [Wed, 4 Dec 2013 13:59:07 +0000 (14:59 +0100)]
s3:smb2_close: make use of smbd_smb2_generate_outbody()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:smb2_break: make use of smbd_smb2_generate_outbody()
Stefan Metzmacher [Wed, 4 Dec 2013 13:59:07 +0000 (14:59 +0100)]
s3:smb2_break: make use of smbd_smb2_generate_outbody()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:smb2_server: add smbd_smb2_generate_outbody() helper
Stefan Metzmacher [Wed, 4 Dec 2013 11:52:21 +0000 (12:52 +0100)]
s3:smb2_server: add smbd_smb2_generate_outbody() helper

We can add optimization there later.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:smb2_read: avoid 2 talloc* calls when using sendfile()
Stefan Metzmacher [Wed, 4 Dec 2013 11:32:36 +0000 (12:32 +0100)]
s3:smb2_read: avoid 2 talloc* calls when using sendfile()

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:smb2_server: avoid a call to data_blob_clear_free() if not needed
Stefan Metzmacher [Wed, 20 Nov 2013 08:56:48 +0000 (09:56 +0100)]
s3:smb2_server: avoid a call to data_blob_clear_free() if not needed

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:smb2_server: optimize smbd_smb2_request_setup_out()
Stefan Metzmacher [Wed, 20 Nov 2013 08:56:19 +0000 (09:56 +0100)]
s3:smb2_server: optimize smbd_smb2_request_setup_out()

We can use a preallocated buffer for the possible error
response of the first response in the compound chain.

This avoids a talloc_array_zero() call for the common case.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:smb2_server: optimize req->in.vector allocation
Stefan Metzmacher [Tue, 19 Nov 2013 06:42:57 +0000 (07:42 +0100)]
s3:smb2_server: optimize req->in.vector allocation

We can avoid a talloc_zero_array() call in the
common case (without compound requests) and use a
preallocated array instead.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:smbd: s/BUFFER_SIZE/LARGE_WRITEX_BUFFER_SIZE
Stefan Metzmacher [Fri, 6 Dec 2013 12:56:12 +0000 (13:56 +0100)]
s3:smbd: s/BUFFER_SIZE/LARGE_WRITEX_BUFFER_SIZE

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10422
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Wed Mar  5 22:53:34 CET 2014 on sn-devel-104

10 years agos3:smbd: fix the maxentries calculation depending on the max_send.
Stefan Metzmacher [Wed, 5 Mar 2014 13:03:42 +0000 (14:03 +0100)]
s3:smbd: fix the maxentries calculation depending on the max_send.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:smbd: simplify maxentries calculation in reply_search()
Stefan Metzmacher [Wed, 5 Mar 2014 13:00:40 +0000 (14:00 +0100)]
s3:smbd: simplify maxentries calculation in reply_search()

Using helper variables make it much easier to understand.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:smbd: fix the read numtoread calculation depending on the max_send.
Stefan Metzmacher [Tue, 4 Mar 2014 13:07:26 +0000 (14:07 +0100)]
s3:smbd: fix the read numtoread calculation depending on the max_send.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:smbd: fix the lockread numtoread calculation depending on the max_send.
Stefan Metzmacher [Tue, 4 Mar 2014 13:07:26 +0000 (14:07 +0100)]
s3:smbd: fix the lockread numtoread calculation depending on the max_send.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
10 years agos3:smbd: pass the final numtoread reply_outbuf() for the lockread reply.
Stefan Metzmacher [Tue, 4 Mar 2014 13:07:26 +0000 (14:07 +0100)]
s3:smbd: pass the final numtoread reply_outbuf() for the lockread reply.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>