samba.git
9 years agocredentials: Set secure_channel_type from secrets.tdb in cli_credentials_set_machine_...
Andrew Bartlett [Thu, 2 Oct 2014 16:14:21 +0000 (05:14 +1300)]
credentials: Set secure_channel_type from secrets.tdb in cli_credentials_set_machine_account

This should ensure more parts of the source4 code can work with a
password set in secrets.tdb.

Andrew Bartlett

Change-Id: I4a890a719246b073898333d2e04841904c6e1a5d
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit adb3eb79ea828b6e6e1858c3d1b8b5ffe868f8ed)

9 years agos3:locking: fix uninitialiazed variable in brl_get_locks_readonly_parser()
Stefan Metzmacher [Wed, 17 Dec 2014 09:43:33 +0000 (10:43 +0100)]
s3:locking: fix uninitialiazed variable in brl_get_locks_readonly_parser()

In a cluster this can be called with an empty record, while
brl_parse_data() relies on an initialized structure.

This is a regression in commit 837e29035c911f3509135252c3f423d0f56b606d.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 6bc41c459f6da7de62d2113590bc7d0c2d04e136)

9 years agoctdb-build: fix build without xsltproc
Björn Baumbach [Mon, 1 Dec 2014 12:28:13 +0000 (13:28 +0100)]
ctdb-build: fix build without xsltproc

Check for XSLTPROC_MANPAGES before trying to build the docs.

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 8d5f58120b6eeb73d1dc3c4df2ec6e12170888aa)

The last 4 patches address
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11014
Top level build does not install CTDB configuration files.

Autobuild-User(v4-2-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-2-test): Wed Dec 17 23:45:20 CET 2014 on sn-devel-104

9 years agopackaging: Include CTDB man pages in the tarball
Amitay Isaacs [Sun, 14 Dec 2014 13:07:33 +0000 (00:07 +1100)]
packaging: Include CTDB man pages in the tarball

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 0f7aae85804889e586c0ce88563af0720e55bd3f)

9 years agoctdb-build: Fix the installation of config files for top-level build
Amitay Isaacs [Mon, 15 Dec 2014 10:15:24 +0000 (21:15 +1100)]
ctdb-build: Fix the installation of config files for top-level build

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit be241207c29357c3cbda2eddb1002930d2e0592c)

9 years agoctdb-build: Fix the indentation
Amitay Isaacs [Mon, 15 Dec 2014 10:14:44 +0000 (21:14 +1100)]
ctdb-build: Fix the indentation

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 641bb5eab344fe85fb93898d5a8bc08d35e11fdc)

9 years agolibcli/smb: only force signing of smb2 session setups when binding a new session
Stefan Metzmacher [Fri, 12 Dec 2014 13:55:38 +0000 (13:55 +0000)]
libcli/smb: only force signing of smb2 session setups when binding a new session

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

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): Fri Dec 12 23:11:40 CET 2014 on sn-devel-104

(cherry picked from commit daff0f5d709eca621a7f319c892ecaba7b03e5c2)

Autobuild-User(v4-2-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-2-test): Tue Dec 16 23:36:50 CET 2014 on sn-devel-104

9 years agos3:smb2_server: allow reauthentication without signing
Stefan Metzmacher [Fri, 12 Dec 2014 08:22:15 +0000 (09:22 +0100)]
s3:smb2_server: allow reauthentication without signing

If signing is not required we should not require it for reauthentication.
Windows clients would otherwise fail to reauthenticate.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 382019656ee164fd21455ed7d7b5e9e18bd0ca72)

9 years agovfs_streams_xattr: add missing call to SMB_VFS_NEXT_CONNECT
Ralph Boehme [Thu, 11 Dec 2014 18:06:11 +0000 (19:06 +0100)]
vfs_streams_xattr: add missing call to SMB_VFS_NEXT_CONNECT

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

Signed-off-by: Ralph Boehme <slow@samba.org>
Rewviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Dec 12 02:09:24 CET 2014 on sn-devel-104

(cherry picked from commit 3554d88a589c079edea068867601c2d25b966932)

9 years agotestprogs/test_ldb: check rootdse search with extended-dn control
Stefan Metzmacher [Fri, 21 Nov 2014 13:11:54 +0000 (14:11 +0100)]
testprogs/test_ldb: check rootdse search with extended-dn control

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
Autobuild-User(master): Günther Deschner <gd@samba.org>
Autobuild-Date(master): Fri Dec 12 20:15:46 CET 2014 on sn-devel-104

(cherry picked from commit 7e81fe282540a5b52dcb8c5396321a67733790d2)

9 years agos4:dsdb/rootdse: expand extended dn values with the AS_SYSTEM control
Stefan Metzmacher [Thu, 20 Nov 2014 13:21:06 +0000 (14:21 +0100)]
s4:dsdb/rootdse: expand extended dn values with the AS_SYSTEM control

Otherwise we can't find the GUID of the 'serverName' attribute
as ANONYMOUS.

This results in

  root@ub1204-161:~# ldbsearch -U% -H ldap://172.31.9.161 -b '' -s base --extended-dn serverName
  search error - LDAP error 1 LDAP_OPERATIONS_ERROR -  <00002020: operations error at ../source4/dsdb/samdb/ldb_modules/rootdse.c:567> <>

