[Pkg-samba-maint] Bug#856931: unblock: samba/2:4.5.5+dfsg-1

Mathieu Parent sathieu at debian.org
Mon Mar 6 12:00:49 UTC 2017


Package: release.debian.org
Severity: normal
User: release.debian.org at packages.debian.org
Usertags: unblock

Please unblock package samba.

samba (2:4.5.5+dfsg-1) unstable; urgency=medium

  * New upstream version
    - Revert rewrite of the vfs_fruit module (Closes: #856561)
  * Fix 'winbindd privileged socket directory' (Closes: #754339):
    - Fix path from /var/run/samba/winbindd_privileged/ to
      /var/lib/samba/winbindd_privileged/.
    - Move mkdir+chgrp+chmod to postinst (to handle systemd also).
    - Thanks to Jim Barber for the report.
  * logrotate: Use delaycompress on all logs (Closes: #702201)
    - Thanks to Matthew Gabeler-Lee for the proposed fix.

 -- Mathieu Parent <sathieu at debian.org>  Sun, 05 Mar 2017 23:21:09 +0100

The new upstream version has 4 patches and the revert (which is RC).

See the complete diff attached.

unblock samba/2:4.5.5+dfsg-1

-- System Information:
Debian Release: 9.0
  APT prefers testing-debug
  APT policy: (500, 'testing-debug'), (500, 'testing')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.9.0-1-amd64 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.utf8, LC_CTYPE=fr_FR.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
-------------- next part --------------
diff -Nru samba-4.5.4+dfsg/ctdb/config/events.d/10.interface samba-4.5.5+dfsg/ctdb/config/events.d/10.interface
--- samba-4.5.4+dfsg/ctdb/config/events.d/10.interface	2016-08-11 09:51:04.000000000 +0200
+++ samba-4.5.5+dfsg/ctdb/config/events.d/10.interface	2017-01-30 10:56:26.000000000 +0100
@@ -215,7 +215,7 @@
 	# 2) remove the IP from the old interface (and new interface, to be sure)
 	# 3) add the IP to the new interface
 	# 4) remove the firewall rule
-	# 5) use ctdb gratiousarp to propagate the new mac address
+	# 5) use ctdb gratarp to propagate the new mac address
 	# 6) use netstat -tn to find existing connections, and tickle them
 	_oiface=$2
 	niface=$3
@@ -240,7 +240,7 @@
 	flush_route_cache
 
 	# propagate the new mac address
-	$CTDB gratiousarp "$ip" "$niface"
+	$CTDB gratarp "$ip" "$niface"
 
 	# tickle all existing connections, so that dropped packets
 	# are retransmited and the tcp streams work
diff -Nru samba-4.5.4+dfsg/ctdb/config/events.d/13.per_ip_routing samba-4.5.5+dfsg/ctdb/config/events.d/13.per_ip_routing
--- samba-4.5.4+dfsg/ctdb/config/events.d/13.per_ip_routing	2016-08-11 09:51:04.000000000 +0200
+++ samba-4.5.5+dfsg/ctdb/config/events.d/13.per_ip_routing	2017-01-30 10:56:26.000000000 +0100
@@ -184,8 +184,8 @@
 	    -v pre="$table_id_prefix" \
 	    '/^#/ ||
 	     !(min <= $1 && $1 <= max) &&
-	     !(index($2, pre) == 1)
-	     { print $0 }' "$rt_tables" >"$_tmp"
+	     !(index($2, pre) == 1) {
+		print $0 }' "$rt_tables" >"$_tmp"
 
 	mv "$_tmp" "$rt_tables"
     ) 9>"$rt_tables_lock"
@@ -398,7 +398,7 @@
 	# flush our route cache
 	set_proc sys/net/ipv4/route/flush 1
 
-	$CTDB gratiousarp "$ip" "$iface"
+	$CTDB gratarp "$ip" "$iface"
 	;;
 
 updateip)
@@ -416,7 +416,7 @@
 	# flush our route cache
 	set_proc sys/net/ipv4/route/flush 1
 
-	$CTDB gratiousarp "$ip" "$niface"
+	$CTDB gratarp "$ip" "$niface"
 	tickle_tcp_connections "$ip"
 	;;
 
diff -Nru samba-4.5.4+dfsg/ctdb/config/events.d/91.lvs samba-4.5.5+dfsg/ctdb/config/events.d/91.lvs
--- samba-4.5.4+dfsg/ctdb/config/events.d/91.lvs	2016-08-11 09:51:04.000000000 +0200
+++ samba-4.5.5+dfsg/ctdb/config/events.d/91.lvs	2017-01-30 10:56:26.000000000 +0100
@@ -110,7 +110,7 @@
 	ipvsadm -a -t "$CTDB_LVS_PUBLIC_IP" -r 127.0.0.1
 	ipvsadm -a -u "$CTDB_LVS_PUBLIC_IP" -r 127.0.0.1
 
-	$CTDB gratiousarp \
+	$CTDB gratarp \
 	     "$CTDB_LVS_PUBLIC_IP" "$CTDB_LVS_PUBLIC_IFACE" >/dev/null 2>&1
 
 	flush_route_cache
diff -Nru samba-4.5.4+dfsg/ctdb/doc/ctdb.1 samba-4.5.5+dfsg/ctdb/doc/ctdb.1
--- samba-4.5.4+dfsg/ctdb/doc/ctdb.1	2016-10-24 21:44:53.000000000 +0200
+++ samba-4.5.5+dfsg/ctdb/doc/ctdb.1	2017-01-30 11:15:39.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: ctdb
 .\"    Author: 
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 10/24/2016
+.\"      Date: 01/30/2017
 .\"    Manual: CTDB - clustered TDB database
 .\"    Source: ctdb
 .\"  Language: English
 .\"
-.TH "CTDB" "1" "10/24/2016" "ctdb" "CTDB \- clustered TDB database"
+.TH "CTDB" "1" "01/30/2017" "ctdb" "CTDB \- clustered TDB database"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -1227,9 +1227,9 @@
 .SS "gettickles \fIIPADDR\fR"
 .PP
 Show TCP connections that are registered with CTDB to be "tickled" if there is a failover\&.
-.SS "gratiousarp \fIIPADDR\fR \fIINTERFACE\fR"
+.SS "gratarp \fIIPADDR\fR \fIINTERFACE\fR"
 .PP
-Send out a gratious ARP for the specified interface through the specified interface\&. This command is mainly used by the ctdb eventscripts\&.
+Send out a gratuitous ARP for the specified interface through the specified interface\&. This command is mainly used by the ctdb eventscripts\&.
 .SS "pdelete \fIDB\fR \fIKEY\fR"
 .PP
 Delete KEY from DB\&.
diff -Nru samba-4.5.4+dfsg/ctdb/doc/ctdb.1.html samba-4.5.5+dfsg/ctdb/doc/ctdb.1.html
--- samba-4.5.4+dfsg/ctdb/doc/ctdb.1.html	2016-10-24 21:44:53.000000000 +0200
+++ samba-4.5.5+dfsg/ctdb/doc/ctdb.1.html	2017-01-30 11:15:40.000000000 +0100
@@ -1,4 +1,4 @@
-<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>ctdb</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry"><a name="ctdb.1"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ctdb — CTDB management utility</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">ctdb</code>  [<em class="replaceable"><code>OPTION</code></em>...] {<em class="replaceable"><code>COMMAND</code></em>} [<em class="replaceable"><code>COMMAND-ARGS</code></em>]</p></div></div><div class="refsect1"><a name="idp53323456"></a><h2>DESCRIPTION</h2><p>
+<html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"><title>ctdb</title><meta name="generator" content="DocBook XSL Stylesheets V1.78.1"></head><body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="refentry"><a name="ctdb.1"></a><div class="titlepage"></div><div class="refnamediv"><h2>Name</h2><p>ctdb — CTDB management utility</p></div><div class="refsynopsisdiv"><h2>Synopsis</h2><div class="cmdsynopsis"><p><code class="command">ctdb</code>  [<em class="replaceable"><code>OPTION</code></em>...] {<em class="replaceable"><code>COMMAND</code></em>} [<em class="replaceable"><code>COMMAND-ARGS</code></em>]</p></div></div><div class="refsect1"><a name="idp52620960"></a><h2>DESCRIPTION</h2><p>
       ctdb is a utility to view and manage a CTDB cluster.
     </p><p>
       The following terms are used when referring to nodes in a
@@ -21,7 +21,7 @@
 	      A space separated list of at least one
 	      <em class="parameter"><code>DB</code></em>.
 	    </p></dd></dl></div><p>
-    </p></div><div class="refsect1"><a name="idp54191488"></a><h2>OPTIONS</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term">-n <em class="parameter"><code>PNN-LIST</code></em></span></dt><dd><p>
+    </p></div><div class="refsect1"><a name="idp53501536"></a><h2>OPTIONS</h2><div class="variablelist"><dl class="variablelist"><dt><span class="term">-n <em class="parameter"><code>PNN-LIST</code></em></span></dt><dd><p>
 	  The nodes specified by PNN-LIST should be queried for the
 	  requested information.  Default is to query the daemon
 	  running on the local host.
@@ -59,21 +59,21 @@
 	  socket to use when connecting to the local CTDB
 	  daemon. The default is
 	  <code class="filename">/usr/local/var/run/ctdb/ctdbd.socket</code>.
-	</p></dd></dl></div></div><div class="refsect1"><a name="idp49121072"></a><h2>ADMINISTRATIVE COMMANDS</h2><p>
+	</p></dd></dl></div></div><div class="refsect1"><a name="idp48976048"></a><h2>ADMINISTRATIVE COMMANDS</h2><p>
       These are commands used to monitor and administer a CTDB cluster.
-    </p><div class="refsect2"><a name="idp49122128"></a><h3>pnn</h3><p>
+    </p><div class="refsect2"><a name="idp48977104"></a><h3>pnn</h3><p>
 	This command displays the PNN of the current node.
-      </p></div><div class="refsect2"><a name="idp49123328"></a><h3>status</h3><p>
+      </p></div><div class="refsect2"><a name="idp48978256"></a><h3>status</h3><p>
 	This command shows the current status of all CTDB nodes based
 	on information from the queried node.
       </p><p>
 	Note: If the the queried node is INACTIVE then the status
 	might not be current.
-      </p><div class="refsect3"><a name="idp49125008"></a><h4>Node status</h4><p>
+      </p><div class="refsect3"><a name="idp48979936"></a><h4>Node status</h4><p>
 	  This includes the number of physical nodes and the status of
 	  each node.  See <span class="citerefentry"><span class="refentrytitle">ctdb</span>(7)</span> for information
 	  about node states.
-	</p></div><div class="refsect3"><a name="idp49127216"></a><h4>Generation</h4><p>
+	</p></div><div class="refsect3"><a name="idp48982192"></a><h4>Generation</h4><p>
 	  The generation id is a number that indicates the current generation 
 	  of a cluster instance. Each time a cluster goes through a 
 	  reconfiguration or a recovery its generation id will be changed.
@@ -94,13 +94,13 @@
 	  All nodes start with generation "INVALID" and are not assigned a real
 	  generation id until they have successfully been merged with a cluster
 	  through a recovery.
-	</p></div><div class="refsect3"><a name="idp49130720"></a><h4>Virtual Node Number (VNN) map</h4><p>
+	</p></div><div class="refsect3"><a name="idp48990416"></a><h4>Virtual Node Number (VNN) map</h4><p>
 	  Consists of the number of virtual nodes and mapping from
 	  virtual node numbers to physical node numbers.  Virtual
 	  nodes host CTDB databases.  Only nodes that are
 	  participating in the VNN map can become lmaster or dmaster
 	  for database records.
-	</p></div><div class="refsect3"><a name="idp49132192"></a><h4>Recovery mode</h4><p>
+	</p></div><div class="refsect3"><a name="idp48991840"></a><h4>Recovery mode</h4><p>
 	  This is the current recovery mode of the cluster. There are two possible modes:
 	</p><p>
 	  NORMAL - The cluster is fully operational.
@@ -120,13 +120,13 @@
 	  databases have been recovered, the node mode will change into
 	  NORMAL mode and the databases will be "thawed", allowing samba
 	  to access the databases again.
-	</p></div><div class="refsect3"><a name="idp49140832"></a><h4>Recovery master</h4><p>
+	</p></div><div class="refsect3"><a name="idp48995744"></a><h4>Recovery master</h4><p>
 	  This is the cluster node that is currently designated as the recovery master. This node is responsible of monitoring the consistency of the cluster and to perform the actual recovery process when reqired.
 	</p><p>
 	  Only one node at a time can be the designated recovery master. Which
 	  node is designated the recovery master is decided by an election
 	  process in the recovery daemons running on each node.
-	</p></div><div class="refsect3"><a name="idp49142832"></a><h4>Example</h4><pre class="screen">
+	</p></div><div class="refsect3"><a name="idp48997744"></a><h4>Example</h4><pre class="screen">
 # ctdb status
 Number of nodes:4
 pnn:0 192.168.2.200       OK (THIS NODE)
@@ -141,7 +141,7 @@
 hash:3 lmaster:3
 Recovery mode:NORMAL (0)
 Recovery master:0
-	</pre></div></div><div class="refsect2"><a name="idp49144736"></a><h3>nodestatus [<span class="optional"><em class="parameter"><code>PNN-LIST</code></em></span>]</h3><p>
+	</pre></div></div><div class="refsect2"><a name="idp48999648"></a><h3>nodestatus [<span class="optional"><em class="parameter"><code>PNN-LIST</code></em></span>]</h3><p>
 	This command is similar to the <span class="command"><strong>status</strong></span>
 	command.  It displays the "node status" subset of output.  The
 	main differences are:
@@ -159,7 +159,7 @@
 	A common invocation in scripts is <span class="command"><strong>ctdb nodestatus
 	all</strong></span> to check whether all nodes in a cluster are
 	healthy.
-      </p><div class="refsect3"><a name="idp49152688"></a><h4>Example</h4><pre class="screen">
+      </p><div class="refsect3"><a name="idp49007648"></a><h4>Example</h4><pre class="screen">
 # ctdb nodestatus
 pnn:0 10.0.0.30        OK (THIS NODE)
 
@@ -167,28 +167,28 @@
 Number of nodes:2
 pnn:0 10.0.0.30        OK (THIS NODE)
 pnn:1 10.0.0.31        OK
-	</pre></div></div><div class="refsect2"><a name="idp49154448"></a><h3>recmaster</h3><p>
+	</pre></div></div><div class="refsect2"><a name="idp49009408"></a><h3>recmaster</h3><p>
 	This command shows the pnn of the node which is currently the recmaster.
       </p><p>
 	Note: If the the queried node is INACTIVE then the status
 	might not be current.
-      </p></div><div class="refsect2"><a name="idp49156224"></a><h3>uptime</h3><p>
+      </p></div><div class="refsect2"><a name="idp49011184"></a><h3>uptime</h3><p>
 	This command shows the uptime for the ctdb daemon. When the last recovery or ip-failover completed and how long it took. If the "duration" is shown as a negative number, this indicates that there is a recovery/failover in progress and it started that many seconds ago.
-      </p><div class="refsect3"><a name="idp49157568"></a><h4>Example</h4><pre class="screen">
+      </p><div class="refsect3"><a name="idp49012528"></a><h4>Example</h4><pre class="screen">
 # ctdb uptime
 Current time of node          :                Thu Oct 29 10:38:54 2009
 Ctdbd start time              : (000 16:54:28) Wed Oct 28 17:44:26 2009
 Time of last recovery/failover: (000 16:53:31) Wed Oct 28 17:45:23 2009
 Duration of last recovery/failover: 2.248552 seconds
-	</pre></div></div><div class="refsect2"><a name="idp49159456"></a><h3>listnodes</h3><p>
+	</pre></div></div><div class="refsect2"><a name="idp54631088"></a><h3>listnodes</h3><p>
 	This command shows lists the ip addresses of all the nodes in the cluster.
-      </p><div class="refsect3"><a name="idp49160608"></a><h4>Example</h4><pre class="screen">
+      </p><div class="refsect3"><a name="idp54632208"></a><h4>Example</h4><pre class="screen">
 # ctdb listnodes
 192.168.2.200
 192.168.2.201
 192.168.2.202
 192.168.2.203
-	</pre></div></div><div class="refsect2"><a name="idp55024288"></a><h3>natgw {master|list|status}</h3><p>
+	</pre></div></div><div class="refsect2"><a name="idp54633824"></a><h3>natgw {master|list|status}</h3><p>
 	This command shows different aspects of NAT gateway status.
 	For an overview of CTDB's NAT gateway functionality please see
 	the <em class="citetitle">NAT GATEWAY</em> section in
@@ -220,16 +220,16 @@
 pnn:1 192.168.2.201       OK
 pnn:2 192.168.2.202       OK
 pnn:3 192.168.2.203       OK
-	    </pre></dd></dl></div></div><div class="refsect2"><a name="idp55035392"></a><h3>ping</h3><p>
+	    </pre></dd></dl></div></div><div class="refsect2"><a name="idp54644928"></a><h3>ping</h3><p>
 	This command will "ping" specified CTDB nodes in the cluster
 	to verify that they are running.
-      </p><div class="refsect3"><a name="idp55036528"></a><h4>Example</h4><pre class="screen">
+      </p><div class="refsect3"><a name="idp54646064"></a><h4>Example</h4><pre class="screen">
 # ctdb ping
 response from 0 time=0.000054 sec  (3 clients)
-	</pre></div></div><div class="refsect2"><a name="idp55038048"></a><h3>ifaces</h3><p>
+	</pre></div></div><div class="refsect2"><a name="idp54647584"></a><h3>ifaces</h3><p>
 	This command will display the list of network interfaces, which could
 	host public addresses, along with their status.
-      </p><div class="refsect3"><a name="idp55039216"></a><h4>Example</h4><pre class="screen">
+      </p><div class="refsect3"><a name="idp54648752"></a><h4>Example</h4><pre class="screen">
 # ctdb ifaces
 Interfaces on node 0
 name:eth5 link:up references:2
@@ -243,9 +243,9 @@
 |eth4|0|0|
 |eth3|1|1|
 |eth2|1|1|
-	</pre></div></div><div class="refsect2"><a name="idp55041008"></a><h3>ip</h3><p>
+	</pre></div></div><div class="refsect2"><a name="idp54650544"></a><h3>ip</h3><p>
 	This command will display the list of public addresses that are provided by the cluster and which physical node is currently serving this ip. By default this command will ONLY show those public addresses that are known to the node itself. To see the full list of all public ips across the cluster you must use "ctdb ip all".
-      </p><div class="refsect3"><a name="idp55042384"></a><h4>Example</h4><pre class="screen">
+      </p><div class="refsect3"><a name="idp54651920"></a><h4>Example</h4><pre class="screen">
 # ctdb ip -v
 Public IPs on node 0
 172.31.91.82 node[1] active[] available[eth2,eth3] configured[eth2,eth3]
@@ -267,9 +267,9 @@
 |172.31.92.83|0|eth5|eth5|eth4,eth5|
 |172.31.92.84|1||eth5|eth4,eth5|
 |172.31.92.85|0|eth5|eth5|eth4,eth5|
-	</pre></div></div><div class="refsect2"><a name="idp55044928"></a><h3>ipinfo <em class="parameter"><code>IP</code></em></h3><p>
+	</pre></div></div><div class="refsect2"><a name="idp54654464"></a><h3>ipinfo <em class="parameter"><code>IP</code></em></h3><p>
 	This command will display details about the specified public addresses.
-      </p><div class="refsect3"><a name="idp55046544"></a><h4>Example</h4><pre class="screen">
+      </p><div class="refsect3"><a name="idp54656080"></a><h4>Example</h4><pre class="screen">
 # ctdb ipinfo 172.31.92.85
 Public IP[172.31.92.85] info on node 0
 IP:172.31.92.85
@@ -277,9 +277,9 @@
 NumInterfaces:2
 Interface[1]: Name:eth4 Link:down References:0
 Interface[2]: Name:eth5 Link:up References:2 (active)
-	</pre></div></div><div class="refsect2"><a name="idp55048288"></a><h3>scriptstatus</h3><p>
+	</pre></div></div><div class="refsect2"><a name="idp54657824"></a><h3>scriptstatus</h3><p>
 	This command displays which scripts where run in the previous monitoring cycle and the result of each script. If a script failed with an error, causing the node to become unhealthy, the output from that script is also shown.
-      </p><div class="refsect3"><a name="idp55049568"></a><h4>Example</h4><pre class="screen">
+      </p><div class="refsect3"><a name="idp54659104"></a><h4>Example</h4><pre class="screen">
 # ctdb scriptstatus
 7 scripts were executed last monitoring cycle
 00.ctdb              Status:OK    Duration:0.056 Tue Mar 24 18:56:57 2009
@@ -291,19 +291,19 @@
 41.httpd             Status:OK    Duration:0.039 Tue Mar 24 18:56:57 2009
 50.samba             Status:ERROR    Duration:0.082 Tue Mar 24 18:56:57 2009
 OUTPUT:ERROR: Samba tcp port 445 is not responding
-      </pre></div></div><div class="refsect2"><a name="idp55051792"></a><h3>disablescript <em class="parameter"><code>SCRIPT</code></em></h3><p>
+      </pre></div></div><div class="refsect2"><a name="idp54661328"></a><h3>disablescript <em class="parameter"><code>SCRIPT</code></em></h3><p>
 	This command is used to disable an eventscript.
       </p><p>
 	This will take effect the next time the eventscripts are being executed so it can take a short while until this is reflected in 'scriptstatus'.
-      </p></div><div class="refsect2"><a name="idp55054000"></a><h3>enablescript <em class="parameter"><code>SCRIPT</code></em></h3><p>
+      </p></div><div class="refsect2"><a name="idp54663536"></a><h3>enablescript <em class="parameter"><code>SCRIPT</code></em></h3><p>
 	This command is used to enable an eventscript.
       </p><p>
 	This will take effect the next time the eventscripts are being executed so it can take a short while until this is reflected in 'scriptstatus'.
-      </p></div><div class="refsect2"><a name="idp55056208"></a><h3>listvars</h3><p>
+      </p></div><div class="refsect2"><a name="idp54665744"></a><h3>listvars</h3><p>
 	List all tuneable variables, except the values of the obsolete tunables
 	like VacuumMinInterval. The obsolete tunables can be retrieved only
 	explicitly with the "ctdb getvar" command.
-      </p><div class="refsect3"><a name="idp55057440"></a><h4>Example</h4><pre class="screen">
+      </p><div class="refsect3"><a name="idp54666976"></a><h4>Example</h4><pre class="screen">
 # ctdb listvars
 SeqnumInterval          = 1000
 ControlTimeout          = 60
@@ -359,16 +359,16 @@
 Samba3AvoidDeadlocks    = 0
 TDBMutexEnabled         = 0
 LockProcessesPerDB      = 200
-	</pre></div></div><div class="refsect2"><a name="idp55062208"></a><h3>getvar <em class="parameter"><code>NAME</code></em></h3><p>
+	</pre></div></div><div class="refsect2"><a name="idp54671744"></a><h3>getvar <em class="parameter"><code>NAME</code></em></h3><p>
 	Get the runtime value of a tuneable variable.
-      </p><div class="refsect3"><a name="idp55063728"></a><h4>Example</h4><pre class="screen">
+      </p><div class="refsect3"><a name="idp54673264"></a><h4>Example</h4><pre class="screen">
 # ctdb getvar MonitorInterval
 MonitorInterval         = 15
-	</pre></div></div><div class="refsect2"><a name="idp55065248"></a><h3>setvar <em class="parameter"><code>NAME</code></em> <em class="parameter"><code>VALUE</code></em></h3><p>
+	</pre></div></div><div class="refsect2"><a name="idp54674784"></a><h3>setvar <em class="parameter"><code>NAME</code></em> <em class="parameter"><code>VALUE</code></em></h3><p>
 	Set the runtime value of a tuneable variable.
-      </p><div class="refsect3"><a name="idp55067392"></a><h4>Example</h4><pre class="screen">
+      </p><div class="refsect3"><a name="idp54676928"></a><h4>Example</h4><pre class="screen">
 # ctdb setvar MonitorInterval 20
-	</pre></div></div><div class="refsect2"><a name="idp55068912"></a><h3>lvs {master|list|status}</h3><p>
+	</pre></div></div><div class="refsect2"><a name="idp54678448"></a><h3>lvs {master|list|status}</h3><p>
 	This command shows different aspects of LVS status.  For an
 	overview of CTDB's LVS functionality please see the
 	<em class="citetitle">LVS</em> section in
@@ -395,7 +395,7 @@
 pnn:1 10.0.0.12        UNHEALTHY
 pnn:2 10.0.0.13        OK
 pnn:3 10.0.0.14        OK
-      </pre></dd></dl></div></div><div class="refsect2"><a name="idp55079808"></a><h3>getcapabilities</h3><p>
+      </pre></dd></dl></div></div><div class="refsect2"><a name="idp54689184"></a><h3>getcapabilities</h3><p>
 	This command shows the capabilities of the current node.  See
 	the <em class="citetitle">CAPABILITIES</em> section in
 	<span class="citerefentry"><span class="refentrytitle">ctdb</span>(7)</span> for more details.
@@ -404,12 +404,12 @@
       </p><pre class="screen">
 RECMASTER: YES
 LMASTER: YES
-      </pre></div><div class="refsect2"><a name="idp55083328"></a><h3>statistics</h3><p>
+      </pre></div><div class="refsect2"><a name="idp54692624"></a><h3>statistics</h3><p>
         Collect statistics from the CTDB daemon about
         how many calls it has served.  Information about
         various fields in statistics can be found in
 	<span class="citerefentry"><span class="refentrytitle">ctdb-statistics</span>(7)</span>.
-      </p><div class="refsect3"><a name="idp55085424"></a><h4>Example</h4><pre class="screen">
+      </p><div class="refsect3"><a name="idp54694720"></a><h4>Example</h4><pre class="screen">
 # ctdb statistics
 CTDB version 1
 Current time of statistics  :                Tue Mar  8 15:18:51 2016
@@ -461,15 +461,15 @@
  reclock_recd       MIN/AVG/MAX     0.000000/0.000000/0.000000 sec out of 0
  call_latency       MIN/AVG/MAX     0.000044/0.002142/0.011702 sec out of 15
  childwrite_latency MIN/AVG/MAX     0.000000/0.000000/0.000000 sec out of 0
-	</pre></div></div><div class="refsect2"><a name="idp55089024"></a><h3>statisticsreset</h3><p>
+	</pre></div></div><div class="refsect2"><a name="idp54698320"></a><h3>statisticsreset</h3><p>
 	This command is used to clear all statistics counters in a node.
       </p><p>
 	Example: ctdb statisticsreset
-      </p></div><div class="refsect2"><a name="idp55090656"></a><h3>dbstatistics <em class="parameter"><code>DB</code></em></h3><p>
+      </p></div><div class="refsect2"><a name="idp54699952"></a><h3>dbstatistics <em class="parameter"><code>DB</code></em></h3><p>
 	Display statistics about the database DB.  Information
 	about various fields in dbstatistics can be found in
 	<span class="citerefentry"><span class="refentrytitle">ctdb-statistics</span>(7)</span>.
-      </p><div class="refsect3"><a name="idp55093200"></a><h4>Example</h4><pre class="screen">
+      </p><div class="refsect3"><a name="idp54702496"></a><h4>Example</h4><pre class="screen">
 # ctdb dbstatistics locking.tdb
 DB Statistics: locking.tdb
  ro_delegations                     0
@@ -485,13 +485,13 @@
  vacuum_latency     MIN/AVG/MAX     0.000472/0.002207/15.243570 sec out of 224530
  Num Hot Keys:     1
      Count:8 Key:ff5bd7cb3ee3822edc1f0000000000000000000000000000
-	</pre></div></div><div class="refsect2"><a name="idp55095392"></a><h3>getreclock</h3><p>
+	</pre></div></div><div class="refsect2"><a name="idp54704688"></a><h3>getreclock</h3><p>
 	Show details of the recovery lock, if any.
       </p><p>
 	Example output:
       </p><pre class="screen">
 	/clusterfs/.ctdb/recovery.lock
-      </pre></div><div class="refsect2"><a name="idp55097552"></a><h3>getdebug</h3><p>
+      </pre></div><div class="refsect2"><a name="idp54706848"></a><h3>getdebug</h3><p>
 	Get the current debug level for the node. the debug level controls what information is written to the log file.
       </p><p>
 	The debug levels are mapped to the corresponding syslog levels.
@@ -501,29 +501,29 @@
 	The list of debug levels from highest to lowest are :
       </p><p>
 	ERROR WARNING NOTICE INFO DEBUG
-      </p></div><div class="refsect2"><a name="idp55100272"></a><h3>setdebug <em class="parameter"><code>DEBUGLEVEL</code></em></h3><p>
+      </p></div><div class="refsect2"><a name="idp54709488"></a><h3>setdebug <em class="parameter"><code>DEBUGLEVEL</code></em></h3><p>
 	Set the debug level of a node. This controls what information will be logged.
       </p><p>
 	The debuglevel is one of ERROR WARNING NOTICE INFO DEBUG
-      </p></div><div class="refsect2"><a name="idp55102480"></a><h3>getpid</h3><p>
+      </p></div><div class="refsect2"><a name="idp54711696"></a><h3>getpid</h3><p>
 	This command will return the process id of the ctdb daemon.
-      </p></div><div class="refsect2"><a name="idp55103712"></a><h3>disable</h3><p>
+      </p></div><div class="refsect2"><a name="idp54712928"></a><h3>disable</h3><p>
 	This command is used to administratively disable a node in the cluster.
 	A disabled node will still participate in the cluster and host
 	clustered TDB records but its public ip address has been taken over by
 	a different node and it no longer hosts any services.
-      </p></div><div class="refsect2"><a name="idp55105152"></a><h3>enable</h3><p>
+      </p></div><div class="refsect2"><a name="idp54714368"></a><h3>enable</h3><p>
 	Re-enable a node that has been administratively disabled.
-      </p></div><div class="refsect2"><a name="idp55106384"></a><h3>stop</h3><p>
+      </p></div><div class="refsect2"><a name="idp54715600"></a><h3>stop</h3><p>
 	This command is used to administratively STOP a node in the cluster.
 	A STOPPED node is connected to the cluster but will not host any
 	public ip addresse, nor does it participate in the VNNMAP.
 	The difference between a DISABLED node and a STOPPED node is that
 	a STOPPED node does not host any parts of the database which means
 	that a recovery is required to stop/continue nodes.
-      </p></div><div class="refsect2"><a name="idp55107936"></a><h3>continue</h3><p>
+      </p></div><div class="refsect2"><a name="idp54717152"></a><h3>continue</h3><p>
 	Re-start a node that has been administratively stopped.
-      </p></div><div class="refsect2"><a name="idp55109168"></a><h3>addip <em class="parameter"><code>IPADDR</code></em>/<em class="parameter"><code>mask</code></em> <em class="parameter"><code>IFACE</code></em></h3><p>
+      </p></div><div class="refsect2"><a name="idp54718384"></a><h3>addip <em class="parameter"><code>IPADDR</code></em>/<em class="parameter"><code>mask</code></em> <em class="parameter"><code>IFACE</code></em></h3><p>
 	This command is used to add a new public ip to a node
 	during runtime.  It should be followed by a <span class="command"><strong>ctdb
 	ipreallocate</strong></span>.  This allows public addresses to be
@@ -533,7 +533,7 @@
 	changes will be lost next time ctdb is restarted and the public
 	addresses file is re-read.  If you want this change to be
 	permanent you must also update the public addresses file manually.
-      </p></div><div class="refsect2"><a name="idp55113584"></a><h3>delip <em class="parameter"><code>IPADDR</code></em></h3><p>
+      </p></div><div class="refsect2"><a name="idp54722800"></a><h3>delip <em class="parameter"><code>IPADDR</code></em></h3><p>
 	This command flags IPADDR for deletion from a node at runtime.
 	It should be followed by a <span class="command"><strong>ctdb
 	ipreallocate</strong></span>.  If IPADDR is currently hosted by the
@@ -546,7 +546,7 @@
 	public addresses file is re-read.  If you want this change to
 	be permanent you must also update the public addresses file
 	manually.
-      </p></div><div class="refsect2"><a name="idp55116848"></a><h3>moveip <em class="parameter"><code>IPADDR</code></em> <em class="parameter"><code>PNN</code></em></h3><p>
+      </p></div><div class="refsect2"><a name="idp54726064"></a><h3>moveip <em class="parameter"><code>IPADDR</code></em> <em class="parameter"><code>PNN</code></em></h3><p>
 	This command can be used to manually fail a public ip address to a
 	specific node.
       </p><p>
@@ -557,9 +557,9 @@
 	DeterministicIPs = 0
       </p><p>
 	NoIPFailback = 1
-      </p></div><div class="refsect2"><a name="idp55120608"></a><h3>shutdown</h3><p>
+      </p></div><div class="refsect2"><a name="idp54729824"></a><h3>shutdown</h3><p>
 	This command will shutdown a specific CTDB daemon.
-      </p></div><div class="refsect2"><a name="idp55121840"></a><h3>setlmasterrole on|off</h3><p>
+      </p></div><div class="refsect2"><a name="idp54731056"></a><h3>setlmasterrole on|off</h3><p>
 	This command is used ot enable/disable the LMASTER capability for a node at runtime. This capability determines whether or not a node can be used as an LMASTER for records in the database. A node that does not have the LMASTER capability will not show up in the vnnmap.
       </p><p>
 	Nodes will by default have this capability, but it can be stripped off nodes by the setting in the sysconfig file or by using this command.
@@ -567,13 +567,13 @@
 	Once this setting has been enabled/disabled, you need to perform a recovery for it to take effect.
       </p><p>
 	See also "ctdb getcapabilities"
-      </p></div><div class="refsect2"><a name="idp55124720"></a><h3>setrecmasterrole on|off</h3><p>
+      </p></div><div class="refsect2"><a name="idp54733936"></a><h3>setrecmasterrole on|off</h3><p>
 	This command is used ot enable/disable the RECMASTER capability for a node at runtime. This capability determines whether or not a node can be used as an RECMASTER for the cluster. A node that does not have the RECMASTER capability can not win a recmaster election. A node that already is the recmaster for the cluster when the capability is stripped off the node will remain the recmaster until the next cluster election.
       </p><p>
 	Nodes will by default have this capability, but it can be stripped off nodes by the setting in the sysconfig file or by using this command.
       </p><p>
 	See also "ctdb getcapabilities"
-      </p></div><div class="refsect2"><a name="idp55127248"></a><h3>reloadnodes</h3><p>
+      </p></div><div class="refsect2"><a name="idp54736464"></a><h3>reloadnodes</h3><p>
 	This command is used when adding new nodes, or removing
 	existing nodes from an existing cluster.
       </p><p>
@@ -622,7 +622,7 @@
 	  </p></li><li class="listitem"><p>
 	    Use <span class="command"><strong>ctdb status</strong></span> on all nodes and verify
 	    that the deleted nodes are no longer listed.
-	  </p></li></ol></div></div><div class="refsect2"><a name="idp55147232"></a><h3>
+	  </p></li></ol></div></div><div class="refsect2"><a name="idp54756448"></a><h3>
 	reloadips
 	[<span class="optional"><em class="parameter"><code>PNN-LIST</code></em></span>]
       </h3><p>
@@ -635,7 +635,7 @@
 	Such changes must be made in 2 steps by deleting addresses in
 	question and re-adding then.  Unfortunately this will disrupt
 	connections to the changed addresses.
-      </p></div><div class="refsect2"><a name="idp55150032"></a><h3>getdbmap</h3><p>
+      </p></div><div class="refsect2"><a name="idp54759248"></a><h3>getdbmap</h3><p>
 	This command lists all clustered TDB databases that the CTDB daemon has attached to. Some databases are flagged as PERSISTENT, this means that the database stores data persistently and the data will remain across reboots. One example of such a database is secrets.tdb where information about how the cluster was joined to the domain is stored.
       </p><p>
 	If a PERSISTENT database is not in a healthy state the database is
@@ -649,7 +649,7 @@
 	and (if samba or tdb-utils are installed) "tdbtool check".
       </p><p>
 	Most databases are not persistent and only store the state information that the currently running samba daemons need. These databases are always wiped when ctdb/samba starts and when a node is rebooted.
-      </p><div class="refsect3"><a name="idp55153344"></a><h4>Example</h4><pre class="screen">
+      </p><div class="refsect3"><a name="idp54762560"></a><h4>Example</h4><pre class="screen">
 # ctdb getdbmap
 Number of databases:10
 dbid:0x435d3410 name:notify.tdb path:/usr/local/var/lib/ctdb/notify.tdb.0
@@ -670,7 +670,7 @@
 # ctdb -X getdbmap
 |ID|Name|Path|Persistent|Unhealthy|
 |0x7bbbd26c|passdb.tdb|/usr/local/var/lib/ctdb/persistent/passdb.tdb.0|1|0|
-	</pre></div></div><div class="refsect2"><a name="idp55156096"></a><h3>
+	</pre></div></div><div class="refsect2"><a name="idp54765312"></a><h3>
 	backupdb
 	<em class="parameter"><code>DB</code></em>
 	<em class="parameter"><code>FILE</code></em>
@@ -679,7 +679,7 @@
 	read back using <span class="command"><strong>restoredb</strong></span>.  This is mainly
 	useful for backing up persistent databases such as
 	<code class="filename">secrets.tdb</code> and similar.
-      </p></div><div class="refsect2"><a name="idp55159920"></a><h3>
+      </p></div><div class="refsect2"><a name="idp54769136"></a><h3>
 	restoredb
 	<em class="parameter"><code>FILE</code></em>
 	[<span class="optional"><em class="parameter"><code>DB</code></em></span>]
@@ -689,45 +689,45 @@
 	be restored back into the same database as it was created
 	from. By specifying dbname you can restore the data into a
 	different database.
-      </p></div><div class="refsect2"><a name="idp55162736"></a><h3>setdbreadonly <em class="parameter"><code>DB</code></em></h3><p>
+      </p></div><div class="refsect2"><a name="idp54771952"></a><h3>setdbreadonly <em class="parameter"><code>DB</code></em></h3><p>
 	This command will enable the read-only record support for a
 	database.  This is an experimental feature to improve
 	performance for contended records primarily in locking.tdb and
 	brlock.tdb.  When enabling this feature you must set it on all
 	nodes in the cluster.
-      </p></div><div class="refsect2"><a name="idp55164672"></a><h3>setdbsticky <em class="parameter"><code>DB</code></em></h3><p>
+      </p></div><div class="refsect2"><a name="idp54773888"></a><h3>setdbsticky <em class="parameter"><code>DB</code></em></h3><p>
 	This command will enable the sticky record support for the
 	specified database.  This is an experimental feature to
 	improve performance for contended records primarily in
 	locking.tdb and brlock.tdb.  When enabling this feature you
 	must set it on all nodes in the cluster.
-      </p></div></div><div class="refsect1"><a name="idp55166752"></a><h2>INTERNAL COMMANDS</h2><p>
+      </p></div></div><div class="refsect1"><a name="idp54775968"></a><h2>INTERNAL COMMANDS</h2><p>
       Internal commands are used by CTDB's scripts and are not
       required for managing a CTDB cluster.  Their parameters and
       behaviour are subject to change.
-    </p><div class="refsect2"><a name="idp55167968"></a><h3>gettickles <em class="parameter"><code>IPADDR</code></em></h3><p>
+    </p><div class="refsect2"><a name="idp54777184"></a><h3>gettickles <em class="parameter"><code>IPADDR</code></em></h3><p>
 	Show TCP connections that are registered with CTDB to be
 	"tickled" if there is a failover.
-      </p></div><div class="refsect2"><a name="idp55169728"></a><h3>gratiousarp <em class="parameter"><code>IPADDR</code></em> <em class="parameter"><code>INTERFACE</code></em></h3><p>
-	Send out a gratious ARP for the specified interface through
+      </p></div><div class="refsect2"><a name="idp54778944"></a><h3>gratarp <em class="parameter"><code>IPADDR</code></em> <em class="parameter"><code>INTERFACE</code></em></h3><p>
+	Send out a gratuitous ARP for the specified interface through
 	the specified interface. This command is mainly used by the
 	ctdb eventscripts.
-      </p></div><div class="refsect2"><a name="idp55172160"></a><h3>
+      </p></div><div class="refsect2"><a name="idp54781376"></a><h3>
 	pdelete <em class="parameter"><code>DB</code></em> <em class="parameter"><code>KEY</code></em>
       </h3><p>
 	Delete KEY from DB.
-      </p></div><div class="refsect2"><a name="idp55174560"></a><h3>
+      </p></div><div class="refsect2"><a name="idp54783776"></a><h3>
 	pfetch <em class="parameter"><code>DB</code></em> <em class="parameter"><code>KEY</code></em>
       </h3><p>
 	Print the value associated with KEY in DB.
-      </p></div><div class="refsect2"><a name="idp55176960"></a><h3>
+      </p></div><div class="refsect2"><a name="idp54786176"></a><h3>
 	pstore
 	<em class="parameter"><code>DB</code></em>
 	<em class="parameter"><code>KEY</code></em>
 	<em class="parameter"><code>FILE</code></em>
       </h3><p>
 	Store KEY in DB with contents of FILE as the associated value.
-      </p></div><div class="refsect2"><a name="idp55180064"></a><h3>
+      </p></div><div class="refsect2"><a name="idp54789280"></a><h3>
 	ptrans
 	<em class="parameter"><code>DB</code></em>
 	[<span class="optional"><em class="parameter"><code>FILE</code></em></span>]
@@ -739,7 +739,7 @@
 	The key and value should be separated by spaces or tabs. Each
 	key/value should be a printable string enclosed in
 	double-quotes.
-      </p></div><div class="refsect2"><a name="idp55183328"></a><h3>runstate [setup|first_recovery|startup|running]</h3><p>
+      </p></div><div class="refsect2"><a name="idp54792544"></a><h3>runstate [setup|first_recovery|startup|running]</h3><p>
 	Print the runstate of the specified node.  Runstates are used
 	to serialise important state transitions in CTDB, particularly
 	during startup.
@@ -747,16 +747,16 @@
 	If one or more optional runstate arguments are specified then
 	the node must be in one of these runstates for the command to
 	succeed.
-      </p><div class="refsect3"><a name="idp55185056"></a><h4>Example</h4><pre class="screen">
+      </p><div class="refsect3"><a name="idp54794272"></a><h4>Example</h4><pre class="screen">
 # ctdb runstate
 RUNNING
-	</pre></div></div><div class="refsect2"><a name="idp55186576"></a><h3>setifacelink <em class="parameter"><code>IFACE</code></em> up|down</h3><p>
+	</pre></div></div><div class="refsect2"><a name="idp54795792"></a><h3>setifacelink <em class="parameter"><code>IFACE</code></em> up|down</h3><p>
 	Set the internal state of network interface IFACE.  This is
 	typically used in the <code class="filename">10.interface</code> script
 	in the "monitor" event.
       </p><p>
 	Example: ctdb setifacelink eth0 up
-      </p></div><div class="refsect2"><a name="idp55189456"></a><h3>tickle</h3><p>
+      </p></div><div class="refsect2"><a name="idp54798672"></a><h3>tickle</h3><p>
 	Read a list of TCP connections, one per line, from standard
 	input and send a TCP tickle to the source host for each
 	connection.  A connection is specified as:
@@ -776,12 +776,12 @@
 	TCP connection has been disrupted and that the client will need
 	to reestablish. This greatly speeds up the time it takes for a client
 	to detect and reestablish after an IP failover in the ctdb cluster.
-      </p></div><div class="refsect2"><a name="idp55195776"></a><h3>version</h3><p>
+      </p></div><div class="refsect2"><a name="idp54804992"></a><h3>version</h3><p>
 	Display the CTDB version.
-      </p></div></div><div class="refsect1"><a name="idp55197056"></a><h2>DEBUGGING COMMANDS</h2><p>
+      </p></div></div><div class="refsect1"><a name="idp54806272"></a><h2>DEBUGGING COMMANDS</h2><p>
       These commands are primarily used for CTDB development and testing and
       should not be used for normal administration.
-    </p><div class="refsect2"><a name="idp55198224"></a><h3>OPTIONS</h3><div class="variablelist"><dl class="variablelist"><dt><span class="term">--print-emptyrecords</span></dt><dd><p>
+    </p><div class="refsect2"><a name="idp54807440"></a><h3>OPTIONS</h3><div class="variablelist"><dl class="variablelist"><dt><span class="term">--print-emptyrecords</span></dt><dd><p>
 	    This enables printing of empty records when dumping databases
 	    with the catdb, cattbd and dumpdbbackup commands. Records with
 	    empty data segment are considered deleted by ctdb and cleaned
@@ -799,11 +799,11 @@
 	    This lets catdb and dumpdbbackup print the
 	    record flags for each record. Note that cattdb always
 	    prints the flags.
-	  </p></dd></dl></div></div><div class="refsect2"><a name="idp55207248"></a><h3>process-exists <em class="parameter"><code>PID</code></em></h3><p>
+	  </p></dd></dl></div></div><div class="refsect2"><a name="idp54816464"></a><h3>process-exists <em class="parameter"><code>PID</code></em></h3><p>
 	This command checks if a specific process exists on the CTDB host. This is mainly used by Samba to check if remote instances of samba are still running or not.
-      </p></div><div class="refsect2"><a name="idp55209088"></a><h3>getdbstatus <em class="parameter"><code>DB</code></em></h3><p>
+      </p></div><div class="refsect2"><a name="idp54818304"></a><h3>getdbstatus <em class="parameter"><code>DB</code></em></h3><p>
 	This command displays more details about a database.
-      </p><div class="refsect3"><a name="idp55210688"></a><h4>Example</h4><pre class="screen">
+      </p><div class="refsect3"><a name="idp54819904"></a><h4>Example</h4><pre class="screen">
 # ctdb getdbstatus test.tdb.0
 dbid: 0x122224da
 name: test.tdb
@@ -817,28 +817,28 @@
 path: /usr/local/var/lib/ctdb/persistent/registry.tdb.0
 PERSISTENT: yes
 HEALTH: NO-HEALTHY-NODES - ERROR - Backup of corrupted TDB in '/usr/local/var/lib/ctdb/persistent/registry.tdb.0.corrupted.20091208091949.0Z'
-	</pre></div></div><div class="refsect2"><a name="idp55212656"></a><h3>catdb <em class="parameter"><code>DB</code></em></h3><p>
+	</pre></div></div><div class="refsect2"><a name="idp54821872"></a><h3>catdb <em class="parameter"><code>DB</code></em></h3><p>
 	Print a dump of the clustered TDB database DB.
-      </p></div><div class="refsect2"><a name="idp55214304"></a><h3>cattdb <em class="parameter"><code>DB</code></em></h3><p>
+      </p></div><div class="refsect2"><a name="idp54823520"></a><h3>cattdb <em class="parameter"><code>DB</code></em></h3><p>
 	Print a dump of the contents of the local TDB database DB.
-      </p></div><div class="refsect2"><a name="idp55216032"></a><h3>dumpdbbackup <em class="parameter"><code>FILE</code></em></h3><p>
+      </p></div><div class="refsect2"><a name="idp54825248"></a><h3>dumpdbbackup <em class="parameter"><code>FILE</code></em></h3><p>
 	Print a dump of the contents from database backup FILE,
 	similar to <span class="command"><strong>catdb</strong></span>.
-      </p></div><div class="refsect2"><a name="idp55218384"></a><h3>wipedb <em class="parameter"><code>DB</code></em></h3><p>
+      </p></div><div class="refsect2"><a name="idp54827600"></a><h3>wipedb <em class="parameter"><code>DB</code></em></h3><p>
 	Remove all contents of database DB.
-      </p></div><div class="refsect2"><a name="idp55220032"></a><h3>recover</h3><p>
+      </p></div><div class="refsect2"><a name="idp54829248"></a><h3>recover</h3><p>
 	This command will trigger the recovery daemon to do a cluster
 	recovery.
-      </p></div><div class="refsect2"><a name="idp55221280"></a><h3>ipreallocate, sync</h3><p>
+      </p></div><div class="refsect2"><a name="idp54830496"></a><h3>ipreallocate, sync</h3><p>
 	This command will force the recovery master to perform a full ip reallocation process and redistribute all ip addresses. This is useful to "reset" the allocations back to its default state if they have been changed using the "moveip" command. While a "recover" will also perform this reallocation, a recovery is much more hevyweight since it will also rebuild all the databases.
-      </p></div><div class="refsect2"><a name="idp55222832"></a><h3>getmonmode</h3><p>
+      </p></div><div class="refsect2"><a name="idp54832048"></a><h3>getmonmode</h3><p>
 	This command prints the monitoring mode of a node.  This
 	indicates when CTDB is monitoring services on the node. The
 	monitoring mode is either ENABLED or DISABLED.
-      </p></div><div class="refsect2"><a name="idp55224176"></a><h3>attach <em class="parameter"><code>DBNAME</code></em> [persistent]</h3><p>
+      </p></div><div class="refsect2"><a name="idp54833392"></a><h3>attach <em class="parameter"><code>DBNAME</code></em> [persistent]</h3><p>
 	Create a new CTDB database called DBNAME and attach to it on
 	all nodes.
-      </p></div><div class="refsect2"><a name="idp55226048"></a><h3>detach <em class="parameter"><code>DB-LIST</code></em></h3><p>
+      </p></div><div class="refsect2"><a name="idp54835264"></a><h3>detach <em class="parameter"><code>DB-LIST</code></em></h3><p>
 	Detach specified non-persistent database(s) from the cluster. This
 	command will disconnect specified database(s) on all nodes in
 	the cluster.  This command should only be used when none of the
@@ -846,16 +846,16 @@
       </p><p>
 	All nodes should be active and tunable AllowClientDBAccess should
 	be disabled on all nodes before detaching databases.
-      </p></div><div class="refsect2"><a name="idp55228480"></a><h3>dumpmemory</h3><p>
+      </p></div><div class="refsect2"><a name="idp54837696"></a><h3>dumpmemory</h3><p>
 	This is a debugging command. This command will make the ctdb
 	daemon to write a fill memory allocation map to standard output.
-      </p></div><div class="refsect2"><a name="idp55229776"></a><h3>rddumpmemory</h3><p>
+      </p></div><div class="refsect2"><a name="idp54838992"></a><h3>rddumpmemory</h3><p>
 	This is a debugging command. This command will dump the talloc memory
 	allocation tree for the recovery daemon to standard output.
-      </p></div><div class="refsect2"><a name="idp55231088"></a><h3>eventscript <em class="parameter"><code>ARGUMENTS</code></em></h3><p>
+      </p></div><div class="refsect2"><a name="idp54840304"></a><h3>eventscript <em class="parameter"><code>ARGUMENTS</code></em></h3><p>
 	This is a debugging command. This command can be used to manually
 	invoke and run the eventscritps with arbitrary arguments.
-      </p></div><div class="refsect2"><a name="idp55232880"></a><h3>ban <em class="parameter"><code>BANTIME</code></em></h3><p>
+      </p></div><div class="refsect2"><a name="idp54842096"></a><h3>ban <em class="parameter"><code>BANTIME</code></em></h3><p>
 	Administratively ban a node for BANTIME seconds.  The node
 	will be unbanned after BANTIME seconds have elapsed.
       </p><p>
@@ -869,21 +869,21 @@
       </p><p>
 	To administratively exclude a node from a cluster use the
 	<span class="command"><strong>stop</strong></span> command.
-      </p></div><div class="refsect2"><a name="idp55236864"></a><h3>unban</h3><p>
+      </p></div><div class="refsect2"><a name="idp54846080"></a><h3>unban</h3><p>
 	This command is used to unban a node that has either been
 	administratively banned using the ban command or has been
 	automatically banned.
-      </p></div><div class="refsect2"><a name="idp55238176"></a><h3>check_srvids <em class="parameter"><code>SRVID</code></em> ...</h3><p>
+      </p></div><div class="refsect2"><a name="idp54847392"></a><h3>check_srvids <em class="parameter"><code>SRVID</code></em> ...</h3><p>
 	This command checks whether a set of srvid message ports are
 	registered on the node or not. The command takes a list of
 	values to check.
-      </p><div class="refsect3"><a name="idp55239984"></a><h4>Example</h4><pre class="screen">
+      </p><div class="refsect3"><a name="idp54849200"></a><h4>Example</h4><pre class="screen">
 # ctdb check_srvids 1 2 3 14765
 Server id 0:1 does not exist
 Server id 0:2 does not exist
 Server id 0:3 does not exist
 Server id 0:14765 exists
-	</pre></div></div></div><div class="refsect1"><a name="idp55242368"></a><h2>SEE ALSO</h2><p>
+	</pre></div></div></div><div class="refsect1"><a name="idp54851584"></a><h2>SEE ALSO</h2><p>
       <span class="citerefentry"><span class="refentrytitle">ctdbd</span>(1)</span>,
 
       <span class="citerefentry"><span class="refentrytitle">onnode</span>(1)</span>,
diff -Nru samba-4.5.4+dfsg/ctdb/doc/ctdb.1.xml samba-4.5.5+dfsg/ctdb/doc/ctdb.1.xml
--- samba-4.5.4+dfsg/ctdb/doc/ctdb.1.xml	2016-09-13 10:21:35.000000000 +0200
+++ samba-4.5.5+dfsg/ctdb/doc/ctdb.1.xml	2017-01-30 10:56:26.000000000 +0100
@@ -1353,9 +1353,9 @@
     </refsect2>
 
     <refsect2>
-      <title>gratiousarp <parameter>IPADDR</parameter> <parameter>INTERFACE</parameter></title>
+      <title>gratarp <parameter>IPADDR</parameter> <parameter>INTERFACE</parameter></title>
       <para>
-	Send out a gratious ARP for the specified interface through
+	Send out a gratuitous ARP for the specified interface through
 	the specified interface. This command is mainly used by the
 	ctdb eventscripts.
       </para>
diff -Nru samba-4.5.4+dfsg/ctdb/server/ctdb_lock.c samba-4.5.5+dfsg/ctdb/server/ctdb_lock.c
--- samba-4.5.4+dfsg/ctdb/server/ctdb_lock.c	2016-08-11 09:51:04.000000000 +0200
+++ samba-4.5.5+dfsg/ctdb/server/ctdb_lock.c	2017-01-30 10:56:26.000000000 +0100
@@ -192,7 +192,7 @@
 		lock_ctx->request->lctx = NULL;
 	}
 	if (lock_ctx->child > 0) {
-		ctdb_kill(lock_ctx->ctdb, lock_ctx->child, SIGKILL);
+		ctdb_kill(lock_ctx->ctdb, lock_ctx->child, SIGTERM);
 		if (lock_ctx->type == LOCK_RECORD) {
 			DLIST_REMOVE(lock_ctx->ctdb_db->lock_current, lock_ctx);
 		} else {
@@ -672,7 +672,7 @@
 					    ctdb_lock_timeout_handler,
 					    (void *)lock_ctx);
 	if (lock_ctx->ttimer == NULL) {
-		ctdb_kill(ctdb, lock_ctx->child, SIGKILL);
+		ctdb_kill(ctdb, lock_ctx->child, SIGTERM);
 		lock_ctx->child = -1;
 		close(lock_ctx->fd[0]);
 		return;
@@ -687,7 +687,7 @@
 				      (void *)lock_ctx);
 	if (lock_ctx->tfd == NULL) {
 		TALLOC_FREE(lock_ctx->ttimer);
-		ctdb_kill(ctdb, lock_ctx->child, SIGKILL);
+		ctdb_kill(ctdb, lock_ctx->child, SIGTERM);
 		lock_ctx->child = -1;
 		close(lock_ctx->fd[0]);
 		return;
diff -Nru samba-4.5.4+dfsg/ctdb/server/ctdb_lock_helper.c samba-4.5.5+dfsg/ctdb/server/ctdb_lock_helper.c
--- samba-4.5.4+dfsg/ctdb/server/ctdb_lock_helper.c	2016-12-05 09:18:44.000000000 +0100
+++ samba-4.5.5+dfsg/ctdb/server/ctdb_lock_helper.c	2017-01-30 10:56:26.000000000 +0100
@@ -20,8 +20,12 @@
 #include "replace.h"
 #include "system/filesys.h"
 #include "system/network.h"
+#include "system/wait.h"
 
 #include <talloc.h>
+#include <tevent.h>
+
+#include "lib/util/tevent_unix.h"
 
 #include "ctdb_private.h"
 
@@ -30,6 +34,11 @@
 static char *progname = NULL;
 static bool realtime = true;
 
+struct lock_state {
+	struct tdb_context *tdb;
+	TDB_DATA key;
+};
+
 static void set_priority(void)
 {
 	const char *ptr;
@@ -72,7 +81,7 @@
 	fprintf(stderr, "\n");
 	fprintf(stderr, "Usage: %s <log-fd> <ctdbd-pid> <output-fd> RECORD <db-path> <db-flags> <db-key>\n",
 		progname);
-	fprintf(stderr, "       %s <log-fd> <ctdbd-pid> <output-fd> DB <db1-path> <db1-flags> [<db2-path> <db2-flags>...]\n",
+	fprintf(stderr, "       %s <log-fd> <ctdbd-pid> <output-fd> DB <db1-path> <db1-flags>\n",
 		progname);
 }
 
@@ -93,10 +102,9 @@
 	return buffer;
 }
 
-static int lock_record(const char *dbpath, const char *dbflags, const char *dbkey)
+static int lock_record(const char *dbpath, const char *dbflags,
+		       const char *dbkey, struct lock_state *state)
 {
-	TDB_DATA key;
-	struct tdb_context *tdb;
 	int tdb_flags;
 
 	/* No error checking since CTDB always passes sane values */
@@ -104,23 +112,25 @@
 
 	/* Convert hex key to key */
 	if (strcmp(dbkey, "NULL") == 0) {
-		key.dptr = NULL;
-		key.dsize = 0;
+		state->key.dptr = NULL;
+		state->key.dsize = 0;
 	} else {
-		key.dptr = hex_decode_talloc(NULL, dbkey, &key.dsize);
+		state->key.dptr = hex_decode_talloc(NULL, dbkey,
+						    &state->key.dsize);
 	}
 
-	tdb = tdb_open(dbpath, 0, tdb_flags, O_RDWR, 0600);
-	if (tdb == NULL) {
-		fprintf(stderr, "%s: Error opening database %s\n", progname, dbpath);
+	state->tdb = tdb_open(dbpath, 0, tdb_flags, O_RDWR, 0600);
+	if (state->tdb == NULL) {
+		fprintf(stderr, "%s: Error opening database %s\n",
+			progname, dbpath);
 		return 1;
 	}
 
 	set_priority();
 
-	if (tdb_chainlock(tdb, key) < 0) {
+	if (tdb_chainlock(state->tdb, state->key) < 0) {
 		fprintf(stderr, "%s: Error getting record lock (%s)\n",
-			progname, tdb_errorstr(tdb));
+			progname, tdb_errorstr(state->tdb));
 		return 1;
 	}
 
@@ -130,26 +140,26 @@
 
 }
 
-
-static int lock_db(const char *dbpath, const char *dbflags)
+static int lock_db(const char *dbpath, const char *dbflags,
+		   struct lock_state *state)
 {
-	struct tdb_context *tdb;
 	int tdb_flags;
 
 	/* No error checking since CTDB always passes sane values */
 	tdb_flags = strtol(dbflags, NULL, 0);
 
-	tdb = tdb_open(dbpath, 0, tdb_flags, O_RDWR, 0600);
-	if (tdb == NULL) {
-		fprintf(stderr, "%s: Error opening database %s\n", progname, dbpath);
+	state->tdb = tdb_open(dbpath, 0, tdb_flags, O_RDWR, 0600);
+	if (state->tdb == NULL) {
+		fprintf(stderr, "%s: Error opening database %s\n",
+			progname, dbpath);
 		return 1;
 	}
 
 	set_priority();
 
-	if (tdb_lockall(tdb) < 0) {
+	if (tdb_lockall(state->tdb) < 0) {
 		fprintf(stderr, "%s: Error getting db lock (%s)\n",
-			progname, tdb_errorstr(tdb));
+			progname, tdb_errorstr(state->tdb));
 		return 1;
 	}
 
@@ -158,13 +168,114 @@
 	return 0;
 }
 
+struct wait_for_parent_state {
+	struct tevent_context *ev;
+	pid_t ppid;
+};
+
+static void wait_for_parent_check(struct tevent_req *subreq);
+
+static struct tevent_req *wait_for_parent_send(TALLOC_CTX *mem_ctx,
+					       struct tevent_context *ev,
+					       pid_t ppid)
+{
+	struct tevent_req *req, *subreq;
+	struct wait_for_parent_state *state;
+
+	req = tevent_req_create(mem_ctx, &state, struct wait_for_parent_state);
+	if (req == NULL) {
+		return NULL;
+	}
+
+	state->ev = ev;
+	state->ppid = ppid;
+
+	if (ppid == 1) {
+		tevent_req_done(req);
+		return tevent_req_post(req, ev);
+	}
+
+	subreq = tevent_wakeup_send(state, ev,
+				    tevent_timeval_current_ofs(5,0));
+	if (tevent_req_nomem(subreq, req)) {
+		return tevent_req_post(req, ev);
+	}
+	tevent_req_set_callback(subreq, wait_for_parent_check, req);
+
+	return req;
+}
+
+static void wait_for_parent_check(struct tevent_req *subreq)
+{
+	struct tevent_req *req = tevent_req_callback_data(
+		subreq, struct tevent_req);
+	struct wait_for_parent_state *state = tevent_req_data(
+		req, struct wait_for_parent_state);
+	bool status;
+
+	status = tevent_wakeup_recv(subreq);
+	TALLOC_FREE(subreq);
+	if (! status) {
+		/* Ignore error */
+		fprintf(stderr, "locking: tevent_wakeup_recv() failed\n");
+	}
+
+	if (kill(state->ppid, 0) == -1 && errno == ESRCH) {
+		tevent_req_done(req);
+		return;
+	}
+
+	subreq = tevent_wakeup_send(state, state->ev,
+				    tevent_timeval_current_ofs(5,0));
+	if (tevent_req_nomem(subreq, req)) {
+		return;
+	}
+	tevent_req_set_callback(subreq, wait_for_parent_check, req);
+}
+
+static bool wait_for_parent_recv(struct tevent_req *req)
+{
+	if (tevent_req_is_unix_error(req, NULL)) {
+		return false;
+	}
+
+	return true;
+}
+
+static void cleanup(struct lock_state *state)
+{
+	if (state->tdb != NULL) {
+		if (state->key.dsize == 0) {
+			tdb_unlockall(state->tdb);
+		} else {
+			tdb_chainunlock(state->tdb, state->key);
+		}
+		tdb_close(state->tdb);
+	}
+}
+
+static void signal_handler(struct tevent_context *ev,
+			   struct tevent_signal *se,
+			   int signum, int count, void *siginfo,
+			   void *private_data)
+{
+	struct lock_state *state = (struct lock_state *)private_data;
+
+	cleanup(state);
+	exit(0);
+}
 
 int main(int argc, char *argv[])
 {
+	struct tevent_context *ev;
+	struct tevent_signal *se;
+	struct tevent_req *req;
+	struct lock_state state = { 0 };
 	int write_fd, log_fd;
 	char result = 0;
 	int ppid;
 	const char *lock_type;
+	bool status;
 
 	reset_scheduler();
 
@@ -186,6 +297,20 @@
 	write_fd = atoi(argv[3]);
 	lock_type = argv[4];
 
+	ev = tevent_context_init(NULL);
+	if (ev == NULL) {
+		fprintf(stderr, "locking: tevent_context_init() failed\n");
+		exit(1);
+	}
+
+	se = tevent_add_signal(ev, ev, SIGTERM, 0,
+			       signal_handler, &state);
+	if (se == NULL) {
+		fprintf(stderr, "locking: tevent_add_signal() failed\n");
+		talloc_free(ev);
+		exit(1);
+	}
+
 	if (strcmp(lock_type, "RECORD") == 0) {
 		if (argc != 8) {
 			fprintf(stderr, "%s: Invalid number of arguments (%d)\n",
@@ -193,20 +318,17 @@
 			usage();
 			exit(1);
 		}
-		result = lock_record(argv[5], argv[6], argv[7]);
+		result = lock_record(argv[5], argv[6], argv[7], &state);
 
 	} else if (strcmp(lock_type, "DB") == 0) {
-		int n;
-
-		/* If there are no databases specified, no need for lock */
-		if (argc > 5) {
-			for (n=5; n+1<argc; n+=2) {
-				result = lock_db(argv[n], argv[n+1]);
-				if (result != 0) {
-					break;
-				}
-			}
+		if (argc != 7) {
+			fprintf(stderr,
+				"locking: Invalid number of arguments (%d)\n",
+				argc);
+			usage();
+			exit(1);
 		}
+		result = lock_db(argv[5], argv[6], &state);
 
 	} else {
 		fprintf(stderr, "%s: Invalid lock-type '%s'\n", progname, lock_type);
@@ -216,6 +338,21 @@
 
 	send_result(write_fd, result);
 
-	ctdb_wait_for_process_to_exit(ppid);
+	req = wait_for_parent_send(ev, ev, ppid);
+	if (req == NULL) {
+		fprintf(stderr, "locking: wait_for_parent_send() failed\n");
+		cleanup(&state);
+		exit(1);
+	}
+
+	tevent_req_poll(req, ev);
+
+	status = wait_for_parent_recv(req);
+	if (! status) {
+		fprintf(stderr, "locking: wait_for_parent_recv() failed\n");
+	}
+
+	talloc_free(ev);
+	cleanup(&state);
 	return 0;
 }
diff -Nru samba-4.5.4+dfsg/ctdb/tests/eventscripts/13.per_ip_routing.024.sh samba-4.5.5+dfsg/ctdb/tests/eventscripts/13.per_ip_routing.024.sh
--- samba-4.5.4+dfsg/ctdb/tests/eventscripts/13.per_ip_routing.024.sh	1970-01-01 01:00:00.000000000 +0100
+++ samba-4.5.5+dfsg/ctdb/tests/eventscripts/13.per_ip_routing.024.sh	2017-01-30 10:56:26.000000000 +0100
@@ -0,0 +1,31 @@
+#!/bin/sh
+
+. "${TEST_SCRIPTS_DIR}/unit.sh"
+
+define_test "Single IP, restores original rt_tables"
+
+setup_ctdb
+setup_ctdb_policy_routing
+
+create_policy_routing_config 1 default
+
+_rt_tables="$CTDB_SYS_ETCDIR/iproute2/rt_tables"
+_rt_orig=$(mktemp --tmpdir="$EVENTSCRIPTS_TESTS_VAR_DIR")
+cp "$_rt_tables" "$_rt_orig"
+
+ctdb_get_1_public_address | {
+	read dev ip bits
+
+	ok_null
+	simple_test_event "takeip" $dev $ip $bits
+
+	ok <<EOF
+Removing ip rule for public address ${ip} for routing table ctdb.${ip}
+EOF
+	simple_test_event "shutdown"
+}
+
+ok_null
+simple_test_command diff -u "$_rt_orig" "$_rt_tables"
+
+check_routes 0
diff -Nru samba-4.5.4+dfsg/ctdb/tests/eventscripts/stubs/ctdb samba-4.5.5+dfsg/ctdb/tests/eventscripts/stubs/ctdb
--- samba-4.5.4+dfsg/ctdb/tests/eventscripts/stubs/ctdb	2016-08-11 09:51:04.000000000 +0200
+++ samba-4.5.5+dfsg/ctdb/tests/eventscripts/stubs/ctdb	2017-01-30 10:56:26.000000000 +0100
@@ -445,7 +445,7 @@
 	    echo "|${2:-monitor}|${_b}|${_code}|${_status}|${_d1}|${_d2}|${_err_out}|"
 	done
 	;;
-    gratiousarp) : ;;  # Do nothing for now
+    gratarp) : ;;  # Do nothing for now
     ip)            ctdb_ip "$@" ;;
     pnn|xpnn)      ctdb_pnn ;;
     enable)        ctdb_enable "$@";;
diff -Nru samba-4.5.4+dfsg/ctdb/tests/src/test_mutex_raw.c samba-4.5.5+dfsg/ctdb/tests/src/test_mutex_raw.c
--- samba-4.5.4+dfsg/ctdb/tests/src/test_mutex_raw.c	1970-01-01 01:00:00.000000000 +0100
+++ samba-4.5.5+dfsg/ctdb/tests/src/test_mutex_raw.c	2017-01-30 10:56:26.000000000 +0100
@@ -0,0 +1,261 @@
+/*
+   Robust mutex test
+
+   Copyright (C) Amitay Isaacs  2016
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program; if not, see <http://www.gnu.org/licenses/>.
+*/
+
+/*
+ * Run this test as follows:
+ *
+ * 1. Running all processes at normal priority
+ *
+ *  $ while true ; do ./bin/test_mutex_raw /tmp/foo 10 0 ; done
+ *
+ * 2. Running all processes at real-time priority
+ *
+ *  # while true ; do ./bin/test_mutex_raw /tmp/foo 10 1 ; done
+ *
+ * The test will block after few iterations.  At this time none of the 
+ * child processes is holding the mutex.
+ *
+ * To check which process is holding a lock:
+ *
+ *  $ ./bin/test_mutex_raw /tmp/foo debug
+ *
+ *  If no pid is printed, then no process is holding the mutex.
+ */
+
+#include <stdio.h>
+#include <unistd.h>
+#include <inttypes.h>
+#include <sys/types.h>
+#include <sys/fcntl.h>
+#include <stdlib.h>
+#include <string.h>
+#include <sys/wait.h>
+#include <sched.h>
+#include <sys/mman.h>
+#include <pthread.h>
+#include <errno.h>
+#include <stdbool.h>
+
+int pthread_mutex_consistent_np(pthread_mutex_t *);
+
+static void set_realtime(void)
+{
+	struct sched_param p;
+	int ret;
+
+	p.sched_priority = 1;
+
+	ret = sched_setscheduler(0, SCHED_FIFO, &p);
+	if (ret == -1) {
+		fprintf(stderr, "Failed to set scheduler to SCHED_FIFO\n");
+	}
+}
+
+static void high_priority(void)
+{
+	int ret;
+
+	ret = nice(-20);
+	if (ret == -1) {
+		fprintf(stderr, "Failed to set high priority\n");
+	}
+}
+
+static void run_child(const char *filename)
+{
+	pthread_mutex_t *mutex;
+	void *addr;
+	int ret, fd;
+
+	fd = open(filename, O_RDWR, 0600);
+	if (fd == -1) {
+		exit(1);
+	}
+
+	addr = mmap(NULL, sizeof(pthread_mutex_t), PROT_READ|PROT_WRITE,
+		    MAP_SHARED|MAP_FILE, fd, 0);
+	if (addr == NULL) {
+		exit(2);
+	}
+
+	mutex = (pthread_mutex_t *)addr;
+
+again:
+	ret = pthread_mutex_lock(mutex);
+	if (ret == EOWNERDEAD) {
+		ret = pthread_mutex_consistent_np(mutex);
+	} else if (ret == EAGAIN) {
+		goto again;
+	}
+	if (ret != 0) {
+		fprintf(stderr, "pid %u lock failed, ret=%d\n", getpid(), ret);
+		exit(3);
+	}
+
+	fprintf(stderr, "pid %u locked\n", getpid());
+	kill(getpid(), SIGKILL);
+}
+
+#define PRIO_NORMAL	0
+#define PRIO_REALTIME	1
+#define PRIO_NICE_20	2
+
+int main(int argc, const char **argv)
+{
+	pthread_mutexattr_t ma;
+	pthread_mutex_t *mutex;
+	int fd, ret, i;
+	pid_t pid;
+	void *addr;
+	int num_children;
+	int priority = PRIO_NORMAL;
+
+	if (argc < 3 || argc > 4) {
+		fprintf(stderr, "Usage: %s <file> <n> [0|1|2]\n", argv[0]);
+		fprintf(stderr, "       %s <file> debug\n", argv[0]);
+		exit(1);
+	}
+
+	if (argc == 4) {
+		priority = atoi(argv[3]);
+	}
+
+	if (priority == PRIO_REALTIME) {
+		set_realtime();
+	} else if (priority == PRIO_NICE_20) {
+		high_priority();
+	}
+
+	fd = open(argv[1], O_CREAT|O_RDWR, 0600);
+	if (fd == -1) {
+		fprintf(stderr, "open failed\n");
+		exit(1);
+	}
+
+	ret = lseek(fd, 0, SEEK_SET);
+	if (ret != 0) {
+		fprintf(stderr, "lseek failed\n");
+		exit(1);
+	}
+
+	ret = ftruncate(fd, sizeof(pthread_mutex_t));
+	if (ret != 0) {
+		fprintf(stderr, "ftruncate failed\n");
+		exit(1);
+	}
+
+	addr = mmap(NULL, sizeof(pthread_mutex_t), PROT_READ|PROT_WRITE,
+		    MAP_SHARED|MAP_FILE, fd, 0);
+	if (addr == NULL) {
+		fprintf(stderr, "mmap failed\n");
+		exit(1);
+	}
+
+	mutex = (pthread_mutex_t *)addr;
+
+	if (strcmp(argv[2], "debug") == 0) {
+		ret = pthread_mutex_trylock(mutex);
+		if (ret == EOWNERDEAD) {
+			ret = pthread_mutex_consistent_np(mutex);
+			if (ret == 0) {
+				pthread_mutex_unlock(mutex);
+			}
+		} else if (ret == EBUSY) {
+			printf("pid=%u\n", mutex->__data.__owner);
+		} else if (ret == 0) {
+			pthread_mutex_unlock(mutex);
+		}
+		exit(0);
+	}
+
+	ret = pthread_mutexattr_init(&ma);
+	if (ret != 0) {
+		fprintf(stderr, "pthread_mutexattr_init failed\n");
+		exit(1);
+	}
+
+	ret = pthread_mutexattr_settype(&ma, PTHREAD_MUTEX_ERRORCHECK);
+	if (ret != 0) {
+		fprintf(stderr, "pthread_mutexattr_settype failed\n");
+		exit(1);
+	}
+
+	ret = pthread_mutexattr_setpshared(&ma, PTHREAD_PROCESS_SHARED);
+	if (ret != 0) {
+		fprintf(stderr, "pthread_mutexattr_setpshared failed\n");
+		exit(1);
+	}
+
+	ret = pthread_mutexattr_setrobust(&ma, PTHREAD_MUTEX_ROBUST);
+	if (ret != 0) {
+		fprintf(stderr, "pthread_mutexattr_setrobust failed\n");
+		exit(1);
+	}
+
+	ret = pthread_mutex_init(mutex, &ma);
+	if (ret != 0) {
+		fprintf(stderr, "pthread_mutex_init failed\n");
+		exit(1);
+	}
+
+	ret = pthread_mutex_lock(mutex);
+	if (ret != 0) {
+		fprintf(stderr, "pthread_mutex_lock failed\n");
+		exit(1);
+	}
+
+	setpgid(0, 0);
+
+	fprintf(stderr, "Creating children\n");
+	num_children = atoi(argv[2]);
+
+	for (i=0; i<num_children; i++) {
+		pid = fork();
+		if (pid < 0) {
+			fprintf(stderr, "fork() failed\n");
+			exit(1);
+		}
+		if (pid == 0) {
+			close(fd);
+			run_child(argv[1]);
+			exit(1);
+		}
+	}
+
+	fprintf(stderr, "Waiting for children\n");
+
+	ret = pthread_mutex_unlock(mutex);
+	if (ret != 0) {
+		fprintf(stderr, "pthread_mutex_unlock failed\n");
+		exit(1);
+	}
+
+	for (i=0; i<num_children; i++) {
+		int status;
+
+		pid = waitpid(-1, &status, 0);
+		if (pid <= 0) {
+			fprintf(stderr, "waitpid() failed\n");
+		}
+	}
+
+	close(fd);
+	unlink(argv[1]);
+	exit(0);
+}
diff -Nru samba-4.5.4+dfsg/ctdb/wscript samba-4.5.5+dfsg/ctdb/wscript
--- samba-4.5.4+dfsg/ctdb/wscript	2017-01-17 20:55:44.000000000 +0100
+++ samba-4.5.5+dfsg/ctdb/wscript	2017-01-30 10:56:26.000000000 +0100
@@ -444,7 +444,8 @@
 
     bld.SAMBA_BINARY('ctdb_lock_helper',
                      source='server/ctdb_lock_helper.c',
-                     deps='samba-util ctdb-system talloc tdb',
+                     deps='''samba-util sys_rw ctdb-system tevent-util
+                             talloc tevent tdb''',
                      includes='include',
                      install_path='${CTDB_HELPER_BINDIR}')
 
@@ -749,6 +750,11 @@
                               ib_deps,
                          install_path='${CTDB_TEST_LIBEXECDIR}')
 
+    bld.SAMBA_BINARY('test_mutex_raw',
+                     source='tests/src/test_mutex_raw.c',
+                     deps='pthread',
+                     install_path='${CTDB_TEST_LIBEXECDIR}')
+
     test_subdirs = [
         'complex',
         'cunit',
diff -Nru samba-4.5.4+dfsg/debian/changelog samba-4.5.5+dfsg/debian/changelog
--- samba-4.5.4+dfsg/debian/changelog	2017-01-25 21:25:40.000000000 +0100
+++ samba-4.5.5+dfsg/debian/changelog	2017-03-05 23:21:09.000000000 +0100
@@ -1,3 +1,17 @@
+samba (2:4.5.5+dfsg-1) unstable; urgency=medium
+
+  * New upstream version
+    - Revert rewrite of the vfs_fruit module (Closes: #856561)
+  * Fix 'winbindd privileged socket directory' (Closes: #754339):
+    - Fix path from /var/run/samba/winbindd_privileged/ to
+      /var/lib/samba/winbindd_privileged/.
+    - Move mkdir+chgrp+chmod to postinst (to handle systemd also).
+    - Thanks to Jim Barber for the report.
+  * logrotate: Use delaycompress on all logs (Closes: #702201)
+    - Thanks to Matthew Gabeler-Lee for the proposed fix.
+
+ -- Mathieu Parent <sathieu at debian.org>  Sun, 05 Mar 2017 23:21:09 +0100
+
 samba (2:4.5.4+dfsg-1) unstable; urgency=medium
 
   [ Mathieu Parent ]
diff -Nru samba-4.5.4+dfsg/debian/ctdb.logrotate samba-4.5.5+dfsg/debian/ctdb.logrotate
--- samba-4.5.4+dfsg/debian/ctdb.logrotate	2017-01-25 08:35:53.000000000 +0100
+++ samba-4.5.5+dfsg/debian/ctdb.logrotate	2017-03-05 22:38:56.000000000 +0100
@@ -4,5 +4,6 @@
 	rotate 7
 	copytruncate
 	compress
+	delaycompress
 	notifempty
 }
diff -Nru samba-4.5.4+dfsg/debian/samba.logrotate samba-4.5.5+dfsg/debian/samba.logrotate
--- samba-4.5.4+dfsg/debian/samba.logrotate	2017-01-25 08:35:55.000000000 +0100
+++ samba-4.5.5+dfsg/debian/samba.logrotate	2017-03-05 23:09:55.000000000 +0100
@@ -6,6 +6,7 @@
 		[ ! -f /var/run/samba/smbd.pid ] || /etc/init.d/smbd reload > /dev/null
 	endscript
 	compress
+	delaycompress
 	notifempty
 }
 
@@ -17,5 +18,6 @@
 		[ ! -f /var/run/samba/nmbd.pid ] || kill -HUP `cat /var/run/samba/nmbd.pid`
 	endscript
 	compress
+	delaycompress
 	notifempty
 }
diff -Nru samba-4.5.4+dfsg/debian/winbind.init samba-4.5.5+dfsg/debian/winbind.init
--- samba-4.5.4+dfsg/debian/winbind.init	2017-01-25 08:35:55.000000000 +0100
+++ samba-4.5.5+dfsg/debian/winbind.init	2017-03-05 22:37:17.000000000 +0100
@@ -40,9 +40,6 @@
 		fi
 		log_daemon_msg "Starting the Winbind daemon" "winbind"
 
-		mkdir -p /var/run/samba/winbindd_privileged || return 1
-		chgrp winbindd_priv $PIDDIR/winbindd_privileged/ || return 1
-		chmod 0750 $PIDDIR/winbindd_privileged/ || return 1
 		start-stop-daemon --start --quiet --oknodo --exec $DAEMON -- $WINBINDD_OPTS
 
 		log_end_msg $?
diff -Nru samba-4.5.4+dfsg/debian/winbind.logrotate samba-4.5.5+dfsg/debian/winbind.logrotate
--- samba-4.5.4+dfsg/debian/winbind.logrotate	2017-01-25 08:35:55.000000000 +0100
+++ samba-4.5.5+dfsg/debian/winbind.logrotate	2017-03-05 22:45:57.000000000 +0100
@@ -6,5 +6,6 @@
 	[ ! -f /var/run/samba/winbindd.pid ] || kill -HUP `cat /var/run/samba/winbindd.pid`
 	endscript
 	compress
+	delaycompress
 	notifempty
 }
diff -Nru samba-4.5.4+dfsg/debian/winbind.postinst samba-4.5.5+dfsg/debian/winbind.postinst
--- samba-4.5.4+dfsg/debian/winbind.postinst	2017-01-25 08:35:55.000000000 +0100
+++ samba-4.5.5+dfsg/debian/winbind.postinst	2017-03-05 22:37:17.000000000 +0100
@@ -5,4 +5,9 @@
 getent group winbindd_priv >/dev/null 2>&1 ||
 	addgroup --system --force-badname --quiet winbindd_priv
 
+winbindd_privileged_socket_directory='/var/lib/samba/winbindd_privileged'
+mkdir -pv "$winbindd_privileged_socket_directory"
+chgrp -c winbindd_priv "$winbindd_privileged_socket_directory"
+chmod -c 0750 "$winbindd_privileged_socket_directory"
+
 #DEBHELPER#
diff -Nru samba-4.5.4+dfsg/debian/winbind.postrm samba-4.5.5+dfsg/debian/winbind.postrm
--- samba-4.5.4+dfsg/debian/winbind.postrm	2017-01-25 08:35:55.000000000 +0100
+++ samba-4.5.5+dfsg/debian/winbind.postrm	2017-03-05 22:37:17.000000000 +0100
@@ -2,9 +2,11 @@
 
 set -e
 if [ "$1" = purge ]; then
+	winbindd_privileged_socket_directory='/var/lib/samba/winbindd_privileged'
 	rm -rf /var/cache/samba/netsamlogon_cache.tdb /var/cache/samba/winbindd_cache.tdb
+	rm -rf "$winbindd_privileged_socket_directory"
 	rm -rf /var/log/samba/log.winbind* /var/log/samba/log.wb*
-	rm -rf /var/run/samba/winbindd.pid /var/run/samba/winbindd_privileged/
+	rm -rf /var/run/samba/winbindd.pid
 fi
 
 #DEBHELPER#
diff -Nru samba-4.5.4+dfsg/debian/winbind.upstart samba-4.5.5+dfsg/debian/winbind.upstart
--- samba-4.5.4+dfsg/debian/winbind.upstart	2017-01-25 08:35:55.000000000 +0100
+++ samba-4.5.5+dfsg/debian/winbind.upstart	2017-03-05 22:37:17.000000000 +0100
@@ -8,9 +8,6 @@
 
 pre-start script
 	test -x /usr/sbin/winbindd || exit 0
-	mkdir -p /var/run/samba/winbindd_privileged
-	chgrp winbindd_priv /var/run/samba/winbindd_privileged
-	chmod 0750 /var/run/samba/winbindd_privileged
 end script
 
 script
diff -Nru samba-4.5.4+dfsg/docs/manpages/cifsdd.8 samba-4.5.5+dfsg/docs/manpages/cifsdd.8
--- samba-4.5.4+dfsg/docs/manpages/cifsdd.8	2017-01-17 21:01:50.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/cifsdd.8	2017-01-30 11:15:43.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: cifsdd
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "CIFSDD" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "CIFSDD" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/dbwrap_tool.1 samba-4.5.5+dfsg/docs/manpages/dbwrap_tool.1
--- samba-4.5.4+dfsg/docs/manpages/dbwrap_tool.1	2017-01-17 21:01:50.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/dbwrap_tool.1	2017-01-30 11:15:43.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: dbwrap_tool
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "DBWRAP_TOOL" "1" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "DBWRAP_TOOL" "1" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/eventlogadm.8 samba-4.5.5+dfsg/docs/manpages/eventlogadm.8
--- samba-4.5.4+dfsg/docs/manpages/eventlogadm.8	2017-01-17 21:01:50.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/eventlogadm.8	2017-01-30 11:15:43.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: eventlogadm
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "EVENTLOGADM" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "EVENTLOGADM" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/findsmb.1 samba-4.5.5+dfsg/docs/manpages/findsmb.1
--- samba-4.5.4+dfsg/docs/manpages/findsmb.1	2017-01-17 21:01:50.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/findsmb.1	2017-01-30 11:15:44.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: findsmb
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: User Commands
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "FINDSMB" "1" "01/17/2017" "Samba 4\&.5" "User Commands"
+.TH "FINDSMB" "1" "01/30/2017" "Samba 4\&.5" "User Commands"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/idmap_ad.8 samba-4.5.5+dfsg/docs/manpages/idmap_ad.8
--- samba-4.5.4+dfsg/docs/manpages/idmap_ad.8	2017-01-17 21:01:51.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/idmap_ad.8	2017-01-30 11:15:44.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: idmap_ad
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "IDMAP_AD" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "IDMAP_AD" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/idmap_autorid.8 samba-4.5.5+dfsg/docs/manpages/idmap_autorid.8
--- samba-4.5.4+dfsg/docs/manpages/idmap_autorid.8	2017-01-17 21:01:51.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/idmap_autorid.8	2017-01-30 11:15:44.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: idmap_autorid
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "IDMAP_AUTORID" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "IDMAP_AUTORID" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/idmap_hash.8 samba-4.5.5+dfsg/docs/manpages/idmap_hash.8
--- samba-4.5.4+dfsg/docs/manpages/idmap_hash.8	2017-01-17 21:01:51.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/idmap_hash.8	2017-01-30 11:15:44.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: idmap_hash
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "IDMAP_HASH" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "IDMAP_HASH" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/idmap_ldap.8 samba-4.5.5+dfsg/docs/manpages/idmap_ldap.8
--- samba-4.5.4+dfsg/docs/manpages/idmap_ldap.8	2017-01-17 21:01:51.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/idmap_ldap.8	2017-01-30 11:15:44.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: idmap_ldap
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "IDMAP_LDAP" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "IDMAP_LDAP" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/idmap_nss.8 samba-4.5.5+dfsg/docs/manpages/idmap_nss.8
--- samba-4.5.4+dfsg/docs/manpages/idmap_nss.8	2017-01-17 21:01:52.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/idmap_nss.8	2017-01-30 11:15:45.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: idmap_nss
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "IDMAP_NSS" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "IDMAP_NSS" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/idmap_rfc2307.8 samba-4.5.5+dfsg/docs/manpages/idmap_rfc2307.8
--- samba-4.5.4+dfsg/docs/manpages/idmap_rfc2307.8	2017-01-17 21:01:52.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/idmap_rfc2307.8	2017-01-30 11:15:45.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: idmap_rfc2307
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "IDMAP_RFC2307" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "IDMAP_RFC2307" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/idmap_rid.8 samba-4.5.5+dfsg/docs/manpages/idmap_rid.8
--- samba-4.5.4+dfsg/docs/manpages/idmap_rid.8	2017-01-17 21:01:52.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/idmap_rid.8	2017-01-30 11:15:45.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: idmap_rid
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "IDMAP_RID" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "IDMAP_RID" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/idmap_script.8 samba-4.5.5+dfsg/docs/manpages/idmap_script.8
--- samba-4.5.4+dfsg/docs/manpages/idmap_script.8	2017-01-17 21:01:52.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/idmap_script.8	2017-01-30 11:15:45.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: idmap_script
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "IDMAP_SCRIPT" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "IDMAP_SCRIPT" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/idmap_tdb2.8 samba-4.5.5+dfsg/docs/manpages/idmap_tdb2.8
--- samba-4.5.4+dfsg/docs/manpages/idmap_tdb2.8	2017-01-17 21:01:53.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/idmap_tdb2.8	2017-01-30 11:15:46.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: idmap_tdb2
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "IDMAP_TDB2" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "IDMAP_TDB2" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/idmap_tdb.8 samba-4.5.5+dfsg/docs/manpages/idmap_tdb.8
--- samba-4.5.4+dfsg/docs/manpages/idmap_tdb.8	2017-01-17 21:01:52.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/idmap_tdb.8	2017-01-30 11:15:46.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: idmap_tdb
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "IDMAP_TDB" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "IDMAP_TDB" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/libsmbclient.7 samba-4.5.5+dfsg/docs/manpages/libsmbclient.7
--- samba-4.5.4+dfsg/docs/manpages/libsmbclient.7	2017-01-17 21:01:53.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/libsmbclient.7	2017-01-30 11:15:46.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: libsmbclient
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: 7
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "LIBSMBCLIENT" "7" "01/17/2017" "Samba 4\&.5" "7"
+.TH "LIBSMBCLIENT" "7" "01/30/2017" "Samba 4\&.5" "7"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/lmhosts.5 samba-4.5.5+dfsg/docs/manpages/lmhosts.5
--- samba-4.5.4+dfsg/docs/manpages/lmhosts.5	2017-01-17 21:01:53.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/lmhosts.5	2017-01-30 11:15:46.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: lmhosts
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: File Formats and Conventions
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "LMHOSTS" "5" "01/17/2017" "Samba 4\&.5" "File Formats and Conventions"
+.TH "LMHOSTS" "5" "01/30/2017" "Samba 4\&.5" "File Formats and Conventions"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/log2pcap.1 samba-4.5.5+dfsg/docs/manpages/log2pcap.1
--- samba-4.5.4+dfsg/docs/manpages/log2pcap.1	2017-01-17 21:01:53.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/log2pcap.1	2017-01-30 11:15:47.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: log2pcap
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: User Commands
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "LOG2PCAP" "1" "01/17/2017" "Samba 4\&.5" "User Commands"
+.TH "LOG2PCAP" "1" "01/30/2017" "Samba 4\&.5" "User Commands"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/net.8 samba-4.5.5+dfsg/docs/manpages/net.8
--- samba-4.5.4+dfsg/docs/manpages/net.8	2017-01-17 21:01:54.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/net.8	2017-01-30 11:15:47.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: net
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "NET" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "NET" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/nmbd.8 samba-4.5.5+dfsg/docs/manpages/nmbd.8
--- samba-4.5.4+dfsg/docs/manpages/nmbd.8	2017-01-17 21:01:54.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/nmbd.8	2017-01-30 11:15:47.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: nmbd
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "NMBD" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "NMBD" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/nmblookup.1 samba-4.5.5+dfsg/docs/manpages/nmblookup.1
--- samba-4.5.4+dfsg/docs/manpages/nmblookup.1	2017-01-17 21:01:54.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/nmblookup.1	2017-01-30 11:15:47.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: nmblookup
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: User Commands
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "NMBLOOKUP" "1" "01/17/2017" "Samba 4\&.5" "User Commands"
+.TH "NMBLOOKUP" "1" "01/30/2017" "Samba 4\&.5" "User Commands"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/ntlm_auth.1 samba-4.5.5+dfsg/docs/manpages/ntlm_auth.1
--- samba-4.5.4+dfsg/docs/manpages/ntlm_auth.1	2017-01-17 21:01:55.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/ntlm_auth.1	2017-01-30 11:15:48.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: ntlm_auth
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: User Commands
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "NTLM_AUTH" "1" "01/17/2017" "Samba 4\&.5" "User Commands"
+.TH "NTLM_AUTH" "1" "01/30/2017" "Samba 4\&.5" "User Commands"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/pam_winbind.8 samba-4.5.5+dfsg/docs/manpages/pam_winbind.8
--- samba-4.5.4+dfsg/docs/manpages/pam_winbind.8	2017-01-17 21:01:55.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/pam_winbind.8	2017-01-30 11:15:48.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: pam_winbind
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: 8
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "PAM_WINBIND" "8" "01/17/2017" "Samba 4\&.5" "8"
+.TH "PAM_WINBIND" "8" "01/30/2017" "Samba 4\&.5" "8"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/pam_winbind.conf.5 samba-4.5.5+dfsg/docs/manpages/pam_winbind.conf.5
--- samba-4.5.4+dfsg/docs/manpages/pam_winbind.conf.5	2017-01-17 21:01:55.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/pam_winbind.conf.5	2017-01-30 11:15:48.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: pam_winbind.conf
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: 5
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "PAM_WINBIND\&.CONF" "5" "01/17/2017" "Samba 4\&.5" "5"
+.TH "PAM_WINBIND\&.CONF" "5" "01/30/2017" "Samba 4\&.5" "5"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/pdbedit.8 samba-4.5.5+dfsg/docs/manpages/pdbedit.8
--- samba-4.5.4+dfsg/docs/manpages/pdbedit.8	2017-01-17 21:01:55.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/pdbedit.8	2017-01-30 11:15:48.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: pdbedit
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "PDBEDIT" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "PDBEDIT" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/profiles.1 samba-4.5.5+dfsg/docs/manpages/profiles.1
--- samba-4.5.4+dfsg/docs/manpages/profiles.1	2017-01-17 21:01:56.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/profiles.1	2017-01-30 11:15:49.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: profiles
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: User Commands
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "PROFILES" "1" "01/17/2017" "Samba 4\&.5" "User Commands"
+.TH "PROFILES" "1" "01/30/2017" "Samba 4\&.5" "User Commands"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/rpcclient.1 samba-4.5.5+dfsg/docs/manpages/rpcclient.1
--- samba-4.5.4+dfsg/docs/manpages/rpcclient.1	2017-01-17 21:01:56.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/rpcclient.1	2017-01-30 11:15:49.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: rpcclient
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: User Commands
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "RPCCLIENT" "1" "01/17/2017" "Samba 4\&.5" "User Commands"
+.TH "RPCCLIENT" "1" "01/30/2017" "Samba 4\&.5" "User Commands"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/samba.7 samba-4.5.5+dfsg/docs/manpages/samba.7
--- samba-4.5.4+dfsg/docs/manpages/samba.7	2017-01-17 21:01:57.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/samba.7	2017-01-30 11:15:50.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: samba
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: Miscellanea
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "SAMBA" "7" "01/17/2017" "Samba 4\&.5" "Miscellanea"
+.TH "SAMBA" "7" "01/30/2017" "Samba 4\&.5" "Miscellanea"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/samba.8 samba-4.5.5+dfsg/docs/manpages/samba.8
--- samba-4.5.4+dfsg/docs/manpages/samba.8	2017-01-17 21:01:57.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/samba.8	2017-01-30 11:15:50.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: samba
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "SAMBA" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "SAMBA" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/samba-regedit.8 samba-4.5.5+dfsg/docs/manpages/samba-regedit.8
--- samba-4.5.4+dfsg/docs/manpages/samba-regedit.8	2017-01-17 21:01:56.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/samba-regedit.8	2017-01-30 11:15:49.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: samba-regedit
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "SAMBA\-REGEDIT" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "SAMBA\-REGEDIT" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/samba-tool.8 samba-4.5.5+dfsg/docs/manpages/samba-tool.8
--- samba-4.5.4+dfsg/docs/manpages/samba-tool.8	2017-01-17 21:01:56.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/samba-tool.8	2017-01-30 11:15:49.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: samba-tool
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "SAMBA\-TOOL" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "SAMBA\-TOOL" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/sharesec.1 samba-4.5.5+dfsg/docs/manpages/sharesec.1
--- samba-4.5.4+dfsg/docs/manpages/sharesec.1	2017-01-17 21:01:57.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/sharesec.1	2017-01-30 11:15:50.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: sharesec
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: User Commands
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "SHARESEC" "1" "01/17/2017" "Samba 4\&.5" "User Commands"
+.TH "SHARESEC" "1" "01/30/2017" "Samba 4\&.5" "User Commands"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/smbcacls.1 samba-4.5.5+dfsg/docs/manpages/smbcacls.1
--- samba-4.5.4+dfsg/docs/manpages/smbcacls.1	2017-01-17 21:02:01.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/smbcacls.1	2017-01-30 11:15:54.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: smbcacls
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: User Commands
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "SMBCACLS" "1" "01/17/2017" "Samba 4\&.5" "User Commands"
+.TH "SMBCACLS" "1" "01/30/2017" "Samba 4\&.5" "User Commands"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/smbclient.1 samba-4.5.5+dfsg/docs/manpages/smbclient.1
--- samba-4.5.4+dfsg/docs/manpages/smbclient.1	2017-01-17 21:02:01.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/smbclient.1	2017-01-30 11:15:54.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: smbclient
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: User Commands
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "SMBCLIENT" "1" "01/17/2017" "Samba 4\&.5" "User Commands"
+.TH "SMBCLIENT" "1" "01/30/2017" "Samba 4\&.5" "User Commands"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/smb.conf.5 samba-4.5.5+dfsg/docs/manpages/smb.conf.5
--- samba-4.5.4+dfsg/docs/manpages/smb.conf.5	2017-01-17 21:02:00.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/smb.conf.5	2017-01-30 11:15:53.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: smb.conf
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: File Formats and Conventions
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "SMB\&.CONF" "5" "01/17/2017" "Samba 4\&.5" "File Formats and Conventions"
+.TH "SMB\&.CONF" "5" "01/30/2017" "Samba 4\&.5" "File Formats and Conventions"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/smbcontrol.1 samba-4.5.5+dfsg/docs/manpages/smbcontrol.1
--- samba-4.5.4+dfsg/docs/manpages/smbcontrol.1	2017-01-17 21:02:01.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/smbcontrol.1	2017-01-30 11:15:54.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: smbcontrol
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: User Commands
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "SMBCONTROL" "1" "01/17/2017" "Samba 4\&.5" "User Commands"
+.TH "SMBCONTROL" "1" "01/30/2017" "Samba 4\&.5" "User Commands"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/smbcquotas.1 samba-4.5.5+dfsg/docs/manpages/smbcquotas.1
--- samba-4.5.4+dfsg/docs/manpages/smbcquotas.1	2017-01-17 21:02:01.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/smbcquotas.1	2017-01-30 11:15:54.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: smbcquotas
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: User Commands
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "SMBCQUOTAS" "1" "01/17/2017" "Samba 4\&.5" "User Commands"
+.TH "SMBCQUOTAS" "1" "01/30/2017" "Samba 4\&.5" "User Commands"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/smbd.8 samba-4.5.5+dfsg/docs/manpages/smbd.8
--- samba-4.5.4+dfsg/docs/manpages/smbd.8	2017-01-17 21:02:02.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/smbd.8	2017-01-30 11:15:55.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: smbd
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "SMBD" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "SMBD" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/smbget.1 samba-4.5.5+dfsg/docs/manpages/smbget.1
--- samba-4.5.4+dfsg/docs/manpages/smbget.1	2017-01-17 21:02:02.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/smbget.1	2017-01-30 11:15:55.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: smbget
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: User Commands
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "SMBGET" "1" "01/17/2017" "Samba 4\&.5" "User Commands"
+.TH "SMBGET" "1" "01/30/2017" "Samba 4\&.5" "User Commands"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/smbgetrc.5 samba-4.5.5+dfsg/docs/manpages/smbgetrc.5
--- samba-4.5.4+dfsg/docs/manpages/smbgetrc.5	2017-01-17 21:02:02.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/smbgetrc.5	2017-01-30 11:15:55.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: smbgetrc
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: File Formats and Conventions
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "SMBGETRC" "5" "01/17/2017" "Samba 4\&.5" "File Formats and Conventions"
+.TH "SMBGETRC" "5" "01/30/2017" "Samba 4\&.5" "File Formats and Conventions"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/smbpasswd.5 samba-4.5.5+dfsg/docs/manpages/smbpasswd.5
--- samba-4.5.4+dfsg/docs/manpages/smbpasswd.5	2017-01-17 21:02:02.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/smbpasswd.5	2017-01-30 11:15:55.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: smbpasswd
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: File Formats and Conventions
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "SMBPASSWD" "5" "01/17/2017" "Samba 4\&.5" "File Formats and Conventions"
+.TH "SMBPASSWD" "5" "01/30/2017" "Samba 4\&.5" "File Formats and Conventions"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/smbpasswd.8 samba-4.5.5+dfsg/docs/manpages/smbpasswd.8
--- samba-4.5.4+dfsg/docs/manpages/smbpasswd.8	2017-01-17 21:02:03.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/smbpasswd.8	2017-01-30 11:15:56.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: smbpasswd
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "SMBPASSWD" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "SMBPASSWD" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/smbspool.8 samba-4.5.5+dfsg/docs/manpages/smbspool.8
--- samba-4.5.4+dfsg/docs/manpages/smbspool.8	2017-01-17 21:02:03.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/smbspool.8	2017-01-30 11:15:56.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: smbspool
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "SMBSPOOL" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "SMBSPOOL" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/smbspool_krb5_wrapper.8 samba-4.5.5+dfsg/docs/manpages/smbspool_krb5_wrapper.8
--- samba-4.5.4+dfsg/docs/manpages/smbspool_krb5_wrapper.8	2017-01-17 21:02:03.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/smbspool_krb5_wrapper.8	2017-01-30 11:15:56.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: smbspool_krb5_wrapper
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "SMBSPOOL_KRB5_WRAPPE" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "SMBSPOOL_KRB5_WRAPPE" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/smbstatus.1 samba-4.5.5+dfsg/docs/manpages/smbstatus.1
--- samba-4.5.4+dfsg/docs/manpages/smbstatus.1	2017-01-17 21:02:03.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/smbstatus.1	2017-01-30 11:15:56.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: smbstatus
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: User Commands
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "SMBSTATUS" "1" "01/17/2017" "Samba 4\&.5" "User Commands"
+.TH "SMBSTATUS" "1" "01/30/2017" "Samba 4\&.5" "User Commands"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/smbtar.1 samba-4.5.5+dfsg/docs/manpages/smbtar.1
--- samba-4.5.4+dfsg/docs/manpages/smbtar.1	2017-01-17 21:02:03.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/smbtar.1	2017-01-30 11:15:56.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: smbtar
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: User Commands
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "SMBTAR" "1" "01/17/2017" "Samba 4\&.5" "User Commands"
+.TH "SMBTAR" "1" "01/30/2017" "Samba 4\&.5" "User Commands"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/smbtree.1 samba-4.5.5+dfsg/docs/manpages/smbtree.1
--- samba-4.5.4+dfsg/docs/manpages/smbtree.1	2017-01-17 21:02:04.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/smbtree.1	2017-01-30 11:15:57.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: smbtree
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: User Commands
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "SMBTREE" "1" "01/17/2017" "Samba 4\&.5" "User Commands"
+.TH "SMBTREE" "1" "01/30/2017" "Samba 4\&.5" "User Commands"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/testparm.1 samba-4.5.5+dfsg/docs/manpages/testparm.1
--- samba-4.5.4+dfsg/docs/manpages/testparm.1	2017-01-17 21:02:04.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/testparm.1	2017-01-30 11:15:57.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: testparm
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: User Commands
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "TESTPARM" "1" "01/17/2017" "Samba 4\&.5" "User Commands"
+.TH "TESTPARM" "1" "01/30/2017" "Samba 4\&.5" "User Commands"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/vfs_acl_tdb.8 samba-4.5.5+dfsg/docs/manpages/vfs_acl_tdb.8
--- samba-4.5.4+dfsg/docs/manpages/vfs_acl_tdb.8	2017-01-17 21:02:04.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/vfs_acl_tdb.8	2017-01-30 11:15:57.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: vfs_acl_tdb
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "VFS_ACL_TDB" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "VFS_ACL_TDB" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/vfs_acl_xattr.8 samba-4.5.5+dfsg/docs/manpages/vfs_acl_xattr.8
--- samba-4.5.4+dfsg/docs/manpages/vfs_acl_xattr.8	2017-01-17 21:02:04.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/vfs_acl_xattr.8	2017-01-30 11:15:57.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: vfs_acl_xattr
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "VFS_ACL_XATTR" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "VFS_ACL_XATTR" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/vfs_aio_fork.8 samba-4.5.5+dfsg/docs/manpages/vfs_aio_fork.8
--- samba-4.5.4+dfsg/docs/manpages/vfs_aio_fork.8	2017-01-17 21:02:05.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/vfs_aio_fork.8	2017-01-30 11:15:58.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: vfs_aio_fork
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "VFS_AIO_FORK" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "VFS_AIO_FORK" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/vfs_aio_linux.8 samba-4.5.5+dfsg/docs/manpages/vfs_aio_linux.8
--- samba-4.5.4+dfsg/docs/manpages/vfs_aio_linux.8	2017-01-17 21:02:05.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/vfs_aio_linux.8	2017-01-30 11:15:58.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: vfs_aio_linux
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "VFS_AIO_LINUX" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "VFS_AIO_LINUX" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/vfs_aio_pthread.8 samba-4.5.5+dfsg/docs/manpages/vfs_aio_pthread.8
--- samba-4.5.4+dfsg/docs/manpages/vfs_aio_pthread.8	2017-01-17 21:02:05.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/vfs_aio_pthread.8	2017-01-30 11:15:58.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: vfs_aio_pthread
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "VFS_AIO_PTHREAD" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "VFS_AIO_PTHREAD" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/vfs_audit.8 samba-4.5.5+dfsg/docs/manpages/vfs_audit.8
--- samba-4.5.4+dfsg/docs/manpages/vfs_audit.8	2017-01-17 21:02:05.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/vfs_audit.8	2017-01-30 11:15:58.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: vfs_audit
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "VFS_AUDIT" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "VFS_AUDIT" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/vfs_btrfs.8 samba-4.5.5+dfsg/docs/manpages/vfs_btrfs.8
--- samba-4.5.4+dfsg/docs/manpages/vfs_btrfs.8	2017-01-17 21:02:05.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/vfs_btrfs.8	2017-01-30 11:15:59.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: vfs_btrfs
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "VFS_BTRFS" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "VFS_BTRFS" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/vfs_cacheprime.8 samba-4.5.5+dfsg/docs/manpages/vfs_cacheprime.8
--- samba-4.5.4+dfsg/docs/manpages/vfs_cacheprime.8	2017-01-17 21:02:06.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/vfs_cacheprime.8	2017-01-30 11:15:59.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: vfs_cacheprime
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "VFS_CACHEPRIME" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "VFS_CACHEPRIME" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/vfs_cap.8 samba-4.5.5+dfsg/docs/manpages/vfs_cap.8
--- samba-4.5.4+dfsg/docs/manpages/vfs_cap.8	2017-01-17 21:02:06.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/vfs_cap.8	2017-01-30 11:15:59.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: vfs_cap
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "VFS_CAP" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "VFS_CAP" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/vfs_catia.8 samba-4.5.5+dfsg/docs/manpages/vfs_catia.8
--- samba-4.5.4+dfsg/docs/manpages/vfs_catia.8	2017-01-17 21:02:06.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/vfs_catia.8	2017-01-30 11:15:59.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: vfs_catia
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "VFS_CATIA" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "VFS_CATIA" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/vfs_ceph.8 samba-4.5.5+dfsg/docs/manpages/vfs_ceph.8
--- samba-4.5.4+dfsg/docs/manpages/vfs_ceph.8	2017-01-17 21:02:06.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/vfs_ceph.8	2017-01-30 11:15:59.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: vfs_ceph
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "VFS_CEPH" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "VFS_CEPH" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/vfs_commit.8 samba-4.5.5+dfsg/docs/manpages/vfs_commit.8
--- samba-4.5.4+dfsg/docs/manpages/vfs_commit.8	2017-01-17 21:02:07.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/vfs_commit.8	2017-01-30 11:16:00.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: vfs_commit
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "VFS_COMMIT" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "VFS_COMMIT" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/vfs_crossrename.8 samba-4.5.5+dfsg/docs/manpages/vfs_crossrename.8
--- samba-4.5.4+dfsg/docs/manpages/vfs_crossrename.8	2017-01-17 21:02:07.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/vfs_crossrename.8	2017-01-30 11:16:00.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: vfs_crossrename
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "VFS_CROSSRENAME" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "VFS_CROSSRENAME" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/vfs_default_quota.8 samba-4.5.5+dfsg/docs/manpages/vfs_default_quota.8
--- samba-4.5.4+dfsg/docs/manpages/vfs_default_quota.8	2017-01-17 21:02:07.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/vfs_default_quota.8	2017-01-30 11:16:00.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: vfs_default_quota
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "VFS_DEFAULT_QUOTA" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "VFS_DEFAULT_QUOTA" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/vfs_dirsort.8 samba-4.5.5+dfsg/docs/manpages/vfs_dirsort.8
--- samba-4.5.4+dfsg/docs/manpages/vfs_dirsort.8	2017-01-17 21:02:07.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/vfs_dirsort.8	2017-01-30 11:16:00.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: vfs_dirsort
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "VFS_DIRSORT" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "VFS_DIRSORT" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/vfs_extd_audit.8 samba-4.5.5+dfsg/docs/manpages/vfs_extd_audit.8
--- samba-4.5.4+dfsg/docs/manpages/vfs_extd_audit.8	2017-01-17 21:02:07.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/vfs_extd_audit.8	2017-01-30 11:16:01.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: vfs_extd_audit
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "VFS_EXTD_AUDIT" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "VFS_EXTD_AUDIT" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/vfs_fake_perms.8 samba-4.5.5+dfsg/docs/manpages/vfs_fake_perms.8
--- samba-4.5.4+dfsg/docs/manpages/vfs_fake_perms.8	2017-01-17 21:02:08.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/vfs_fake_perms.8	2017-01-30 11:16:01.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: vfs_fake_perms
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "VFS_FAKE_PERMS" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "VFS_FAKE_PERMS" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/vfs_fileid.8 samba-4.5.5+dfsg/docs/manpages/vfs_fileid.8
--- samba-4.5.4+dfsg/docs/manpages/vfs_fileid.8	2017-01-17 21:02:08.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/vfs_fileid.8	2017-01-30 11:16:01.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: vfs_fileid
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "VFS_FILEID" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "VFS_FILEID" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/vfs_fruit.8 samba-4.5.5+dfsg/docs/manpages/vfs_fruit.8
--- samba-4.5.4+dfsg/docs/manpages/vfs_fruit.8	2017-01-17 21:02:08.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/vfs_fruit.8	2017-01-30 11:16:01.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: vfs_fruit
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "VFS_FRUIT" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "VFS_FRUIT" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
@@ -197,13 +197,7 @@
 .PP
 fruit:encoding = [ native | private ]
 .RS 4
-Controls how the set of illegal NTFS ASCII character, commonly used by OS X clients, are stored in the filesystem\&.
-.sp
-\fIImportant:\fR
-this is known to not fully work with
-\fIfruit:metadata=stream\fR
-or
-\fIfruit:resource=stream\fR\&.
+Controls how the set of illegal NTFS ASCII character, commonly used by OS X clients, are stored in the filesystem:
 .sp
 .RS 4
 .ie n \{\
diff -Nru samba-4.5.4+dfsg/docs/manpages/vfs_full_audit.8 samba-4.5.5+dfsg/docs/manpages/vfs_full_audit.8
--- samba-4.5.4+dfsg/docs/manpages/vfs_full_audit.8	2017-01-17 21:02:08.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/vfs_full_audit.8	2017-01-30 11:16:02.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: vfs_full_audit
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "VFS_FULL_AUDIT" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "VFS_FULL_AUDIT" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/vfs_glusterfs.8 samba-4.5.5+dfsg/docs/manpages/vfs_glusterfs.8
--- samba-4.5.4+dfsg/docs/manpages/vfs_glusterfs.8	2017-01-17 21:02:09.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/vfs_glusterfs.8	2017-01-30 11:16:02.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: vfs_glusterfs
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "VFS_GLUSTERFS" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "VFS_GLUSTERFS" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/vfs_gpfs.8 samba-4.5.5+dfsg/docs/manpages/vfs_gpfs.8
--- samba-4.5.4+dfsg/docs/manpages/vfs_gpfs.8	2017-01-17 21:02:09.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/vfs_gpfs.8	2017-01-30 11:16:02.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: vfs_gpfs
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "VFS_GPFS" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "VFS_GPFS" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/vfs_linux_xfs_sgid.8 samba-4.5.5+dfsg/docs/manpages/vfs_linux_xfs_sgid.8
--- samba-4.5.4+dfsg/docs/manpages/vfs_linux_xfs_sgid.8	2017-01-17 21:02:09.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/vfs_linux_xfs_sgid.8	2017-01-30 11:16:02.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: vfs_syncops
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "VFS_SYNCOPS" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "VFS_SYNCOPS" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/vfs_media_harmony.8 samba-4.5.5+dfsg/docs/manpages/vfs_media_harmony.8
--- samba-4.5.4+dfsg/docs/manpages/vfs_media_harmony.8	2017-01-17 21:02:09.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/vfs_media_harmony.8	2017-01-30 11:16:03.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: vfs_media_harmony
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "VFS_MEDIA_HARMONY" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "VFS_MEDIA_HARMONY" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/vfs_netatalk.8 samba-4.5.5+dfsg/docs/manpages/vfs_netatalk.8
--- samba-4.5.4+dfsg/docs/manpages/vfs_netatalk.8	2017-01-17 21:02:09.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/vfs_netatalk.8	2017-01-30 11:16:03.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: vfs_netatalk
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "VFS_NETATALK" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "VFS_NETATALK" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/vfs_offline.8 samba-4.5.5+dfsg/docs/manpages/vfs_offline.8
--- samba-4.5.4+dfsg/docs/manpages/vfs_offline.8	2017-01-17 21:02:10.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/vfs_offline.8	2017-01-30 11:16:03.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: vfs_offline
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "VFS_OFFLINE" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "VFS_OFFLINE" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/vfs_prealloc.8 samba-4.5.5+dfsg/docs/manpages/vfs_prealloc.8
--- samba-4.5.4+dfsg/docs/manpages/vfs_prealloc.8	2017-01-17 21:02:10.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/vfs_prealloc.8	2017-01-30 11:16:03.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: vfs_prealloc
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "VFS_PREALLOC" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "VFS_PREALLOC" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/vfs_preopen.8 samba-4.5.5+dfsg/docs/manpages/vfs_preopen.8
--- samba-4.5.4+dfsg/docs/manpages/vfs_preopen.8	2017-01-17 21:02:10.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/vfs_preopen.8	2017-01-30 11:16:04.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: vfs_preopen
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "VFS_PREOPEN" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "VFS_PREOPEN" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/vfs_readahead.8 samba-4.5.5+dfsg/docs/manpages/vfs_readahead.8
--- samba-4.5.4+dfsg/docs/manpages/vfs_readahead.8	2017-01-17 21:02:10.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/vfs_readahead.8	2017-01-30 11:16:04.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: vfs_readahead
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "VFS_READAHEAD" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "VFS_READAHEAD" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/vfs_readonly.8 samba-4.5.5+dfsg/docs/manpages/vfs_readonly.8
--- samba-4.5.4+dfsg/docs/manpages/vfs_readonly.8	2017-01-17 21:02:11.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/vfs_readonly.8	2017-01-30 11:16:04.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: vfs_readonly
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "VFS_READONLY" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "VFS_READONLY" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/vfs_recycle.8 samba-4.5.5+dfsg/docs/manpages/vfs_recycle.8
--- samba-4.5.4+dfsg/docs/manpages/vfs_recycle.8	2017-01-17 21:02:11.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/vfs_recycle.8	2017-01-30 11:16:04.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: vfs_recycle
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "VFS_RECYCLE" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "VFS_RECYCLE" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/vfs_shadow_copy2.8 samba-4.5.5+dfsg/docs/manpages/vfs_shadow_copy2.8
--- samba-4.5.4+dfsg/docs/manpages/vfs_shadow_copy2.8	2017-01-17 21:02:11.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/vfs_shadow_copy2.8	2017-01-30 11:16:05.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: vfs_shadow_copy2
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "VFS_SHADOW_COPY2" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "VFS_SHADOW_COPY2" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/vfs_shadow_copy.8 samba-4.5.5+dfsg/docs/manpages/vfs_shadow_copy.8
--- samba-4.5.4+dfsg/docs/manpages/vfs_shadow_copy.8	2017-01-17 21:02:11.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/vfs_shadow_copy.8	2017-01-30 11:16:04.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: vfs_shadow_copy
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "VFS_SHADOW_COPY" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "VFS_SHADOW_COPY" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/vfs_shell_snap.8 samba-4.5.5+dfsg/docs/manpages/vfs_shell_snap.8
--- samba-4.5.4+dfsg/docs/manpages/vfs_shell_snap.8	2017-01-17 21:02:11.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/vfs_shell_snap.8	2017-01-30 11:16:05.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: vfs_shell_snap
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "VFS_SHELL_SNAP" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "VFS_SHELL_SNAP" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/vfs_snapper.8 samba-4.5.5+dfsg/docs/manpages/vfs_snapper.8
--- samba-4.5.4+dfsg/docs/manpages/vfs_snapper.8	2017-01-17 21:02:12.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/vfs_snapper.8	2017-01-30 11:16:05.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: vfs_snapper
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "VFS_SNAPPER" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "VFS_SNAPPER" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/vfs_streams_depot.8 samba-4.5.5+dfsg/docs/manpages/vfs_streams_depot.8
--- samba-4.5.4+dfsg/docs/manpages/vfs_streams_depot.8	2017-01-17 21:02:12.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/vfs_streams_depot.8	2017-01-30 11:16:05.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: vfs_streams_depot
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "VFS_STREAMS_DEPOT" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "VFS_STREAMS_DEPOT" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/vfs_streams_xattr.8 samba-4.5.5+dfsg/docs/manpages/vfs_streams_xattr.8
--- samba-4.5.4+dfsg/docs/manpages/vfs_streams_xattr.8	2017-01-17 21:02:12.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/vfs_streams_xattr.8	2017-01-30 11:16:06.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: vfs_streams_xattr
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "VFS_STREAMS_XATTR" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "VFS_STREAMS_XATTR" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/vfs_syncops.8 samba-4.5.5+dfsg/docs/manpages/vfs_syncops.8
--- samba-4.5.4+dfsg/docs/manpages/vfs_syncops.8	2017-01-17 21:02:12.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/vfs_syncops.8	2017-01-30 11:16:06.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: vfs_syncops
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "VFS_SYNCOPS" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "VFS_SYNCOPS" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/vfstest.1 samba-4.5.5+dfsg/docs/manpages/vfstest.1
--- samba-4.5.4+dfsg/docs/manpages/vfstest.1	2017-01-17 21:02:14.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/vfstest.1	2017-01-30 11:16:08.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: vfstest
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: User Commands
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "VFSTEST" "1" "01/17/2017" "Samba 4\&.5" "User Commands"
+.TH "VFSTEST" "1" "01/30/2017" "Samba 4\&.5" "User Commands"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/vfs_time_audit.8 samba-4.5.5+dfsg/docs/manpages/vfs_time_audit.8
--- samba-4.5.4+dfsg/docs/manpages/vfs_time_audit.8	2017-01-17 21:02:13.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/vfs_time_audit.8	2017-01-30 11:16:06.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: vfs_time_audit
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "VFS_TIME_AUDIT" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "VFS_TIME_AUDIT" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/vfs_tsmsm.8 samba-4.5.5+dfsg/docs/manpages/vfs_tsmsm.8
--- samba-4.5.4+dfsg/docs/manpages/vfs_tsmsm.8	2017-01-17 21:02:13.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/vfs_tsmsm.8	2017-01-30 11:16:06.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: vfs_tsmsm
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "VFS_TSMSM" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "VFS_TSMSM" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/vfs_unityed_media.8 samba-4.5.5+dfsg/docs/manpages/vfs_unityed_media.8
--- samba-4.5.4+dfsg/docs/manpages/vfs_unityed_media.8	2017-01-17 21:02:13.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/vfs_unityed_media.8	2017-01-30 11:16:07.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: vfs_unityed_media
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "VFS_UNITYED_MEDIA" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "VFS_UNITYED_MEDIA" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/vfs_worm.8 samba-4.5.5+dfsg/docs/manpages/vfs_worm.8
--- samba-4.5.4+dfsg/docs/manpages/vfs_worm.8	2017-01-17 21:02:13.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/vfs_worm.8	2017-01-30 11:16:07.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: vfs_worm
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "VFS_WORM" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "VFS_WORM" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/vfs_xattr_tdb.8 samba-4.5.5+dfsg/docs/manpages/vfs_xattr_tdb.8
--- samba-4.5.4+dfsg/docs/manpages/vfs_xattr_tdb.8	2017-01-17 21:02:13.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/vfs_xattr_tdb.8	2017-01-30 11:16:07.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: vfs_xattr_tdb
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "VFS_XATTR_TDB" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "VFS_XATTR_TDB" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/vfs_zfsacl.8 samba-4.5.5+dfsg/docs/manpages/vfs_zfsacl.8
--- samba-4.5.4+dfsg/docs/manpages/vfs_zfsacl.8	2017-01-17 21:02:14.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/vfs_zfsacl.8	2017-01-30 11:16:07.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: vfs_zfsacl
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "VFS_ZFSACL" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "VFS_ZFSACL" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/wbinfo.1 samba-4.5.5+dfsg/docs/manpages/wbinfo.1
--- samba-4.5.4+dfsg/docs/manpages/wbinfo.1	2017-01-17 21:02:14.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/wbinfo.1	2017-01-30 11:16:08.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: wbinfo
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: User Commands
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "WBINFO" "1" "01/17/2017" "Samba 4\&.5" "User Commands"
+.TH "WBINFO" "1" "01/30/2017" "Samba 4\&.5" "User Commands"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/winbindd.8 samba-4.5.5+dfsg/docs/manpages/winbindd.8
--- samba-4.5.4+dfsg/docs/manpages/winbindd.8	2017-01-17 21:02:15.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/winbindd.8	2017-01-30 11:16:08.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: winbindd
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: System Administration tools
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "WINBINDD" "8" "01/17/2017" "Samba 4\&.5" "System Administration tools"
+.TH "WINBINDD" "8" "01/30/2017" "Samba 4\&.5" "System Administration tools"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs/manpages/winbind_krb5_locator.7 samba-4.5.5+dfsg/docs/manpages/winbind_krb5_locator.7
--- samba-4.5.4+dfsg/docs/manpages/winbind_krb5_locator.7	2017-01-17 21:02:14.000000000 +0100
+++ samba-4.5.5+dfsg/docs/manpages/winbind_krb5_locator.7	2017-01-30 11:16:08.000000000 +0100
@@ -2,12 +2,12 @@
 .\"     Title: winbind_krb5_locator
 .\"    Author: [see the "AUTHOR" section]
 .\" Generator: DocBook XSL Stylesheets v1.78.1 <http://docbook.sf.net/>
-.\"      Date: 01/17/2017
+.\"      Date: 01/30/2017
 .\"    Manual: 7
 .\"    Source: Samba 4.5
 .\"  Language: English
 .\"
-.TH "WINBIND_KRB5_LOCATOR" "7" "01/17/2017" "Samba 4\&.5" "7"
+.TH "WINBIND_KRB5_LOCATOR" "7" "01/30/2017" "Samba 4\&.5" "7"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
diff -Nru samba-4.5.4+dfsg/docs-xml/manpages/vfs_fruit.8.xml samba-4.5.5+dfsg/docs-xml/manpages/vfs_fruit.8.xml
--- samba-4.5.4+dfsg/docs-xml/manpages/vfs_fruit.8.xml	2017-01-17 20:55:44.000000000 +0100
+++ samba-4.5.5+dfsg/docs-xml/manpages/vfs_fruit.8.xml	2017-01-30 10:56:26.000000000 +0100
@@ -168,13 +168,9 @@
 
 	      <para>Controls how the set of illegal NTFS ASCII
 	      character, commonly used by OS X clients, are stored in
-	      the filesystem.</para>
+	      the filesystem:</para>
 
-	      <para><emphasis>Important:</emphasis> this is known to not fully
-	      work with <emphasis>fruit:metadata=stream</emphasis> or
-	      <emphasis>fruit:resource=stream</emphasis>.</para>
-
- 	      <itemizedlist>
+	      <itemizedlist>
 
 		<listitem><para><command>private (default)</command> -
 		store characters as encoded by the OS X client: mapped
diff -Nru samba-4.5.4+dfsg/lib/torture/torture.h samba-4.5.5+dfsg/lib/torture/torture.h
--- samba-4.5.4+dfsg/lib/torture/torture.h	2017-01-17 20:55:44.000000000 +0100
+++ samba-4.5.5+dfsg/lib/torture/torture.h	2017-01-30 10:56:26.000000000 +0100
@@ -357,16 +357,6 @@
 	} \
 	} while(0)
 
-#define torture_assert_mem_equal_goto(torture_ctx,got,expected,len,ret,label,cmt) \
-	do { const void *__got = (got), *__expected = (expected); \
-	if (memcmp(__got, __expected, len) != 0) { \
-		torture_result(torture_ctx, TORTURE_FAIL, \
-			       __location__": "#got" of len %d did not match "#expected": %s", (int)len, cmt); \
-		return false; \
-		goto label; \
-	} \
-	} while(0)
-
 static inline void torture_dump_data_str_cb(const char *buf, void *private_data)
 {
 	char **dump = (char **)private_data;
diff -Nru samba-4.5.4+dfsg/script/release.sh samba-4.5.5+dfsg/script/release.sh
--- samba-4.5.4+dfsg/script/release.sh	2016-12-05 09:18:44.000000000 +0100
+++ samba-4.5.5+dfsg/script/release.sh	2017-01-30 10:56:26.000000000 +0100
@@ -830,7 +830,8 @@
 			top=$(cat ${TMPDIR}/WHATSNEW.txt | wc -l)
 		}
 		local skip=$(cat ${TMPDIR}/WHATSNEW.txt | grep -n '^[^ ]' | head -1 | cut -d ':' -f1)
-		local bottom=$(expr ${top} - \( ${skip} - 1 \))
+		local headlimit=$(expr ${top} - 1 )
+		local taillimit=$(expr ${headlimit} - \( ${skip} - 1 \))
 
 		cat "announce.${tagname}.quotation.txt"
 		echo ""
@@ -838,7 +839,7 @@
 		echo "Release Announcements"
 		echo "---------------------"
 		echo ""
-		head -${top} ${TMPDIR}/WHATSNEW.txt | tail -${bottom}
+		head -${headlimit} ${TMPDIR}/WHATSNEW.txt | tail -${taillimit}
 		echo ""
 		echo "================"
 		echo "Download Details"
diff -Nru samba-4.5.4+dfsg/selftest/target/Samba3.pm samba-4.5.5+dfsg/selftest/target/Samba3.pm
--- samba-4.5.4+dfsg/selftest/target/Samba3.pm	2017-01-17 20:55:44.000000000 +0100
+++ samba-4.5.5+dfsg/selftest/target/Samba3.pm	2017-01-30 10:56:26.000000000 +0100
@@ -1610,35 +1610,11 @@
 	path = $shrdir
 	vfs objects = catia fruit streams_xattr acl_xattr
 	ea support = yes
-	fruit:resource = file
+	fruit:ressource = file
 	fruit:metadata = netatalk
 	fruit:locking = netatalk
 	fruit:encoding = native
 
-[vfs_fruit_metadata_stream]
-	path = $shrdir
-	vfs objects = fruit streams_xattr acl_xattr
-	ea support = yes
-	fruit:resource = file
-	fruit:metadata = stream
-
-[vfs_fruit_stream_depot]
-	path = $shrdir
-	vfs objects = fruit streams_depot acl_xattr
-	ea support = yes
-	fruit:resource = stream
-	fruit:metadata = stream
-
-[vfs_wo_fruit]
-	path = $shrdir
-	vfs objects = streams_xattr acl_xattr
-	ea support = yes
-
-[vfs_wo_fruit_stream_depot]
-	path = $shrdir
-	vfs objects = streams_depot acl_xattr
-	ea support = yes
-
 [badname-tmp]
 	path = $badnames_shrdir
 	guest ok = yes
diff -Nru samba-4.5.4+dfsg/selftest/target/Samba4.pm samba-4.5.5+dfsg/selftest/target/Samba4.pm
--- samba-4.5.4+dfsg/selftest/target/Samba4.pm	2017-01-17 20:55:44.000000000 +0100
+++ samba-4.5.5+dfsg/selftest/target/Samba4.pm	2017-01-30 10:56:26.000000000 +0100
@@ -910,7 +910,7 @@
 	path = $ctx->{share}
 	vfs objects = catia fruit streams_xattr acl_xattr
 	ea support = yes
-	fruit:resource = file
+	fruit:ressource = file
 	fruit:metadata = netatalk
 	fruit:locking = netatalk
 	fruit:encoding = native
diff -Nru samba-4.5.4+dfsg/source3/include/MacExtensions.h samba-4.5.5+dfsg/source3/include/MacExtensions.h
--- samba-4.5.4+dfsg/source3/include/MacExtensions.h	2017-01-17 20:55:44.000000000 +0100
+++ samba-4.5.5+dfsg/source3/include/MacExtensions.h	2017-01-30 10:56:26.000000000 +0100
@@ -51,9 +51,6 @@
 #define AFP_Version			0x00000100
 #define AFP_BackupTime		0x80000000
 #define AFP_FinderSize		32
-
-#define AFP_OFF_FinderInfo	16
-
 /*
 ** Orginal AFP_AfpInfo stream used by NT 
 ** We needed a way to store the create date so SAMBA
diff -Nru samba-4.5.4+dfsg/source3/modules/vfs_catia.c samba-4.5.5+dfsg/source3/modules/vfs_catia.c
--- samba-4.5.4+dfsg/source3/modules/vfs_catia.c	2017-01-17 20:55:44.000000000 +0100
+++ samba-4.5.5+dfsg/source3/modules/vfs_catia.c	2017-01-30 10:56:26.000000000 +0100
@@ -1114,1036 +1114,6 @@
 	return ret;
 }
 
-static int catia_fstat(vfs_handle_struct *handle,
-		       files_struct *fsp,
-		       SMB_STRUCT_STAT *sbuf)
-{
-	char *fname = NULL;
-	char *tmp_fname = NULL;
-	char *base_fname = NULL;
-	char *tmp_base_fname = NULL;
-	int ret = -1;
-	NTSTATUS status;
-
-	status = catia_string_replace_allocate(handle->conn,
-					       fsp->fsp_name->base_name,
-					       &fname, vfs_translate_to_unix);
-	if (!NT_STATUS_IS_OK(status)) {
-		errno = map_errno_from_nt_status(status);
-		goto done;
-	}
-
-	if (fsp->base_fsp != NULL) {
-		status = catia_string_replace_allocate(
-			handle->conn,
-			fsp->base_fsp->fsp_name->base_name,
-			&base_fname, vfs_translate_to_unix);
-		if (!NT_STATUS_IS_OK(status)) {
-			errno = map_errno_from_nt_status(status);
-			goto done;
-		}
-
-		tmp_base_fname = fsp->base_fsp->fsp_name->base_name;
-		fsp->base_fsp->fsp_name->base_name = base_fname;
-	}
-
-	tmp_fname = fsp->fsp_name->base_name;
-	fsp->fsp_name->base_name = fname;
-
-	ret = SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf);
-
-	fsp->fsp_name->base_name = tmp_fname;
-	if (fsp->base_fsp != NULL) {
-		fsp->base_fsp->fsp_name->base_name = tmp_base_fname;
-	}
-
-done:
-	TALLOC_FREE(fname);
-	TALLOC_FREE(base_fname);
-
-	return ret;
-}
-
-static ssize_t catia_pread(vfs_handle_struct *handle,
-			   files_struct *fsp, void *data,
-			   size_t n, off_t offset)
-{
-	char *fname = NULL;
-	char *tmp_fname = NULL;
-	char *base_fname = NULL;
-	char *tmp_base_fname = NULL;
-	int ret = -1;
-	NTSTATUS status;
-
-	status = catia_string_replace_allocate(handle->conn,
-					       fsp->fsp_name->base_name,
-					       &fname, vfs_translate_to_unix);
-	if (!NT_STATUS_IS_OK(status)) {
-		errno = map_errno_from_nt_status(status);
-		goto done;
-	}
-
-	if (fsp->base_fsp != NULL) {
-		status = catia_string_replace_allocate(
-			handle->conn,
-			fsp->base_fsp->fsp_name->base_name,
-			&base_fname, vfs_translate_to_unix);
-		if (!NT_STATUS_IS_OK(status)) {
-			errno = map_errno_from_nt_status(status);
-			goto done;
-		}
-
-		tmp_base_fname = fsp->base_fsp->fsp_name->base_name;
-		fsp->base_fsp->fsp_name->base_name = base_fname;
-	}
-
-	tmp_fname = fsp->fsp_name->base_name;
-	fsp->fsp_name->base_name = fname;
-
-	ret = SMB_VFS_NEXT_PREAD(handle, fsp, data, n, offset);
-
-	fsp->fsp_name->base_name = tmp_fname;
-	if (fsp->base_fsp != NULL) {
-		fsp->base_fsp->fsp_name->base_name = tmp_base_fname;
-	}
-
-done:
-	TALLOC_FREE(fname);
-	TALLOC_FREE(base_fname);
-
-	return ret;
-}
-
-static ssize_t catia_pwrite(vfs_handle_struct *handle,
-			    files_struct *fsp, const void *data,
-			    size_t n, off_t offset)
-{
-	char *fname = NULL;
-	char *tmp_fname = NULL;
-	char *base_fname = NULL;
-	char *tmp_base_fname = NULL;
-	int ret = -1;
-	NTSTATUS status;
-
-	status = catia_string_replace_allocate(handle->conn,
-					       fsp->fsp_name->base_name,
-					       &fname, vfs_translate_to_unix);
-	if (!NT_STATUS_IS_OK(status)) {
-		errno = map_errno_from_nt_status(status);
-		goto done;
-	}
-
-	if (fsp->base_fsp != NULL) {
-		status = catia_string_replace_allocate(
-			handle->conn,
-			fsp->base_fsp->fsp_name->base_name,
-			&base_fname, vfs_translate_to_unix);
-		if (!NT_STATUS_IS_OK(status)) {
-			errno = map_errno_from_nt_status(status);
-			goto done;
-		}
-
-		tmp_base_fname = fsp->base_fsp->fsp_name->base_name;
-		fsp->base_fsp->fsp_name->base_name = base_fname;
-	}
-
-	tmp_fname = fsp->fsp_name->base_name;
-	fsp->fsp_name->base_name = fname;
-
-	ret = SMB_VFS_NEXT_PWRITE(handle, fsp, data, n, offset);
-
-	fsp->fsp_name->base_name = tmp_fname;
-	if (fsp->base_fsp != NULL) {
-		fsp->base_fsp->fsp_name->base_name = tmp_base_fname;
-	}
-
-done:
-	TALLOC_FREE(fname);
-	TALLOC_FREE(base_fname);
-
-	return ret;
-}
-
-static int catia_ftruncate(struct vfs_handle_struct *handle,
-			   struct files_struct *fsp,
-			   off_t offset)
-{
-	char *fname = NULL;
-	char *tmp_fname = NULL;
-	char *base_fname = NULL;
-	char *tmp_base_fname = NULL;
-	int ret = -1;
-	NTSTATUS status;
-
-	status = catia_string_replace_allocate(handle->conn,
-					       fsp->fsp_name->base_name,
-					       &fname, vfs_translate_to_unix);
-	if (!NT_STATUS_IS_OK(status)) {
-		errno = map_errno_from_nt_status(status);
-		goto done;
-	}
-
-	if (fsp->base_fsp != NULL) {
-		status = catia_string_replace_allocate(
-			handle->conn,
-			fsp->base_fsp->fsp_name->base_name,
-			&base_fname, vfs_translate_to_unix);
-		if (!NT_STATUS_IS_OK(status)) {
-			errno = map_errno_from_nt_status(status);
-			goto done;
-		}
-
-		tmp_base_fname = fsp->base_fsp->fsp_name->base_name;
-		fsp->base_fsp->fsp_name->base_name = base_fname;
-	}
-
-	tmp_fname = fsp->fsp_name->base_name;
-	fsp->fsp_name->base_name = fname;
-
-	ret = SMB_VFS_NEXT_FTRUNCATE(handle, fsp, offset);
-
-	fsp->fsp_name->base_name = tmp_fname;
-	if (fsp->base_fsp != NULL) {
-		fsp->base_fsp->fsp_name->base_name = tmp_base_fname;
-	}
-
-done:
-	TALLOC_FREE(fname);
-	TALLOC_FREE(base_fname);
-
-	return ret;
-}
-
-static int catia_fallocate(struct vfs_handle_struct *handle,
-			   struct files_struct *fsp,
-			   uint32_t mode,
-			   off_t offset,
-			   off_t len)
-{
-	char *fname = NULL;
-	char *tmp_fname = NULL;
-	char *base_fname = NULL;
-	char *tmp_base_fname = NULL;
-	int ret = -1;
-	NTSTATUS status;
-
-	status = catia_string_replace_allocate(handle->conn,
-					       fsp->fsp_name->base_name,
-					       &fname, vfs_translate_to_unix);
-	if (!NT_STATUS_IS_OK(status)) {
-		errno = map_errno_from_nt_status(status);
-		goto done;
-	}
-
-	if (fsp->base_fsp != NULL) {
-		status = catia_string_replace_allocate(
-			handle->conn,
-			fsp->base_fsp->fsp_name->base_name,
-			&base_fname, vfs_translate_to_unix);
-		if (!NT_STATUS_IS_OK(status)) {
-			errno = map_errno_from_nt_status(status);
-			goto done;
-		}
-
-		tmp_base_fname = fsp->base_fsp->fsp_name->base_name;
-		fsp->base_fsp->fsp_name->base_name = base_fname;
-	}
-
-	tmp_fname = fsp->fsp_name->base_name;
-	fsp->fsp_name->base_name = fname;
-
-	ret = SMB_VFS_NEXT_FALLOCATE(handle, fsp, mode, offset, len);
-
-	fsp->fsp_name->base_name = tmp_fname;
-	if (fsp->base_fsp != NULL) {
-		fsp->base_fsp->fsp_name->base_name = tmp_base_fname;
-	}
-
-done:
-	TALLOC_FREE(fname);
-	TALLOC_FREE(base_fname);
-
-	return ret;
-}
-
-static ssize_t catia_fgetxattr(struct vfs_handle_struct *handle, struct files_struct *fsp, const char *name, void *value, size_t size)
-{
-	char *fname = NULL;
-	char *tmp_fname = NULL;
-	char *base_fname = NULL;
-	char *tmp_base_fname = NULL;
-	ssize_t result = -1;
-	NTSTATUS status;
-
-	status = catia_string_replace_allocate(handle->conn,
-					       fsp->fsp_name->base_name,
-					       &fname, vfs_translate_to_unix);
-	if (!NT_STATUS_IS_OK(status)) {
-		errno = map_errno_from_nt_status(status);
-		goto done;
-	}
-
-	if (fsp->base_fsp != NULL) {
-		status = catia_string_replace_allocate(
-			handle->conn,
-			fsp->base_fsp->fsp_name->base_name,
-			&base_fname, vfs_translate_to_unix);
-		if (!NT_STATUS_IS_OK(status)) {
-			errno = map_errno_from_nt_status(status);
-			goto done;
-		}
-
-		tmp_base_fname = fsp->base_fsp->fsp_name->base_name;
-		fsp->base_fsp->fsp_name->base_name = base_fname;
-	}
-
-	tmp_fname = fsp->fsp_name->base_name;
-	fsp->fsp_name->base_name = fname;
-
-	result = SMB_VFS_NEXT_FGETXATTR(handle, fsp, name, value, size);
-
-	fsp->fsp_name->base_name = tmp_fname;
-	if (fsp->base_fsp != NULL) {
-		fsp->base_fsp->fsp_name->base_name = tmp_base_fname;
-	}
-
-done:
-	TALLOC_FREE(fname);
-	TALLOC_FREE(base_fname);
-
-	return result;
-}
-
-static ssize_t catia_flistxattr(struct vfs_handle_struct *handle, struct files_struct *fsp, char *list, size_t size)
-{
-	char *fname = NULL;
-	char *tmp_fname = NULL;
-	char *base_fname = NULL;
-	char *tmp_base_fname = NULL;
-	ssize_t result = -1;
-	NTSTATUS status;
-
-	status = catia_string_replace_allocate(handle->conn,
-					       fsp->fsp_name->base_name,
-					       &fname, vfs_translate_to_unix);
-	if (!NT_STATUS_IS_OK(status)) {
-		errno = map_errno_from_nt_status(status);
-		goto done;
-	}
-
-	if (fsp->base_fsp != NULL) {
-		status = catia_string_replace_allocate(
-			handle->conn,
-			fsp->base_fsp->fsp_name->base_name,
-			&base_fname, vfs_translate_to_unix);
-		if (!NT_STATUS_IS_OK(status)) {
-			errno = map_errno_from_nt_status(status);
-			goto done;
-		}
-
-		tmp_base_fname = fsp->base_fsp->fsp_name->base_name;
-		fsp->base_fsp->fsp_name->base_name = base_fname;
-	}
-
-	tmp_fname = fsp->fsp_name->base_name;
-	fsp->fsp_name->base_name = fname;
-
-	result = SMB_VFS_NEXT_FLISTXATTR(handle, fsp, list, size);
-
-	fsp->fsp_name->base_name = tmp_fname;
-	if (fsp->base_fsp != NULL) {
-		fsp->base_fsp->fsp_name->base_name = tmp_base_fname;
-	}
-
-done:
-	TALLOC_FREE(fname);
-	TALLOC_FREE(base_fname);
-
-	return result;
-}
-
-static int catia_fremovexattr(struct vfs_handle_struct *handle, struct files_struct *fsp, const char *name)
-{
-	char *fname = NULL;
-	char *tmp_fname = NULL;
-	char *base_fname = NULL;
-	char *tmp_base_fname = NULL;
-	int ret = -1;
-	NTSTATUS status;
-
-	status = catia_string_replace_allocate(handle->conn,
-					       fsp->fsp_name->base_name,
-					       &fname, vfs_translate_to_unix);
-	if (!NT_STATUS_IS_OK(status)) {
-		errno = map_errno_from_nt_status(status);
-		goto done;
-	}
-
-	if (fsp->base_fsp != NULL) {
-		status = catia_string_replace_allocate(
-			handle->conn,
-			fsp->base_fsp->fsp_name->base_name,
-			&base_fname, vfs_translate_to_unix);
-		if (!NT_STATUS_IS_OK(status)) {
-			errno = map_errno_from_nt_status(status);
-			goto done;
-		}
-
-		tmp_base_fname = fsp->base_fsp->fsp_name->base_name;
-		fsp->base_fsp->fsp_name->base_name = base_fname;
-	}
-
-	tmp_fname = fsp->fsp_name->base_name;
-	fsp->fsp_name->base_name = fname;
-
-	ret = SMB_VFS_NEXT_FREMOVEXATTR(handle, fsp, name);
-
-	fsp->fsp_name->base_name = tmp_fname;
-	if (fsp->base_fsp != NULL) {
-		fsp->base_fsp->fsp_name->base_name = tmp_base_fname;
-	}
-
-done:
-	TALLOC_FREE(fname);
-	TALLOC_FREE(base_fname);
-
-	return ret;
-}
-
-static int catia_fsetxattr(struct vfs_handle_struct *handle, struct files_struct *fsp, const char *name, const void *value, size_t size, int flags)
-{
-	char *fname = NULL;
-	char *tmp_fname = NULL;
-	char *base_fname = NULL;
-	char *tmp_base_fname = NULL;
-	int ret = -1;
-	NTSTATUS status;
-
-	status = catia_string_replace_allocate(handle->conn,
-					       fsp->fsp_name->base_name,
-					       &fname, vfs_translate_to_unix);
-	if (!NT_STATUS_IS_OK(status)) {
-		errno = map_errno_from_nt_status(status);
-		goto done;
-	}
-
-	if (fsp->base_fsp != NULL) {
-		status = catia_string_replace_allocate(
-			handle->conn,
-			fsp->base_fsp->fsp_name->base_name,
-			&base_fname, vfs_translate_to_unix);
-		if (!NT_STATUS_IS_OK(status)) {
-			errno = map_errno_from_nt_status(status);
-			goto done;
-		}
-
-		tmp_base_fname = fsp->base_fsp->fsp_name->base_name;
-		fsp->base_fsp->fsp_name->base_name = base_fname;
-	}
-
-	tmp_fname = fsp->fsp_name->base_name;
-	fsp->fsp_name->base_name = fname;
-
-	ret = SMB_VFS_NEXT_FSETXATTR(handle, fsp, name, value, size, flags);
-
-	fsp->fsp_name->base_name = tmp_fname;
-	if (fsp->base_fsp != NULL) {
-		fsp->base_fsp->fsp_name->base_name = tmp_base_fname;
-	}
-
-done:
-	TALLOC_FREE(fname);
-	TALLOC_FREE(base_fname);
-
-	return ret;
-}
-
-static SMB_ACL_T catia_sys_acl_get_fd(vfs_handle_struct *handle,
-				      files_struct *fsp,
-				      TALLOC_CTX *mem_ctx)
-{
-	struct smb_acl_t *result = NULL;
-	char *fname = NULL;
-	char *tmp_fname = NULL;
-	char *base_fname = NULL;
-	char *tmp_base_fname = NULL;
-	NTSTATUS status;
-
-	status = catia_string_replace_allocate(handle->conn,
-					       fsp->fsp_name->base_name,
-					       &fname, vfs_translate_to_unix);
-	if (!NT_STATUS_IS_OK(status)) {
-		errno = map_errno_from_nt_status(status);
-		goto done;
-	}
-
-	if (fsp->base_fsp != NULL) {
-		status = catia_string_replace_allocate(
-			handle->conn,
-			fsp->base_fsp->fsp_name->base_name,
-			&base_fname, vfs_translate_to_unix);
-		if (!NT_STATUS_IS_OK(status)) {
-			errno = map_errno_from_nt_status(status);
-			goto done;
-		}
-
-		tmp_base_fname = fsp->base_fsp->fsp_name->base_name;
-		fsp->base_fsp->fsp_name->base_name = base_fname;
-	}
-
-	tmp_fname = fsp->fsp_name->base_name;
-	fsp->fsp_name->base_name = fname;
-
-	result = SMB_VFS_NEXT_SYS_ACL_GET_FD(handle, fsp, mem_ctx);
-
-	fsp->fsp_name->base_name = tmp_fname;
-	if (fsp->base_fsp != NULL) {
-		fsp->base_fsp->fsp_name->base_name = tmp_base_fname;
-	}
-
-done:
-	TALLOC_FREE(fname);
-	TALLOC_FREE(base_fname);
-
-	return result;
-}
-
-static int catia_sys_acl_blob_get_fd(vfs_handle_struct *handle,
-				     files_struct *fsp,
-				     TALLOC_CTX *mem_ctx,
-				     char **blob_description,
-				     DATA_BLOB *blob)
-{
-	char *fname = NULL;
-	char *tmp_fname = NULL;
-	char *base_fname = NULL;
-	char *tmp_base_fname = NULL;
-	int ret = -1;
-	NTSTATUS status;
-
-	status = catia_string_replace_allocate(handle->conn,
-					       fsp->fsp_name->base_name,
-					       &fname, vfs_translate_to_unix);
-	if (!NT_STATUS_IS_OK(status)) {
-		errno = map_errno_from_nt_status(status);
-		goto done;
-	}
-
-	if (fsp->base_fsp != NULL) {
-		status = catia_string_replace_allocate(
-			handle->conn,
-			fsp->base_fsp->fsp_name->base_name,
-			&base_fname, vfs_translate_to_unix);
-		if (!NT_STATUS_IS_OK(status)) {
-			errno = map_errno_from_nt_status(status);
-			goto done;
-		}
-
-		tmp_base_fname = fsp->base_fsp->fsp_name->base_name;
-		fsp->base_fsp->fsp_name->base_name = base_fname;
-	}
-
-	tmp_fname = fsp->fsp_name->base_name;
-	fsp->fsp_name->base_name = fname;
-
-	ret = SMB_VFS_NEXT_SYS_ACL_BLOB_GET_FD(handle, fsp, mem_ctx,
-					       blob_description, blob);
-
-	fsp->fsp_name->base_name = tmp_fname;
-	if (fsp->base_fsp != NULL) {
-		fsp->base_fsp->fsp_name->base_name = tmp_base_fname;
-	}
-
-done:
-	TALLOC_FREE(fname);
-	TALLOC_FREE(base_fname);
-
-	return ret;
-}
-
-static int catia_sys_acl_set_fd(vfs_handle_struct *handle, files_struct *fsp, SMB_ACL_T theacl)
-{
-	char *fname = NULL;
-	char *tmp_fname = NULL;
-	char *base_fname = NULL;
-	char *tmp_base_fname = NULL;
-	int ret = -1;
-	NTSTATUS status;
-
-	status = catia_string_replace_allocate(handle->conn,
-					       fsp->fsp_name->base_name,
-					       &fname, vfs_translate_to_unix);
-	if (!NT_STATUS_IS_OK(status)) {
-		errno = map_errno_from_nt_status(status);
-		goto done;
-	}
-
-	if (fsp->base_fsp != NULL) {
-		status = catia_string_replace_allocate(
-			handle->conn,
-			fsp->base_fsp->fsp_name->base_name,
-			&base_fname, vfs_translate_to_unix);
-		if (!NT_STATUS_IS_OK(status)) {
-			errno = map_errno_from_nt_status(status);
-			goto done;
-		}
-
-		tmp_base_fname = fsp->base_fsp->fsp_name->base_name;
-		fsp->base_fsp->fsp_name->base_name = base_fname;
-	}
-
-	tmp_fname = fsp->fsp_name->base_name;
-	fsp->fsp_name->base_name = fname;
-
-	ret = SMB_VFS_NEXT_SYS_ACL_SET_FD(handle, fsp, theacl);
-
-	fsp->fsp_name->base_name = tmp_fname;
-	if (fsp->base_fsp != NULL) {
-		fsp->base_fsp->fsp_name->base_name = tmp_base_fname;
-	}
-
-done:
-	TALLOC_FREE(fname);
-	TALLOC_FREE(base_fname);
-
-	return ret;
-}
-
-static int catia_fchmod_acl(vfs_handle_struct *handle, files_struct *fsp, mode_t mode)
-{
-	char *fname = NULL;
-	char *tmp_fname = NULL;
-	char *base_fname = NULL;
-	char *tmp_base_fname = NULL;
-	int ret = -1;
-	NTSTATUS status;
-
-	status = catia_string_replace_allocate(handle->conn,
-					       fsp->fsp_name->base_name,
-					       &fname, vfs_translate_to_unix);
-	if (!NT_STATUS_IS_OK(status)) {
-		errno = map_errno_from_nt_status(status);
-		goto done;
-	}
-
-	if (fsp->base_fsp != NULL) {
-		status = catia_string_replace_allocate(
-			handle->conn,
-			fsp->base_fsp->fsp_name->base_name,
-			&base_fname, vfs_translate_to_unix);
-		if (!NT_STATUS_IS_OK(status)) {
-			errno = map_errno_from_nt_status(status);
-			goto done;
-		}
-
-		tmp_base_fname = fsp->base_fsp->fsp_name->base_name;
-		fsp->base_fsp->fsp_name->base_name = base_fname;
-	}
-
-	tmp_fname = fsp->fsp_name->base_name;
-	fsp->fsp_name->base_name = fname;
-
-	ret = SMB_VFS_NEXT_FCHMOD_ACL(handle, fsp, mode);
-
-	fsp->fsp_name->base_name = tmp_fname;
-	if (fsp->base_fsp != NULL) {
-		fsp->base_fsp->fsp_name->base_name = tmp_base_fname;
-	}
-
-done:
-	TALLOC_FREE(fname);
-	TALLOC_FREE(base_fname);
-
-	return ret;
-}
-
-static NTSTATUS catia_fget_nt_acl(vfs_handle_struct *handle,
-				  files_struct *fsp,
-				  uint32_t security_info,
-				  TALLOC_CTX *mem_ctx,
-				  struct security_descriptor **ppdesc)
-{
-	char *fname = NULL;
-	char *tmp_fname = NULL;
-	char *base_fname = NULL;
-	char *tmp_base_fname = NULL;
-	NTSTATUS status;
-
-	status = catia_string_replace_allocate(handle->conn,
-					       fsp->fsp_name->base_name,
-					       &fname, vfs_translate_to_unix);
-	if (!NT_STATUS_IS_OK(status)) {
-		errno = map_errno_from_nt_status(status);
-		goto done;
-	}
-
-	if (fsp->base_fsp != NULL) {
-		status = catia_string_replace_allocate(
-			handle->conn,
-			fsp->base_fsp->fsp_name->base_name,
-			&base_fname, vfs_translate_to_unix);
-		if (!NT_STATUS_IS_OK(status)) {
-			errno = map_errno_from_nt_status(status);
-			goto done;
-		}
-
-		tmp_base_fname = fsp->base_fsp->fsp_name->base_name;
-		fsp->base_fsp->fsp_name->base_name = base_fname;
-	}
-
-	tmp_fname = fsp->fsp_name->base_name;
-	fsp->fsp_name->base_name = fname;
-
-	status = SMB_VFS_NEXT_FGET_NT_ACL(handle, fsp, security_info, mem_ctx, ppdesc);
-
-	fsp->fsp_name->base_name = tmp_fname;
-	if (fsp->base_fsp != NULL) {
-		fsp->base_fsp->fsp_name->base_name = tmp_base_fname;
-	}
-
-done:
-	TALLOC_FREE(fname);
-	TALLOC_FREE(base_fname);
-
-	return status;
-}
-
-static NTSTATUS catia_fset_nt_acl(vfs_handle_struct *handle, files_struct *fsp, uint32_t security_info_sent, const struct security_descriptor *psd)
-{
-	char *fname = NULL;
-	char *tmp_fname = NULL;
-	char *base_fname = NULL;
-	char *tmp_base_fname = NULL;
-	NTSTATUS status;
-
-	status = catia_string_replace_allocate(handle->conn,
-					       fsp->fsp_name->base_name,
-					       &fname, vfs_translate_to_unix);
-	if (!NT_STATUS_IS_OK(status)) {
-		errno = map_errno_from_nt_status(status);
-		goto done;
-	}
-
-	if (fsp->base_fsp != NULL) {
-		status = catia_string_replace_allocate(
-			handle->conn,
-			fsp->base_fsp->fsp_name->base_name,
-			&base_fname, vfs_translate_to_unix);
-		if (!NT_STATUS_IS_OK(status)) {
-			errno = map_errno_from_nt_status(status);
-			goto done;
-		}
-
-		tmp_base_fname = fsp->base_fsp->fsp_name->base_name;
-		fsp->base_fsp->fsp_name->base_name = base_fname;
-	}
-
-	tmp_fname = fsp->fsp_name->base_name;
-	fsp->fsp_name->base_name = fname;
-
-	status = SMB_VFS_NEXT_FSET_NT_ACL(handle, fsp, security_info_sent, psd);
-
-	fsp->fsp_name->base_name = tmp_fname;
-	if (fsp->base_fsp != NULL) {
-		fsp->base_fsp->fsp_name->base_name = tmp_base_fname;
-	}
-
-done:
-	TALLOC_FREE(fname);
-	TALLOC_FREE(base_fname);
-
-	return status;
-}
-
-static NTSTATUS catia_fset_dos_attributes(struct vfs_handle_struct *handle,
-					  struct files_struct *fsp,
-					  uint32_t dosmode)
-{
-	char *fname = NULL;
-	char *tmp_fname = NULL;
-	char *base_fname = NULL;
-	char *tmp_base_fname = NULL;
-	NTSTATUS status;
-
-	status = catia_string_replace_allocate(handle->conn,
-					       fsp->fsp_name->base_name,
-					       &fname, vfs_translate_to_unix);
-	if (!NT_STATUS_IS_OK(status)) {
-		errno = map_errno_from_nt_status(status);
-		goto done;
-	}
-
-	if (fsp->base_fsp != NULL) {
-		status = catia_string_replace_allocate(
-			handle->conn,
-			fsp->base_fsp->fsp_name->base_name,
-			&base_fname, vfs_translate_to_unix);
-		if (!NT_STATUS_IS_OK(status)) {
-			errno = map_errno_from_nt_status(status);
-			goto done;
-		}
-
-		tmp_base_fname = fsp->base_fsp->fsp_name->base_name;
-		fsp->base_fsp->fsp_name->base_name = base_fname;
-	}
-
-	tmp_fname = fsp->fsp_name->base_name;
-	fsp->fsp_name->base_name = fname;
-
-	status = SMB_VFS_NEXT_FSET_DOS_ATTRIBUTES(handle, fsp, dosmode);
-
-	fsp->fsp_name->base_name = tmp_fname;
-	if (fsp->base_fsp != NULL) {
-		fsp->base_fsp->fsp_name->base_name = tmp_base_fname;
-	}
-
-done:
-	TALLOC_FREE(fname);
-	TALLOC_FREE(base_fname);
-
-	return status;
-}
-
-static NTSTATUS catia_fget_dos_attributes(struct vfs_handle_struct *handle,
-					  struct files_struct *fsp,
-					  uint32_t *dosmode)
-{
-	char *fname = NULL;
-	char *tmp_fname = NULL;
-	char *base_fname = NULL;
-	char *tmp_base_fname = NULL;
-	NTSTATUS status;
-
-	status = catia_string_replace_allocate(handle->conn,
-					       fsp->fsp_name->base_name,
-					       &fname, vfs_translate_to_unix);
-	if (!NT_STATUS_IS_OK(status)) {
-		errno = map_errno_from_nt_status(status);
-		goto done;
-	}
-
-	if (fsp->base_fsp != NULL) {
-		status = catia_string_replace_allocate(
-			handle->conn,
-			fsp->base_fsp->fsp_name->base_name,
-			&base_fname, vfs_translate_to_unix);
-		if (!NT_STATUS_IS_OK(status)) {
-			errno = map_errno_from_nt_status(status);
-			goto done;
-		}
-
-		tmp_base_fname = fsp->base_fsp->fsp_name->base_name;
-		fsp->base_fsp->fsp_name->base_name = base_fname;
-	}
-
-	tmp_fname = fsp->fsp_name->base_name;
-	fsp->fsp_name->base_name = fname;
-
-	status = SMB_VFS_NEXT_FGET_DOS_ATTRIBUTES(handle, fsp, dosmode);
-
-	fsp->fsp_name->base_name = tmp_fname;
-	if (fsp->base_fsp != NULL) {
-		fsp->base_fsp->fsp_name->base_name = tmp_base_fname;
-	}
-
-done:
-	TALLOC_FREE(fname);
-	TALLOC_FREE(base_fname);
-
-	return status;
-}
-
-static int catia_fchown(vfs_handle_struct *handle, files_struct *fsp, uid_t uid, gid_t gid)
-{
-	char *fname = NULL;
-	char *tmp_fname = NULL;
-	char *base_fname = NULL;
-	char *tmp_base_fname = NULL;
-	int ret = -1;
-	NTSTATUS status;
-
-	status = catia_string_replace_allocate(handle->conn,
-					       fsp->fsp_name->base_name,
-					       &fname, vfs_translate_to_unix);
-	if (!NT_STATUS_IS_OK(status)) {
-		errno = map_errno_from_nt_status(status);
-		goto done;
-	}
-
-	if (fsp->base_fsp != NULL) {
-		status = catia_string_replace_allocate(
-			handle->conn,
-			fsp->base_fsp->fsp_name->base_name,
-			&base_fname, vfs_translate_to_unix);
-		if (!NT_STATUS_IS_OK(status)) {
-			errno = map_errno_from_nt_status(status);
-			goto done;
-		}
-
-		tmp_base_fname = fsp->base_fsp->fsp_name->base_name;
-		fsp->base_fsp->fsp_name->base_name = base_fname;
-	}
-
-	tmp_fname = fsp->fsp_name->base_name;
-	fsp->fsp_name->base_name = fname;
-
-	ret = SMB_VFS_NEXT_FCHOWN(handle, fsp, uid, gid);
-
-	fsp->fsp_name->base_name = tmp_fname;
-	if (fsp->base_fsp != NULL) {
-		fsp->base_fsp->fsp_name->base_name = tmp_base_fname;
-	}
-
-done:
-	TALLOC_FREE(fname);
-	TALLOC_FREE(base_fname);
-
-	return ret;
-}
-
-static int catia_fchmod(vfs_handle_struct *handle, files_struct *fsp, mode_t mode)
-{
-	char *fname = NULL;
-	char *tmp_fname = NULL;
-	char *base_fname = NULL;
-	char *tmp_base_fname = NULL;
-	int ret = -1;
-	NTSTATUS status;
-
-	status = catia_string_replace_allocate(handle->conn,
-					       fsp->fsp_name->base_name,
-					       &fname, vfs_translate_to_unix);
-	if (!NT_STATUS_IS_OK(status)) {
-		errno = map_errno_from_nt_status(status);
-		goto done;
-	}
-
-	if (fsp->base_fsp != NULL) {
-		status = catia_string_replace_allocate(
-			handle->conn,
-			fsp->base_fsp->fsp_name->base_name,
-			&base_fname, vfs_translate_to_unix);
-		if (!NT_STATUS_IS_OK(status)) {
-			errno = map_errno_from_nt_status(status);
-			goto done;
-		}
-
-		tmp_base_fname = fsp->base_fsp->fsp_name->base_name;
-		fsp->base_fsp->fsp_name->base_name = base_fname;
-	}
-
-	tmp_fname = fsp->fsp_name->base_name;
-	fsp->fsp_name->base_name = fname;
-
-	ret = SMB_VFS_NEXT_FCHMOD(handle, fsp, mode);
-
-	fsp->fsp_name->base_name = tmp_fname;
-	if (fsp->base_fsp != NULL) {
-		fsp->base_fsp->fsp_name->base_name = tmp_base_fname;
-	}
-
-done:
-	TALLOC_FREE(fname);
-	TALLOC_FREE(base_fname);
-
-	return ret;
-}
-
-static NTSTATUS catia_readdir_attr(struct vfs_handle_struct *handle,
-				   const struct smb_filename *smb_fname_in,
-				   TALLOC_CTX *mem_ctx,
-				   struct readdir_attr_data **pattr_data)
-{
-	struct smb_filename *smb_fname;
-	char *fname = NULL;
-	NTSTATUS status;
-
-	status = catia_string_replace_allocate(handle->conn,
-					       smb_fname_in->base_name,
-					       &fname,
-					       vfs_translate_to_unix);
-	if (!NT_STATUS_IS_OK(status)) {
-		errno = map_errno_from_nt_status(status);
-		return status;
-	}
-
-	smb_fname = synthetic_smb_fname(talloc_tos(), fname, NULL,
-					&smb_fname_in->st, 0);
-
-	status = SMB_VFS_NEXT_READDIR_ATTR(handle, smb_fname, mem_ctx, pattr_data);
-
-	TALLOC_FREE(smb_fname);
-	return status;
-}
-
-static NTSTATUS catia_get_dos_attributes(struct vfs_handle_struct *handle,
-					 struct smb_filename *smb_fname,
-					 uint32_t *dosmode)
-{
-	char *mapped_name = NULL;
-	const char *path = smb_fname->base_name;
-	struct smb_filename *mapped_smb_fname = NULL;
-	NTSTATUS status;
-
-	status = catia_string_replace_allocate(handle->conn,
-				path, &mapped_name, vfs_translate_to_unix);
-	if (!NT_STATUS_IS_OK(status)) {
-		errno = map_errno_from_nt_status(status);
-		return status;
-	}
-	mapped_smb_fname = synthetic_smb_fname(talloc_tos(),
-					mapped_name,
-					NULL,
-					NULL,
-					smb_fname->flags);
-	if (mapped_smb_fname == NULL) {
-		TALLOC_FREE(mapped_name);
-		return NT_STATUS_NO_MEMORY;
-	}
-
-	status = SMB_VFS_NEXT_GET_DOS_ATTRIBUTES(handle,
-						 mapped_smb_fname,
-						 dosmode);
-	TALLOC_FREE(mapped_name);
-	TALLOC_FREE(mapped_smb_fname);
-
-	return status;
-}
-
-static NTSTATUS catia_set_dos_attributes(struct vfs_handle_struct *handle,
-					 const struct smb_filename *smb_fname,
-					 uint32_t dosmode)
-{
-	char *mapped_name = NULL;
-	const char *path = smb_fname->base_name;
-	struct smb_filename *mapped_smb_fname = NULL;
-	NTSTATUS status;
-
-	status = catia_string_replace_allocate(handle->conn,
-				path, &mapped_name, vfs_translate_to_unix);
-	if (!NT_STATUS_IS_OK(status)) {
-		errno = map_errno_from_nt_status(status);
-		return status;
-	}
-	mapped_smb_fname = synthetic_smb_fname(talloc_tos(),
-					mapped_name,
-					NULL,
-					NULL,
-					smb_fname->flags);
-	if (mapped_smb_fname == NULL) {
-		TALLOC_FREE(mapped_name);
-		return NT_STATUS_NO_MEMORY;
-	}
-
-	status = SMB_VFS_NEXT_SET_DOS_ATTRIBUTES(handle,
-						 mapped_smb_fname,
-						 dosmode);
-	TALLOC_FREE(mapped_name);
-	TALLOC_FREE(mapped_smb_fname);
-
-	return status;
-}
-
 static struct vfs_fn_pointers vfs_catia_fns = {
 	.mkdir_fn = catia_mkdir,
 	.rmdir_fn = catia_rmdir,
@@ -2171,28 +1141,6 @@
 	.listxattr_fn = catia_listxattr,
 	.removexattr_fn = catia_removexattr,
 	.setxattr_fn = catia_setxattr,
-	.pread_fn = catia_pread,
-	.pwrite_fn = catia_pwrite,
-	.fstat_fn = catia_fstat,
-	.ftruncate_fn = catia_ftruncate,
-	.fallocate_fn = catia_fallocate,
-	.fgetxattr_fn = catia_fgetxattr,
-	.flistxattr_fn = catia_flistxattr,
-	.fremovexattr_fn = catia_fremovexattr,
-	.fsetxattr_fn = catia_fsetxattr,
-	.sys_acl_get_fd_fn = catia_sys_acl_get_fd,
-	.sys_acl_blob_get_fd_fn = catia_sys_acl_blob_get_fd,
-	.sys_acl_set_fd_fn = catia_sys_acl_set_fd,
-	.fchmod_acl_fn = catia_fchmod_acl,
-	.fget_nt_acl_fn = catia_fget_nt_acl,
-	.fset_nt_acl_fn = catia_fset_nt_acl,
-	.get_dos_attributes_fn = catia_get_dos_attributes,
-	.set_dos_attributes_fn = catia_set_dos_attributes,
-	.fset_dos_attributes_fn = catia_fset_dos_attributes,
-	.fget_dos_attributes_fn = catia_fget_dos_attributes,
-	.fchown_fn = catia_fchown,
-	.fchmod_fn = catia_fchmod,
-	.readdir_attr_fn = catia_readdir_attr,
 };
 
 static_decl_vfs;
diff -Nru samba-4.5.4+dfsg/source3/modules/vfs_default.c samba-4.5.5+dfsg/source3/modules/vfs_default.c
--- samba-4.5.4+dfsg/source3/modules/vfs_default.c	2016-09-13 10:21:35.000000000 +0200
+++ samba-4.5.5+dfsg/source3/modules/vfs_default.c	2017-01-30 10:56:26.000000000 +0100
@@ -1537,7 +1537,7 @@
 			saved_errno = errno;
 		}
 
-		SMB_VFS_STRICT_UNLOCK(src_fsp->conn, src_fsp, &lck);
+		SMB_VFS_STRICT_UNLOCK(dest_fsp->conn, dest_fsp, &lck);
 
 		if (ret == -1) {
 			errno = saved_errno;
diff -Nru samba-4.5.4+dfsg/source3/modules/vfs_fruit.c samba-4.5.5+dfsg/source3/modules/vfs_fruit.c
--- samba-4.5.4+dfsg/source3/modules/vfs_fruit.c	2017-01-17 20:55:44.000000000 +0100
+++ samba-4.5.5+dfsg/source3/modules/vfs_fruit.c	2017-01-30 10:56:26.000000000 +0100
@@ -68,7 +68,7 @@
  *
  * The AFP_Resource stream is stored in an AppleDouble file prepending
  * "._" to the filename. On Solaris with ZFS the stream is optionally
- * stored in an EA "org.netatalk.resource".
+ * stored in an EA "org.netatalk.ressource".
  *
  *
  * Extended Attributes
@@ -343,6 +343,7 @@
 #define ad_getentryoff(ad,eid)     ((ad)->ad_eid[(eid)].ade_off)
 #define ad_setentrylen(ad,eid,len) ((ad)->ad_eid[(eid)].ade_len = (len))
 #define ad_setentryoff(ad,eid,off) ((ad)->ad_eid[(eid)].ade_off = (off))
+#define ad_entry(ad,eid)           ((ad)->ad_data + ad_getentryoff((ad),(eid)))
 
 struct ad_entry {
 	size_t ade_off;
@@ -351,8 +352,7 @@
 
 struct adouble {
 	vfs_handle_struct        *ad_handle;
-	int                       ad_fd;
-	bool                      ad_opened;
+	files_struct             *ad_fsp;
 	adouble_type_t            ad_type;
 	uint32_t                  ad_magic;
 	uint32_t                  ad_version;
@@ -378,7 +378,7 @@
 	{0, 0, 0}
 };
 
-/* AppleDouble resource fork file (the ones prefixed by "._") */
+/* AppleDouble ressource fork file (the ones prefixed by "._") */
 static const
 struct ad_entry_order entry_order_dot_und[ADEID_NUM_DOT_UND + 1] = {
 	{ADEID_FINDERI,    ADEDOFF_FINDERI_DOT_UND,  ADEDLEN_FINDERI},
@@ -387,8 +387,8 @@
 };
 
 /*
- * Fake AppleDouble entry oder for resource fork xattr.  The xattr
- * isn't an AppleDouble file, it simply contains the resource data,
+ * Fake AppleDouble entry oder for ressource fork xattr.  The xattr
+ * isn't an AppleDouble file, it simply contains the ressource data,
  * but in order to be able to use some API calls like ad_getentryoff()
  * we build a fake/helper struct adouble with this entry order struct.
  */
@@ -405,41 +405,15 @@
 	AD_DEV, AD_INO, AD_SYN, AD_ID
 };
 
-struct fio {
-	/* tcon config handle */
-	struct fruit_config_data *config;
-
-	/* Denote stream type, meta or rsrc */
-	adouble_type_t type;
-};
-
 /*
  * Forward declarations
  */
 static struct adouble *ad_init(TALLOC_CTX *ctx, vfs_handle_struct *handle,
-			       adouble_type_t type);
-static int ad_set(struct adouble *ad, const char *path);
-static int ad_fset(struct adouble *ad, files_struct *fsp);
+			       adouble_type_t type, files_struct *fsp);
+static int ad_write(struct adouble *ad, const char *path);
 static int adouble_path(TALLOC_CTX *ctx, const char *path_in, char **path_out);
 
 /**
- * Return a pointer to an AppleDouble entry
- *
- * Returns NULL if the entry is not present
- **/
-static char *ad_get_entry(const struct adouble *ad, int eid)
-{
-	off_t off = ad_getentryoff(ad, eid);
-	size_t len = ad_getentrylen(ad, eid);
-
-	if (off == 0 || len == 0) {
-		return NULL;
-	}
-
-	return ad->ad_data + off;
-}
-
-/**
  * Get a date
  **/
 static int ad_getdate(const struct adouble *ad,
@@ -447,19 +421,18 @@
 		      uint32_t *date)
 {
 	bool xlate = (dateoff & AD_DATE_UNIX);
-	char *p = NULL;
 
 	dateoff &= AD_DATE_MASK;
-	p = ad_get_entry(ad, ADEID_FILEDATESI);
-	if (p == NULL) {
+	if (!ad_getentryoff(ad, ADEID_FILEDATESI)) {
 		return -1;
 	}
 
 	if (dateoff > AD_DATE_ACCESS) {
 	    return -1;
 	}
-
-	memcpy(date, p + dateoff, sizeof(uint32_t));
+	memcpy(date,
+	       ad_entry(ad, ADEID_FILEDATESI) + dateoff,
+	       sizeof(uint32_t));
 
 	if (xlate) {
 		*date = AD_DATE_TO_UNIX(*date);
@@ -473,11 +446,9 @@
 static int ad_setdate(struct adouble *ad, unsigned int dateoff, uint32_t date)
 {
 	bool xlate = (dateoff & AD_DATE_UNIX);
-	char *p = NULL;
 
-	p = ad_get_entry(ad, ADEID_FILEDATESI);
-	if (p == NULL) {
-		return -1;
+	if (!ad_getentryoff(ad, ADEID_FILEDATESI)) {
+		return 0;
 	}
 
 	dateoff &= AD_DATE_MASK;
@@ -489,7 +460,7 @@
 		return -1;
 	}
 
-	memcpy(p + dateoff, &date, sizeof(date));
+	memcpy(ad_entry(ad, ADEID_FILEDATESI) + dateoff, &date, sizeof(date));
 
 	return 0;
 }
@@ -781,7 +752,7 @@
 /**
  * Read and parse Netatalk AppleDouble metadata xattr
  **/
-static ssize_t ad_read_meta(struct adouble *ad, const char *path)
+static ssize_t ad_header_read_meta(struct adouble *ad, const char *path)
 {
 	int      rc = 0;
 	ssize_t  ealen;
@@ -853,220 +824,184 @@
 	return ealen;
 }
 
-static int ad_open_meta(const char *path, int flags, mode_t mode)
-{
-	return open(path, flags, mode);
-}
-
-static int ad_open_rsrc_xattr(const char *path, int flags, mode_t mode)
-{
-#ifdef HAVE_ATTROPEN
-	/* FIXME: direct Solaris xattr syscall */
-	return attropen(path, AFPRESOURCE_EA_NETATALK, flags, mode);
-#else
-	errno = ENOSYS;
-	return -1;
-#endif
-}
-
-static int ad_open_rsrc_adouble(const char *path, int flags, mode_t mode)
-{
-	char *adp = NULL;
-	int ret;
-	int fd;
-
-	ret = adouble_path(talloc_tos(), path, &adp);
-	if (ret != 0) {
-		return -1;
-	}
-
-	fd = open(adp, flags, mode);
-	TALLOC_FREE(adp);
-
-	return fd;
-}
-
-static int ad_open_rsrc(vfs_handle_struct *handle,
-			const char *path,
-			int flags,
-			mode_t mode)
+/**
+ * Read and parse resource fork, either ._ AppleDouble file or xattr
+ **/
+static ssize_t ad_header_read_rsrc(struct adouble *ad, const char *path)
 {
 	struct fruit_config_data *config = NULL;
-	int fd;
+	int fd = -1;
+	int rc = 0;
+	ssize_t len;
+	char *adpath = NULL;
+	bool opened = false;
+	int mode;
+	struct adouble *meta_ad = NULL;
+	SMB_STRUCT_STAT sbuf;
+	bool ok;
+	int saved_errno = 0;
 
-	SMB_VFS_HANDLE_GET_DATA(handle, config,
+	SMB_VFS_HANDLE_GET_DATA(ad->ad_handle, config,
 				struct fruit_config_data, return -1);
 
-	if (config->rsrc == FRUIT_RSRC_XATTR) {
-		fd = ad_open_rsrc_xattr(path, flags, mode);
-	} else {
-		fd = ad_open_rsrc_adouble(path, flags, mode);
-	}
-
-	return fd;
-}
-
-static int ad_open(vfs_handle_struct *handle,
-		   struct adouble *ad,
-		   const char *path,
-		   adouble_type_t t,
-		   int flags,
-		   mode_t mode)
-{
-	int fd;
-
-	DBG_DEBUG("Path [%s] type [%s]\n",
-		  path, t == ADOUBLE_META ? "meta" : "rsrc");
+	/* Try rw first so we can use the fd in ad_convert() */
+	mode = O_RDWR;
 
-	if (t == ADOUBLE_META) {
-		fd = ad_open_meta(path, flags, mode);
+	if (ad->ad_fsp && ad->ad_fsp->fh && (ad->ad_fsp->fh->fd != -1)) {
+		fd = ad->ad_fsp->fh->fd;
 	} else {
-		fd = ad_open_rsrc(handle, path, flags, mode);
-	}
-
-	if (fd != -1) {
-		ad->ad_opened = true;
-		ad->ad_fd = fd;
-	}
-
-	DBG_DEBUG("Path [%s] type [%s] fd [%d]\n",
-		  path, t == ADOUBLE_META ? "meta" : "rsrc", fd);
-
-	return fd;
-}
-
-static ssize_t ad_read_rsrc_xattr(struct adouble *ad,
-				  const char *path)
-{
-	int ret;
-	SMB_STRUCT_STAT st;
-
-	/* FIXME: direct sys_fstat(), don't have an fsp */
-	ret = sys_fstat(ad->ad_fd, &st,
-			lp_fake_directory_create_times(
-				SNUM(ad->ad_handle->conn)));
-	if (ret != 0) {
-		return -1;
-	}
-
-	ad_setentrylen(ad, ADEID_RFORK, st.st_ex_size);
-	return st.st_ex_size;
-}
+		if (config->rsrc == FRUIT_RSRC_XATTR) {
+			adpath = talloc_strdup(talloc_tos(), path);
+		} else {
+			rc = adouble_path(talloc_tos(), path, &adpath);
+			if (rc != 0) {
+				goto exit;
+			}
+		}
 
-static ssize_t ad_read_rsrc_adouble(struct adouble *ad,
-				    const char *path)
-{
-	struct adouble *meta_ad = NULL;
-	SMB_STRUCT_STAT sbuf;
-	char *p_ad = NULL;
-	char *p_meta_ad = NULL;
-	ssize_t len;
-	int ret;
-	bool ok;
+	retry:
+		if (config->rsrc == FRUIT_RSRC_XATTR) {
+#ifndef HAVE_ATTROPEN
+			errno = ENOSYS;
+			rc = -1;
+			goto exit;
+#else
+			/* FIXME: direct Solaris xattr syscall */
+			fd = attropen(adpath, AFPRESOURCE_EA_NETATALK,
+				      mode, 0);
+#endif
+		} else {
+			/* FIXME: direct open(), don't have an fsp */
+			fd = open(adpath, mode);
+		}
 
-	len = sys_pread(ad->ad_fd, ad->ad_data, AD_DATASZ_DOT_UND, 0);
-	if (len != AD_DATASZ_DOT_UND) {
-		DBG_NOTICE("%s %s: bad size: %zd\n",
-			   path, strerror(errno), len);
-		return -1;
+		if (fd == -1) {
+			switch (errno) {
+			case EROFS:
+			case EACCES:
+				if (mode == O_RDWR) {
+					mode = O_RDONLY;
+					goto retry;
+				}
+				/* fall through ... */
+			default:
+				DEBUG(2, ("open AppleDouble: %s, %s\n",
+					  adpath, strerror(errno)));
+				rc = -1;
+				goto exit;
+			}
+		}
+		opened = true;
 	}
 
-	ret = sys_fstat(ad->ad_fd, &sbuf, lp_fake_directory_create_times(
+	if (config->rsrc == FRUIT_RSRC_XATTR) {
+		/* FIXME: direct sys_fstat(), don't have an fsp */
+		rc = sys_fstat(
+			fd, &sbuf,
+			lp_fake_directory_create_times(
 				SNUM(ad->ad_handle->conn)));
-	if (ret != 0) {
-		return -1;
-	}
+		if (rc != 0) {
+			goto exit;
+		}
+		len = sbuf.st_ex_size;
+		ad_setentrylen(ad, ADEID_RFORK, len);
+	} else {
+		/* FIXME: direct sys_pread(), don't have an fsp */
+		len = sys_pread(fd, ad->ad_data, AD_DATASZ_DOT_UND, 0);
+		if (len != AD_DATASZ_DOT_UND) {
+			DEBUG(2, ("%s: bad size: %zd\n",
+				  strerror(errno), len));
+			rc = -1;
+			goto exit;
+		}
 
-	/* Now parse entries */
-	ok = ad_unpack(ad, ADEID_NUM_DOT_UND, sbuf.st_ex_size);
-	if (!ok) {
-		DBG_ERR("invalid AppleDouble resource %s\n", path);
-		errno = EINVAL;
-		return -1;
-	}
+		/* FIXME: direct sys_fstat(), we don't have an fsp */
+		rc = sys_fstat(fd, &sbuf,
+			       lp_fake_directory_create_times(
+				       SNUM(ad->ad_handle->conn)));
+		if (rc != 0) {
+			goto exit;
+		}
 
-	if ((ad_getentryoff(ad, ADEID_FINDERI) != ADEDOFF_FINDERI_DOT_UND)
-	    || (ad_getentrylen(ad, ADEID_FINDERI) < ADEDLEN_FINDERI)
-	    || (ad_getentryoff(ad, ADEID_RFORK)	< ADEDOFF_RFORK_DOT_UND)) {
-		DBG_ERR("invalid AppleDouble resource %s\n", path);
-		errno = EINVAL;
-		return -1;
-	}
+		/* Now parse entries */
+		ok = ad_unpack(ad, ADEID_NUM_DOT_UND, sbuf.st_ex_size);
+		if (!ok) {
+			DEBUG(1, ("invalid AppleDouble ressource %s\n", path));
+			errno = EINVAL;
+			rc = -1;
+			goto exit;
+		}
 
-	if (ad_getentrylen(ad, ADEID_FINDERI) == ADEDLEN_FINDERI) {
-		return len;
-	}
+		if ((ad_getentryoff(ad, ADEID_FINDERI)
+		     != ADEDOFF_FINDERI_DOT_UND)
+		    || (ad_getentrylen(ad, ADEID_FINDERI)
+			< ADEDLEN_FINDERI)
+		    || (ad_getentryoff(ad, ADEID_RFORK)
+			< ADEDOFF_RFORK_DOT_UND)) {
+			DEBUG(2, ("invalid AppleDouble ressource %s\n", path));
+			errno = EINVAL;
+			rc = -1;
+			goto exit;
+		}
 
-	/*
-	 * Try to fixup AppleDouble files created by OS X with xattrs
-	 * appended to the ADEID_FINDERI entry. We simply remove the
-	 * xattrs blob, this means any fancy xattr that was stored
-	 * there is lost.
-	 */
+		if ((mode == O_RDWR)
+		    && (ad_getentrylen(ad, ADEID_FINDERI) > ADEDLEN_FINDERI)) {
+			rc = ad_convert(ad, fd);
+			if (rc != 0) {
+				rc = -1;
+				goto exit;
+			}
+			/*
+			 * Can't use ad_write() because we might not have a fsp
+			 */
+			ok = ad_pack(ad);
+			if (!ok) {
+				rc = -1;
+				goto exit;
+			}
+			/* FIXME: direct sys_pwrite(), don't have an fsp */
+			len = sys_pwrite(fd, ad->ad_data,
+					 AD_DATASZ_DOT_UND, 0);
+			if (len != AD_DATASZ_DOT_UND) {
+				DEBUG(2, ("%s: bad size: %zd\n", adpath, len));
+				rc = -1;
+				goto exit;
+			}
 
-	ret = ad_convert(ad, ad->ad_fd);
-	if (ret != 0) {
-		DBG_WARNING("Failed to convert [%s]\n", path);
-		return len;
-	}
+			meta_ad = ad_init(talloc_tos(), ad->ad_handle,
+					  ADOUBLE_META, NULL);
+			if (meta_ad == NULL) {
+				rc = -1;
+				goto exit;
+			}
 
-	ok = ad_pack(ad);
-	if (!ok) {
-		DBG_WARNING("ad_pack [%s] failed\n", path);
-		return -1;
-	}
+			memcpy(ad_entry(meta_ad, ADEID_FINDERI),
+			       ad_entry(ad, ADEID_FINDERI),
+			       ADEDLEN_FINDERI);
 
-	len = sys_pwrite(ad->ad_fd, ad->ad_data, AD_DATASZ_DOT_UND, 0);
-	if (len != AD_DATASZ_DOT_UND) {
-		DBG_ERR("%s: bad size: %zd\n", path, len);
-		return -1;
+			rc = ad_write(meta_ad, path);
+			if (rc != 0) {
+				rc = -1;
+				goto exit;
+			}
+		}
 	}
 
-	meta_ad = ad_init(talloc_tos(), ad->ad_handle, ADOUBLE_META);
-	if (meta_ad == NULL) {
-		return -1;
-	}
+	DEBUG(10, ("opened AppleDouble: %s\n", path));
 
-	p_ad = ad_get_entry(ad, ADEID_FINDERI);
-	if (p_ad == NULL) {
-		TALLOC_FREE(meta_ad);
-		return -1;
+exit:
+	if (rc != 0) {
+		saved_errno = errno;
+		len = -1;
 	}
-	p_meta_ad = ad_get_entry(meta_ad, ADEID_FINDERI);
-	if (p_meta_ad == NULL) {
-		TALLOC_FREE(meta_ad);
-		return -1;
+	if (opened && fd != -1) {
+		close(fd);
 	}
-
-	memcpy(p_meta_ad, p_ad, ADEDLEN_FINDERI);
-
-	ret = ad_set(meta_ad, path);
+	TALLOC_FREE(adpath);
 	TALLOC_FREE(meta_ad);
-	if (ret != 0) {
-		return -1;
-	}
-
-	return len;
-}
-
-/**
- * Read and parse resource fork, either ._ AppleDouble file or xattr
- **/
-static ssize_t ad_read_rsrc(struct adouble *ad,
-			    const char *path)
-{
-	struct fruit_config_data *config = NULL;
-	ssize_t len;
-
-	SMB_VFS_HANDLE_GET_DATA(ad->ad_handle, config,
-				struct fruit_config_data, return -1);
-
-	if (config->rsrc == FRUIT_RSRC_XATTR) {
-		len = ad_read_rsrc_xattr(ad, path);
-	} else {
-		len = ad_read_rsrc_adouble(ad, path);
+	if (rc != 0) {
+		errno = saved_errno;
 	}
-
 	return len;
 }
 
@@ -1077,23 +1012,14 @@
 {
 	switch (ad->ad_type) {
 	case ADOUBLE_META:
-		return ad_read_meta(ad, path);
+		return ad_header_read_meta(ad, path);
 	case ADOUBLE_RSRC:
-		return ad_read_rsrc(ad, path);
+		return ad_header_read_rsrc(ad, path);
 	default:
 		return -1;
 	}
 }
 
-static int adouble_destructor(struct adouble *ad)
-{
-	if ((ad->ad_fd != -1) && ad->ad_opened) {
-		close(ad->ad_fd);
-		ad->ad_fd = -1;
-	}
-	return 0;
-}
-
 /**
  * Allocate a struct adouble without initialiing it
  *
@@ -1103,11 +1029,14 @@
  * @param[in] ctx        talloc context
  * @param[in] handle     vfs handle
  * @param[in] type       type of AppleDouble, ADOUBLE_META or ADOUBLE_RSRC
+
+ * @param[in] fsp        if not NULL (for stream IO), the adouble handle is
+ *                       added as an fsp extension
  *
  * @return               adouble handle
  **/
 static struct adouble *ad_alloc(TALLOC_CTX *ctx, vfs_handle_struct *handle,
-				adouble_type_t type)
+				adouble_type_t type, files_struct *fsp)
 {
 	int rc = 0;
 	size_t adsize = 0;
@@ -1130,27 +1059,39 @@
 		return NULL;
 	}
 
-	ad = talloc_zero(ctx, struct adouble);
-	if (ad == NULL) {
-		rc = -1;
-		goto exit;
-	}
-
-	if (adsize) {
-		ad->ad_data = talloc_zero_array(ad, char, adsize);
-		if (ad->ad_data == NULL) {
+	if (!fsp) {
+		ad = talloc_zero(ctx, struct adouble);
+		if (ad == NULL) {
+			rc = -1;
+			goto exit;
+		}
+		if (adsize) {
+			ad->ad_data = talloc_zero_array(ad, char, adsize);
+		}
+	} else {
+		ad = (struct adouble *)VFS_ADD_FSP_EXTENSION(handle, fsp,
+							     struct adouble,
+							     NULL);
+		if (ad == NULL) {
 			rc = -1;
 			goto exit;
 		}
+		if (adsize) {
+			ad->ad_data = talloc_zero_array(
+				VFS_MEMCTX_FSP_EXTENSION(handle, fsp),
+				char, adsize);
+		}
+		ad->ad_fsp = fsp;
 	}
 
+	if (adsize && ad->ad_data == NULL) {
+		rc = -1;
+		goto exit;
+	}
 	ad->ad_handle = handle;
 	ad->ad_type = type;
 	ad->ad_magic = AD_MAGIC;
 	ad->ad_version = AD_VERSION;
-	ad->ad_fd = -1;
-
-	talloc_set_destructor(ad, adouble_destructor);
 
 exit:
 	if (rc != 0) {
@@ -1165,11 +1106,12 @@
  * @param[in] ctx        talloc context
  * @param[in] handle     vfs handle
  * @param[in] type       type of AppleDouble, ADOUBLE_META or ADOUBLE_RSRC
+ * @param[in] fsp        file handle, may be NULL for a type of e_ad_meta
  *
  * @return               adouble handle, initialized
  **/
 static struct adouble *ad_init(TALLOC_CTX *ctx, vfs_handle_struct *handle,
-			       adouble_type_t type)
+			       adouble_type_t type, files_struct *fsp)
 {
 	int rc = 0;
 	const struct ad_entry_order  *eid;
@@ -1195,7 +1137,7 @@
 		return NULL;
 	}
 
-	ad = ad_alloc(ctx, handle, type);
+	ad = ad_alloc(ctx, handle, type, fsp);
 	if (ad == NULL) {
 		return NULL;
 	}
@@ -1234,42 +1176,16 @@
 	int rc = 0;
 	ssize_t len;
 	struct adouble *ad = NULL;
-	int fd;
-	int mode;
 
 	DEBUG(10, ("ad_get(%s) called for %s\n",
 		   type == ADOUBLE_META ? "meta" : "rsrc", path));
 
-	ad = ad_alloc(ctx, handle, type);
+	ad = ad_alloc(ctx, handle, type, NULL);
 	if (ad == NULL) {
 		rc = -1;
 		goto exit;
 	}
 
-	/*
-	 * Here's the deal: for ADOUBLE_META we can do without an fd
-	 * as we can issue path based xattr calls. For ADOUBLE_RSRC
-	 * however we need a full-fledged fd for file IO on the ._
-	 * file.
-	 */
-	if (type == ADOUBLE_RSRC) {
-		/* Try rw first so we can use the fd in ad_convert() */
-		mode = O_RDWR;
-
-		fd = ad_open(handle, ad, path, ADOUBLE_RSRC, mode, 0);
-		if (fd == -1 && ((errno == EROFS) || (errno == EACCES))) {
-			mode = O_RDONLY;
-			fd = ad_open(handle, ad, path, ADOUBLE_RSRC, mode, 0);
-		}
-
-		if (fd == -1) {
-			DBG_DEBUG("ad_open [%s] error [%s]\n",
-				  path, strerror(errno));
-			rc = -1;
-			goto exit;
-		}
-	}
-
 	len = ad_read(ad, path);
 	if (len == -1) {
 		DEBUG(10, ("error reading AppleDouble for %s\n", path));
@@ -1288,144 +1204,21 @@
 }
 
 /**
- * Return AppleDouble data for a file
- *
- * @param[in] ctx      talloc context
- * @param[in] handle   vfs handle
- * @param[in] fsp      fsp to use for IO
- * @param[in] type     type of AppleDouble, ADOUBLE_META or ADOUBLE_RSRC
- *
- * @return             talloced struct adouble or NULL on error
- **/
-static struct adouble *ad_fget(TALLOC_CTX *ctx, vfs_handle_struct *handle,
-			       files_struct *fsp, adouble_type_t type)
-{
-	int rc = 0;
-	ssize_t len;
-	struct adouble *ad = NULL;
-	char *path = fsp->base_fsp->fsp_name->base_name;
-
-	DBG_DEBUG("ad_get(%s) path [%s]\n",
-		  type == ADOUBLE_META ? "meta" : "rsrc",
-		  fsp_str_dbg(fsp));
-
-	ad = ad_alloc(ctx, handle, type);
-	if (ad == NULL) {
-		rc = -1;
-		goto exit;
-	}
-
-	if ((fsp->fh != NULL) && (fsp->fh->fd != -1)) {
-		ad->ad_fd = fsp->fh->fd;
-	} else {
-		/*
-		 * Here's the deal: for ADOUBLE_META we can do without an fd
-		 * as we can issue path based xattr calls. For ADOUBLE_RSRC
-		 * however we need a full-fledged fd for file IO on the ._
-		 * file.
-		 */
-		int fd;
-		int mode;
-
-		if (type == ADOUBLE_RSRC) {
-			/* Try rw first so we can use the fd in ad_convert() */
-			mode = O_RDWR;
-
-			fd = ad_open(handle, ad, path, ADOUBLE_RSRC, mode, 0);
-			if (fd == -1 &&
-			    ((errno == EROFS) || (errno == EACCES)))
-			{
-				mode = O_RDONLY;
-				fd = ad_open(handle, ad, path, ADOUBLE_RSRC,
-					     mode, 0);
-			}
-
-			if (fd == -1) {
-				DBG_DEBUG("error opening AppleDouble for %s\n", path);
-				rc = -1;
-				goto exit;
-			}
-		}
-	}
-
-	len = ad_read(ad, path);
-	if (len == -1) {
-		DBG_DEBUG("error reading AppleDouble for %s\n", path);
-		rc = -1;
-		goto exit;
-	}
-
-exit:
-	DBG_DEBUG("ad_get(%s) path [%s] rc [%d]\n",
-		  type == ADOUBLE_META ? "meta" : "rsrc",
-		  fsp_str_dbg(fsp), rc);
-
-	if (rc != 0) {
-		TALLOC_FREE(ad);
-	}
-	return ad;
-}
-
-/**
  * Set AppleDouble metadata on a file or directory
  *
  * @param[in] ad      adouble handle
- *
- * @param[in] path    pathname to file or directory
- *
- * @return            status code, 0 means success
- **/
-static int ad_set(struct adouble *ad, const char *path)
-{
-	bool ok;
-	int ret;
-
-	DBG_DEBUG("Path [%s]\n", path);
-
-	if (ad->ad_type != ADOUBLE_META) {
-		DBG_ERR("ad_set on [%s] used with ADOUBLE_RSRC\n", path);
-		return -1;
-	}
 
-	ok = ad_pack(ad);
-	if (!ok) {
-		return -1;
-	}
-
-	ret = SMB_VFS_SETXATTR(ad->ad_handle->conn,
-			       path,
-			       AFPINFO_EA_NETATALK,
-			       ad->ad_data,
-			       AD_DATASZ_XATTR, 0);
-
-	DBG_DEBUG("Path [%s] ret [%d]\n", path, ret);
-
-	return ret;
-}
-
-/**
- * Set AppleDouble metadata on a file or directory
- *
- * @param[in] ad      adouble handle
- * @param[in] fsp     file handle
+ * @param[in] path    pathname to file or directory, may be NULL for a
+ *                    resource fork
  *
  * @return            status code, 0 means success
  **/
-static int ad_fset(struct adouble *ad, files_struct *fsp)
+static int ad_write(struct adouble *ad, const char *path)
 {
-	int rc = -1;
+	int rc = 0;
 	ssize_t len;
 	bool ok;
 
-	DBG_DEBUG("Path [%s]\n", fsp_str_dbg(fsp));
-
-	if ((fsp == NULL)
-	    || (fsp->fh == NULL)
-	    || (fsp->fh->fd == -1))
-	{
-		smb_panic("bad fsp");
-	}
-
 	ok = ad_pack(ad);
 	if (!ok) {
 		return -1;
@@ -1433,30 +1226,31 @@
 
 	switch (ad->ad_type) {
 	case ADOUBLE_META:
-		rc = SMB_VFS_FSETXATTR(fsp, AFPINFO_EA_NETATALK,
-				       ad->ad_data,
-				       AD_DATASZ_XATTR, 0);
+		rc = SMB_VFS_SETXATTR(ad->ad_handle->conn, path,
+				      AFPINFO_EA_NETATALK, ad->ad_data,
+				      AD_DATASZ_XATTR, 0);
 		break;
-
 	case ADOUBLE_RSRC:
-		len = SMB_VFS_NEXT_PWRITE(ad->ad_handle,
-					  fsp,
-					  ad->ad_data,
-					  talloc_get_size(ad->ad_data),
-					  0);
-		if (len != (ssize_t)talloc_get_size(ad->ad_data)) {
-			DBG_ERR("short write on %s: %zd", fsp_str_dbg(fsp), len);
-			return -1;
+		if ((ad->ad_fsp == NULL)
+		    || (ad->ad_fsp->fh == NULL)
+		    || (ad->ad_fsp->fh->fd == -1)) {
+			rc = -1;
+			goto exit;
+		}
+		/* FIXME: direct sys_pwrite(), don't have an fsp */
+		len = sys_pwrite(ad->ad_fsp->fh->fd, ad->ad_data,
+				 talloc_get_size(ad->ad_data), 0);
+		if (len != talloc_get_size(ad->ad_data)) {
+			DEBUG(1, ("short write on %s: %zd",
+				  fsp_str_dbg(ad->ad_fsp), len));
+			rc = -1;
+			goto exit;
 		}
-		rc = 0;
 		break;
-
 	default:
 		return -1;
 	}
-
-	DBG_DEBUG("Path [%s] rc [%d]\n", fsp_str_dbg(fsp), rc);
-
+exit:
 	return rc;
 }
 
@@ -1697,6 +1491,19 @@
 	return result;
 }
 
+/**
+ * Ensure ad_fsp is still valid
+ **/
+static bool fruit_fsp_recheck(struct adouble *ad, files_struct *fsp)
+{
+	if (ad->ad_fsp == fsp) {
+		return true;
+	}
+	ad->ad_fsp = fsp;
+
+	return true;
+}
+
 static bool add_fruit_stream(TALLOC_CTX *mem_ctx, unsigned int *num_streams,
 			     struct stream_struct **streams,
 			     const char *name, off_t size,
@@ -1723,40 +1530,6 @@
 	return true;
 }
 
-static bool filter_empty_rsrc_stream(unsigned int *num_streams,
-				     struct stream_struct **streams)
-{
-	struct stream_struct *tmp = *streams;
-	unsigned int i;
-
-	if (*num_streams == 0) {
-		return true;
-	}
-
-	for (i = 0; i < *num_streams; i++) {
-		if (strequal_m(tmp[i].name, AFPRESOURCE_STREAM)) {
-			break;
-		}
-	}
-
-	if (i == *num_streams) {
-		return true;
-	}
-
-	if (tmp[i].size > 0) {
-		return true;
-	}
-
-	TALLOC_FREE(tmp[i].name);
-	if (*num_streams - 1 > i) {
-		memmove(&tmp[i], &tmp[i+1],
-			(*num_streams - i - 1) * sizeof(struct stream_struct));
-	}
-
-	*num_streams -= 1;
-	return true;
-}
-
 static bool del_fruit_stream(TALLOC_CTX *mem_ctx, unsigned int *num_streams,
 			     struct stream_struct **streams,
 			     const char *name)
@@ -1788,29 +1561,16 @@
 	return true;
 }
 
-static bool ad_empty_finderinfo(const struct adouble *ad)
+static bool empty_finderinfo(const struct adouble *ad)
 {
-	int cmp;
-	char emptybuf[ADEDLEN_FINDERI] = {0};
-	char *fi = NULL;
 
-	fi = ad_get_entry(ad, ADEID_FINDERI);
-	if (fi == NULL) {
-		DBG_ERR("Missing FinderInfo in struct adouble [%p]\n", ad);
-		return false;
-	}
-
-	cmp = memcmp(emptybuf, fi, ADEDLEN_FINDERI);
-	return (cmp == 0);
-}
-
-static bool ai_empty_finderinfo(const AfpInfo *ai)
-{
-	int cmp;
 	char emptybuf[ADEDLEN_FINDERI] = {0};
-
-	cmp = memcmp(emptybuf, &ai->afpi_FinderInfo[0], ADEDLEN_FINDERI);
-	return (cmp == 0);
+	if (memcmp(emptybuf,
+		   ad_entry(ad, ADEID_FINDERI),
+		   ADEDLEN_FINDERI) == 0) {
+		return true;
+	}
+	return false;
 }
 
 /**
@@ -1822,21 +1582,6 @@
 	uint32_t t;
 	struct timespec creation_time = {0};
 	struct adouble *ad;
-	struct fruit_config_data *config = NULL;
-
-	SMB_VFS_HANDLE_GET_DATA(handle, config, struct fruit_config_data,
-				return);
-
-	switch (config->meta) {
-	case FRUIT_META_STREAM:
-		return;
-	case FRUIT_META_NETATALK:
-		/* Handled below */
-		break;
-	default:
-		DBG_ERR("Unexpected meta config [%d]\n", config->meta);
-		return;
-	}
 
 	ad = ad_get(talloc_tos(), handle, smb_fname->base_name, ADOUBLE_META);
 	if (ad == NULL) {
@@ -1952,8 +1697,6 @@
 	struct byte_range_lock *br_lck = NULL;
 	bool open_for_reading, open_for_writing, deny_read, deny_write;
 	off_t off;
-	bool have_read = false;
-	int flags;
 
 	/* FIXME: hardcoded data fork, add resource fork */
 	enum apple_fork fork_type = APPLE_FORK_DATA;
@@ -1965,26 +1708,6 @@
 		  deny_mode & DENY_READ ? "DENY_READ" : "-",
 		  deny_mode & DENY_WRITE ? "DENY_WRITE" : "-"));
 
-	if (fsp->fh->fd == -1) {
-		return NT_STATUS_OK;
-	}
-
-	flags = fcntl(fsp->fh->fd, F_GETFL);
-	if (flags == -1) {
-		DBG_ERR("fcntl get flags [%s] fd [%d] failed [%s]\n",
-			fsp_str_dbg(fsp), fsp->fh->fd, strerror(errno));
-		return map_nt_error_from_unix(errno);
-	}
-
-	if (flags & (O_RDONLY|O_RDWR)) {
-		/*
-		 * Applying fcntl read locks requires an fd opened for
-		 * reading. This means we won't be applying locks for
-		 * files openend write-only, but what can we do...
-		 */
-		have_read = true;
-	}
-
 	/*
 	 * Check read access and deny read mode
 	 */
@@ -2006,7 +1729,7 @@
 		}
 
 		/* Set locks */
-		if ((access_mask & FILE_READ_DATA) && have_read) {
+		if (access_mask & FILE_READ_DATA) {
 			off = access_to_netatalk_brl(fork_type, FILE_READ_DATA);
 			br_lck = do_lock(
 				handle->conn->sconn->msg_ctx, fsp,
@@ -2020,7 +1743,7 @@
 			TALLOC_FREE(br_lck);
 		}
 
-		if ((deny_mode & DENY_READ) && have_read) {
+		if (deny_mode & DENY_READ) {
 			off = denymode_to_netatalk_brl(fork_type, DENY_READ);
 			br_lck = do_lock(
 				handle->conn->sconn->msg_ctx, fsp,
@@ -2056,7 +1779,7 @@
 		}
 
 		/* Set locks */
-		if ((access_mask & FILE_WRITE_DATA) && have_read) {
+		if (access_mask & FILE_WRITE_DATA) {
 			off = access_to_netatalk_brl(fork_type, FILE_WRITE_DATA);
 			br_lck = do_lock(
 				handle->conn->sconn->msg_ctx, fsp,
@@ -2070,7 +1793,7 @@
 			TALLOC_FREE(br_lck);
 
 		}
-		if ((deny_mode & DENY_WRITE) && have_read) {
+		if (deny_mode & DENY_WRITE) {
 			off = denymode_to_netatalk_brl(fork_type, DENY_WRITE);
 			br_lck = do_lock(
 				handle->conn->sconn->msg_ctx, fsp,
@@ -2217,251 +1940,14 @@
 	return status;
 }
 
-static bool readdir_attr_meta_finderi_stream(
-	struct vfs_handle_struct *handle,
-	const struct smb_filename *smb_fname,
-	AfpInfo *ai)
-{
-	struct smb_filename *stream_name = NULL;
-	files_struct *fsp = NULL;
-	ssize_t nread;
-	NTSTATUS status;
-	int ret;
-	bool ok;
-	uint8_t buf[AFP_INFO_SIZE];
-
-	stream_name = synthetic_smb_fname(talloc_tos(),
-					  smb_fname->base_name,
-					  AFPINFO_STREAM_NAME,
-					  NULL, smb_fname->flags);
-	if (stream_name == NULL) {
-		return false;
-	}
-
-	ret = SMB_VFS_STAT(handle->conn, stream_name);
-	if (ret != 0) {
-		return false;
-	}
-
-	status = SMB_VFS_CREATE_FILE(
-		handle->conn,                           /* conn */
-		NULL,                                   /* req */
-		0,                                      /* root_dir_fid */
-		stream_name,				/* fname */
-		FILE_READ_DATA,                         /* access_mask */
-		(FILE_SHARE_READ | FILE_SHARE_WRITE |   /* share_access */
-			FILE_SHARE_DELETE),
-		FILE_OPEN,                              /* create_disposition*/
-		0,                                      /* create_options */
-		0,                                      /* file_attributes */
-		INTERNAL_OPEN_ONLY,                     /* oplock_request */
-		NULL,					/* lease */
-                0,                                      /* allocation_size */
-		0,                                      /* private_flags */
-		NULL,                                   /* sd */
-		NULL,                                   /* ea_list */
-		&fsp,                                   /* result */
-		NULL,                                   /* pinfo */
-		NULL, NULL);				/* create context */
-
-	TALLOC_FREE(stream_name);
-
-	if (!NT_STATUS_IS_OK(status)) {
-		return false;
-	}
-
-	nread = SMB_VFS_PREAD(fsp, &buf[0], AFP_INFO_SIZE, 0);
-	if (nread != AFP_INFO_SIZE) {
-		DBG_ERR("short read [%s] [%zd/%d]\n",
-			smb_fname_str_dbg(stream_name), nread, AFP_INFO_SIZE);
-		ok = false;
-		goto fail;
-	}
-
-	memcpy(&ai->afpi_FinderInfo[0], &buf[AFP_OFF_FinderInfo],
-	       AFP_FinderSize);
-
-	ok = true;
-
-fail:
-	if (fsp != NULL) {
-		close_file(NULL, fsp, NORMAL_CLOSE);
-	}
-
-	return ok;
-}
-
-static bool readdir_attr_meta_finderi_netatalk(
-	struct vfs_handle_struct *handle,
-	const struct smb_filename *smb_fname,
-	AfpInfo *ai)
-{
-	struct adouble *ad = NULL;
-	char *p = NULL;
-
-	ad = ad_get(talloc_tos(), handle, smb_fname->base_name, ADOUBLE_META);
-	if (ad == NULL) {
-		return false;
-	}
-
-	p = ad_get_entry(ad, ADEID_FINDERI);
-	if (p == NULL) {
-		DBG_ERR("No ADEID_FINDERI for [%s]\n", smb_fname->base_name);
-		TALLOC_FREE(ad);
-		return false;
-	}
-
-	memcpy(&ai->afpi_FinderInfo[0], p, AFP_FinderSize);
-	TALLOC_FREE(ad);
-	return true;
-}
-
-static bool readdir_attr_meta_finderi(struct vfs_handle_struct *handle,
-				      const struct smb_filename *smb_fname,
-				      struct readdir_attr_data *attr_data)
-{
-	struct fruit_config_data *config = NULL;
-	uint32_t date_added;
-	AfpInfo ai = {0};
-	bool ok;
-
-	SMB_VFS_HANDLE_GET_DATA(handle, config,
-				struct fruit_config_data,
-				return false);
-
-	switch (config->meta) {
-	case FRUIT_META_NETATALK:
-		ok = readdir_attr_meta_finderi_netatalk(
-			handle, smb_fname, &ai);
-		break;
-
-	case FRUIT_META_STREAM:
-		ok = readdir_attr_meta_finderi_stream(
-			handle, smb_fname, &ai);
-		break;
-
-	default:
-		DBG_ERR("Unexpected meta config [%d]\n", config->meta);
-		return false;
-	}
-
-	if (!ok) {
-		/* Don't bother with errors, it's likely ENOENT */
-		return true;
-	}
-
-	if (S_ISREG(smb_fname->st.st_ex_mode)) {
-		/* finder_type */
-		memcpy(&attr_data->attr_data.aapl.finder_info[0],
-		       &ai.afpi_FinderInfo[0], 4);
-
-		/* finder_creator */
-		memcpy(&attr_data->attr_data.aapl.finder_info[0] + 4,
-		       &ai.afpi_FinderInfo[4], 4);
-	}
-
-	/* finder_flags */
-	memcpy(&attr_data->attr_data.aapl.finder_info[0] + 8,
-	       &ai.afpi_FinderInfo[8], 2);
-
-	/* finder_ext_flags */
-	memcpy(&attr_data->attr_data.aapl.finder_info[0] + 10,
-	       &ai.afpi_FinderInfo[24], 2);
-
-	/* creation date */
-	date_added = convert_time_t_to_uint32_t(
-		smb_fname->st.st_ex_btime.tv_sec - AD_DATE_DELTA);
-
-	RSIVAL(&attr_data->attr_data.aapl.finder_info[0], 12, date_added);
-
-	return true;
-}
-
-static uint64_t readdir_attr_rfork_size_adouble(
-	struct vfs_handle_struct *handle,
-	const struct smb_filename *smb_fname)
-{
-	struct adouble *ad = NULL;
-	uint64_t rfork_size;
-
-	ad = ad_get(talloc_tos(), handle, smb_fname->base_name,
-		    ADOUBLE_RSRC);
-	if (ad == NULL) {
-		return 0;
-	}
-
-	rfork_size = ad_getentrylen(ad, ADEID_RFORK);
-	TALLOC_FREE(ad);
-
-	return rfork_size;
-}
-
-static uint64_t readdir_attr_rfork_size_stream(
-	struct vfs_handle_struct *handle,
-	const struct smb_filename *smb_fname)
-{
-	struct smb_filename *stream_name = NULL;
-	int ret;
-	uint64_t rfork_size;
-
-	stream_name = synthetic_smb_fname(talloc_tos(),
-					  smb_fname->base_name,
-					  AFPRESOURCE_STREAM_NAME,
-					  NULL, 0);
-	if (stream_name == NULL) {
-		return 0;
-	}
-
-	ret = SMB_VFS_STAT(handle->conn, stream_name);
-	if (ret != 0) {
-		TALLOC_FREE(stream_name);
-		return 0;
-	}
-
-	rfork_size = stream_name->st.st_ex_size;
-	TALLOC_FREE(stream_name);
-
-	return rfork_size;
-}
-
-static uint64_t readdir_attr_rfork_size(struct vfs_handle_struct *handle,
-					const struct smb_filename *smb_fname)
-{
-	struct fruit_config_data *config = NULL;
-	uint64_t rfork_size;
-
-	SMB_VFS_HANDLE_GET_DATA(handle, config,
-				struct fruit_config_data,
-				return 0);
-
-	switch (config->rsrc) {
-	case FRUIT_RSRC_ADFILE:
-	case FRUIT_RSRC_XATTR:
-		rfork_size = readdir_attr_rfork_size_adouble(handle,
-							     smb_fname);
-		break;
-
-	case FRUIT_META_STREAM:
-		rfork_size = readdir_attr_rfork_size_stream(handle,
-							    smb_fname);
-		break;
-
-	default:
-		DBG_ERR("Unexpected rsrc config [%d]\n", config->rsrc);
-		rfork_size = 0;
-		break;
-	}
-
-	return rfork_size;
-}
-
 static NTSTATUS readdir_attr_macmeta(struct vfs_handle_struct *handle,
 				     const struct smb_filename *smb_fname,
 				     struct readdir_attr_data *attr_data)
 {
 	NTSTATUS status = NT_STATUS_OK;
+	uint32_t date_added;
+	struct adouble *ad = NULL;
 	struct fruit_config_data *config = NULL;
-	bool ok;
 
 	SMB_VFS_HANDLE_GET_DATA(handle, config,
 				struct fruit_config_data,
@@ -2476,10 +1962,13 @@
 	 */
 
 	if (config->readdir_attr_rsize) {
-		uint64_t rfork_size;
-
-		rfork_size = readdir_attr_rfork_size(handle, smb_fname);
-		attr_data->attr_data.aapl.rfork_size = rfork_size;
+		ad = ad_get(talloc_tos(), handle, smb_fname->base_name,
+			    ADOUBLE_RSRC);
+		if (ad) {
+			attr_data->attr_data.aapl.rfork_size = ad_getentrylen(
+				ad, ADEID_RFORK);
+			TALLOC_FREE(ad);
+		}
 	}
 
 	/*
@@ -2487,12 +1976,37 @@
 	 */
 
 	if (config->readdir_attr_finder_info) {
-		ok = readdir_attr_meta_finderi(handle, smb_fname, attr_data);
-		if (!ok) {
-			status = NT_STATUS_INTERNAL_ERROR;
+		ad = ad_get(talloc_tos(), handle, smb_fname->base_name,
+			    ADOUBLE_META);
+		if (ad) {
+			if (S_ISREG(smb_fname->st.st_ex_mode)) {
+				/* finder_type */
+				memcpy(&attr_data->attr_data.aapl.finder_info[0],
+				       ad_entry(ad, ADEID_FINDERI), 4);
+
+				/* finder_creator */
+				memcpy(&attr_data->attr_data.aapl.finder_info[0] + 4,
+				       ad_entry(ad, ADEID_FINDERI) + 4, 4);
+			}
+
+			/* finder_flags */
+			memcpy(&attr_data->attr_data.aapl.finder_info[0] + 8,
+			       ad_entry(ad, ADEID_FINDERI) + 8, 2);
+
+			/* finder_ext_flags */
+			memcpy(&attr_data->attr_data.aapl.finder_info[0] + 10,
+			       ad_entry(ad, ADEID_FINDERI) + 24, 2);
+
+			/* creation date */
+			date_added = convert_time_t_to_uint32_t(
+				smb_fname->st.st_ex_btime.tv_sec - AD_DATE_DELTA);
+			RSIVAL(&attr_data->attr_data.aapl.finder_info[0], 12, date_added);
+
+			TALLOC_FREE(ad);
 		}
 	}
 
+	TALLOC_FREE(ad);
 	return status;
 }
 
@@ -2602,87 +2116,25 @@
 	return rc;
 }
 
-static int fruit_open_meta_stream(vfs_handle_struct *handle,
-				  struct smb_filename *smb_fname,
-				  files_struct *fsp,
-				  int flags,
-				  mode_t mode)
-{
-	AfpInfo *ai = NULL;
-	char afpinfo_buf[AFP_INFO_SIZE];
-	ssize_t len, written;
-	int hostfd = -1;
-	int rc = -1;
-
-	hostfd = SMB_VFS_NEXT_OPEN(handle, smb_fname, fsp, flags, mode);
-	if (hostfd == -1) {
-		return -1;
-	}
-
-	if (!(flags & (O_CREAT | O_TRUNC))) {
-		return hostfd;
-	}
-
-	ai = afpinfo_new(talloc_tos());
-	if (ai == NULL) {
-		rc = -1;
-		goto fail;
-	}
-
-	len = afpinfo_pack(ai, afpinfo_buf);
-	if (len != AFP_INFO_SIZE) {
-		rc = -1;
-		goto fail;
-	}
-
-	/* Set fd, needed in SMB_VFS_NEXT_PWRITE() */
-	fsp->fh->fd = hostfd;
-
-	written = SMB_VFS_NEXT_PWRITE(handle, fsp, afpinfo_buf,
-				      AFP_INFO_SIZE, 0);
-	if (written != AFP_INFO_SIZE) {
-		DBG_ERR("bad write [%zd/%d]\n", written, AFP_INFO_SIZE);
-		rc = -1;
-		goto fail;
-	}
-
-	/* Reset fd, set above just for SMB_VFS_NEXT_PWRITE() */
-	fsp->fh->fd = -1;
-
-	rc = 0;
-fail:
-	DBG_DEBUG("rc=%d, fd=%d\n", rc, hostfd);
-
-	if (rc != 0) {
-		int saved_errno = errno;
-		if (hostfd >= 0) {
-			/*
-			 * BUGBUGBUG -- we would need to call
-			 * fd_close_posix here, but we don't have a
-			 * full fsp yet
-			 */
-			fsp->fh->fd = hostfd;
-			SMB_VFS_CLOSE(fsp);
-		}
-		hostfd = -1;
-		errno = saved_errno;
-	}
-	return hostfd;
-}
-
-static int fruit_open_meta_netatalk(vfs_handle_struct *handle,
-				    struct smb_filename *smb_fname,
-				    files_struct *fsp,
-				    int flags,
-				    mode_t mode)
+static int fruit_open_meta(vfs_handle_struct *handle,
+			   struct smb_filename *smb_fname,
+			   files_struct *fsp, int flags, mode_t mode)
 {
 	int rc = 0;
+	struct fruit_config_data *config = NULL;
 	struct smb_filename *smb_fname_base = NULL;
 	int baseflags;
 	int hostfd = -1;
 	struct adouble *ad = NULL;
 
-	DBG_DEBUG("Path [%s]\n", smb_fname_str_dbg(smb_fname));
+	DEBUG(10, ("fruit_open_meta for %s\n", smb_fname_str_dbg(smb_fname)));
+
+	SMB_VFS_HANDLE_GET_DATA(handle, config,
+				struct fruit_config_data, return -1);
+
+	if (config->meta == FRUIT_META_STREAM) {
+		return SMB_VFS_NEXT_OPEN(handle, smb_fname, fsp, flags, mode);
+	}
 
 	/* Create an smb_filename with stream_name == NULL. */
 	smb_fname_base = synthetic_smb_fname(talloc_tos(),
@@ -2732,22 +2184,29 @@
 		 * The attribute does not exist or needs to be truncated,
 		 * create an AppleDouble EA
 		 */
-		ad = ad_init(fsp, handle, ADOUBLE_META);
+		ad = ad_init(VFS_MEMCTX_FSP_EXTENSION(handle, fsp),
+			     handle, ADOUBLE_META, fsp);
 		if (ad == NULL) {
 			rc = -1;
 			goto exit;
 		}
 
-		fsp->fh->fd = hostfd;
-
-		rc = ad_fset(ad, fsp);
-		fsp->fh->fd = -1;
+		rc = ad_write(ad, smb_fname->base_name);
 		if (rc != 0) {
 			rc = -1;
 			goto exit;
 		}
-
-		TALLOC_FREE(ad);
+	} else {
+		ad = ad_alloc(VFS_MEMCTX_FSP_EXTENSION(handle, fsp),
+			      handle, ADOUBLE_META, fsp);
+		if (ad == NULL) {
+			rc = -1;
+			goto exit;
+		}
+		if (ad_read(ad, smb_fname->base_name) == -1) {
+			rc = -1;
+			goto exit;
+		}
 	}
 
 exit:
@@ -2769,64 +2228,47 @@
 	return hostfd;
 }
 
-static int fruit_open_meta(vfs_handle_struct *handle,
+static int fruit_open_rsrc(vfs_handle_struct *handle,
 			   struct smb_filename *smb_fname,
 			   files_struct *fsp, int flags, mode_t mode)
 {
-	int fd;
-	struct fruit_config_data *config = NULL;
-	struct fio *fio = NULL;
-
-	DBG_DEBUG("path [%s]\n", smb_fname_str_dbg(smb_fname));
-
-	SMB_VFS_HANDLE_GET_DATA(handle, config,
-				struct fruit_config_data, return -1);
-
-	switch (config->meta) {
-	case FRUIT_META_STREAM:
-		fd = fruit_open_meta_stream(handle, smb_fname,
-					    fsp, flags, mode);
-		break;
-
-	case FRUIT_META_NETATALK:
-		fd = fruit_open_meta_netatalk(handle, smb_fname,
-					      fsp, flags, mode);
-		break;
-
-	default:
-		DBG_ERR("Unexpected meta config [%d]\n", config->meta);
-		return -1;
-	}
-
-	DBG_DEBUG("path [%s] fd [%d]\n", smb_fname_str_dbg(smb_fname), fd);
-
-	if (fd == -1) {
-		return -1;
-	}
-
-	fio = (struct fio *)VFS_ADD_FSP_EXTENSION(handle, fsp, struct fio, NULL);
-	fio->type = ADOUBLE_META;
-	fio->config = config;
-
-	return fd;
-}
-
-static int fruit_open_rsrc_adouble(vfs_handle_struct *handle,
-				   struct smb_filename *smb_fname,
-				   files_struct *fsp,
-				   int flags,
-				   mode_t mode)
-{
 	int rc = 0;
+	struct fruit_config_data *config = NULL;
 	struct adouble *ad = NULL;
 	struct smb_filename *smb_fname_base = NULL;
-	struct fruit_config_data *config = NULL;
 	char *adpath = NULL;
 	int hostfd = -1;
 
+	DEBUG(10, ("fruit_open_rsrc for %s\n", smb_fname_str_dbg(smb_fname)));
+
 	SMB_VFS_HANDLE_GET_DATA(handle, config,
 				struct fruit_config_data, return -1);
 
+	switch (config->rsrc) {
+	case FRUIT_RSRC_STREAM:
+		return SMB_VFS_NEXT_OPEN(handle, smb_fname, fsp, flags, mode);
+	case FRUIT_RSRC_XATTR:
+#ifdef HAVE_ATTROPEN
+		hostfd = attropen(smb_fname->base_name,
+				  AFPRESOURCE_EA_NETATALK, flags, mode);
+		if (hostfd == -1) {
+			return -1;
+		}
+		ad = ad_init(VFS_MEMCTX_FSP_EXTENSION(handle, fsp),
+			     handle, ADOUBLE_RSRC, fsp);
+		if (ad == NULL) {
+			rc = -1;
+			goto exit;
+		}
+		goto exit;
+#else
+		errno = ENOTSUP;
+		return -1;
+#endif
+	default:
+		break;
+	}
+
 	if (!(flags & O_CREAT) && !VALID_STAT(smb_fname->st)) {
 		rc = SMB_VFS_NEXT_STAT(handle, smb_fname);
 		if (rc != 0) {
@@ -2872,22 +2314,32 @@
 		goto exit;
 	}
 
+	/* REVIEW: we need this in ad_write() */
+	fsp->fh->fd = hostfd;
+
 	if (flags & (O_CREAT | O_TRUNC)) {
-		ad = ad_init(fsp, handle, ADOUBLE_RSRC);
+		ad = ad_init(VFS_MEMCTX_FSP_EXTENSION(handle, fsp),
+			     handle, ADOUBLE_RSRC, fsp);
 		if (ad == NULL) {
 			rc = -1;
 			goto exit;
 		}
-
-		fsp->fh->fd = hostfd;
-
-		rc = ad_fset(ad, fsp);
-		fsp->fh->fd = -1;
+		rc = ad_write(ad, smb_fname->base_name);
 		if (rc != 0) {
 			rc = -1;
 			goto exit;
 		}
-		TALLOC_FREE(ad);
+	} else {
+		ad = ad_alloc(VFS_MEMCTX_FSP_EXTENSION(handle, fsp),
+			      handle, ADOUBLE_RSRC, fsp);
+		if (ad == NULL) {
+			rc = -1;
+			goto exit;
+		}
+		if (ad_read(ad, smb_fname->base_name) == -1) {
+			rc = -1;
+			goto exit;
+		}
 	}
 
 exit:
@@ -2913,100 +2365,24 @@
 	return hostfd;
 }
 
-static int fruit_open_rsrc_xattr(vfs_handle_struct *handle,
-				 struct smb_filename *smb_fname,
-				 files_struct *fsp,
-				 int flags,
-				 mode_t mode)
-{
-#ifdef HAVE_ATTROPEN
-	int fd = -1;
-
-	fd = attropen(smb_fname->base_name,
-		      AFPRESOURCE_EA_NETATALK,
-		      flags,
-		      mode);
-	if (fd == -1) {
-		return -1;
-	}
-
-	return fd;
-
-#else
-	errno = ENOSYS;
-	return -1;
-#endif
-}
-
-static int fruit_open_rsrc(vfs_handle_struct *handle,
-			   struct smb_filename *smb_fname,
-			   files_struct *fsp, int flags, mode_t mode)
-{
-	int fd;
-	struct fruit_config_data *config = NULL;
-	struct fio *fio = NULL;
-
-	DBG_DEBUG("Path [%s]\n", smb_fname_str_dbg(smb_fname));
-
-	SMB_VFS_HANDLE_GET_DATA(handle, config,
-				struct fruit_config_data, return -1);
-
-	switch (config->rsrc) {
-	case FRUIT_RSRC_STREAM:
-		fd = SMB_VFS_NEXT_OPEN(handle, smb_fname, fsp, flags, mode);
-		break;
-
-	case FRUIT_RSRC_ADFILE:
-		fd = fruit_open_rsrc_adouble(handle, smb_fname,
-					     fsp, flags, mode);
-		break;
-
-	case FRUIT_RSRC_XATTR:
-		fd = fruit_open_rsrc_xattr(handle, smb_fname,
-					   fsp, flags, mode);
-		break;
-
-	default:
-		DBG_ERR("Unexpected rsrc config [%d]\n", config->rsrc);
-		return -1;
-	}
-
-	DBG_DEBUG("Path [%s] fd [%d]\n", smb_fname_str_dbg(smb_fname), fd);
-
-	if (fd == -1) {
-		return -1;
-	}
-
-	fio = (struct fio *)VFS_ADD_FSP_EXTENSION(handle, fsp, struct fio, NULL);
-	fio->type = ADOUBLE_RSRC;
-	fio->config = config;
-
-	return fd;
-}
-
 static int fruit_open(vfs_handle_struct *handle,
                       struct smb_filename *smb_fname,
                       files_struct *fsp, int flags, mode_t mode)
 {
-	int fd;
-
-	DBG_DEBUG("Path [%s]\n", smb_fname_str_dbg(smb_fname));
+	DEBUG(10, ("fruit_open called for %s\n",
+		   smb_fname_str_dbg(smb_fname)));
 
 	if (!is_ntfs_stream_smb_fname(smb_fname)) {
 		return SMB_VFS_NEXT_OPEN(handle, smb_fname, fsp, flags, mode);
 	}
 
 	if (is_afpinfo_stream(smb_fname)) {
-		fd = fruit_open_meta(handle, smb_fname, fsp, flags, mode);
+		return fruit_open_meta(handle, smb_fname, fsp, flags, mode);
 	} else if (is_afpresource_stream(smb_fname)) {
-		fd = fruit_open_rsrc(handle, smb_fname, fsp, flags, mode);
-	} else {
-		fd = SMB_VFS_NEXT_OPEN(handle, smb_fname, fsp, flags, mode);
+		return fruit_open_rsrc(handle, smb_fname, fsp, flags, mode);
 	}
 
-	DBG_DEBUG("Path [%s] fd [%d]\n", smb_fname_str_dbg(smb_fname), fd);
-
-	return fd;
+	return SMB_VFS_NEXT_OPEN(handle, smb_fname, fsp, flags, mode);
 }
 
 static int fruit_rename(struct vfs_handle_struct *handle,
@@ -3017,27 +2393,19 @@
 	char *src_adouble_path = NULL;
 	char *dst_adouble_path = NULL;
 	struct fruit_config_data *config = NULL;
-	struct smb_filename *src_adp_smb_fname = NULL;
-	struct smb_filename *dst_adp_smb_fname = NULL;
 
-	SMB_VFS_HANDLE_GET_DATA(handle, config,
-				struct fruit_config_data, return -1);
+	rc = SMB_VFS_NEXT_RENAME(handle, smb_fname_src, smb_fname_dst);
 
-	if (!VALID_STAT(smb_fname_src->st)) {
-		DBG_ERR("Need valid stat for [%s]\n",
-			smb_fname_str_dbg(smb_fname_src));
-		return -1;
+	if (!VALID_STAT(smb_fname_src->st)
+	    || !S_ISREG(smb_fname_src->st.st_ex_mode)) {
+		return rc;
 	}
 
-	rc = SMB_VFS_NEXT_RENAME(handle, smb_fname_src, smb_fname_dst);
-	if (rc != 0) {
-		return -1;
-	}
+	SMB_VFS_HANDLE_GET_DATA(handle, config,
+				struct fruit_config_data, return -1);
 
-	if ((config->rsrc != FRUIT_RSRC_ADFILE) ||
-	    (!S_ISREG(smb_fname_src->st.st_ex_mode)))
-	{
-		return 0;
+	if (config->rsrc == FRUIT_RSRC_XATTR) {
+		return rc;
 	}
 
 	rc = adouble_path(talloc_tos(), smb_fname_src->base_name,
@@ -3045,271 +2413,93 @@
 	if (rc != 0) {
 		goto done;
 	}
-	src_adp_smb_fname = synthetic_smb_fname(talloc_tos(),
-						src_adouble_path,
-						NULL, NULL,
-						smb_fname_src->flags);
-	TALLOC_FREE(src_adouble_path);
-	if (src_adp_smb_fname == NULL) {
-		rc = -1;
-		goto done;
-	}
-
 	rc = adouble_path(talloc_tos(), smb_fname_dst->base_name,
 			  &dst_adouble_path);
 	if (rc != 0) {
 		goto done;
 	}
-	dst_adp_smb_fname = synthetic_smb_fname(talloc_tos(),
-						dst_adouble_path,
-						NULL, NULL,
-						smb_fname_dst->flags);
-	TALLOC_FREE(dst_adouble_path);
-	if (dst_adp_smb_fname == NULL) {
-		rc = -1;
-		goto done;
-	}
 
-	DBG_DEBUG("%s -> %s\n",
-		  smb_fname_str_dbg(src_adp_smb_fname),
-		  smb_fname_str_dbg(dst_adp_smb_fname));
+	DEBUG(10, ("fruit_rename: %s -> %s\n",
+		   src_adouble_path, dst_adouble_path));
 
-	rc = SMB_VFS_NEXT_RENAME(handle, src_adp_smb_fname, dst_adp_smb_fname);
+	rc = rename(src_adouble_path, dst_adouble_path);
 	if (errno == ENOENT) {
 		rc = 0;
 	}
 
+	TALLOC_FREE(src_adouble_path);
+	TALLOC_FREE(dst_adouble_path);
+
 done:
-	TALLOC_FREE(src_adp_smb_fname);
-	TALLOC_FREE(dst_adp_smb_fname);
 	return rc;
 }
 
-static int fruit_unlink_meta_stream(vfs_handle_struct *handle,
-				    const struct smb_filename *smb_fname)
-{
-	return SMB_VFS_NEXT_UNLINK(handle, smb_fname);
-}
-
-static int fruit_unlink_meta_netatalk(vfs_handle_struct *handle,
-				      const struct smb_filename *smb_fname)
-{
-	return SMB_VFS_REMOVEXATTR(handle->conn,
-				   smb_fname->base_name,
-				   AFPINFO_EA_NETATALK);
-}
-
-static int fruit_unlink_meta(vfs_handle_struct *handle,
-			     const struct smb_filename *smb_fname)
+static int fruit_unlink(vfs_handle_struct *handle,
+			const struct smb_filename *smb_fname)
 {
+	int rc = -1;
 	struct fruit_config_data *config = NULL;
-	int rc;
 
 	SMB_VFS_HANDLE_GET_DATA(handle, config,
 				struct fruit_config_data, return -1);
 
-	switch (config->meta) {
-	case FRUIT_META_STREAM:
-		rc = fruit_unlink_meta_stream(handle, smb_fname);
-		break;
-
-	case FRUIT_META_NETATALK:
-		rc = fruit_unlink_meta_netatalk(handle, smb_fname);
-		break;
-
-	default:
-		DBG_ERR("Unsupported meta config [%d]\n", config->meta);
-		return -1;
-	}
-
-	return rc;
-}
-
-static int fruit_unlink_rsrc_stream(vfs_handle_struct *handle,
-				    const struct smb_filename *smb_fname,
-				    bool force_unlink)
-{
-	int ret;
-
-	if (!force_unlink) {
-		struct smb_filename *smb_fname_cp = NULL;
-		off_t size;
+	if (!is_ntfs_stream_smb_fname(smb_fname)) {
+		char *adp = NULL;
 
-		smb_fname_cp = cp_smb_filename(talloc_tos(), smb_fname);
-		if (smb_fname_cp == NULL) {
+		rc = SMB_VFS_NEXT_UNLINK(handle, smb_fname);
+		if (rc != 0) {
 			return -1;
 		}
 
+		if (config->rsrc != FRUIT_RSRC_ADFILE) {
+			return 0;
+		}
+
 		/*
 		 * 0 byte resource fork streams are not listed by
 		 * vfs_streaminfo, as a result stream cleanup/deletion of file
 		 * deletion doesn't remove the resourcefork stream.
 		 */
-
-		ret = SMB_VFS_NEXT_STAT(handle, smb_fname_cp);
-		if (ret != 0) {
-			TALLOC_FREE(smb_fname_cp);
-			DBG_ERR("stat [%s] failed [%s]\n",
-				smb_fname_str_dbg(smb_fname_cp), strerror(errno));
+		rc = adouble_path(talloc_tos(),
+				  smb_fname->base_name, &adp);
+		if (rc != 0) {
 			return -1;
 		}
 
-		size = smb_fname_cp->st.st_ex_size;
-		TALLOC_FREE(smb_fname_cp);
-
-		if (size > 0) {
-			/* OS X ignores resource fork stream delete requests */
-			return 0;
+		/* FIXME: direct unlink(), missing smb_fname */
+		DBG_DEBUG("fruit_unlink: %s\n", adp);
+		rc = unlink(adp);
+		if ((rc == -1) && (errno == ENOENT)) {
+			rc = 0;
 		}
-	}
 
-	ret = SMB_VFS_NEXT_UNLINK(handle, smb_fname);
-	if ((ret != 0) && (errno == ENOENT) && force_unlink) {
-		ret = 0;
+		TALLOC_FREE(adp);
+		return 0;
 	}
 
-	return ret;
-}
-
-static int fruit_unlink_rsrc_adouble(vfs_handle_struct *handle,
-				     const struct smb_filename *smb_fname,
-				     bool force_unlink)
-{
-	int rc;
-	char *adp = NULL;
-	struct adouble *ad = NULL;
-	struct smb_filename *adp_smb_fname = NULL;
-
-	if (!force_unlink) {
-		ad = ad_get(talloc_tos(), handle, smb_fname->base_name,
-			    ADOUBLE_RSRC);
-		if (ad == NULL) {
-			errno = ENOENT;
-			return -1;
-		}
-
-
-		/*
-		 * 0 byte resource fork streams are not listed by
-		 * vfs_streaminfo, as a result stream cleanup/deletion of file
-		 * deletion doesn't remove the resourcefork stream.
-		 */
-
-		if (ad_getentrylen(ad, ADEID_RFORK) > 0) {
-			/* OS X ignores resource fork stream delete requests */
-			TALLOC_FREE(ad);
-			return 0;
+	if (is_afpinfo_stream(smb_fname)) {
+		if (config->meta == FRUIT_META_STREAM) {
+			rc = SMB_VFS_NEXT_UNLINK(handle, smb_fname);
+		} else {
+			rc = SMB_VFS_REMOVEXATTR(handle->conn,
+						 smb_fname->base_name,
+						 AFPINFO_EA_NETATALK);
 		}
 
-		TALLOC_FREE(ad);
-	}
-
-	rc = adouble_path(talloc_tos(), smb_fname->base_name, &adp);
-	if (rc != 0) {
-		return -1;
+		return rc;
 	}
 
-	adp_smb_fname = synthetic_smb_fname(talloc_tos(), adp,
-					    NULL, NULL,
-					    smb_fname->flags);
-	TALLOC_FREE(adp);
-	if (adp_smb_fname == NULL) {
-		return -1;
+	if (is_afpresource_stream(smb_fname)) {
+		/* OS X ignores deletes on the AFP_Resource stream */
+		return 0;
 	}
 
-	rc = SMB_VFS_NEXT_UNLINK(handle, adp_smb_fname);
-	TALLOC_FREE(adp_smb_fname);
-	if ((rc != 0) && (errno == ENOENT) && force_unlink) {
-		rc = 0;
-	}
+	return SMB_VFS_NEXT_UNLINK(handle, smb_fname);
 
-	return rc;
-}
 
-static int fruit_unlink_rsrc_xattr(vfs_handle_struct *handle,
-				   const struct smb_filename *smb_fname,
-				   bool force_unlink)
-{
-	/* Nothing to do here, removing the file will remove the xattr */
 	return 0;
 }
 
-static int fruit_unlink_rsrc(vfs_handle_struct *handle,
-			     const struct smb_filename *smb_fname,
-			     bool force_unlink)
-{
-	struct fruit_config_data *config = NULL;
-	int rc;
-
-	SMB_VFS_HANDLE_GET_DATA(handle, config,
-				struct fruit_config_data, return -1);
-
-	switch (config->rsrc) {
-	case FRUIT_RSRC_STREAM:
-		rc = fruit_unlink_rsrc_stream(handle, smb_fname, force_unlink);
-		break;
-
-	case FRUIT_RSRC_ADFILE:
-		rc = fruit_unlink_rsrc_adouble(handle, smb_fname, force_unlink);
-		break;
-
-	case FRUIT_RSRC_XATTR:
-		rc = fruit_unlink_rsrc_xattr(handle, smb_fname, force_unlink);
-		break;
-
-	default:
-		DBG_ERR("Unsupported rsrc config [%d]\n", config->rsrc);
-		return -1;
-	}
-
-	return rc;
-}
-
-static int fruit_unlink(vfs_handle_struct *handle,
-			const struct smb_filename *smb_fname)
-{
-	int rc;
-	struct fruit_config_data *config = NULL;
-	struct smb_filename *rsrc_smb_fname = NULL;
-
-	SMB_VFS_HANDLE_GET_DATA(handle, config,
-				struct fruit_config_data, return -1);
-
-	if (is_afpinfo_stream(smb_fname)) {
-		return fruit_unlink_meta(handle, smb_fname);
-	} else if (is_afpresource_stream(smb_fname)) {
-		return fruit_unlink_rsrc(handle, smb_fname, false);
-	} if (is_ntfs_stream_smb_fname(smb_fname)) {
-		return SMB_VFS_NEXT_UNLINK(handle, smb_fname);
-	}
-
-	/*
-	 * A request to delete the base file. Because 0 byte resource
-	 * fork streams are not listed by fruit_streaminfo,
-	 * delete_all_streams() can't remove 0 byte resource fork
-	 * streams, so we have to cleanup this here.
-	 */
-	rsrc_smb_fname = synthetic_smb_fname(talloc_tos(),
-					     smb_fname->base_name,
-					     AFPRESOURCE_STREAM_NAME,
-					     NULL,
-					     smb_fname->flags);
-	if (rsrc_smb_fname == NULL) {
-		return -1;
-	}
-
-	rc = fruit_unlink_rsrc(handle, rsrc_smb_fname, true);
-	if ((rc != 0) && (errno != ENOENT)) {
-		DBG_ERR("Forced unlink of [%s] failed [%s]\n",
-			smb_fname_str_dbg(rsrc_smb_fname), strerror(errno));
-		TALLOC_FREE(rsrc_smb_fname);
-		return -1;
-	}
-	TALLOC_FREE(rsrc_smb_fname);
-
-	return SMB_VFS_NEXT_UNLINK(handle, smb_fname);
-}
-
 static int fruit_chmod(vfs_handle_struct *handle,
 		       const struct smb_filename *smb_fname,
 		       mode_t mode)
@@ -3317,6 +2507,7 @@
 	int rc = -1;
 	char *adp = NULL;
 	struct fruit_config_data *config = NULL;
+	SMB_STRUCT_STAT sb;
 	const char *path = smb_fname->base_name;
 	struct smb_filename *smb_fname_adp = NULL;
 
@@ -3328,16 +2519,14 @@
 	SMB_VFS_HANDLE_GET_DATA(handle, config,
 				struct fruit_config_data, return -1);
 
-	if (config->rsrc != FRUIT_RSRC_ADFILE) {
-		return 0;
-	}
-
-	if (!VALID_STAT(smb_fname->st)) {
+	if (config->rsrc == FRUIT_RSRC_XATTR) {
 		return 0;
 	}
 
-	if (!S_ISREG(smb_fname->st.st_ex_mode)) {
-		return 0;
+	/* FIXME: direct sys_lstat(), missing smb_fname */
+	rc = sys_lstat(path, &sb, false);
+	if (rc != 0 || !S_ISREG(sb.st_ex_mode)) {
+		return rc;
 	}
 
 	rc = adouble_path(talloc_tos(), path, &adp);
@@ -3377,6 +2566,7 @@
 	char *adp = NULL;
 	struct fruit_config_data *config = NULL;
 	struct smb_filename *adp_smb_fname = NULL;
+	SMB_STRUCT_STAT sb;
 
 	rc = SMB_VFS_NEXT_CHOWN(handle, smb_fname, uid, gid);
 	if (rc != 0) {
@@ -3386,16 +2576,14 @@
 	SMB_VFS_HANDLE_GET_DATA(handle, config,
 				struct fruit_config_data, return -1);
 
-	if (config->rsrc != FRUIT_RSRC_ADFILE) {
-		return 0;
-	}
-
-	if (!VALID_STAT(smb_fname->st)) {
-		return 0;
+	if (config->rsrc == FRUIT_RSRC_XATTR) {
+		return rc;
 	}
 
-	if (!S_ISREG(smb_fname->st.st_ex_mode)) {
-		return 0;
+	/* FIXME: direct sys_lstat(), need non-const smb_fname */
+	rc = sys_lstat(smb_fname->base_name, &sb, false);
+	if (rc != 0 || !S_ISREG(sb.st_ex_mode)) {
+		return rc;
 	}
 
 	rc = adouble_path(talloc_tos(), smb_fname->base_name, &adp);
@@ -3433,11 +2621,12 @@
 	DIR *dh = NULL;
 	struct dirent *de;
 	struct fruit_config_data *config;
+	const char *path = smb_fname->base_name;
 
 	SMB_VFS_HANDLE_GET_DATA(handle, config,
 				struct fruit_config_data, return -1);
 
-	if (config->rsrc != FRUIT_RSRC_ADFILE) {
+	if (!handle->conn->cwd || !path || (config->rsrc == FRUIT_RSRC_XATTR)) {
 		goto exit_rmdir;
 	}
 
@@ -3445,58 +2634,24 @@
 	 * Due to there is no way to change bDeleteVetoFiles variable
 	 * from this module, need to clean up ourselves
 	 */
-
-	dh = SMB_VFS_OPENDIR(handle->conn, smb_fname, NULL, 0);
+	dh = opendir(path);
 	if (dh == NULL) {
 		goto exit_rmdir;
 	}
 
-	while ((de = SMB_VFS_READDIR(handle->conn, dh, NULL)) != NULL) {
-		int match;
-		struct adouble *ad = NULL;
-		char *p = NULL;
-		struct smb_filename *ad_smb_fname = NULL;
-		int ret;
-
-		match = strncmp(de->d_name,
-				ADOUBLE_NAME_PREFIX,
-				strlen(ADOUBLE_NAME_PREFIX));
-		if (match != 0) {
-			continue;
-		}
-
-		p = talloc_asprintf(talloc_tos(), "%s/%s",
-				    smb_fname->base_name, de->d_name);
-		if (p == NULL) {
-			DBG_ERR("talloc_asprintf failed\n");
-			return -1;
-		}
-
-		/*
-		 * Check whether it's a valid AppleDouble file, if
-		 * yes, delete it, ignore it otherwise.
-		 */
-		ad = ad_get(talloc_tos(), handle, p, ADOUBLE_RSRC);
-		if (ad == NULL) {
+	while ((de = readdir(dh)) != NULL) {
+		if ((strncmp(de->d_name,
+			     ADOUBLE_NAME_PREFIX,
+			     strlen(ADOUBLE_NAME_PREFIX))) == 0) {
+			char *p = talloc_asprintf(talloc_tos(),
+						  "%s/%s",
+						  path, de->d_name);
+			if (p == NULL) {
+				goto exit_rmdir;
+			}
+			DEBUG(10, ("fruit_rmdir: delete %s\n", p));
+			(void)unlink(p);
 			TALLOC_FREE(p);
-			continue;
-		}
-		TALLOC_FREE(ad);
-
-		ad_smb_fname = synthetic_smb_fname(talloc_tos(), p,
-						    NULL, NULL,
-						    smb_fname->flags);
-		TALLOC_FREE(p);
-		if (ad_smb_fname == NULL) {
-			DBG_ERR("synthetic_smb_fname failed\n");
-			return -1;
-		}
-
-		ret = SMB_VFS_NEXT_UNLINK(handle, ad_smb_fname);
-		TALLOC_FREE(ad_smb_fname);
-		if (ret != 0) {
-			DBG_ERR("Deleting [%s] failed\n",
-				smb_fname_str_dbg(ad_smb_fname));
 		}
 	}
 
@@ -3507,424 +2662,243 @@
 	return SMB_VFS_NEXT_RMDIR(handle, smb_fname);
 }
 
-static ssize_t fruit_pread_meta_stream(vfs_handle_struct *handle,
-				       files_struct *fsp, void *data,
-				       size_t n, off_t offset)
-{
-	ssize_t nread;
-	int ret;
-
-	nread = SMB_VFS_NEXT_PREAD(handle, fsp, data, n, offset);
-
-	if (nread == n) {
-		return nread;
-	}
-
-	DBG_ERR("Removing [%s] after short read [%zd]\n",
-		fsp_str_dbg(fsp), nread);
-
-	ret = SMB_VFS_NEXT_UNLINK(handle, fsp->fsp_name);
-	if (ret != 0) {
-		DBG_ERR("Removing [%s] failed\n", fsp_str_dbg(fsp));
-		return -1;
-	}
-
-	errno = EINVAL;
-	return -1;
-}
-
-static ssize_t fruit_pread_meta_adouble(vfs_handle_struct *handle,
-					files_struct *fsp, void *data,
-					size_t n, off_t offset)
+static ssize_t fruit_pread(vfs_handle_struct *handle,
+			   files_struct *fsp, void *data,
+			   size_t n, off_t offset)
 {
+	int rc = 0;
+        struct adouble *ad = (struct adouble *)VFS_FETCH_FSP_EXTENSION(
+		handle, fsp);
+	struct fruit_config_data *config = NULL;
 	AfpInfo *ai = NULL;
-	struct adouble *ad = NULL;
-	char afpinfo_buf[AFP_INFO_SIZE];
-	char *p = NULL;
-	ssize_t nread;
-
-	ai = afpinfo_new(talloc_tos());
-	if (ai == NULL) {
-		return -1;
-	}
-
-	ad = ad_fget(talloc_tos(), handle, fsp, ADOUBLE_META);
-	if (ad == NULL) {
-		nread = -1;
-		goto fail;
-	}
-
-	p = ad_get_entry(ad, ADEID_FINDERI);
-	if (p == NULL) {
-		DBG_ERR("No ADEID_FINDERI for [%s]\n", fsp_str_dbg(fsp));
-		nread = -1;
-		goto fail;
-	}
-
-	memcpy(&ai->afpi_FinderInfo[0], p, ADEDLEN_FINDERI);
-
-	nread = afpinfo_pack(ai, afpinfo_buf);
-	if (nread != AFP_INFO_SIZE) {
-		nread = -1;
-		goto fail;
-	}
-
-	memcpy(data, afpinfo_buf, n);
-	nread = n;
-
-fail:
-	TALLOC_FREE(ai);
-	return nread;
-}
+	ssize_t len = -1;
+	char *name = NULL;
+	char *tmp_base_name = NULL;
+	NTSTATUS status;
 
-static ssize_t fruit_pread_meta(vfs_handle_struct *handle,
-				files_struct *fsp, void *data,
-				size_t n, off_t offset)
-{
-	struct fio *fio = (struct fio *)VFS_FETCH_FSP_EXTENSION(handle, fsp);
-	ssize_t nread;
-	ssize_t to_return;
+	DEBUG(10, ("fruit_pread: offset=%d, size=%d\n", (int)offset, (int)n));
 
-	/*
-	 * OS X has a off-by-1 error in the offset calculation, so we're
-	 * bug compatible here. It won't hurt, as any relevant real
-	 * world read requests from the AFP_AfpInfo stream will be
-	 * offset=0 n=60. offset is ignored anyway, see below.
-	 */
-	if ((offset < 0) || (offset >= AFP_INFO_SIZE + 1)) {
-		return 0;
+	if (!fsp->base_fsp) {
+		return SMB_VFS_NEXT_PREAD(handle, fsp, data, n, offset);
 	}
 
-	/* Yes, macOS always reads from offset 0 */
-	offset = 0;
-	to_return = MIN(n, AFP_INFO_SIZE);
-
-	switch (fio->config->meta) {
-	case FRUIT_META_STREAM:
-		nread = fruit_pread_meta_stream(handle, fsp, data,
-						to_return, offset);
-		break;
-
-	case FRUIT_META_NETATALK:
-		nread = fruit_pread_meta_adouble(handle, fsp, data,
-						 to_return, offset);
-		break;
+	SMB_VFS_HANDLE_GET_DATA(handle, config,
+				struct fruit_config_data, return -1);
 
-	default:
-		DBG_ERR("Unexpected meta config [%d]\n", fio->config->meta);
-		return -1;
+	/* fsp_name is not converted with vfs_catia */
+	tmp_base_name = fsp->base_fsp->fsp_name->base_name;
+	status = SMB_VFS_TRANSLATE_NAME(handle->conn,
+					fsp->base_fsp->fsp_name->base_name,
+					vfs_translate_to_unix,
+					talloc_tos(), &name);
+	if (NT_STATUS_EQUAL(status, NT_STATUS_NONE_MAPPED)) {
+		name = talloc_strdup(talloc_tos(), tmp_base_name);
+		if (name == NULL) {
+			rc = -1;
+			goto exit;
+		}
+	} else if (!NT_STATUS_IS_OK(status)) {
+		errno = map_errno_from_nt_status(status);
+		rc = -1;
+		goto exit;
 	}
+	fsp->base_fsp->fsp_name->base_name = name;
 
-	return nread;
-}
-
-static ssize_t fruit_pread_rsrc_stream(vfs_handle_struct *handle,
-				       files_struct *fsp, void *data,
-				       size_t n, off_t offset)
-{
-	return SMB_VFS_NEXT_PREAD(handle, fsp, data, n, offset);
-}
-
-static ssize_t fruit_pread_rsrc_xattr(vfs_handle_struct *handle,
-				      files_struct *fsp, void *data,
-				      size_t n, off_t offset)
-{
-	return SMB_VFS_NEXT_PREAD(handle, fsp, data, n, offset);
-}
-
-static ssize_t fruit_pread_rsrc_adouble(vfs_handle_struct *handle,
-					files_struct *fsp, void *data,
-					size_t n, off_t offset)
-{
-	struct adouble *ad = NULL;
-	ssize_t nread;
-
-	ad = ad_fget(talloc_tos(), handle, fsp, ADOUBLE_RSRC);
 	if (ad == NULL) {
-		return -1;
+		len = SMB_VFS_NEXT_PREAD(handle, fsp, data, n, offset);
+		if (len == -1) {
+			rc = -1;
+			goto exit;
+		}
+		goto exit;
 	}
 
-	nread = SMB_VFS_NEXT_PREAD(handle, fsp, data, n,
-				   offset + ad_getentryoff(ad, ADEID_RFORK));
-
-	TALLOC_FREE(ad);
-	return nread;
-}
-
-static ssize_t fruit_pread_rsrc(vfs_handle_struct *handle,
-				files_struct *fsp, void *data,
-				size_t n, off_t offset)
-{
-	struct fio *fio = (struct fio *)VFS_FETCH_FSP_EXTENSION(handle, fsp);
-	ssize_t nread;
-
-	switch (fio->config->rsrc) {
-	case FRUIT_RSRC_STREAM:
-		nread = fruit_pread_rsrc_stream(handle, fsp, data, n, offset);
-		break;
-
-	case FRUIT_RSRC_ADFILE:
-		nread = fruit_pread_rsrc_adouble(handle, fsp, data, n, offset);
-		break;
+	if (!fruit_fsp_recheck(ad, fsp)) {
+		rc = -1;
+		goto exit;
+	}
 
-	case FRUIT_RSRC_XATTR:
-		nread = fruit_pread_rsrc_xattr(handle, fsp, data, n, offset);
-		break;
+	if (ad->ad_type == ADOUBLE_META) {
+		char afpinfo_buf[AFP_INFO_SIZE];
+		size_t to_return;
 
-	default:
-		DBG_ERR("Unexpected rsrc config [%d]\n", fio->config->rsrc);
-		return -1;
-	}
+		/*
+		 * OS X has a off-by-1 error in the offset calculation, so we're
+		 * bug compatible here. It won't hurt, as any relevant real
+		 * world read requests from the AFP_AfpInfo stream will be
+		 * offset=0 n=60. offset is ignored anyway, see below.
+		 */
+		if ((offset < 0) || (offset >= AFP_INFO_SIZE + 1)) {
+			len = 0;
+			rc = 0;
+			goto exit;
+		}
 
-	return nread;
-}
+		to_return = MIN(n, AFP_INFO_SIZE);
 
-static ssize_t fruit_pread(vfs_handle_struct *handle,
-			   files_struct *fsp, void *data,
-			   size_t n, off_t offset)
-{
-	struct fio *fio = (struct fio *)VFS_FETCH_FSP_EXTENSION(handle, fsp);
-	ssize_t nread;
+		ai = afpinfo_new(talloc_tos());
+		if (ai == NULL) {
+			rc = -1;
+			goto exit;
+		}
 
-	DBG_DEBUG("Path [%s] offset=%zd, size=%zd\n",
-		  fsp_str_dbg(fsp), offset, n);
+		len = ad_read(ad, fsp->base_fsp->fsp_name->base_name);
+		if (len == -1) {
+			rc = -1;
+			goto exit;
+		}
 
-	if (fio == NULL) {
-		return SMB_VFS_NEXT_PREAD(handle, fsp, data, n, offset);
-	}
+		memcpy(&ai->afpi_FinderInfo[0],
+		       ad_entry(ad, ADEID_FINDERI),
+		       ADEDLEN_FINDERI);
+		len = afpinfo_pack(ai, afpinfo_buf);
+		if (len != AFP_INFO_SIZE) {
+			rc = -1;
+			goto exit;
+		}
 
-	if (fio->type == ADOUBLE_META) {
-		nread = fruit_pread_meta(handle, fsp, data, n, offset);
+		/*
+		 * OS X ignores offset when reading from AFP_AfpInfo stream!
+		 */
+		memcpy(data, afpinfo_buf, to_return);
+		len = to_return;
 	} else {
-		nread = fruit_pread_rsrc(handle, fsp, data, n, offset);
+		len = SMB_VFS_NEXT_PREAD(
+			handle, fsp, data, n,
+			offset + ad_getentryoff(ad, ADEID_RFORK));
+		if (len == -1) {
+			rc = -1;
+			goto exit;
+		}
 	}
-
-	DBG_DEBUG("Path [%s] nread [%zd]\n", fsp_str_dbg(fsp), nread);
-	return nread;
+exit:
+	fsp->base_fsp->fsp_name->base_name = tmp_base_name;
+	TALLOC_FREE(name);
+	TALLOC_FREE(ai);
+	if (rc != 0) {
+		len = -1;
+	}
+	DEBUG(10, ("fruit_pread: rc=%d, len=%zd\n", rc, len));
+	return len;
 }
 
-static ssize_t fruit_pwrite_meta_stream(vfs_handle_struct *handle,
-					files_struct *fsp, const void *data,
-					size_t n, off_t offset)
+static ssize_t fruit_pwrite(vfs_handle_struct *handle,
+			    files_struct *fsp, const void *data,
+			    size_t n, off_t offset)
 {
+	int rc = 0;
+	struct adouble *ad = (struct adouble *)VFS_FETCH_FSP_EXTENSION(
+		handle, fsp);
+	struct fruit_config_data *config = NULL;
 	AfpInfo *ai = NULL;
-	int ret;
-
-	ai = afpinfo_unpack(talloc_tos(), data);
-	if (ai == NULL) {
-		return -1;
-	}
+	ssize_t len;
+	char *name = NULL;
+	char *tmp_base_name = NULL;
+	NTSTATUS status;
 
-	if (ai_empty_finderinfo(ai)) {
-		ret = SMB_VFS_NEXT_UNLINK(handle, fsp->fsp_name);
-		if (ret != 0 && errno != ENOENT && errno != ENOATTR) {
-			DBG_ERR("Can't delete metadata for %s: %s\n",
-				fsp_str_dbg(fsp), strerror(errno));
-			TALLOC_FREE(ai);
-			return -1;
-		}
+	DEBUG(10, ("fruit_pwrite: offset=%d, size=%d\n", (int)offset, (int)n));
 
-		return n;
+	if (!fsp->base_fsp) {
+		return SMB_VFS_NEXT_PWRITE(handle, fsp, data, n, offset);
 	}
 
-	return SMB_VFS_NEXT_PWRITE(handle, fsp, data, n, offset);
-}
-
-static ssize_t fruit_pwrite_meta_netatalk(vfs_handle_struct *handle,
-					  files_struct *fsp, const void *data,
-					  size_t n, off_t offset)
-{
-	struct adouble *ad = NULL;
-	AfpInfo *ai = NULL;
-	char *p = NULL;
-	int ret;
-
-	ai = afpinfo_unpack(talloc_tos(), data);
-	if (ai == NULL) {
-		return -1;
-	}
+	SMB_VFS_HANDLE_GET_DATA(handle, config,
+				struct fruit_config_data, return -1);
 
-	if (ai_empty_finderinfo(ai)) {
-		ret = SMB_VFS_REMOVEXATTR(handle->conn,
-					  fsp->fsp_name->base_name,
-					  AFPINFO_EA_NETATALK);
-
-		if (ret != 0 && errno != ENOENT && errno != ENOATTR) {
-			DBG_ERR("Can't delete metadata for %s: %s\n",
-				fsp_str_dbg(fsp), strerror(errno));
-			return -1;
+	tmp_base_name = fsp->base_fsp->fsp_name->base_name;
+	status = SMB_VFS_TRANSLATE_NAME(handle->conn,
+					fsp->base_fsp->fsp_name->base_name,
+					vfs_translate_to_unix,
+					talloc_tos(), &name);
+	if (NT_STATUS_EQUAL(status, NT_STATUS_NONE_MAPPED)) {
+		name = talloc_strdup(talloc_tos(), tmp_base_name);
+		if (name == NULL) {
+			rc = -1;
+			goto exit;
 		}
-
-		return n;
+	} else if (!NT_STATUS_IS_OK(status)) {
+		errno = map_errno_from_nt_status(status);
+		rc = -1;
+		goto exit;
 	}
+	fsp->base_fsp->fsp_name->base_name = name;
 
-	ad = ad_fget(talloc_tos(), handle, fsp, ADOUBLE_META);
 	if (ad == NULL) {
-		ad = ad_init(talloc_tos(), handle, ADOUBLE_META);
-		if (ad == NULL) {
-			return -1;
+		len = SMB_VFS_NEXT_PWRITE(handle, fsp, data, n, offset);
+		if (len != n) {
+			rc = -1;
+			goto exit;
 		}
+		goto exit;
 	}
-	p = ad_get_entry(ad, ADEID_FINDERI);
-	if (p == NULL) {
-		DBG_ERR("No ADEID_FINDERI for [%s]\n", fsp_str_dbg(fsp));
-		TALLOC_FREE(ad);
-		return -1;
-	}
-
-	memcpy(p, &ai->afpi_FinderInfo[0], ADEDLEN_FINDERI);
-
-	ret = ad_fset(ad, fsp);
-	if (ret != 0) {
-		DBG_ERR("ad_pwrite [%s] failed\n", fsp_str_dbg(fsp));
-		TALLOC_FREE(ad);
-		return -1;
-	}
-
-	TALLOC_FREE(ad);
-	return n;
-}
-
-static ssize_t fruit_pwrite_meta(vfs_handle_struct *handle,
-				 files_struct *fsp, const void *data,
-				 size_t n, off_t offset)
-{
-	struct fio *fio = (struct fio *)VFS_FETCH_FSP_EXTENSION(handle, fsp);
-	ssize_t nwritten;
-
-	/*
-	 * Writing an all 0 blob to the metadata stream
-	 * results in the stream being removed on a macOS
-	 * server. This ensures we behave the same and it
-	 * verified by the "delete AFP_AfpInfo by writing all
-	 * 0" test.
-	 */
-	if (n != AFP_INFO_SIZE || offset != 0) {
-		DBG_ERR("unexpected offset=%jd or size=%jd\n",
-			(intmax_t)offset, (intmax_t)n);
-		return -1;
-	}
-
-	switch (fio->config->meta) {
-	case FRUIT_META_STREAM:
-		nwritten = fruit_pwrite_meta_stream(handle, fsp, data,
-						    n, offset);
-		break;
 
-	case FRUIT_META_NETATALK:
-		nwritten = fruit_pwrite_meta_netatalk(handle, fsp, data,
-						      n, offset);
-		break;
-
-	default:
-		DBG_ERR("Unexpected meta config [%d]\n", fio->config->meta);
-		return -1;
+	if (!fruit_fsp_recheck(ad, fsp)) {
+		rc = -1;
+		goto exit;
 	}
 
-	return nwritten;
-}
-
-static ssize_t fruit_pwrite_rsrc_stream(vfs_handle_struct *handle,
-					files_struct *fsp, const void *data,
-					size_t n, off_t offset)
-{
-	return SMB_VFS_NEXT_PWRITE(handle, fsp, data, n, offset);
-}
-
-static ssize_t fruit_pwrite_rsrc_xattr(vfs_handle_struct *handle,
-				       files_struct *fsp, const void *data,
-				       size_t n, off_t offset)
-{
-	return SMB_VFS_NEXT_PWRITE(handle, fsp, data, n, offset);
-}
-
-static ssize_t fruit_pwrite_rsrc_adouble(vfs_handle_struct *handle,
-					 files_struct *fsp, const void *data,
-					 size_t n, off_t offset)
-{
-	struct adouble *ad = NULL;
-	ssize_t nwritten;
-	int ret;
-
-	ad = ad_fget(talloc_tos(), handle, fsp, ADOUBLE_RSRC);
-	if (ad == NULL) {
-		DBG_ERR("ad_get [%s] failed\n", fsp_str_dbg(fsp));
-		return -1;
-	}
+	if (ad->ad_type == ADOUBLE_META) {
+		if (n != AFP_INFO_SIZE || offset != 0) {
+			DEBUG(1, ("unexpected offset=%jd or size=%jd\n",
+				  (intmax_t)offset, (intmax_t)n));
+			rc = -1;
+			goto exit;
+		}
+		ai = afpinfo_unpack(talloc_tos(), data);
+		if (ai == NULL) {
+			rc = -1;
+			goto exit;
+		}
+		memcpy(ad_entry(ad, ADEID_FINDERI),
+		       &ai->afpi_FinderInfo[0], ADEDLEN_FINDERI);
+		if (empty_finderinfo(ad)) {
+			/* Discard metadata */
+			if (config->meta == FRUIT_META_STREAM) {
+				rc = SMB_VFS_FTRUNCATE(fsp, 0);
+			} else {
+				rc = SMB_VFS_REMOVEXATTR(handle->conn,
+							 fsp->fsp_name->base_name,
+							 AFPINFO_EA_NETATALK);
+			}
+			if (rc != 0 && errno != ENOENT && errno != ENOATTR) {
+				DBG_WARNING("Can't delete metadata for %s: %s\n",
+					    fsp->fsp_name->base_name, strerror(errno));
+				goto exit;
+			}
+			rc = 0;
+			goto exit;
+		}
+		rc = ad_write(ad, name);
+	} else {
+		len = SMB_VFS_NEXT_PWRITE(handle, fsp, data, n,
+                                   offset + ad_getentryoff(ad, ADEID_RFORK));
+		if (len != n) {
+			rc = -1;
+			goto exit;
+		}
 
-	nwritten = SMB_VFS_NEXT_PWRITE(handle, fsp, data, n,
-				       offset + ad_getentryoff(ad, ADEID_RFORK));
-	if (nwritten != n) {
-		DBG_ERR("Short write on [%s] [%zd/%zd]\n",
-			fsp_str_dbg(fsp), nwritten, n);
-		TALLOC_FREE(ad);
-		return -1;
-	}
+		if (config->rsrc == FRUIT_RSRC_ADFILE) {
+			rc = ad_read(ad, name);
+			if (rc == -1) {
+				goto exit;
+			}
+			rc = 0;
 
-	if ((n + offset) > ad_getentrylen(ad, ADEID_RFORK)) {
-		ad_setentrylen(ad, ADEID_RFORK, n + offset);
-		ret = ad_fset(ad, fsp);
-		if (ret != 0) {
-			DBG_ERR("ad_pwrite [%s] failed\n", fsp_str_dbg(fsp));
-			TALLOC_FREE(ad);
-			return -1;
+			if ((len + offset) > ad_getentrylen(ad, ADEID_RFORK)) {
+				ad_setentrylen(ad, ADEID_RFORK, len + offset);
+				rc = ad_write(ad, name);
+			}
 		}
 	}
 
-	TALLOC_FREE(ad);
-	return n;
-}
-
-static ssize_t fruit_pwrite_rsrc(vfs_handle_struct *handle,
-				 files_struct *fsp, const void *data,
-				 size_t n, off_t offset)
-{
-	struct fio *fio = (struct fio *)VFS_FETCH_FSP_EXTENSION(handle, fsp);
-	ssize_t nwritten;
-
-	switch (fio->config->rsrc) {
-	case FRUIT_RSRC_STREAM:
-		nwritten = fruit_pwrite_rsrc_stream(handle, fsp, data, n, offset);
-		break;
-
-	case FRUIT_RSRC_ADFILE:
-		nwritten = fruit_pwrite_rsrc_adouble(handle, fsp, data, n, offset);
-		break;
-
-	case FRUIT_RSRC_XATTR:
-		nwritten = fruit_pwrite_rsrc_xattr(handle, fsp, data, n, offset);
-		break;
-
-	default:
-		DBG_ERR("Unexpected rsrc config [%d]\n", fio->config->rsrc);
+exit:
+	fsp->base_fsp->fsp_name->base_name = tmp_base_name;
+	TALLOC_FREE(name);
+	TALLOC_FREE(ai);
+	if (rc != 0) {
 		return -1;
 	}
-
-	return nwritten;
-}
-
-static ssize_t fruit_pwrite(vfs_handle_struct *handle,
-			    files_struct *fsp, const void *data,
-			    size_t n, off_t offset)
-{
-	struct fio *fio = (struct fio *)VFS_FETCH_FSP_EXTENSION(handle, fsp);
-	ssize_t nwritten;
-
-	DBG_DEBUG("Path [%s] offset=%zd, size=%zd\n",
-		  fsp_str_dbg(fsp), offset, n);
-
-	if (fio == NULL) {
-		return SMB_VFS_NEXT_PWRITE(handle, fsp, data, n, offset);
-	}
-
-	if (fio->type == ADOUBLE_META) {
-		nwritten = fruit_pwrite_meta(handle, fsp, data, n, offset);
-	} else {
-		nwritten = fruit_pwrite_rsrc(handle, fsp, data, n, offset);
-	}
-
-	DBG_DEBUG("Path [%s] nwritten=%zd\n", fsp_str_dbg(fsp), nwritten);
-	return nwritten;
+	return n;
 }
 
 /**
@@ -3948,24 +2922,9 @@
 	return rc;
 }
 
-static int fruit_stat_meta_stream(vfs_handle_struct *handle,
-				  struct smb_filename *smb_fname,
-				  bool follow_links)
-{
-	int ret;
-
-	if (follow_links) {
-		ret = SMB_VFS_NEXT_STAT(handle, smb_fname);
-	} else {
-		ret = SMB_VFS_NEXT_LSTAT(handle, smb_fname);
-	}
-
-	return ret;
-}
-
-static int fruit_stat_meta_netatalk(vfs_handle_struct *handle,
-				    struct smb_filename *smb_fname,
-				    bool follow_links)
+static int fruit_stat_meta(vfs_handle_struct *handle,
+			   struct smb_filename *smb_fname,
+			   bool follow_links)
 {
 	struct adouble *ad = NULL;
 
@@ -3988,39 +2947,15 @@
 	return 0;
 }
 
-static int fruit_stat_meta(vfs_handle_struct *handle,
+static int fruit_stat_rsrc(vfs_handle_struct *handle,
 			   struct smb_filename *smb_fname,
 			   bool follow_links)
-{
-	struct fruit_config_data *config = NULL;
-	int ret;
-
-	SMB_VFS_HANDLE_GET_DATA(handle, config,
-				struct fruit_config_data, return -1);
 
-	switch (config->meta) {
-	case FRUIT_META_STREAM:
-		ret = fruit_stat_meta_stream(handle, smb_fname, follow_links);
-		break;
-
-	case FRUIT_META_NETATALK:
-		ret = fruit_stat_meta_netatalk(handle, smb_fname, follow_links);
-		break;
-
-	default:
-		DBG_ERR("Unexpected meta config [%d]\n", config->meta);
-		return -1;
-	}
-
-	return ret;
-}
-
-static int fruit_stat_rsrc_netatalk(vfs_handle_struct *handle,
-				    struct smb_filename *smb_fname,
-				    bool follow_links)
 {
 	struct adouble *ad = NULL;
-	int ret;
+
+	DEBUG(10, ("fruit_stat_rsrc called for %s\n",
+		   smb_fname_str_dbg(smb_fname)));
 
 	ad = ad_get(talloc_tos(), handle, smb_fname->base_name, ADOUBLE_RSRC);
 	if (ad == NULL) {
@@ -4029,8 +2964,7 @@
 	}
 
 	/* Populate the stat struct with info from the base file. */
-	ret = fruit_stat_base(handle, smb_fname, follow_links);
-	if (ret != 0) {
+	if (fruit_stat_base(handle, smb_fname, follow_links) == -1) {
 		TALLOC_FREE(ad);
 		return -1;
 	}
@@ -4042,96 +2976,6 @@
 	return 0;
 }
 
-static int fruit_stat_rsrc_stream(vfs_handle_struct *handle,
-				  struct smb_filename *smb_fname,
-				  bool follow_links)
-{
-	int ret;
-
-	if (follow_links) {
-		ret = SMB_VFS_NEXT_STAT(handle, smb_fname);
-	} else {
-		ret = SMB_VFS_NEXT_LSTAT(handle, smb_fname);
-	}
-
-	return ret;
-}
-
-static int fruit_stat_rsrc_xattr(vfs_handle_struct *handle,
-				 struct smb_filename *smb_fname,
-				 bool follow_links)
-{
-#ifdef HAVE_ATTROPEN
-	int ret;
-	int fd = -1;
-
-	/* Populate the stat struct with info from the base file. */
-	ret = fruit_stat_base(handle, smb_fname, follow_links);
-	if (ret != 0) {
-		return -1;
-	}
-
-	fd = attropen(smb_fname->base_name,
-		      AFPRESOURCE_EA_NETATALK,
-		      O_RDONLY);
-	if (fd == -1) {
-		return 0;
-	}
-
-	ret = sys_fstat(fd, &smb_fname->st, false);
-	if (ret != 0) {
-		close(fd);
-		DBG_ERR("fstat [%s:%s] failed\n", smb_fname->base_name,
-			AFPRESOURCE_EA_NETATALK);
-		return -1;
-	}
-	close(fd);
-	fd = -1;
-
-	smb_fname->st.st_ex_ino = fruit_inode(&smb_fname->st,
-					      smb_fname->stream_name);
-
-	return ret;
-
-#else
-	errno = ENOSYS;
-	return -1;
-#endif
-}
-
-static int fruit_stat_rsrc(vfs_handle_struct *handle,
-			   struct smb_filename *smb_fname,
-			   bool follow_links)
-{
-	struct fruit_config_data *config = NULL;
-	int ret;
-
-	DBG_DEBUG("Path [%s]\n", smb_fname_str_dbg(smb_fname));
-
-	SMB_VFS_HANDLE_GET_DATA(handle, config,
-				struct fruit_config_data, return -1);
-
-	switch (config->rsrc) {
-	case FRUIT_RSRC_STREAM:
-		ret = fruit_stat_rsrc_stream(handle, smb_fname, follow_links);
-		break;
-
-	case FRUIT_RSRC_XATTR:
-		ret = fruit_stat_rsrc_xattr(handle, smb_fname, follow_links);
-		break;
-
-	case FRUIT_RSRC_ADFILE:
-		ret = fruit_stat_rsrc_netatalk(handle, smb_fname, follow_links);
-		break;
-
-	default:
-		DBG_ERR("Unexpected rsrc config [%d]\n", config->rsrc);
-		return -1;
-	}
-
-	return ret;
-}
-
 static int fruit_stat(vfs_handle_struct *handle,
 		      struct smb_filename *smb_fname)
 {
@@ -4209,24 +3053,17 @@
 	return rc;
 }
 
-static int fruit_fstat_meta_stream(vfs_handle_struct *handle,
-				   files_struct *fsp,
-				   SMB_STRUCT_STAT *sbuf)
-{
-	return SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf);
-}
-
-static int fruit_fstat_meta_netatalk(vfs_handle_struct *handle,
-				     files_struct *fsp,
-				     SMB_STRUCT_STAT *sbuf)
+static int fruit_fstat_meta(vfs_handle_struct *handle,
+			    files_struct *fsp,
+			    SMB_STRUCT_STAT *sbuf)
 {
-	int ret;
+	DEBUG(10, ("fruit_fstat_meta called for %s\n",
+		   smb_fname_str_dbg(fsp->base_fsp->fsp_name)));
 
-	ret = fruit_stat_base(handle, fsp->base_fsp->fsp_name, false);
-	if (ret != 0) {
+	/* Populate the stat struct with info from the base file. */
+	if (fruit_stat_base(handle, fsp->base_fsp->fsp_name, false) == -1) {
 		return -1;
 	}
-
 	*sbuf = fsp->base_fsp->fsp_name->st;
 	sbuf->st_ex_size = AFP_INFO_SIZE;
 	sbuf->st_ex_ino = fruit_inode(sbuf, fsp->fsp_name->stream_name);
@@ -4234,399 +3071,113 @@
 	return 0;
 }
 
-static int fruit_fstat_meta(vfs_handle_struct *handle,
-			    files_struct *fsp,
+static int fruit_fstat_rsrc(vfs_handle_struct *handle, files_struct *fsp,
 			    SMB_STRUCT_STAT *sbuf)
 {
-	struct fio *fio = (struct fio *)VFS_FETCH_FSP_EXTENSION(handle, fsp);
-	int ret;
-
-	if (fio == NULL) {
-		return SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf);
-	}
-
-	DBG_DEBUG("Path [%s]\n", fsp_str_dbg(fsp));
+	struct fruit_config_data *config;
+	struct adouble *ad = (struct adouble *)VFS_FETCH_FSP_EXTENSION(
+		handle, fsp);
 
-	switch (fio->config->meta) {
-	case FRUIT_META_STREAM:
-		ret = fruit_fstat_meta_stream(handle, fsp, sbuf);
-		break;
+	DEBUG(10, ("fruit_fstat_rsrc called for %s\n",
+		   smb_fname_str_dbg(fsp->base_fsp->fsp_name)));
 
-	case FRUIT_META_NETATALK:
-		ret = fruit_fstat_meta_netatalk(handle, fsp, sbuf);
-		break;
+	SMB_VFS_HANDLE_GET_DATA(handle, config,
+				struct fruit_config_data, return -1);
 
-	default:
-		DBG_ERR("Unexpected meta config [%d]\n", fio->config->meta);
-		return -1;
+	if (config->rsrc == FRUIT_RSRC_STREAM) {
+		return SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf);
 	}
 
-	DBG_DEBUG("Path [%s] ret [%d]\n", fsp_str_dbg(fsp), ret);
-	return ret;
-}
-
-static int fruit_fstat_rsrc_xattr(vfs_handle_struct *handle,
-				  files_struct *fsp,
-				  SMB_STRUCT_STAT *sbuf)
-{
-	return SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf);
-}
-
-static int fruit_fstat_rsrc_stream(vfs_handle_struct *handle,
-				   files_struct *fsp,
-				   SMB_STRUCT_STAT *sbuf)
-{
-	return SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf);
-}
-
-static int fruit_fstat_rsrc_adouble(vfs_handle_struct *handle,
-				    files_struct *fsp,
-				    SMB_STRUCT_STAT *sbuf)
-{
-	struct adouble *ad = NULL;
-	int ret;
-
 	/* Populate the stat struct with info from the base file. */
-	ret = fruit_stat_base(handle, fsp->base_fsp->fsp_name, false);
-	if (ret == -1) {
+	if (fruit_stat_base(handle, fsp->base_fsp->fsp_name, false) == -1) {
 		return -1;
 	}
-
-	ad = ad_get(talloc_tos(), handle,
-		    fsp->base_fsp->fsp_name->base_name,
-		    ADOUBLE_RSRC);
-	if (ad == NULL) {
-		DBG_ERR("ad_get [%s] failed [%s]\n",
-			fsp_str_dbg(fsp), strerror(errno));
-		return -1;
-	}
-
 	*sbuf = fsp->base_fsp->fsp_name->st;
 	sbuf->st_ex_size = ad_getentrylen(ad, ADEID_RFORK);
 	sbuf->st_ex_ino = fruit_inode(sbuf, fsp->fsp_name->stream_name);
 
-	TALLOC_FREE(ad);
-	return 0;
-}
-
-static int fruit_fstat_rsrc(vfs_handle_struct *handle, files_struct *fsp,
-			    SMB_STRUCT_STAT *sbuf)
-{
-	struct fio *fio = (struct fio *)VFS_FETCH_FSP_EXTENSION(handle, fsp);
-	int ret;
-
-	switch (fio->config->rsrc) {
-	case FRUIT_RSRC_STREAM:
-		ret = fruit_fstat_rsrc_stream(handle, fsp, sbuf);
-		break;
-
-	case FRUIT_RSRC_ADFILE:
-		ret = fruit_fstat_rsrc_adouble(handle, fsp, sbuf);
-		break;
-
-	case FRUIT_RSRC_XATTR:
-		ret = fruit_fstat_rsrc_xattr(handle, fsp, sbuf);
-		break;
-
-	default:
-		DBG_ERR("Unexpected rsrc config [%d]\n", fio->config->rsrc);
-		return -1;
-	}
+	DEBUG(10, ("fruit_fstat_rsrc %s, size: %zd\n",
+		   smb_fname_str_dbg(fsp->fsp_name),
+		   (ssize_t)sbuf->st_ex_size));
 
-	return ret;
+	return 0;
 }
 
 static int fruit_fstat(vfs_handle_struct *handle, files_struct *fsp,
 		       SMB_STRUCT_STAT *sbuf)
 {
-	struct fio *fio = (struct fio *)VFS_FETCH_FSP_EXTENSION(handle, fsp);
 	int rc;
+	char *name = NULL;
+	char *tmp_base_name = NULL;
+	NTSTATUS status;
+	struct adouble *ad = (struct adouble *)
+		VFS_FETCH_FSP_EXTENSION(handle, fsp);
 
-	if (fio == NULL) {
-		return SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf);
-	}
-
-	DBG_DEBUG("Path [%s]\n", fsp_str_dbg(fsp));
-
-	if (fio->type == ADOUBLE_META) {
-		rc = fruit_fstat_meta(handle, fsp, sbuf);
-	} else {
-		rc = fruit_fstat_rsrc(handle, fsp, sbuf);
-	}
-
-	if (rc == 0) {
-		sbuf->st_ex_mode &= ~S_IFMT;
-		sbuf->st_ex_mode |= S_IFREG;
-		sbuf->st_ex_blocks = sbuf->st_ex_size / STAT_ST_BLOCKSIZE + 1;
-	}
-
-	DBG_DEBUG("Path [%s] rc [%d] size [%zd]\n",
-		  fsp_str_dbg(fsp), rc, sbuf->st_ex_size);
-	return rc;
-}
-
-static NTSTATUS fruit_streaminfo_meta_stream(
-	vfs_handle_struct *handle,
-	struct files_struct *fsp,
-	const struct smb_filename *smb_fname,
-	TALLOC_CTX *mem_ctx,
-	unsigned int *pnum_streams,
-	struct stream_struct **pstreams)
-{
-	struct stream_struct *stream = *pstreams;
-	unsigned int num_streams = *pnum_streams;
-	struct smb_filename *sname = NULL;
-	int i;
-	int ret;
-	bool ok;
-
-	for (i = 0; i < num_streams; i++) {
-		if (strequal_m(stream[i].name, AFPINFO_STREAM)) {
-			break;
-		}
-	}
-
-	if (i == num_streams) {
-		return NT_STATUS_OK;
-	}
-
-	if (stream[i].size == AFP_INFO_SIZE) {
-		return NT_STATUS_OK;
-	}
-
-	DBG_ERR("Removing invalid AFPINFO_STREAM size [%zd] from [%s]\n",
-		stream[i].size, smb_fname_str_dbg(smb_fname));
-
-	ok = del_fruit_stream(mem_ctx, pnum_streams, pstreams, AFPINFO_STREAM);
-	if (!ok) {
-		return NT_STATUS_INTERNAL_ERROR;
-	}
-
-	sname = synthetic_smb_fname(talloc_tos(),
-				    smb_fname->base_name,
-				    AFPINFO_STREAM_NAME,
-				    NULL, 0);
-	if (sname == NULL) {
-		return NT_STATUS_NO_MEMORY;
-	}
-
-	ret = SMB_VFS_NEXT_UNLINK(handle, sname);
-	TALLOC_FREE(sname);
-	if (ret != 0) {
-		DBG_ERR("Removing [%s] failed\n", smb_fname_str_dbg(sname));
-		return map_nt_error_from_unix(errno);
-	}
-
-	return NT_STATUS_OK;
-}
-
-static NTSTATUS fruit_streaminfo_meta_netatalk(
-	vfs_handle_struct *handle,
-	struct files_struct *fsp,
-	const struct smb_filename *smb_fname,
-	TALLOC_CTX *mem_ctx,
-	unsigned int *pnum_streams,
-	struct stream_struct **pstreams)
-{
-	struct stream_struct *stream = *pstreams;
-	unsigned int num_streams = *pnum_streams;
-	struct adouble *ad = NULL;
-	bool is_fi_empty;
-	int i;
-	bool ok;
-
-	/*
-	 * Check if there's a AFPINFO_STREAM from the VFS streams
-	 * backend and if yes, remove it from the list
-	 */
-	for (i = 0; i < num_streams; i++) {
-		if (strequal_m(stream[i].name, AFPINFO_STREAM)) {
-			break;
-		}
-	}
-
-	if (i < num_streams) {
-		DBG_WARNING("Unexpected AFPINFO_STREAM on [%s]\n",
-			    smb_fname_str_dbg(smb_fname));
+	DEBUG(10, ("fruit_fstat called for %s\n",
+		   smb_fname_str_dbg(fsp->fsp_name)));
 
-		ok = del_fruit_stream(mem_ctx, pnum_streams, pstreams,
-				      AFPINFO_STREAM);
-		if (!ok) {
-			return NT_STATUS_INTERNAL_ERROR;
+	if (fsp->base_fsp) {
+		tmp_base_name = fsp->base_fsp->fsp_name->base_name;
+		/* fsp_name is not converted with vfs_catia */
+		status = SMB_VFS_TRANSLATE_NAME(
+			handle->conn,
+			fsp->base_fsp->fsp_name->base_name,
+			vfs_translate_to_unix,
+			talloc_tos(), &name);
+
+		if (NT_STATUS_EQUAL(status, NT_STATUS_NONE_MAPPED)) {
+			name = talloc_strdup(talloc_tos(), tmp_base_name);
+			if (name == NULL) {
+				rc = -1;
+				goto exit;
+			}
+		} else if (!NT_STATUS_IS_OK(status)) {
+			errno = map_errno_from_nt_status(status);
+			rc = -1;
+			goto exit;
 		}
+		fsp->base_fsp->fsp_name->base_name = name;
 	}
 
-	ad = ad_get(talloc_tos(), handle,
-		    smb_fname->base_name, ADOUBLE_META);
-	if (ad == NULL) {
-		return NT_STATUS_OK;
-	}
-
-	is_fi_empty = ad_empty_finderinfo(ad);
-	TALLOC_FREE(ad);
-
-	if (is_fi_empty) {
-		return NT_STATUS_OK;
-	}
-
-	ok = add_fruit_stream(mem_ctx, pnum_streams, pstreams,
-			      AFPINFO_STREAM_NAME, AFP_INFO_SIZE,
-			      smb_roundup(handle->conn, AFP_INFO_SIZE));
-	if (!ok) {
-		return NT_STATUS_NO_MEMORY;
+	if (ad == NULL || fsp->base_fsp == NULL) {
+		rc = SMB_VFS_NEXT_FSTAT(handle, fsp, sbuf);
+		goto exit;
 	}
 
-	/* Remove the Netatalk xattr from the list */
-	ok = del_fruit_stream(mem_ctx, pnum_streams, pstreams,
-			      ":" NETATALK_META_XATTR ":$DATA");
-	if (!ok) {
-		return NT_STATUS_NO_MEMORY;
+	if (!fruit_fsp_recheck(ad, fsp)) {
+		rc = -1;
+		goto exit;
 	}
 
-	return NT_STATUS_OK;
-}
-
-static NTSTATUS fruit_streaminfo_meta(vfs_handle_struct *handle,
-				      struct files_struct *fsp,
-				      const struct smb_filename *smb_fname,
-				      TALLOC_CTX *mem_ctx,
-				      unsigned int *pnum_streams,
-				      struct stream_struct **pstreams)
-{
-	struct fruit_config_data *config = NULL;
-	NTSTATUS status;
-
-	SMB_VFS_HANDLE_GET_DATA(handle, config, struct fruit_config_data,
-				return NT_STATUS_INTERNAL_ERROR);
-
-	switch (config->meta) {
-	case FRUIT_META_NETATALK:
-		status = fruit_streaminfo_meta_netatalk(handle, fsp, smb_fname,
-							mem_ctx, pnum_streams,
-							pstreams);
+	switch (ad->ad_type) {
+	case ADOUBLE_META:
+		rc = fruit_fstat_meta(handle, fsp, sbuf);
 		break;
-
-	case FRUIT_META_STREAM:
-		status = fruit_streaminfo_meta_stream(handle, fsp, smb_fname,
-						      mem_ctx, pnum_streams,
-						      pstreams);
+	case ADOUBLE_RSRC:
+		rc = fruit_fstat_rsrc(handle, fsp, sbuf);
 		break;
-
 	default:
-		return NT_STATUS_INTERNAL_ERROR;
-	}
-
-	return status;
-}
-
-static NTSTATUS fruit_streaminfo_rsrc_stream(
-	vfs_handle_struct *handle,
-	struct files_struct *fsp,
-	const struct smb_filename *smb_fname,
-	TALLOC_CTX *mem_ctx,
-	unsigned int *pnum_streams,
-	struct stream_struct **pstreams)
-{
-	bool ok;
-
-	ok = filter_empty_rsrc_stream(pnum_streams, pstreams);
-	if (!ok) {
-		DBG_ERR("Filtering resource stream failed\n");
-		return NT_STATUS_INTERNAL_ERROR;
-	}
-	return NT_STATUS_OK;
-}
-
-static NTSTATUS fruit_streaminfo_rsrc_xattr(
-	vfs_handle_struct *handle,
-	struct files_struct *fsp,
-	const struct smb_filename *smb_fname,
-	TALLOC_CTX *mem_ctx,
-	unsigned int *pnum_streams,
-	struct stream_struct **pstreams)
-{
-	bool ok;
-
-	ok = filter_empty_rsrc_stream(pnum_streams, pstreams);
-	if (!ok) {
-		DBG_ERR("Filtering resource stream failed\n");
-		return NT_STATUS_INTERNAL_ERROR;
-	}
-	return NT_STATUS_OK;
-}
-
-static NTSTATUS fruit_streaminfo_rsrc_adouble(
-	vfs_handle_struct *handle,
-	struct files_struct *fsp,
-	const struct smb_filename *smb_fname,
-	TALLOC_CTX *mem_ctx,
-	unsigned int *pnum_streams,
-	struct stream_struct **pstreams)
-{
-	struct adouble *ad = NULL;
-	bool ok;
-	size_t rlen;
-
-	ad = ad_get(talloc_tos(), handle, smb_fname->base_name,
-		    ADOUBLE_RSRC);
-	if (ad == NULL) {
-		return NT_STATUS_OK;
-	}
-
-	rlen = ad_getentrylen(ad, ADEID_RFORK);
-	TALLOC_FREE(ad);
-
-	if (rlen == 0) {
-		return NT_STATUS_OK;
+		DEBUG(10, ("fruit_fstat %s: bad type\n",
+			   smb_fname_str_dbg(fsp->fsp_name)));
+		rc = -1;
+		goto exit;
 	}
 
-	ok = add_fruit_stream(mem_ctx, pnum_streams, pstreams,
-			      AFPRESOURCE_STREAM_NAME, rlen,
-			      smb_roundup(handle->conn, rlen));
-	if (!ok) {
-		return NT_STATUS_NO_MEMORY;
+	if (rc == 0) {
+		sbuf->st_ex_mode &= ~S_IFMT;
+		sbuf->st_ex_mode |= S_IFREG;
+		sbuf->st_ex_blocks = sbuf->st_ex_size / STAT_ST_BLOCKSIZE + 1;
 	}
 
-	return NT_STATUS_OK;
-}
-
-static NTSTATUS fruit_streaminfo_rsrc(vfs_handle_struct *handle,
-				      struct files_struct *fsp,
-				      const struct smb_filename *smb_fname,
-				      TALLOC_CTX *mem_ctx,
-				      unsigned int *pnum_streams,
-				      struct stream_struct **pstreams)
-{
-	struct fruit_config_data *config = NULL;
-	NTSTATUS status;
-
-	SMB_VFS_HANDLE_GET_DATA(handle, config, struct fruit_config_data,
-				return NT_STATUS_INTERNAL_ERROR);
-
-	switch (config->rsrc) {
-	case FRUIT_RSRC_STREAM:
-		status = fruit_streaminfo_rsrc_stream(handle, fsp, smb_fname,
-						      mem_ctx, pnum_streams,
-						      pstreams);
-		break;
-
-	case FRUIT_RSRC_XATTR:
-		status = fruit_streaminfo_rsrc_xattr(handle, fsp, smb_fname,
-						     mem_ctx, pnum_streams,
-						     pstreams);
-		break;
-
-	case FRUIT_RSRC_ADFILE:
-		status = fruit_streaminfo_rsrc_adouble(handle, fsp, smb_fname,
-						       mem_ctx, pnum_streams,
-						       pstreams);
-		break;
-
-	default:
-		return NT_STATUS_INTERNAL_ERROR;
+exit:
+	DEBUG(10, ("fruit_fstat %s, size: %zd\n",
+		   smb_fname_str_dbg(fsp->fsp_name),
+		   (ssize_t)sbuf->st_ex_size));
+	if (tmp_base_name) {
+		fsp->base_fsp->fsp_name->base_name = tmp_base_name;
 	}
-
-	return status;
+	TALLOC_FREE(name);
+	return rc;
 }
 
 static NTSTATUS fruit_streaminfo(vfs_handle_struct *handle,
@@ -4637,29 +3188,60 @@
 				 struct stream_struct **pstreams)
 {
 	struct fruit_config_data *config = NULL;
+	struct adouble *ad = NULL;
 	NTSTATUS status;
 
 	SMB_VFS_HANDLE_GET_DATA(handle, config, struct fruit_config_data,
 				return NT_STATUS_UNSUCCESSFUL);
+	DEBUG(10, ("fruit_streaminfo called for %s\n", smb_fname->base_name));
 
-	DBG_DEBUG("Path [%s]\n", smb_fname_str_dbg(smb_fname));
+	if (config->meta == FRUIT_META_NETATALK) {
+		ad = ad_get(talloc_tos(), handle,
+			    smb_fname->base_name, ADOUBLE_META);
+		if (ad && !empty_finderinfo(ad)) {
+			if (!add_fruit_stream(
+				    mem_ctx, pnum_streams, pstreams,
+				    AFPINFO_STREAM_NAME, AFP_INFO_SIZE,
+				    smb_roundup(handle->conn,
+						AFP_INFO_SIZE))) {
+				TALLOC_FREE(ad);
+				return NT_STATUS_NO_MEMORY;
+			}
+		}
+		TALLOC_FREE(ad);
+	}
 
-	status = SMB_VFS_NEXT_STREAMINFO(handle, fsp, smb_fname, mem_ctx,
-					 pnum_streams, pstreams);
-	if (!NT_STATUS_IS_OK(status)) {
-		return status;
+	if (config->rsrc != FRUIT_RSRC_STREAM) {
+		ad = ad_get(talloc_tos(), handle, smb_fname->base_name,
+			    ADOUBLE_RSRC);
+		if (ad && (ad_getentrylen(ad, ADEID_RFORK) > 0)) {
+			if (!add_fruit_stream(
+				    mem_ctx, pnum_streams, pstreams,
+				    AFPRESOURCE_STREAM_NAME,
+				    ad_getentrylen(ad, ADEID_RFORK),
+				    smb_roundup(handle->conn,
+						ad_getentrylen(
+							ad, ADEID_RFORK)))) {
+				TALLOC_FREE(ad);
+				return NT_STATUS_NO_MEMORY;
+			}
+		}
+		TALLOC_FREE(ad);
 	}
 
-	status = fruit_streaminfo_meta(handle, fsp, smb_fname,
-				       mem_ctx, pnum_streams, pstreams);
+	status = SMB_VFS_NEXT_STREAMINFO(handle, fsp, smb_fname, mem_ctx,
+					 pnum_streams, pstreams);
 	if (!NT_STATUS_IS_OK(status)) {
 		return status;
 	}
 
-	status = fruit_streaminfo_rsrc(handle, fsp, smb_fname,
-				       mem_ctx, pnum_streams, pstreams);
-	if (!NT_STATUS_IS_OK(status)) {
-		return status;
+	if (config->meta == FRUIT_META_NETATALK) {
+		/* Remove the Netatalk xattr from the list */
+		if (!del_fruit_stream(mem_ctx, pnum_streams, pstreams,
+				      ":" NETATALK_META_XATTR ":$DATA")) {
+				TALLOC_FREE(ad);
+				return NT_STATUS_NO_MEMORY;
+		}
 	}
 
 	return NT_STATUS_OK;
@@ -4671,15 +3253,9 @@
 {
 	int rc = 0;
 	struct adouble *ad = NULL;
-	struct fruit_config_data *config = NULL;
-
-	SMB_VFS_HANDLE_GET_DATA(handle, config, struct fruit_config_data,
-				return -1);
 
-	if ((config->meta != FRUIT_META_NETATALK) ||
-	    null_timespec(ft->create_time))
-	{
-		return SMB_VFS_NEXT_NTIMES(handle, smb_fname, ft);
+	if (null_timespec(ft->create_time)) {
+		goto exit;
 	}
 
 	DEBUG(10,("set btime for %s to %s\n", smb_fname_str_dbg(smb_fname),
@@ -4693,7 +3269,7 @@
 	ad_setdate(ad, AD_DATE_CREATE | AD_DATE_UNIX,
 		   convert_time_t_to_uint32_t(ft->create_time.tv_sec));
 
-	rc = ad_set(ad, smb_fname->base_name);
+	rc = ad_write(ad, smb_fname->base_name);
 
 exit:
 
@@ -4711,120 +3287,79 @@
 			   off_t offset,
 			   off_t len)
 {
-	struct fio *fio = (struct fio *)VFS_FETCH_FSP_EXTENSION(handle, fsp);
+        struct adouble *ad =
+		(struct adouble *)VFS_FETCH_FSP_EXTENSION(handle, fsp);
 
-	if (fio == NULL) {
+	if (ad == NULL) {
 		return SMB_VFS_NEXT_FALLOCATE(handle, fsp, mode, offset, len);
 	}
 
+	if (!fruit_fsp_recheck(ad, fsp)) {
+		return -1;
+	}
+
 	/* Let the pwrite code path handle it. */
 	errno = ENOSYS;
 	return -1;
 }
 
-static int fruit_ftruncate_rsrc_xattr(struct vfs_handle_struct *handle,
-				      struct files_struct *fsp,
-				      off_t offset)
-{
-	if (offset == 0) {
-		return SMB_VFS_FREMOVEXATTR(fsp, AFPRESOURCE_EA_NETATALK);
-	}
-
-	return SMB_VFS_NEXT_FTRUNCATE(handle, fsp, offset);
-}
-
-static int fruit_ftruncate_rsrc_adouble(struct vfs_handle_struct *handle,
-					struct files_struct *fsp,
-					off_t offset)
+static int fruit_ftruncate_meta(struct vfs_handle_struct *handle,
+				struct files_struct *fsp,
+				off_t offset,
+				struct adouble *ad)
 {
-	int rc;
-	struct adouble *ad = NULL;
-	off_t ad_off;
-
-	ad = ad_fget(talloc_tos(), handle, fsp, ADOUBLE_RSRC);
-	if (ad == NULL) {
-		DBG_DEBUG("ad_get [%s] failed [%s]\n",
-			  fsp_str_dbg(fsp), strerror(errno));
-		return -1;
-	}
-
-	ad_off = ad_getentryoff(ad, ADEID_RFORK);
-
-	rc = SMB_VFS_NEXT_FTRUNCATE(handle, fsp, offset + ad_off);
-	if (rc != 0) {
-		TALLOC_FREE(ad);
-		return -1;
-	}
+	struct fruit_config_data *config;
 
-	ad_setentrylen(ad, ADEID_RFORK, offset);
+	SMB_VFS_HANDLE_GET_DATA(handle, config,
+				struct fruit_config_data, return -1);
 
-	rc = ad_fset(ad, fsp);
-	if (rc != 0) {
-		DBG_ERR("ad_fset [%s] failed [%s]\n",
-			fsp_str_dbg(fsp), strerror(errno));
-		TALLOC_FREE(ad);
+	if (offset > 60) {
+		DBG_WARNING("ftruncate %s to %jd",
+			    fsp_str_dbg(fsp), (intmax_t)offset);
+		/* OS X returns NT_STATUS_ALLOTTED_SPACE_EXCEEDED  */
+		errno = EOVERFLOW;
 		return -1;
 	}
 
-	TALLOC_FREE(ad);
+	DBG_WARNING("ignoring ftruncate %s to %jd",
+		    fsp_str_dbg(fsp), (intmax_t)offset);
+	/* OS X returns success but does nothing  */
 	return 0;
 }
 
-static int fruit_ftruncate_rsrc_stream(struct vfs_handle_struct *handle,
-				       struct files_struct *fsp,
-				       off_t offset)
-{
-	if (offset == 0) {
-		return SMB_VFS_NEXT_UNLINK(handle, fsp->fsp_name);
-	}
-
-	return SMB_VFS_NEXT_FTRUNCATE(handle, fsp, offset);
-}
-
 static int fruit_ftruncate_rsrc(struct vfs_handle_struct *handle,
 				struct files_struct *fsp,
-				off_t offset)
+				off_t offset,
+				struct adouble *ad)
 {
-	struct fio *fio = (struct fio *)VFS_FETCH_FSP_EXTENSION(handle, fsp);
-	int ret;
-
-	switch (fio->config->rsrc) {
-	case FRUIT_RSRC_XATTR:
-		ret = fruit_ftruncate_rsrc_xattr(handle, fsp, offset);
-		break;
+	int rc;
+	struct fruit_config_data *config;
 
-	case FRUIT_RSRC_ADFILE:
-		ret = fruit_ftruncate_rsrc_adouble(handle, fsp, offset);
-		break;
+	SMB_VFS_HANDLE_GET_DATA(handle, config,
+				struct fruit_config_data, return -1);
 
-	case FRUIT_RSRC_STREAM:
-		ret = fruit_ftruncate_rsrc_stream(handle, fsp, offset);
-		break;
+	if (config->rsrc == FRUIT_RSRC_XATTR && offset == 0) {
+		return SMB_VFS_FREMOVEXATTR(fsp,
+					    AFPRESOURCE_EA_NETATALK);
+	}
 
-	default:
-		DBG_ERR("Unexpected rsrc config [%d]\n", fio->config->rsrc);
+	rc = SMB_VFS_NEXT_FTRUNCATE(
+		handle, fsp,
+		offset + ad_getentryoff(ad, ADEID_RFORK));
+	if (rc != 0) {
 		return -1;
 	}
 
-
-	return ret;
-}
-
-static int fruit_ftruncate_meta(struct vfs_handle_struct *handle,
-				struct files_struct *fsp,
-				off_t offset)
-{
-	if (offset > 60) {
-		DBG_WARNING("ftruncate %s to %jd",
-			    fsp_str_dbg(fsp), (intmax_t)offset);
-		/* OS X returns NT_STATUS_ALLOTTED_SPACE_EXCEEDED  */
-		errno = EOVERFLOW;
-		return -1;
+	if (config->rsrc == FRUIT_RSRC_ADFILE) {
+		ad_setentrylen(ad, ADEID_RFORK, offset);
+		rc = ad_write(ad, NULL);
+		if (rc != 0) {
+			return -1;
+		}
+		DEBUG(10, ("fruit_ftruncate_rsrc file %s offset %jd\n",
+			   fsp_str_dbg(fsp), (intmax_t)offset));
 	}
 
-	/* OS X returns success but does nothing  */
-	DBG_INFO("ignoring ftruncate %s to %jd\n",
-		 fsp_str_dbg(fsp), (intmax_t)offset);
 	return 0;
 }
 
@@ -4832,23 +3367,35 @@
 			   struct files_struct *fsp,
 			   off_t offset)
 {
-	struct fio *fio = (struct fio *)VFS_FETCH_FSP_EXTENSION(handle, fsp);
-	int ret;
+	int rc = 0;
+        struct adouble *ad =
+		(struct adouble *)VFS_FETCH_FSP_EXTENSION(handle, fsp);
 
-	DBG_DEBUG("Path [%s] offset [%zd]\n", fsp_str_dbg(fsp), offset);
+	DBG_DEBUG("fruit_ftruncate called for file %s offset %.0f\n",
+		   fsp_str_dbg(fsp), (double)offset);
 
-	if (fio == NULL) {
+	if (ad == NULL) {
 		return SMB_VFS_NEXT_FTRUNCATE(handle, fsp, offset);
 	}
 
-	if (fio->type == ADOUBLE_META) {
-		ret = fruit_ftruncate_meta(handle, fsp, offset);
-	} else {
-		ret = fruit_ftruncate_rsrc(handle, fsp, offset);
+	if (!fruit_fsp_recheck(ad, fsp)) {
+		return -1;
 	}
 
-	DBG_DEBUG("Path [%s] result [%d]\n", fsp_str_dbg(fsp), ret);
-	return ret;
+	switch (ad->ad_type) {
+	case ADOUBLE_META:
+		rc = fruit_ftruncate_meta(handle, fsp, offset, ad);
+		break;
+
+	case ADOUBLE_RSRC:
+		rc = fruit_ftruncate_rsrc(handle, fsp, offset, ad);
+		break;
+
+	default:
+		return -1;
+	}
+
+	return rc;
 }
 
 static NTSTATUS fruit_create_file(vfs_handle_struct *handle,
diff -Nru samba-4.5.4+dfsg/source3/modules/vfs_streams_xattr.c samba-4.5.5+dfsg/source3/modules/vfs_streams_xattr.c
--- samba-4.5.4+dfsg/source3/modules/vfs_streams_xattr.c	2017-01-17 20:55:44.000000000 +0100
+++ samba-4.5.5+dfsg/source3/modules/vfs_streams_xattr.c	2017-01-30 10:56:26.000000000 +0100
@@ -452,18 +452,18 @@
         hostfd = SMB_VFS_OPEN(handle->conn, smb_fname_base, fsp,
 			      baseflags, mode);
 
+	TALLOC_FREE(smb_fname_base);
+
         /* It is legit to open a stream on a directory, but the base
          * fd has to be read-only.
          */
         if ((hostfd == -1) && (errno == EISDIR)) {
                 baseflags &= ~O_ACCMODE;
                 baseflags |= O_RDONLY;
-                hostfd = SMB_VFS_OPEN(handle->conn, smb_fname_base, fsp, baseflags,
+                hostfd = SMB_VFS_OPEN(handle->conn, smb_fname, fsp, baseflags,
 				      mode);
         }
 
-	TALLOC_FREE(smb_fname_base);
-
         if (hostfd == -1) {
 		goto fail;
         }
diff -Nru samba-4.5.4+dfsg/source3/selftest/tests.py samba-4.5.5+dfsg/source3/selftest/tests.py
--- samba-4.5.4+dfsg/source3/selftest/tests.py	2017-01-17 20:55:44.000000000 +0100
+++ samba-4.5.5+dfsg/source3/selftest/tests.py	2017-01-30 10:56:26.000000000 +0100
@@ -323,7 +323,7 @@
 
 libsmbclient = ["libsmbclient"]
 
-vfs = ["vfs.fruit", "vfs.acl_xattr", "vfs.fruit_netatalk"]
+vfs = ["vfs.fruit", "vfs.acl_xattr"]
 
 tests= base + raw + smb2 + rpc + unix + local + rap + nbt + libsmbclient + idmap + vfs
 
@@ -404,11 +404,8 @@
         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmpsort -U$USERNAME%$PASSWORD')
         plansmbtorture4testsuite(t, "ad_dc", '//$SERVER/tmp -U$USERNAME%$PASSWORD')
     elif t == "vfs.fruit":
-        plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/vfs_fruit -U$USERNAME%$PASSWORD --option=torture:localdir=$SELFTEST_PREFIX/nt4_dc/share --option=torture:share2=vfs_wo_fruit', 'metadata_netatalk')
-        plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/vfs_fruit_metadata_stream --option=torture:share2=vfs_wo_fruit -U$USERNAME%$PASSWORD', 'metadata_stream')
-        plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/vfs_fruit_stream_depot --option=torture:share2=vfs_wo_fruit_stream_depot -U$USERNAME%$PASSWORD', 'streams_depot')
-    elif t == "vfs.fruit_netatalk":
         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/vfs_fruit -U$USERNAME%$PASSWORD --option=torture:localdir=$SELFTEST_PREFIX/nt4_dc/share')
+        plansmbtorture4testsuite(t, "ad_dc", '//$SERVER_IP/vfs_fruit -U$USERNAME%$PASSWORD --option=torture:localdir=$SELFTEST_PREFIX/ad_dc/share')
     elif t == "rpc.schannel_anon_setpw":
         plansmbtorture4testsuite(t, "nt4_dc", '//$SERVER_IP/tmp -U$%', description="anonymous password set")
         plansmbtorture4testsuite(t, "nt4_dc_schannel", '//$SERVER_IP/tmp -U$%', description="anonymous password set (schannel enforced server-side)")
diff -Nru samba-4.5.4+dfsg/source4/torture/vfs/fruit.c samba-4.5.5+dfsg/source4/torture/vfs/fruit.c
--- samba-4.5.4+dfsg/source4/torture/vfs/fruit.c	2017-01-17 20:55:44.000000000 +0100
+++ samba-4.5.5+dfsg/source4/torture/vfs/fruit.c	2017-01-30 10:56:26.000000000 +0100
@@ -3527,383 +3527,6 @@
 }
 
 /*
- * This tests that right after creating the AFP_AfpInfo stream,
- * reading from the stream returns an empty, default metadata blob of
- * 60 bytes.
- *
- * NOTE: against OS X SMB server this only works if the read request
- * is compounded with the create that created the stream, is fails
- * otherwise. We don't care...
- */
-static bool test_null_afpinfo(struct torture_context *tctx,
-			      struct smb2_tree *tree)
-{
-	TALLOC_CTX *mem_ctx = talloc_new(tctx);
-	const char *fname = "test_null_afpinfo";
-	const char *sname = "test_null_afpinfo" AFPINFO_STREAM_NAME;
-	NTSTATUS status;
-	bool ret = true;
-	struct smb2_request *req[3];
-	struct smb2_handle handle;
-	struct smb2_create create;
-	struct smb2_read read;
-	AfpInfo *afpinfo = NULL;
-	char *afpinfo_buf = NULL;
-	const char *type_creator = "SMB,OLE!";
-
-	torture_comment(tctx, "Checking create of AfpInfo stream\n");
-
-	smb2_util_unlink(tree, fname);
-
-	ret = torture_setup_file(mem_ctx, tree, fname, false);
-	torture_assert_goto(tctx, ret == true, ret, done, "torture_setup_file failed");
-
-	ZERO_STRUCT(create);
-	create.in.desired_access = SEC_FILE_READ_DATA|SEC_FILE_WRITE_DATA;
-	create.in.share_access = FILE_SHARE_READ | FILE_SHARE_DELETE;
-	create.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
-	create.in.impersonation_level = SMB2_IMPERSONATION_IMPERSONATION;
-	create.in.create_disposition = NTCREATEX_DISP_OPEN_IF;
-	create.in.fname = sname;
-
-	smb2_transport_compound_start(tree->session->transport, 2);
-
-	req[0] = smb2_create_send(tree, &create);
-
-	handle.data[0] = UINT64_MAX;
-	handle.data[1] = UINT64_MAX;
-
-	smb2_transport_compound_set_related(tree->session->transport, true);
-
-	ZERO_STRUCT(read);
-	read.in.file.handle = handle;
-	read.in.length = AFP_INFO_SIZE;
-	req[1] = smb2_read_send(tree, &read);
-
-	status = smb2_create_recv(req[0], tree, &create);
-	torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "smb2_create_recv failed");
-
-	handle = create.out.file.handle;
-
-	status = smb2_read_recv(req[1], tree, &read);
-	torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "smb2_read_recv failed");
-
-	afpinfo = torture_afpinfo_new(mem_ctx);
-	torture_assert_goto(tctx, afpinfo != NULL, ret, done, "torture_afpinfo_new failed");
-
-	memcpy(afpinfo->afpi_FinderInfo, type_creator, 8);
-
-	afpinfo_buf = torture_afpinfo_pack(tctx, afpinfo);
-	torture_assert_goto(tctx, afpinfo_buf != NULL, ret, done, "torture_afpinfo_new failed");
-
-	status = smb2_util_write(tree, handle, afpinfo_buf, 0, AFP_INFO_SIZE);
-	torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "smb2_util_write failed");
-
-	smb2_util_close(tree, handle);
-
-	ret = check_stream(tree, __location__, tctx, mem_ctx, fname, AFPINFO_STREAM,
-			   0, 60, 16, 8, type_creator);
-	torture_assert_goto(tctx, ret == true, ret, done, "check_stream failed");
-
-done:
-	smb2_util_unlink(tree, fname);
-	talloc_free(mem_ctx);
-	return ret;
-}
-
-static bool test_delete_file_with_rfork(struct torture_context *tctx,
-					struct smb2_tree *tree)
-{
-	const char *fname = "torture_write_rfork_io";
-	const char *rfork_content = "1234567890";
-	NTSTATUS status;
-	bool ret = true;
-
-	smb2_util_unlink(tree, fname);
-
-	torture_comment(tctx, "Test deleting file with resource fork\n");
-
-	ret = torture_setup_file(tctx, tree, fname, false);
-	torture_assert_goto(tctx, ret == true, ret, done, "torture_setup_file failed\n");
-
-	ret = write_stream(tree, __location__, tctx, tctx,
-			   fname, AFPRESOURCE_STREAM_NAME,
-			   10, 10, rfork_content);
-	torture_assert_goto(tctx, ret == true, ret, done, "write_stream failed\n");
-
-	ret = check_stream(tree, __location__, tctx, tctx,
-			   fname, AFPRESOURCE_STREAM_NAME,
-			   0, 20, 10, 10, rfork_content);
-	torture_assert_goto(tctx, ret == true, ret, done, "check_stream failed\n");
-
-	status = smb2_util_unlink(tree, fname);
-	torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "check_stream failed\n");
-
-done:
-	return ret;
-}
-
-static bool test_rename_and_read_rsrc(struct torture_context *tctx,
-				      struct smb2_tree *tree)
-{
-	bool ret = true;
-	NTSTATUS status;
-	struct smb2_create create, create2;
-	struct smb2_handle h1, h2;
-	const char *fname = "test_rename_openfile";
-	const char *sname = "test_rename_openfile" AFPRESOURCE_STREAM_NAME;
-	const char *fname_renamed = "test_rename_openfile_renamed";
-	const char *data = "1234567890";
-	union smb_setfileinfo sinfo;
-	struct smb2_read r;
-
-	ret = enable_aapl(tctx, tree);
-	torture_assert_goto(tctx, ret == true, ret, done, "enable_aapl failed");
-
-	torture_comment(tctx, "Create file with resource fork\n");
-
-	ret = torture_setup_file(tctx, tree, fname, false);
-	torture_assert_goto(tctx, ret == true, ret, done, "torture_setup_file");
-
-	ret = write_stream(tree, __location__, tctx, tctx,
-			   fname, AFPRESOURCE_STREAM_NAME, 0, 10, data);
-	torture_assert_goto(tctx, ret == true, ret, done, "write_stream failed");
-
-	torture_comment(tctx, "Open resource fork\n");
-
-	ZERO_STRUCT(create);
-	create.in.desired_access = SEC_FILE_ALL;
-	create.in.share_access = NTCREATEX_SHARE_ACCESS_MASK;
-	create.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
-	create.in.create_disposition = NTCREATEX_DISP_OPEN;
-	create.in.impersonation_level = SMB2_IMPERSONATION_IMPERSONATION;
-	create.in.fname = sname;
-
-	status = smb2_create(tree, tctx, &create);
-	torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "smb2_create failed");
-
-	h1 = create.out.file.handle;
-
-	torture_comment(tctx, "Rename base file\n");
-
-	ZERO_STRUCT(create2);
-	create2.in.desired_access = SEC_FILE_ALL;
-	create2.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
-	create2.in.share_access = NTCREATEX_SHARE_ACCESS_MASK;
-	create2.in.create_disposition = NTCREATEX_DISP_OPEN;
-	create2.in.impersonation_level = SMB2_IMPERSONATION_IMPERSONATION;
-	create2.in.fname = fname;
-
-	status = smb2_create(tree, tctx, &create2);
-	torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "smb2_create failed");
-
-	h2 = create2.out.file.handle;
-
-	ZERO_STRUCT(sinfo);
-	sinfo.rename_information.level = RAW_SFILEINFO_RENAME_INFORMATION;
-	sinfo.rename_information.in.file.handle = h2;
-	sinfo.rename_information.in.overwrite = 0;
-	sinfo.rename_information.in.root_fid = 0;
-	sinfo.rename_information.in.new_name = fname_renamed;
-
-	status = smb2_setinfo_file(tree, &sinfo);
-	torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "smb2_setinfo_file failed");
-
-	smb2_util_close(tree, h2);
-
-	ZERO_STRUCT(r);
-	r.in.file.handle = h1;
-	r.in.length      = 10;
-	r.in.offset      = 0;
-
-	torture_comment(tctx, "Read resource fork of renamed file\n");
-
-	status = smb2_read(tree, tree, &r);
-	torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "smb2_read failed");
-
-	smb2_util_close(tree, h1);
-
-	torture_assert_goto(tctx, r.out.data.length == 10, ret, done,
-			    talloc_asprintf(tctx, "smb2_read returned %jd bytes, expected 10\n",
-					    (intmax_t)r.out.data.length));
-
-	torture_assert_goto(tctx, memcmp(r.out.data.data, data, 10) == 0, ret, done,
-			    talloc_asprintf(tctx, "Bad data in stream\n"));
-
-done:
-	smb2_util_unlink(tree, fname);
-	smb2_util_unlink(tree, fname_renamed);
-
-	return ret;
-}
-
-static bool test_readdir_attr_illegal_ntfs(struct torture_context *tctx,
-					   struct smb2_tree *tree)
-{
-	TALLOC_CTX *mem_ctx = talloc_new(tctx);
-	const char *name = "test" "\xef\x80\xa2" "aapl"; /* "test:aapl" */
-	const char *fname = BASEDIR "\\test" "\xef\x80\xa2" "aapl"; /* "test:aapl" */
-	NTSTATUS status;
-	struct smb2_handle testdirh;
-	bool ret = true;
-	struct smb2_create io;
-	AfpInfo *info;
-	const char *type_creator = "SMB,OLE!";
-	struct smb2_find f;
-	unsigned int count;
-	union smb_search_data *d;
-	uint64_t rfork_len;
-	int i;
-
-	smb2_deltree(tree, BASEDIR);
-
-	status = torture_smb2_testdir(tree, BASEDIR, &testdirh);
-	torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "torture_smb2_testdir failed");
-	smb2_util_close(tree, testdirh);
-
-	torture_comment(tctx, "Enabling AAPL\n");
-
-	ret = enable_aapl(tctx, tree);
-	torture_assert_goto(tctx, ret == true, ret, done, "enable_aapl failed");
-
-	/*
-	 * Now that Requested AAPL extensions are enabled, setup some
-	 * Mac files with metadata and resource fork
-	 */
-
-	torture_comment(tctx, "Preparing file\n");
-
-	ret = torture_setup_file(mem_ctx, tree, fname, false);
-	torture_assert_goto(tctx, ret == true, ret, done, "torture_setup_file failed");
-
-	info = torture_afpinfo_new(mem_ctx);
-	torture_assert_not_null_goto(tctx, info, ret, done, "torture_afpinfo_new failed");
-
-	memcpy(info->afpi_FinderInfo, type_creator, 8);
-	ret = torture_write_afpinfo(tree, tctx, mem_ctx, fname, info);
-	torture_assert_goto(tctx, ret == true, ret, done, "torture_write_afpinfo failed");
-
-	ret = write_stream(tree, __location__, tctx, mem_ctx,
-			   fname, AFPRESOURCE_STREAM_NAME,
-			   0, 3, "foo");
-	torture_assert_goto(tctx, ret == true, ret, done, "write_stream failed");
-
-	/*
-	 * Ok, file is prepared, now call smb2/find
-	 */
-
-	torture_comment(tctx, "Issue find\n");
-
-	ZERO_STRUCT(io);
-	io.in.desired_access = SEC_RIGHTS_DIR_READ;
-	io.in.create_options = NTCREATEX_OPTIONS_DIRECTORY;
-	io.in.file_attributes = FILE_ATTRIBUTE_DIRECTORY;
-	io.in.share_access = (NTCREATEX_SHARE_ACCESS_READ |
-			      NTCREATEX_SHARE_ACCESS_WRITE |
-			      NTCREATEX_SHARE_ACCESS_DELETE);
-	io.in.create_disposition = NTCREATEX_DISP_OPEN;
-	io.in.fname = BASEDIR;
-	status = smb2_create(tree, tctx, &io);
-	torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "smb2_create failed");
-
-	ZERO_STRUCT(f);
-	f.in.file.handle	= io.out.file.handle;
-	f.in.pattern		= "*";
-	f.in.max_response_size	= 0x1000;
-	f.in.level              = SMB2_FIND_ID_BOTH_DIRECTORY_INFO;
-
-	status = smb2_find_level(tree, tree, &f, &count, &d);
-	torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "smb2_find_level failed");
-
-	status = smb2_util_close(tree, io.out.file.handle);
-	torture_assert_ntstatus_ok_goto(tctx, status, ret, done, "smb2_util_close failed");
-
-	torture_comment(tctx, "Checking find response with enriched macOS metadata\n");
-
-	for (i = 0; i < count; i++) {
-		const char *found = d[i].id_both_directory_info.name.s;
-
-		if (!strcmp(found, ".") || !strcmp(found, ".."))
-			continue;
-		break;
-	}
-
-	torture_assert_str_equal_goto(tctx,
-				      d[i].id_both_directory_info.name.s, name,
-				      ret, done, "bad name");
-
-	rfork_len = BVAL(d[i].id_both_directory_info.short_name_buf, 0);
-	torture_assert_int_equal_goto(tctx, rfork_len, 3, ret, done, "bad resource fork length");
-
-	torture_assert_mem_equal_goto(tctx, type_creator,
-				      d[i].id_both_directory_info.short_name_buf + 8,
-				      8, ret, done, "Bad FinderInfo");
-done:
-	smb2_util_unlink(tree, fname);
-	smb2_deltree(tree, BASEDIR);
-	talloc_free(mem_ctx);
-	return ret;
-}
-
-static bool test_invalid_afpinfo(struct torture_context *tctx,
-				 struct smb2_tree *tree1,
-				 struct smb2_tree *tree2)
-{
-	const char *fname = "filtest_invalid_afpinfo";
-	const char *sname = "filtest_invalid_afpinfo" AFPINFO_STREAM_NAME;
-	struct smb2_create create;
-	const char *streams_basic[] = {
-		"::$DATA"
-	};
-	const char *streams_afpinfo[] = {
-		"::$DATA",
-		AFPINFO_STREAM
-	};
-	NTSTATUS status;
-	bool ret = true;
-
-	if (tree2 == NULL) {
-		torture_skip_goto(tctx, done, "need second share without fruit\n");
-	}
-
-	torture_comment(tctx, "Testing invalid AFP_AfpInfo stream\n");
-
-	ret = torture_setup_file(tctx, tree2, fname, false);
-	torture_assert_goto(tctx, ret == true, ret, done, "torture_setup_file");
-
-	ret = write_stream(tree2, __location__, tctx, tctx,
-			   fname, AFPINFO_STREAM_NAME,
-			   0, 3, "foo");
-	torture_assert_goto(tctx, ret == true, ret, done, "write_stream failed");
-
-	ret = check_stream_list(tree2, tctx, fname, 2, streams_afpinfo, false);
-	torture_assert_goto(tctx, ret == true, ret, done, "Bad streams");
-
-	torture_comment(tctx, "Listing streams, bad AFPINFO stream must not be present\n");
-
-	ret = check_stream_list(tree1, tctx, fname, 1, streams_basic, false);
-	torture_assert_goto(tctx, ret == true, ret, done, "Bad streams");
-
-	torture_comment(tctx, "Try to open AFPINFO stream, must fail\n");
-
-	ZERO_STRUCT(create);
-	create.in.desired_access = SEC_FILE_ALL;
-	create.in.share_access = NTCREATEX_SHARE_ACCESS_MASK;
-	create.in.file_attributes = FILE_ATTRIBUTE_NORMAL;
-	create.in.create_disposition = NTCREATEX_DISP_OPEN;
-	create.in.impersonation_level = SMB2_IMPERSONATION_IMPERSONATION;
-	create.in.fname = sname;
-
-	status = smb2_create(tree1, tctx, &create);
-	torture_assert_ntstatus_equal_goto(tctx, status, NT_STATUS_OBJECT_NAME_NOT_FOUND,
-					   ret, done, "Stream still around?");
-
-done:
-	smb2_util_unlink(tree1, fname);
-	return ret;
-}
-
-/*
  * Note: This test depends on "vfs objects = catia fruit streams_xattr".  For
  * some tests torture must be run on the host it tests and takes an additional
  * argument with the local path to the share:
@@ -3919,9 +3542,11 @@
 	suite->description = talloc_strdup(suite, "vfs_fruit tests");
 
 	torture_suite_add_1smb2_test(suite, "copyfile", test_copyfile);
+	torture_suite_add_1smb2_test(suite, "read netatalk metadata", test_read_netatalk_metadata);
 	torture_suite_add_1smb2_test(suite, "read metadata", test_read_afpinfo);
 	torture_suite_add_1smb2_test(suite, "write metadata", test_write_atalk_metadata);
 	torture_suite_add_1smb2_test(suite, "resource fork IO", test_write_atalk_rfork_io);
+	torture_suite_add_1smb2_test(suite, "OS X AppleDouble file conversion", test_adouble_conversion);
 	torture_suite_add_1smb2_test(suite, "SMB2/CREATE context AAPL", test_aapl);
 	torture_suite_add_1smb2_test(suite, "stream names", test_stream_names);
 	torture_suite_add_1smb2_test(suite, "truncate resource fork to 0 bytes", test_rfork_truncate);
@@ -3935,25 +3560,6 @@
 	torture_suite_add_1smb2_test(suite, "create delete-on-close AFP_AfpResource", test_create_delete_on_close_resource);
 	torture_suite_add_1smb2_test(suite, "setinfo delete-on-close AFP_AfpResource", test_setinfo_delete_on_close_resource);
 	torture_suite_add_1smb2_test(suite, "setinfo eof AFP_AfpResource", test_setinfo_eof_resource);
-	torture_suite_add_1smb2_test(suite, "null afpinfo", test_null_afpinfo);
-	torture_suite_add_1smb2_test(suite, "delete", test_delete_file_with_rfork);
-	torture_suite_add_1smb2_test(suite, "read open rsrc after rename", test_rename_and_read_rsrc);
-	torture_suite_add_1smb2_test(suite, "readdir_attr with names with illegal ntfs characters", test_readdir_attr_illegal_ntfs);
-
-	torture_suite_add_2ns_smb2_test(suite, "invalid AFP_AfpInfo", test_invalid_afpinfo);
-
-	return suite;
-}
-
-struct torture_suite *torture_vfs_fruit_netatalk(void)
-{
-	struct torture_suite *suite = torture_suite_create(
-		talloc_autofree_context(), "fruit_netatalk");
-
-	suite->description = talloc_strdup(suite, "vfs_fruit tests for Netatalk interop that require fruit:metadata=netatalk");
-
-	torture_suite_add_1smb2_test(suite, "read netatalk metadata", test_read_netatalk_metadata);
-	torture_suite_add_1smb2_test(suite, "OS X AppleDouble file conversion", test_adouble_conversion);
 
 	return suite;
 }
diff -Nru samba-4.5.4+dfsg/source4/torture/vfs/vfs.c samba-4.5.5+dfsg/source4/torture/vfs/vfs.c
--- samba-4.5.4+dfsg/source4/torture/vfs/vfs.c	2017-01-17 20:55:44.000000000 +0100
+++ samba-4.5.5+dfsg/source4/torture/vfs/vfs.c	2017-01-30 10:56:26.000000000 +0100
@@ -38,44 +38,42 @@
 			       struct torture_test *test)
 {
 	bool (*fn) (struct torture_context *, struct smb2_tree *, struct smb2_tree *);
-	bool ok;
+	bool ret = false;
 
-	struct smb2_tree *tree1 = NULL;
-	struct smb2_tree *tree2 = NULL;
+	struct smb2_tree *tree1;
+	struct smb2_tree *tree2;
 	TALLOC_CTX *mem_ctx = talloc_new(torture_ctx);
 
-	if (!torture_smb2_connection(torture_ctx, &tree1)) {
+	if (!torture_smb2_con_sopt(torture_ctx, "share1", &tree1)) {
 		torture_fail(torture_ctx,
-			    "Establishing SMB2 connection failed\n");
-		return false;
+		    "Establishing SMB2 connection failed\n");
+		goto done;
 	}
 
-	/*
-	 * This is a trick:
-	 * The test might close the connection. If we steal the tree context
-	 * before that and free the parent instead of tree directly, we avoid
-	 * a double free error.
-	 */
 	talloc_steal(mem_ctx, tree1);
 
-	ok = torture_smb2_con_sopt(torture_ctx, "share2", &tree2);
-	if (ok) {
-		talloc_steal(mem_ctx, tree2);
+	if (!torture_smb2_con_sopt(torture_ctx, "share2", &tree2)) {
+		torture_fail(torture_ctx,
+		    "Establishing SMB2 connection failed\n");
+		goto done;
 	}
 
+	talloc_steal(mem_ctx, tree2);
+
 	fn = test->fn;
 
-	ok = fn(torture_ctx, tree1, tree2);
+	ret = fn(torture_ctx, tree1, tree2);
 
+done:
 	/* the test may already have closed some of the connections */
 	talloc_free(mem_ctx);
 
-	return ok;
+	return ret;
 }
 
 /*
- * Run a test with 2 connected trees, the default share and another
- * taken from option strings "torture:share2"
+ * Run a test with 2 connected trees, Share names to connect are taken
+ * from option strings "torture:share1" and "torture:share2"
  */
 struct torture_test *torture_suite_add_2ns_smb2_test(struct torture_suite *suite,
 						     const char *name,
@@ -109,7 +107,6 @@
 	suite->description = talloc_strdup(suite, "VFS modules tests");
 
 	torture_suite_add_suite(suite, torture_vfs_fruit());
-	torture_suite_add_suite(suite, torture_vfs_fruit_netatalk());
 	torture_suite_add_suite(suite, torture_acl_xattr());
 
 	torture_register_suite(suite);
diff -Nru samba-4.5.4+dfsg/VERSION samba-4.5.5+dfsg/VERSION
--- samba-4.5.4+dfsg/VERSION	2017-01-17 20:55:44.000000000 +0100
+++ samba-4.5.5+dfsg/VERSION	2017-01-30 10:56:26.000000000 +0100
@@ -25,7 +25,7 @@
 ########################################################
 SAMBA_VERSION_MAJOR=4
 SAMBA_VERSION_MINOR=5
-SAMBA_VERSION_RELEASE=4
+SAMBA_VERSION_RELEASE=5
 
 ########################################################
 # If a official release has a serious bug              #
diff -Nru samba-4.5.4+dfsg/WHATSNEW.txt samba-4.5.5+dfsg/WHATSNEW.txt
--- samba-4.5.4+dfsg/WHATSNEW.txt	2017-01-17 20:55:44.000000000 +0100
+++ samba-4.5.5+dfsg/WHATSNEW.txt	2017-01-30 10:56:26.000000000 +0100
@@ -1,4 +1,55 @@
                    =============================
+                   Release Notes for Samba 4.5.5
+                          January 30, 2017
+                   =============================
+
+
+This is the latest stable release of the Samba 4.5 release series.
+
+Samba 4.5.4 erroneously included a rewrite of the vfs_fruit module.
+This patchset will be reverted with this release, because it needs to pass the
+review process first. If you are using the vfs_fruit module, please do not use
+Samba 4.5.4.
+
+Changes since 4.5.4:
+--------------------
+
+o  Amitay Isaacs <amitay at gmail.com>
+   * BUG 12469: ctdb-locking: Explicitly unlock record/db in lock helper.
+
+o  Bj?rn Jacke <bj at sernet.de>
+   * BUG 12535: vfs_default: Unlock the right file in copy chunk.
+
+o  Martin Schwenke <martin at meltin.net>
+   * BUG 12512: ctdb-scripts: Fix remaining uses of "ctdb gratiousarp".
+   * BUG 12516: /etc/iproute2/rt_tables gets populated with multiple
+     'default' entries.
+
+
+#######################################
+Reporting bugs & Development Discussion
+#######################################
+
+Please discuss this release on the samba-technical mailing list or by
+joining the #samba-technical IRC channel on irc.freenode.net.
+
+If you do report problems then please try to send high quality
+feedback. If you don't provide vital information to help us track down
+the problem then you will probably be ignored.  All bug reports should
+be filed under the Samba 4.1 and newer product in the project's Bugzilla
+database (https://bugzilla.samba.org/).
+
+
+======================================================================
+== Our Code, Our Bugs, Our Responsibility.
+== The Samba Team
+======================================================================
+
+
+Release notes for older releases follow:
+----------------------------------------
+
+                   =============================
                    Release Notes for Samba 4.5.4
                           January 18, 2017
                    =============================
@@ -68,8 +119,8 @@
 ======================================================================
 
 
-Release notes for older releases follow:
-----------------------------------------
+----------------------------------------------------------------------
+
 
                    =============================
                    Release Notes for Samba 4.5.3


More information about the Pkg-samba-maint mailing list