While it works as system:

  root@ub1204-161:~# ldbsearch -U% -H /var/lib/samba/private/sam.ldb -b '' -s base --extended-dn serverName
  # record 1
  dn:
  serverName: <GUID=348c35e1-04e3-4988-a32c-32478d584551>;CN=UB1204-161,CN=Serve
   rs,CN=Default-First-Site-Name,CN=Sites,CN=Configuration,DC=s4xdom,DC=base

  # returned 1 records
  # 1 entries
  # 0 referrals

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
(cherry picked from commit a6ecef4532e4529a819219cd814e2979c2df0797)

9 years agos3:utils/profiles fix a use after free
Christian Ambach [Tue, 4 Nov 2014 22:51:23 +0000 (23:51 +0100)]
s3:utils/profiles fix a use after free

path is a talloc-child of subkeys, so subkeys should not be freed before calling
verbose_output

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Christian Ambach <ambi@samba.org>
Autobuild-Date(master): Wed Dec  3 00:43:19 CET 2014 on sn-devel-104

(cherry picked from commit 3b90bfb1089e6a4b7e05e7ed62bb642521f57917)

9 years agos3:registry/regfio fix some valgrind warnings
Christian Ambach [Tue, 4 Nov 2014 22:50:07 +0000 (23:50 +0100)]
s3:registry/regfio fix some valgrind warnings

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 4b41489901b7f1a78ffd479128c3e0d309e53b53)

9 years agos3:registry/regfio read SD from the correct location
Christian Ambach [Tue, 4 Nov 2014 22:47:26 +0000 (23:47 +0100)]
s3:registry/regfio read SD from the correct location

try to find the security descriptor at the data pointer, not at the beginning of the hbin

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

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 217a0189c15761f6c7b24c9d7bfdbccf85de8e1d)

9 years agoctdb-tests: Need to drop public IPs in kill-failover tests
Martin Schwenke [Wed, 3 Dec 2014 01:10:07 +0000 (12:10 +1100)]
ctdb-tests: Need to drop public IPs in kill-failover tests

These tests simulate a dead node rather than a CTDB failure, so drop
IP addresses when killing a "node" to avoid problems with duplicates.

To cope with a CTDB failure a watchdog would be needed to ensure that
the public IPs are dropped when CTDB dies.  Let's not do that now.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Fri Dec  5 23:29:39 CET 2014 on sn-devel-104

(cherry picked from commit a07af1bb56a76d1a7ab856547c801499fc17b21b)

The last 30 patches address
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10996
IPv6 support in CTDB is broken.

Autobuild-User(v4-2-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-2-test): Wed Dec 10 23:19:21 CET 2014 on sn-devel-104

9 years agoctdb-daemon: Gratuitous ARP equivalent for IPv6 is neighbor advertisement
Martin Schwenke [Mon, 1 Dec 2014 23:57:12 +0000 (10:57 +1100)]
ctdb-daemon: Gratuitous ARP equivalent for IPv6 is neighbor advertisement

Not neighbour solicitation.  See:

  https://tools.ietf.org/html/rfc4861#section-4.4

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 7f3f3b15d52c4047cbcb1c3e81f65675c8708f5f)

9 years agoctdb-tests: More debug on SSH failure
Martin Schwenke [Wed, 3 Dec 2014 01:09:12 +0000 (12:09 +1100)]
ctdb-tests: More debug on SSH failure

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 3a2c8bb906fac4e2611a28ead6b4290ddc93de54)

9 years agoctdb-tests: Make tcpdump output more verbose
Martin Schwenke [Mon, 1 Dec 2014 02:30:29 +0000 (13:30 +1100)]
ctdb-tests: Make tcpdump output more verbose

This helps with debugging.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 49449f66fca52d5044d2e486570562df866adf57)

9 years agoctdb-tests: Use ip neigh command instead of arp
Martin Schwenke [Sat, 29 Nov 2014 09:01:20 +0000 (20:01 +1100)]
ctdb-tests: Use ip neigh command instead of arp

Extend select_test_node_and_ips() to set $test_prefix in addition to
$test_ip.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit a7e7d95de9cf09652cef63d65484bbb0faa42e1c)

9 years agoctdb-tests: Generalise the gratarp and tickle sniffing code for IPv6
Martin Schwenke [Mon, 1 Dec 2014 03:07:57 +0000 (14:07 +1100)]
ctdb-tests: Generalise the gratarp and tickle sniffing code for IPv6

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Pair-programmed-with: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 0f3d9752c4677b2f3b5ee47a0b8f973b4260ef57)

9 years agoctdb-tests: Match IPv6 connections in netstat output
Martin Schwenke [Mon, 1 Dec 2014 02:51:47 +0000 (13:51 +1100)]
ctdb-tests: Match IPv6 connections in netstat output

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 3135a8c62551e09a3abada86335882a91d398747)

9 years agoctdb-tests: Use ping_wrapper to do relevant ping or ping6
Martin Schwenke [Mon, 1 Dec 2014 02:50:42 +0000 (13:50 +1100)]
ctdb-tests: Use ping_wrapper to do relevant ping or ping6

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 255705c030135bd54a1f7a7dc40cbf00c2fb39c9)

9 years agoctdb-tests: Extend regexps to handle IPv6 address matching
Martin Schwenke [Wed, 3 Dec 2014 04:58:20 +0000 (15:58 +1100)]
ctdb-tests: Extend regexps to handle IPv6 address matching

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 62acf5986f52a3118ed4e3638c5ac8b1f9c0adf8)

9 years agoctdb-tests: Bracket IP addresses in NFS mounts and scp command (for IPv6)
Martin Schwenke [Wed, 3 Dec 2014 04:57:35 +0000 (15:57 +1100)]
ctdb-tests: Bracket IP addresses in NFS mounts and scp command (for IPv6)

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 62164ec52fd1082863bf5017a5170f74f18a07c3)

9 years agoctdb-tests: Try to handle IPv6 addresses for local daemons
Martin Schwenke [Wed, 26 Nov 2014 10:32:22 +0000 (21:32 +1100)]
ctdb-tests: Try to handle IPv6 addresses for local daemons

If CTDB_USE_IPV6 is set then use IPv6 addresses for nodes and public
IPs.  This can be useful for some simple tests.  However, the node
address actually needs to be on lo so that ctdbd can bind to the port
on that address, so they actually need to be added as root before
running tests, like this:

  for i in $(seq 1 10) ; do ip addr add "fc00:10::${i}/64" dev lo ; done

IPv4 127.0.0.0/8 addresses are somehow magic and only one needs to be
on lo so that many can be bound to.

Also change the IPv4 node addresses to be (slightly) more exotic.

For both IPv4 and IPv6, choose addresses that are compatible with
socket wrapper.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Signed-off-by: Amitay Isaacs <amitay@gmail.com> (socket wrapper fixes)
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net> (socket wrapper fixes)
(cherry picked from commit d9d07fff34143d251b4987cdb1cff1e8b3384e64)

9 years agoctdb-tests: Extend regexp to match IPv6 addresses
Martin Schwenke [Wed, 26 Nov 2014 10:31:42 +0000 (21:31 +1100)]
ctdb-tests: Extend regexp to match IPv6 addresses

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 2a83b74597a3366536e1935e2e8ff23493503117)

9 years agoctdb-tools: Bracket IP addresses in onnode (for IPv6)
Martin Schwenke [Fri, 28 Nov 2014 10:49:08 +0000 (21:49 +1100)]
ctdb-tools: Bracket IP addresses in onnode (for IPv6)

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 2d480792e7d0b3f6628186dc77f54b708e315dd1)

9 years agoctdb-daemon: Fix IP address comparisons for IPv6 addresses
Amitay Isaacs [Tue, 25 Nov 2014 01:38:23 +0000 (12:38 +1100)]
ctdb-daemon: Fix IP address comparisons for IPv6 addresses

Before storing node IP address, convert into the correct abbreviated
string form for IPv6 addresses.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
(cherry picked from commit e3c59d83d0ace9d7421d40d33fe917fb82bb38d8)

9 years agoctdb-scripts: Wait until IPv6 addresses are not "tentative"
Martin Schwenke [Fri, 21 Nov 2014 06:33:21 +0000 (17:33 +1100)]
ctdb-scripts: Wait until IPv6 addresses are not "tentative"

There are a few potential failure modes when adding an IPv6 address.
It takes a little while of duplicate address detection to complete, so
wait for a while.  After a timeout, also need to check to see if
duplicate address detection failed - if it did then actually drop the
IP address.

This really needs some careful thinking.  If CTDB disappears on a node
but the node's IP addresses are still on interfaces then the above
failure mode could cause the takeover nodes to become banned.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit d0b2375c3d754da3cd68e34617ab3edd36e9317b)

9 years agoctdb-eventscripts: Specify broadcast optionally to ip addr add
Amitay Isaacs [Thu, 20 Nov 2014 10:58:31 +0000 (21:58 +1100)]
ctdb-eventscripts: Specify broadcast optionally to ip addr add

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
(cherry picked from commit d4212bd6a533b4b54b56e376a9246f2396cba253)

9 years agoctdb-daemon: Trust vnn->interface for an IP when releasing it
Martin Schwenke [Fri, 21 Nov 2014 03:52:47 +0000 (14:52 +1100)]
ctdb-daemon: Trust vnn->interface for an IP when releasing it

ctdb_sys_find_ifname() doesn't work for IPv6 addresses so don't use
it.

Trust the eventscript to do sanity checking on the interface.  Current
warnings are replaced with equivalents generated by the eventscript.
The unlikely message:

  Public IP %s is hosted on interface %s but we have no VNN

will be replaced by:

  WARNING: Public IP %s hosted on interface %s but VNN says __none__

which is clear enough.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 108b1be0ee62af7ecb3c775f45c540dd07a527bf)

9 years agoctdb-scripts: Make 10.interface IPv6-safe
Martin Schwenke [Fri, 21 Nov 2014 03:46:00 +0000 (14:46 +1100)]
ctdb-scripts: Make 10.interface IPv6-safe

Add checking to "releaseip" and "updateip" to ensure that the given IP
address is really on the given interface with the given netmask.  If
reality doesn't match the given arguments then believe reality.

Use new function iptables_wrapper() instead of calling iptables()
directly.

Use new function flush_route_cache() instead of doing IPv4-specific
/proc magic.

Remove setting of otherwise unused variable "failed".

Fix a test for which the error message has changed.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 6471541d6d2bc9f2af0ff92b280abbd1d933cf88)

9 years agoctdb-scripts: New functions ip6tables() and iptables_wrapper()
Martin Schwenke [Fri, 21 Nov 2014 03:39:43 +0000 (14:39 +1100)]
ctdb-scripts: New functions ip6tables() and iptables_wrapper()

ip6tables() uses the same lock as iptables().  This is done on
suspicion.

iptables_wrapper() takes 1st argument "inet" or "inet6", and the rest
is passed to the correct iptables variant.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit c314ae0b2af4a902cdd003ec6d663fe5b62b003b)

9 years agoctdb-scripts: Add IPv6 addresses support in ip_maskbits_iface()
Martin Schwenke [Fri, 21 Nov 2014 03:37:54 +0000 (14:37 +1100)]
ctdb-scripts: Add IPv6 addresses support in ip_maskbits_iface()

It also prints a third word, the address family.  This is either
"inet" or "inet6".

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit ed029ae0a1faa56bf882a71d10828e2a90ab0bc7)

9 years agoctdb-utils: Update Nagios code to use ctdb -X
Martin Schwenke [Thu, 20 Nov 2014 23:48:25 +0000 (10:48 +1100)]
ctdb-utils: Update Nagios code to use ctdb -X

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit b41c1bdaa1df92ee6c510ae6749d0524b88ef828)

9 years agoctdb-doc: Update examples to use ctdb -X
Martin Schwenke [Thu, 20 Nov 2014 23:47:22 +0000 (10:47 +1100)]
ctdb-doc: Update examples to use ctdb -X

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 0d61b6137306ee0eab2981e3c213023c332da550)

9 years agoctdb-tool: Fix "ctdb -Y ifaces" output to have trailing delimiters
Martin Schwenke [Thu, 20 Nov 2014 23:45:57 +0000 (10:45 +1100)]
ctdb-tool: Fix "ctdb -Y ifaces" output to have trailing delimiters

In the CTDB CLI tool source code and the documentation example.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 550fb8ce877cf980b4fd3be4f964449b369cf61e)

9 years agoctdb-tests: Update integration tests to use ctdb -X
Martin Schwenke [Thu, 20 Nov 2014 04:03:25 +0000 (15:03 +1100)]
ctdb-tests: Update integration tests to use ctdb -X

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 2c4de75d8754616891e97222cfb2ec58fdd8eac2)

9 years agoctdb-tools: Update onnode and ctdb-diagnostics to use ctdb -X
Martin Schwenke [Thu, 20 Nov 2014 03:39:59 +0000 (14:39 +1100)]
ctdb-tools: Update onnode and ctdb-diagnostics to use ctdb -X

Also update onnode unit tests.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 55df9c86c19e261a2a384ffc4b77c596c84e53a0)

9 years agoctdb-scripts: Update eventscripts to use ctdb -X instead of ctdb -Y
Martin Schwenke [Thu, 20 Nov 2014 03:32:46 +0000 (14:32 +1100)]
ctdb-scripts: Update eventscripts to use ctdb -X instead of ctdb -Y

Also update associated eventscript unit tests and ctdb stub.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 4940f191d37b5deadc8b1edf0cd516674e5d5d64)

9 years agoctdb-tools: Add -X option for machine parsable output with separator '|'
Martin Schwenke [Wed, 19 Nov 2014 07:19:50 +0000 (18:19 +1100)]
ctdb-tools: Add -X option for machine parsable output with separator '|'

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 7428f809a76044fcbc98fd5f718e331ce183941d)

9 years agoctdb-tools: Add -x option to specify delimiter for machine readable output
Martin Schwenke [Wed, 19 Nov 2014 06:15:21 +0000 (17:15 +1100)]
ctdb-tools: Add -x option to specify delimiter for machine readable output

To support this, update printm() to replace ':' in format string with
options.machineseparator, which is a string but must contain a single
character.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit 3b90e45bae555cc4a47fe9958b86628d41084868)

9 years agoctdb-tools: Produce machine readable output with new function printm()
Martin Schwenke [Wed, 19 Nov 2014 05:35:35 +0000 (16:35 +1100)]
ctdb-tools: Produce machine readable output with new function printm()

printm() is a printf(3) replacement and must be used to printing any
machine readable output.  It currently just calls vprintf(3).  Later
it will change the field delimiter.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
(cherry picked from commit fbacbb9c7868e22c04980af3602bae59dd5fe34d)

Conflicts:
ctdb/tools/ctdb.c

9 years agoctdb-recoverd: Process all the records for vacuum fetch in a loop
Amitay Isaacs [Wed, 23 Apr 2014 08:02:39 +0000 (18:02 +1000)]
ctdb-recoverd: Process all the records for vacuum fetch in a loop

Processing one migration request at a time is very slow and processing
a batch of records can take longer than VacuumInterval.  This causes
subsequent vacuum fetch requests to be dropped.  The dropped records
can accumulate quickly and will cause the vacuum database traverse to
be quite expensive.

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 Dec  5 17:06:58 CET 2014 on sn-devel-104

(cherry picked from commit 959b9ea0ef85c57ffc84d66a6e5e855868943391)

The last 6 patches address
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10997
Fix database vacuuming.

9 years agoctdb-vacuum: Do not delete VACUUM MIGRATED records immediately
Amitay Isaacs [Mon, 14 Apr 2014 04:53:25 +0000 (14:53 +1000)]
ctdb-vacuum: Do not delete VACUUM MIGRATED records immediately

Such records should be processed by the local vacuuming daemon to ensure
that all the remote copies have been deleted first.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
(cherry picked from commit 257311e337065f089df688cbf261d2577949203d)

9 years agoctdb-vacuum: Use non-blocking lock when traversing delete tree
Amitay Isaacs [Wed, 5 Nov 2014 22:33:50 +0000 (09:33 +1100)]
ctdb-vacuum: Use non-blocking lock when traversing delete tree

This avoids vacuuming getting in the way of ctdb daemon to process
record requests.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
(cherry picked from commit dbb1958284657f26a868705e5f9612bc377fd5e0)

9 years agoctdb-vacuum: Use non-blocking lock when traversing delete queue
Amitay Isaacs [Mon, 14 Apr 2014 03:18:41 +0000 (13:18 +1000)]
ctdb-vacuum: Use non-blocking lock when traversing delete queue

This avoids vacuuming getting in the way of ctdb daemon to process
record requests.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
(cherry picked from commit d35f512cd972ac1f732fe998b2179242d042082d)

9 years agoctdb-vacuum: Stagger vacuuming child processes
Amitay Isaacs [Fri, 21 Feb 2014 03:58:00 +0000 (14:58 +1100)]
ctdb-vacuum: Stagger vacuuming child processes

This prevents multiple child processes being forked at the same time
for vacuuming TDBs.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
(cherry picked from commit e4597f8771f42cf315bd163c18b2f27147d3de5f)

9 years agoctdb-vacuum: Track time for vacuuming in database statistics
Amitay Isaacs [Tue, 11 Feb 2014 03:23:28 +0000 (14:23 +1100)]
ctdb-vacuum: Track time for vacuuming in database statistics

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
(cherry picked from commit a0628e317df76c7c38a7cca9c3090077fa352899)

9 years agoWHATSNEW: Announce SMB2 leases support.
Jeremy Allison [Sun, 9 Nov 2014 20:30:27 +0000 (21:30 +0100)]
WHATSNEW: Announce SMB2 leases support.

Signed-off-by: Karolin Seeger <kseeger@samba.org>
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10911

Autobuild-User(v4-2-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-2-test): Wed Dec 10 00:00:08 CET 2014 on sn-devel-104

9 years agos3:locking: Change the data model for leases_db to cope with dynamic path renames.
Jeremy Allison [Fri, 5 Dec 2014 20:47:52 +0000 (12:47 -0800)]
s3:locking: Change the data model for leases_db to cope with dynamic path renames.

interface leases_db
{
        typedef [public] struct {
                GUID client_guid;
                smb2_lease_key lease_key;
        } leases_db_key;

        typedef [public] struct {
                file_id id;
                [string,charset(UTF8)] char *servicepath;
                [string,charset(UTF8)] char *base_name;
                [string,charset(UTF8)] char *stream_name;
        } leases_db_file;

        typedef [public] struct {
                uint32 num_files;
                [size_is(num_files)] leases_db_file files[];
        } leases_db_value;
}

As designed by metze.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Dec  9 03:44:04 CET 2014 on sn-devel-104

(cherry picked from commit 5ebb1903858b4d1aadfa4e04644ec1b2b218b914)

The last 5 patches address
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10911
SMB2 leases are not yet supported.

9 years agos3:locking: pass down servicepath to leases_db_add()
Jeremy Allison [Fri, 5 Dec 2014 20:58:39 +0000 (12:58 -0800)]
s3:locking: pass down servicepath to leases_db_add()

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 708f87b79dcdfc58e2219e90473160eb5a22ecb6)

9 years agos3:locking: Add new utility function leases_db_copy_file_ids()
Jeremy Allison [Fri, 5 Dec 2014 20:57:24 +0000 (12:57 -0800)]
s3:locking: Add new utility function leases_db_copy_file_ids()

Will be used by lease db parsers.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit b3b878eea4ecdd13828fc8f912ad95904e8a6c5e)

9 years agos3:locking: prepare the data model for leases_db to cope with dynamic path renames.
Jeremy Allison [Fri, 5 Dec 2014 20:47:52 +0000 (12:47 -0800)]
s3:locking: prepare the data model for leases_db to cope with dynamic path renames.

interface leases_db
{
        typedef [public] struct {
                GUID client_guid;
                smb2_lease_key lease_key;
        } leases_db_key;

        typedef [public] struct {
                file_id id;
                [string,charset(UTF8)] char *servicepath;
                [string,charset(UTF8)] char *base_name;
                [string,charset(UTF8)] char *stream_name;
        } leases_db_file;

        typedef [public] struct {
                uint32 num_files;
                [size_is(num_files)] leases_db_file files[];
        } leases_db_value;
}

As designed by metze.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 5661198d718496201ea2a6bb75d043a8b255b578)

9 years agos3:locking: pass servicename_new to leases_db_rename()
Jeremy Allison [Fri, 5 Dec 2014 20:56:03 +0000 (12:56 -0800)]
s3:locking: pass servicename_new to leases_db_rename()

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 2cd9a5c3209e947a6e63ad019da869790d01d0aa)

9 years agosocket_wrapper: Add missing prototype check for eventfd.
Andreas Schneider [Wed, 26 Nov 2014 09:18:34 +0000 (10:18 +0100)]
socket_wrapper: Add missing prototype check for eventfd.

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

Newer glibc versions use and unsinged integer for the count instead of
an integer.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 78e8bafb322ec69c5ff4b32a5e1c5679c9dea6bf)

9 years agoswrap: Bump version to 1.1.2.
Andreas Schneider [Thu, 2 Oct 2014 05:26:35 +0000 (07:26 +0200)]
swrap: Bump version to 1.1.2.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Matthieu Patou <mat@matws.net>
Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Oct  2 12:00:14 CEST 2014 on sn-devel-104

(cherry picked from commit 47f307d112a4eaec0d375ee1604c13ed7449b3c4)

9 years agoswrap: Add support for eventfd with unsigned count variable.
Andreas Schneider [Thu, 2 Oct 2014 05:25:32 +0000 (07:25 +0200)]
swrap: Add support for eventfd with unsigned count variable.

The prototype in glibc 2.20.90 changed.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit afe2f47c0fd17c215857e800296de795d48c004d)

9 years agoswrap: Add a trace message for swrap_socket().
Andreas Schneider [Thu, 2 Oct 2014 05:24:55 +0000 (07:24 +0200)]
swrap: Add a trace message for swrap_socket().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 539fa2c04f6220e72a63ab492fae298c86b00954)

9 years agoswrap: Implement fcntl() to catch F_DUPFD.
Andreas Schneider [Thu, 2 Oct 2014 05:24:27 +0000 (07:24 +0200)]
swrap: Implement fcntl() to catch F_DUPFD.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 8efc0952adda9273e90ffbbc0c691c9ff4b9b947)

9 years agoswrap: Include the function name in the debug output.
Andreas Schneider [Thu, 2 Oct 2014 05:23:53 +0000 (07:23 +0200)]
swrap: Include the function name in the debug output.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 2efd5b242928c2e048b5421d52e35dd2e13dca15)

9 years agoswrap: Silence alignment warnings.
Andreas Schneider [Thu, 2 Oct 2014 05:23:25 +0000 (07:23 +0200)]
swrap: Silence alignment warnings.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 872e1ae0ef22f659f52241c753f7f9b1b6f5b279)

9 years agoswrap: Fix type punning warnings when loading functions.
Andreas Schneider [Thu, 2 Oct 2014 05:22:59 +0000 (07:22 +0200)]
swrap: Fix type punning warnings when loading functions.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 088db7f7b561c1b87a890359c67b551bc1a48593)

9 years agoswrap: Fix access to struct members in log messages.
Andreas Schneider [Thu, 2 Oct 2014 05:22:13 +0000 (07:22 +0200)]
swrap: Fix access to struct members in log messages.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit b3c72e151f5dc479e600118dbdca2fdc006dbd83)

9 years agoswrap: Fix whitespace errors.
Andreas Schneider [Thu, 2 Oct 2014 05:20:53 +0000 (07:20 +0200)]
swrap: Fix whitespace errors.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 9ba259e68aa755037a1a720da3662fe07a0a7ee4)

9 years agoswrap: Update copyright notice.
Andreas Schneider [Thu, 2 Oct 2014 05:20:15 +0000 (07:20 +0200)]
swrap: Update copyright notice.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit a5046865661f814bab8af7f84f8ebd81a62067b7)

9 years agoswrap: Wrap fopen to detect stale file descriptors.
Andreas Schneider [Thu, 2 Oct 2014 05:18:48 +0000 (07:18 +0200)]
swrap: Wrap fopen to detect stale file descriptors.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 9731516e7f87cc16412eb830840d0393e8a4f823)

9 years agoswrap: Use swrap_address in swrap_accept().
Andreas Schneider [Thu, 2 Oct 2014 05:18:14 +0000 (07:18 +0200)]
swrap: Use swrap_address in swrap_accept().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit f8584abfef0974a19547927258369b04e03d6336)

9 years agoswrap: Remove unused sockaddr_dup() function.
Andreas Schneider [Thu, 2 Oct 2014 05:17:42 +0000 (07:17 +0200)]
swrap: Remove unused sockaddr_dup() function.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 891e837c3c0ca3db2ae2d59d04296aa67eb25d3a)

9 years agoswrap: Use swrap_address in the socket_info struct.
Andreas Schneider [Thu, 2 Oct 2014 05:17:10 +0000 (07:17 +0200)]
swrap: Use swrap_address in the socket_info struct.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 889747486560e71d27c5a5255c825c4ebd62f8f9)

9 years agoswrap: Use a sockaddr_un for the unix path in socket_info.
Andreas Schneider [Thu, 2 Oct 2014 05:16:25 +0000 (07:16 +0200)]
swrap: Use a sockaddr_un for the unix path in socket_info.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 4402ba10b5afc57e72b45ce640c14764d5f0f2c7)

9 years agoswrap: Rename swrap_pcap_dump_packet().
Andreas Schneider [Thu, 2 Oct 2014 05:15:38 +0000 (07:15 +0200)]
swrap: Rename swrap_pcap_dump_packet().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 9da1ff9ad1d7983bd11693263f3dfcd1ed9685d4)

9 years agoswrap: Rename swrap_pcap_get_fd().
Andreas Schneider [Thu, 2 Oct 2014 05:14:44 +0000 (07:14 +0200)]
swrap: Rename swrap_pcap_get_fd().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 79e545b304db8b3fa6fcb21a6f1e023e0ae0f3b4)

9 years agoswrap: Rename swrap_marshall_packet().
Andreas Schneider [Thu, 2 Oct 2014 05:14:04 +0000 (07:14 +0200)]
swrap: Rename swrap_marshall_packet().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 7d4c6cf25d5f424156fa0a6f90673744c5eba18e)

9 years agoswrap: Rename swrap_packet_init().
Andreas Schneider [Thu, 2 Oct 2014 05:13:10 +0000 (07:13 +0200)]
swrap: Rename swrap_packet_init().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit e64ea9cb79b804c299d0213b2cca207fb000a3b8)

9 years agoswrap: Rename socket_wrapper_pcap_file().
Andreas Schneider [Thu, 2 Oct 2014 05:11:49 +0000 (07:11 +0200)]
swrap: Rename socket_wrapper_pcap_file().

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit c626aad36a9757d584b9f10f0ba55dda72499c50)

9 years agoswrap: Fix type punning warnings.
Andreas Schneider [Thu, 2 Oct 2014 05:09:33 +0000 (07:09 +0200)]
swrap: Fix type punning warnings.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
(cherry picked from commit 2be25abcb13353c26712ec8bc50f65ad53d390d4)

9 years agoProvide a compatible declaration of CMSG_ALIGN
Jakub Hrozek [Thu, 2 Oct 2014 05:05:35 +0000 (07:05 +0200)]
Provide a compatible declaration of CMSG_ALIGN

Some platforms (like OSX) do support some of the CMGS macros, but don't
have a CMSG_ALIGN macro of their own.

Signed-off-by: Jakub Hrozek <jakub.hrozek@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
(cherry picked from commit 95c9917c8638f1eb5480e851c8dfbb808f1687bd)

9 years agoswrap: fix another discard const warning in swrap_bind()
Michael Adam [Thu, 2 Oct 2014 05:03:22 +0000 (07:03 +0200)]
swrap: fix another discard const warning in swrap_bind()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit 616364378da073f841d46fb299c81adb05d5222d)

9 years agoswrap: fix discard const warning in swrap_bind()
Michael Adam [Thu, 2 Oct 2014 05:02:36 +0000 (07:02 +0200)]
swrap: fix discard const warning in swrap_bind()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit f6fe9a997d2f5a1c504ea53886e00cfb33ec76d0)

9 years agoswrap: fix discard const warning in swrap_remove_stale()
Michael Adam [Thu, 2 Oct 2014 05:01:34 +0000 (07:01 +0200)]
swrap: fix discard const warning in swrap_remove_stale()

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit bebbd289859cff50d63cdbe76d214b67fd33e3f8)

9 years agoswrap: fix build when neither HAVE_STRUCT_IN_PKTINFO nor IP_RECVDSTADDR is defined
Michael Adam [Thu, 2 Oct 2014 05:00:44 +0000 (07:00 +0200)]
swrap: fix build when neither HAVE_STRUCT_IN_PKTINFO nor IP_RECVDSTADDR is defined

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
(cherry picked from commit a7a47796fd7ca1fa830a8c2644042c311b9796da)

9 years agoWHATSNEW: Apple's SMB2 extension AAPL
Ralph Boehme [Mon, 8 Dec 2014 12:27:22 +0000 (13:27 +0100)]
WHATSNEW: Apple's SMB2 extension AAPL

Signed-off-by: Ralph Boehme <slow@samba.org>
9 years agos3: modules: Fix *allocate* calls to follow POSIX error return convention.
Jeremy Allison [Fri, 5 Dec 2014 23:37:11 +0000 (15:37 -0800)]
s3: modules: Fix *allocate* calls to follow POSIX error return convention.

Fix up the ceph, fruit, time_audit and streams_xattr modules to follow
the -1,errno convention for errors.

Reported by Jones <jones.kstw@gmail.com> who provided the
initial patch. This patch tested and confirmed working
by him as well.

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@suse.de>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Dec  8 02:59:43 CET 2014 on sn-devel-104

(cherry picked from commit 2845e1c29f8bce6306a73d546184c401bf89cfea)

Autobuild-User(v4-2-test): Karolin Seeger <kseeger@samba.org>
Autobuild-Date(v4-2-test): Mon Dec  8 12:37:27 CET 2014 on sn-devel-104

9 years agos3: smbd: Fix *allocate* calls to follow POSIX error return convention.
Jeremy Allison [Fri, 5 Dec 2014 23:34:12 +0000 (15:34 -0800)]
s3: smbd: Fix *allocate* calls to follow POSIX error return convention.

Fix vfs_allocate_file_space(), vfs_slow_fallocate(),
vfs_fill_sparse() to follow the -1,errno convention
for errors.

Standardize on the -1,errno convention.

Reported by Jones <jones.kstw@gmail.com> who provided the
initial patch. This patch tested and confirmed working
by him as well.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@suse.de>
(cherry picked from commit cc1f91cec627cb3e4fc89b96aae1e7e4c539cd1c)

9 years agos3: smbd: Fix *allocate* calls to follow POSIX error return convention.
Jeremy Allison [Fri, 5 Dec 2014 23:31:19 +0000 (15:31 -0800)]
s3: smbd: Fix *allocate* calls to follow POSIX error return convention.

vfswrap_fallocate() is broken in that it can call posix_fallocate()
which returns an int error (and doesn't set errno) but can also
call Linux fallocate() which returns -1 and sets errno.

Standardize on the -1,errno convention.

Reported by Jones <jones.kstw@gmail.com> who provided the
initial patch. This patch tested and confirmed working
by him as well.

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

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@suse.de>
(cherry picked from commit c9235deee0fc49c99cfaf2329b7af526d9dd12d0)

9 years agovfs_fruit: add AAPL options
Ralph Boehme [Fri, 28 Nov 2014 21:44:29 +0000 (22:44 +0100)]
vfs_fruit: add AAPL options

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Dec  5 00:34:01 CET 2014 on sn-devel-104

(cherry picked from commit 8f4813ff3070858cfa7e7da6fb703294bdedabed)

The last 12 patches address
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10983
Backport AAPL patches from master

9 years agos4:torture:vfs_fruit: smb2/create context AAPL test
Ralph Boehme [Sat, 27 Sep 2014 15:21:12 +0000 (17:21 +0200)]
s4:torture:vfs_fruit: smb2/create context AAPL test

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 9994f1fed885ed6e413dffadf6ea93a97f57ac5a)

9 years agos4:libcli/raw: make short_name available in buffer
Ralph Boehme [Wed, 1 Oct 2014 12:36:43 +0000 (14:36 +0200)]
s4:libcli/raw: make short_name available in buffer

This will be used in smb2/create AAPL context torture tests, where the
server returns an Mac OS X specific data blob in the short name
buffer. It's not a string, so the existing string extraction doesn't
cut it.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit b942d6b05f5eacfe33631534f559ab8b99369347)

9 years agos3:smbd: add SMB_VFS_READDIR_ATTR() to marshall direntry
Ralph Boehme [Wed, 26 Nov 2014 14:21:36 +0000 (15:21 +0100)]
s3:smbd: add SMB_VFS_READDIR_ATTR() to marshall direntry

SMB_VFS_READDIR_ATTR is a last minute hook to fetch additional metadata
for a directory entry when we're already marshalling the SMB reply buffer.

This would we used, when there's a need to repurpose some fields in the
the reply, like it's done with Apple's SMB2 extension "AAPL".

We then fetch AAPL metadata with the shiny new SMB_VFS_READDIR_ATTR()
VFS call and marshall appropiately.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 2236883cdeadab02f0ed367e13b41a32b1f85c34)

9 years agovfs_fruit: AAPL support
Ralph Boehme [Wed, 26 Nov 2014 17:11:17 +0000 (18:11 +0100)]
vfs_fruit: AAPL support

* readdir_attr VFS functions, used in trans2 when marshalling
  metadata associated with a directory entry

* support for reading and writing UNIX mode via MS NFS ACEs in NT ACL

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 353acb6d294bd32fdaaf1e4d95c663cae30775a0)

9 years agos3:smbd: ignore dacls with MS NFS ACEs
Ralph Boehme [Wed, 26 Nov 2014 17:01:37 +0000 (18:01 +0100)]
s3:smbd: ignore dacls with MS NFS ACEs

Ignore NFS ACEs in code the modifies
* default POSIX ACLs
* VFS: NFSv4 ACLs
* VFS: xattr and tdb ACLs

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 5ff72827c3b74f28995b45250fe8efa79495e3b6)

9 years agolibcli/security: add a function that checks for MS NFS ACEs
Ralph Boehme [Tue, 14 Oct 2014 11:54:05 +0000 (13:54 +0200)]
libcli/security: add a function that checks for MS NFS ACEs

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 2ab6b43da63715350db8675bd3804e64f4241bca)

9 years agolibcli/security: add NFS SID mappings
Ralph Boehme [Mon, 8 Sep 2014 21:18:35 +0000 (23:18 +0200)]
libcli/security: add NFS SID mappings

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 549ee51674a3a50f866bcf37b3ae58f5e8a9080e)

9 years agos3:smbd: add SMB2 AAPL create context defines
Ralph Boehme [Fri, 22 Aug 2014 01:48:50 +0000 (03:48 +0200)]
s3:smbd: add SMB2 AAPL create context defines

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 80849d31a1be489c292a82b8abb95d843988154a)

9 years agos3:vfs: add create tags to SMB_VFS_CREATEFILE
Ralph Boehme [Wed, 26 Nov 2014 13:12:51 +0000 (14:12 +0100)]
s3:vfs: add create tags to SMB_VFS_CREATEFILE

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit 142db4048f41f793d9b919a93877d547ff593c6d)

9 years agos3:smbd: allocate out_context_blobs with talloc
Ralph Boehme [Fri, 28 Nov 2014 10:44:09 +0000 (11:44 +0100)]
s3:smbd: allocate out_context_blobs with talloc

By tallocing the out_context_blobs instead of using an automatic stack
variable, we can use out_context_blobs as talloc parent for individual
create tag that we add via smb2_create_blob_add().

This is in preperation of a SMB_VFS_CREATE_FILE modification where I add
the in and out_context_blobs as additional args. With this change in
place we can add create tags to out_context_blobs from there too.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit af846264d89f21ac7db8d0cdf6e861ba9cc74151)

9 years agos3:vfs: add SMB_VFS_READDIR_ATTR()
Ralph Boehme [Wed, 26 Nov 2014 13:30:37 +0000 (14:30 +0100)]
s3:vfs: add SMB_VFS_READDIR_ATTR()

SMB_VFS_READDIR_ATTR is a last minute hook to fetch additional metadata
for a directory entry when we're already marshalling the SMB reply
buffer.

This would be used, when there's a need to repurpose some fields in the
the reply, like it's done with Apple's SMB2 extension "AAPL".

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
(cherry picked from commit b65e37dc01d7afa007768f7cadfcf3b7c1007664)

9 years agovfs_snapper: check for <linux/ioctl.h>
Ralph Boehme [Sat, 8 Nov 2014 21:18:08 +0000 (22:18 +0100)]
vfs_snapper: check for <linux/ioctl.h>

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10834

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Sun Nov  9 16:02:24 CET 2014 on sn-devel-104

(cherry picked from commit 5f68f7289c3028f50a449120cce000dcf40db788)

9 years agos3-libsmb: Duplicate the memory before we free it.
Andreas Schneider [Fri, 14 Nov 2014 09:05:13 +0000 (10:05 +0100)]
s3-libsmb: Duplicate the memory before we free it.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>
(cherry picked from commit 8c41795c81d85114e383e694ba7421e95bacb912)