[SCM] Samba Shared Repository - branch master updated

Michael Adam obnox at samba.org
Mon Nov 9 09:59:04 UTC 2015


The branch, master has been updated
       via  be670ef ctdb-scripts: Add support for CTDB_DBDIR in tmpfs
       via  f05c6d3 ctdb-scripts: Improve CTDB wrapper shutdown code
       via  3a7c73f ctdb-tests: Fix "setreclock" test
       via  1ed577e ctdb-tests: Fix the name of the "setreclock" test
       via  af26da1 vfs_acl_*: Only sha256 needed
       via  dee23e9 vfs_cap: Fix a warning
       via  9b2a4b1 lib: messages.h references struct iovec
       via  c66592b lib: Move some procid functions out of util.c
       via  f0bfd61 lib: Increase a debuglevel
       via  c526f5f vfs_fruit: Fix a typo
      from  c315fce Fix various spelling errors

https://git.samba.org/?p=samba.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit be670ef0103878d8d939de5972b567c4db404082
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Oct 23 14:04:04 2015 +1100

    ctdb-scripts: Add support for CTDB_DBDIR in tmpfs
    
    The tmpfs is mounted and unmounted by ctdbd_wrapper.  Format is
    CTDB_DBDIR=tmpfs:<tmpfs-options>.  The only default for the tmpfs is
    mode=700 - to override, specify a different value in <tmpfs-options>.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Michael Adam <obnox at samba.org>
    
    Autobuild-User(master): Michael Adam <obnox at samba.org>
    Autobuild-Date(master): Mon Nov  9 10:58:32 CET 2015 on sn-devel-104

commit f05c6d32cce334d29e373f1e74f0b52cab14409d
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Oct 23 14:04:04 2015 +1100

    ctdb-scripts: Improve CTDB wrapper shutdown code
    
    This will make it easier to run things after CTDB is stopped.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit 3a7c73ff7ba8d66b5e0430c188e8ba0657252cea
Author: Martin Schwenke <martin at meltin.net>
Date:   Fri Oct 30 13:06:24 2015 +1100

    ctdb-tests: Fix "setreclock" test
    
    1. Waiting for generation to change isn't enough.  It now changes
       early in recovery and reclock might not have been set on all nodes.
       So wait until recovery is complete before checking reclock.
    
    2. Use onnode -p when setting reclock on all nodes.  That will cause
       it to be set quickly on all nodes, to avoid the situation where the
       recovery master is the late in the list and resets the reclock on
       earlier nodes back to the old value.  This shouldn't matter if (1)
       is done but it can't hurt.
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit 1ed577efa0e99ee55d78a261ffb9c6497701173f
Author: Martin Schwenke <martin at meltin.net>
Date:   Mon Nov 9 11:35:03 2015 +1100

    ctdb-tests: Fix the name of the "setreclock" test
    
    It currently claims to test "setrecmaster".
    
    Signed-off-by: Martin Schwenke <martin at meltin.net>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit af26da1e479c05090023e7066a1dfb0806e14ea4
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Nov 8 11:34:40 2015 +0100

    vfs_acl_*: Only sha256 needed
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit dee23e94722e9b5243619711ae10d38820c4fd66
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Nov 8 10:43:59 2015 +0100

    vfs_cap: Fix a warning
    
    clang warns about increased alignment cast. talloc_size does align properly.
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit 9b2a4b1fb1d4291cc0b1e9a9f8078eb15f4b8d68
Author: Volker Lendecke <vl at samba.org>
Date:   Mon Nov 2 12:46:35 2015 +0100

    lib: messages.h references struct iovec
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit c66592bcf75e205fcf8c3c09897f5db4f71824d6
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Nov 6 16:59:44 2015 +0100

    lib: Move some procid functions out of util.c
    
    Including proto.h just for pid_to_procid() is a pain...
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit f0bfd61556f9fce1e7543e96e1c14b730226ee4c
Author: Volker Lendecke <vl at samba.org>
Date:   Fri Nov 6 15:39:45 2015 +0100

    lib: Increase a debuglevel
    
    We do this every time when a process exits. If that process has
    properly cleaned up after itself, we spit out this message.
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

commit c526f5f28cac1aeda4cbe4ac2d70c0f2e9a65a4d
Author: Volker Lendecke <vl at samba.org>
Date:   Sun Nov 8 10:16:04 2015 +0100

    vfs_fruit: Fix a typo
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Michael Adam <obnox at samba.org>

-----------------------------------------------------------------------

Summary of changes:
 ctdb/config/ctdbd_wrapper                          | 86 +++++++++++++++++++---
 ctdb/doc/ctdbd.conf.5.xml                          | 11 +++
 .../{35_set_recmaster.sh => 35_set_reclock.sh}     | 19 +++--
 source3/include/messages.h                         |  1 +
 source3/include/proto.h                            |  9 +--
 source3/lib/util.c                                 | 43 -----------
 source3/lib/util_procid.c                          | 69 +++++++++++++++++
 .../sys_rw_data.h => source3/lib/util_procid.h     | 27 ++++---
 source3/modules/vfs_acl_tdb.c                      |  2 +-
 source3/modules/vfs_acl_xattr.c                    |  2 +-
 source3/modules/vfs_cap.c                          |  7 +-
 source3/modules/vfs_fruit.c                        |  2 +-
 source3/wscript_build                              |  1 +
 13 files changed, 196 insertions(+), 83 deletions(-)
 rename ctdb/tests/simple/{35_set_recmaster.sh => 35_set_reclock.sh} (87%)
 create mode 100644 source3/lib/util_procid.c
 copy lib/util/sys_rw_data.h => source3/lib/util_procid.h (57%)


Changeset truncated at 500 lines:

diff --git a/ctdb/config/ctdbd_wrapper b/ctdb/config/ctdbd_wrapper
index c98c190..71c7b25 100755
--- a/ctdb/config/ctdbd_wrapper
+++ b/ctdb/config/ctdbd_wrapper
@@ -25,6 +25,7 @@ loadconfig "ctdb"
 [ -n "$CTDB_SOCKET" ] && export CTDB_SOCKET
 
 ctdbd="${CTDBD:-/usr/local/sbin/ctdbd}"
+ctdb_rundir="/usr/local/var/run/ctdb"
 
 ############################################################
 
@@ -79,6 +80,63 @@ ctdbd_is_running ()
 
 ############################################################
 
+# Mount given database directories on tmpfs
+dbdir_tmpfs_start ()
+{
+    for _var ; do
+	# $_var is the name of the configuration varable, so get the
+	# value
+	eval _val="\$${_var}"
+
+	case "$_val" in
+	    tmpfs|tmpfs:*)
+		_opts_defaults="mode=700"
+		# Get any extra options specified after colon
+		if [ "$_val" = "tmpfs" ] ; then
+		    _opts=""
+		else
+		    _opts="${_val#tmpfs:}"
+		fi
+		# It is OK to repeat options - last value wins
+		_opts_all="${_opts_defaults}${_opts:+,}${_opts}"
+
+		# Last component of mountpoint is variable name
+		_mnt="${ctdb_rundir}/${_var}"
+		mkdir -p "$_mnt" || exit $?
+
+		# If already mounted then remount, otherwise mount
+		if findmnt -t tmpfs "$_mnt" >/dev/null ; then
+		    mount -t tmpfs -o "remount,$_opts_all" none "$_mnt" || \
+			exit $?
+		else
+		    mount -t tmpfs -o "$_opts_all" none "$_mnt" || exit $?
+		fi
+
+		# Replace specified value with mountpoint, to be
+		# passed to ctdbd
+		eval "${_var}=${_mnt}"
+		;;
+	esac
+    done
+}
+
+# Unmount database tmpfs directories on exit
+dbdir_tmpfs_stop ()
+{
+    for _var ; do
+	eval _val="\$${_var}"
+
+	case "$_val" in
+	    tmpfs|tmpfs:*)
+		_mnt="${ctdb_rundir}/${_var}"
+		if [ -d "$_mnt" ] && findmnt -t tmpfs "$_mnt" >/dev/null ; then
+		    umount "$_mnt"
+		fi
+		;;
+	esac
+    done
+}
+
 build_ctdb_options ()
 {
     ctdb_options=""
@@ -165,6 +223,8 @@ start()
     # there may still be other processes around, so do some cleanup.
     kill_ctdbd "$_session"
 
+    dbdir_tmpfs_start CTDB_DBDIR
+
     build_ctdb_options
 
     export_debug_variables
@@ -249,25 +309,33 @@ stop()
     # Wait for remaining CTDB processes to exit...
     _timeout=${CTDB_SHUTDOWN_TIMEOUT:-30}
     _count=0
+    _terminated=false
     while [ $_count -lt $_timeout ] ; do
-	pkill -0 -s "$_session" 2>/dev/null || return 0
+	if ! pkill -0 -s "$_session" 2>/dev/null ; then
+	    _terminated=true
+	    break
+	fi
 
 	_count=$(($_count + 1))
 	sleep 1
     done
 
-    echo "Timed out waiting for CTDB to shutdown.  Killing CTDB processes."
-    kill_ctdbd "$_session"
-    drop_all_public_ips >/dev/null 2>&1
+    if ! $_terminated ; then
+	echo "Timed out waiting for CTDB to shutdown.  Killing CTDB processes."
+	kill_ctdbd "$_session"
+	drop_all_public_ips >/dev/null 2>&1
 
-    sleep 1
+	sleep 1
 
-    if pkill -0 -s "$_session" ; then
-	# If SIGKILL didn't work then things are bad...
-	echo "Failed to kill all CTDB processes.  Giving up."
-	return 1
+	if pkill -0 -s "$_session" ; then
+	    # If SIGKILL didn't work then things are bad...
+	    echo "Failed to kill all CTDB processes.  Giving up."
+	    return 1
+	fi
     fi
 
+    dbdir_tmpfs_stop CTDB_DBDIR
+
     return 0
 }
 
diff --git a/ctdb/doc/ctdbd.conf.5.xml b/ctdb/doc/ctdbd.conf.5.xml
index 15ee746..40296ba 100644
--- a/ctdb/doc/ctdbd.conf.5.xml
+++ b/ctdb/doc/ctdbd.conf.5.xml
@@ -159,6 +159,17 @@
 	    Defaults to <filename>/usr/local/var/lib/ctdb</filename>.
 	  </para>
 	  <para>
+	    Apart from a DIRECTORY, this can take a special value of
+	    the form
+	    <option>tmpfs</option><optional>:<parameter>OPTIONS</parameter></optional>.
+	    OPTIONS is a comma-separated list of any permissible
+	    options to the tmpfs filesystem.  The only pre-specified
+	    default is <option>mode=700</option>, which can
+	    overriden by specifying <option>mode</option> in
+	    OPTIONS.  It probably makes sense to specify a maximum
+	    <option>size</option>.
+	  </para>
+	  <para>
 	    Corresponds to <option>--dbdir</option>.
 	  </para>
 	</listitem>
diff --git a/ctdb/tests/simple/35_set_recmaster.sh b/ctdb/tests/simple/35_set_reclock.sh
similarity index 87%
rename from ctdb/tests/simple/35_set_recmaster.sh
rename to ctdb/tests/simple/35_set_reclock.sh
index fe78809..07e3185 100755
--- a/ctdb/tests/simple/35_set_recmaster.sh
+++ b/ctdb/tests/simple/35_set_reclock.sh
@@ -3,7 +3,7 @@
 test_info()
 {
     cat <<EOF
-Verify that "ctdb setrecmaster" sets the recovery lock correctly.
+Verify that "ctdb setreclock" sets the recovery lock correctly.
 
 This test only does something when there is a recovery lock
 configured.
@@ -42,6 +42,12 @@ wait_until_generation_has_changed ()
     wait_until 60 generation_has_changed
 }
 
+wait_until_recovered ()
+{
+    wait_until_generation_has_changed
+    wait_until_node_has_status all recovered
+}
+
 echo "Check that recovery lock is set the same on all nodes..."
 try_command_on_node -v -q all $CTDB getreclock
 n=$(echo "$out" | sort -u | wc -l)
@@ -68,7 +74,8 @@ echo "Remember original recovery lock file: \"${orig_reclock}\""
 
 echo
 echo "Unset and test the recovery lock on all nodes..."
-try_command_on_node -q all $CTDB setreclock
+try_command_on_node -pq all $CTDB setreclock
+wait_until_recovered
 try_command_on_node -v -q all $CTDB getreclock
 t=$(sort -u <<<"$out")
 if [ "$t" = "No reclock file used." ] ; then
@@ -85,7 +92,8 @@ echo "Current generation is ${generation}"
 alt="${orig_reclock}.test"
 echo
 echo "Set alternative recovery lock (${alt}) and test on all nodes..."
-try_command_on_node -q all $CTDB setreclock "$alt"
+try_command_on_node -pq all $CTDB setreclock "$alt"
+wait_until_recovered
 try_command_on_node -v -q all $CTDB getreclock
 t=$(echo "$out" | sed -e 's@^Reclock file:@@' | sort -u)
 if [ "$t" = "$alt" ] ; then
@@ -97,12 +105,12 @@ else
 fi
 
 # Setting or updating the recovery lock file must cause a recovery
-wait_until_generation_has_changed
 echo "Current generation is ${generation}"
 
 echo
 echo "Restore and test the recovery lock on all nodes..."
-try_command_on_node -q all $CTDB setreclock "$orig_reclock"
+try_command_on_node -pq all $CTDB setreclock "$orig_reclock"
+wait_until_recovered
 try_command_on_node -v all rm -vf "$alt"
 try_command_on_node -v -q all $CTDB getreclock
 t=$(echo "$out" | sed -e 's@^Reclock file:@@' | sort -u)
@@ -113,5 +121,4 @@ else
     exit 1
 fi
 
-wait_until_generation_has_changed
 echo "Current generation is ${generation}"
diff --git a/source3/include/messages.h b/source3/include/messages.h
index 35f5ea7..8bbe026 100644
--- a/source3/include/messages.h
+++ b/source3/include/messages.h
@@ -60,6 +60,7 @@
 
 #include "librpc/gen_ndr/server_id.h"
 #include "lib/util/data_blob.h"
+#include "system/network.h"
 
 #define MSG_BROADCAST_PID_STR	"0:0"
 
diff --git a/source3/include/proto.h b/source3/include/proto.h
index c2d9166..9dd08fb 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -433,14 +433,11 @@ bool unix_wild_match(const char *pattern, const char *string);
 bool name_to_fqdn(fstring fqdn, const char *name);
 void *talloc_append_blob(TALLOC_CTX *mem_ctx, void *buf, DATA_BLOB blob);
 uint32_t map_share_mode_to_deny_mode(uint32_t share_access, uint32_t private_options);
-pid_t procid_to_pid(const struct server_id *proc);
-void set_my_vnn(uint32_t vnn);
-uint32_t get_my_vnn(void);
-struct server_id pid_to_procid(pid_t pid);
+
+#include "lib/util_procid.h"
+
 #define serverid_equal(p1, p2) server_id_equal(p1,p2)
 struct server_id interpret_pid(const char *pid_string);
-bool procid_valid(const struct server_id *pid);
-bool procid_is_local(const struct server_id *pid);
 bool is_offset_safe(const char *buf_base, size_t buf_len, char *ptr, size_t off);
 char *get_safe_ptr(const char *buf_base, size_t buf_len, char *ptr, size_t off);
 char *get_safe_str_ptr(const char *buf_base, size_t buf_len, char *ptr, size_t off);
diff --git a/source3/lib/util.c b/source3/lib/util.c
index 3a8bc67..420fe91 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -1942,54 +1942,11 @@ uint32_t map_share_mode_to_deny_mode(uint32_t share_access, uint32_t private_opt
 	return (uint32_t)-1;
 }
 
-pid_t procid_to_pid(const struct server_id *proc)
-{
-	return proc->pid;
-}
-
-static uint32_t my_vnn = NONCLUSTER_VNN;
-
-void set_my_vnn(uint32_t vnn)
-{
-	DEBUG(10, ("vnn pid %d = %u\n", (int)getpid(), (unsigned int)vnn));
-	my_vnn = vnn;
-}
-
-uint32_t get_my_vnn(void)
-{
-	return my_vnn;
-}
-
-struct server_id pid_to_procid(pid_t pid)
-{
-	uint64_t unique = 0;
-	int ret;
-
-	ret = messaging_dgm_get_unique(pid, &unique);
-	if (ret != 0) {
-		DBG_WARNING("messaging_dgm_get_unique failed: %s\n",
-			    strerror(ret));
-	}
-
-	return (struct server_id) {
-		.pid = pid, .unique_id = unique, .vnn = my_vnn };
-}
-
 struct server_id interpret_pid(const char *pid_string)
 {
 	return server_id_from_string(get_my_vnn(), pid_string);
 }
 
-bool procid_valid(const struct server_id *pid)
-{
-	return (pid->pid != (uint64_t)-1);
-}
-
-bool procid_is_local(const struct server_id *pid)
-{
-	return pid->vnn == my_vnn;
-}
-
 /****************************************************************
  Check if an offset into a buffer is safe.
  If this returns True it's safe to indirect into the byte at
diff --git a/source3/lib/util_procid.c b/source3/lib/util_procid.c
new file mode 100644
index 0000000..0ae99cc
--- /dev/null
+++ b/source3/lib/util_procid.c
@@ -0,0 +1,69 @@
+/*
+ * Unix SMB/CIFS implementation.
+ * Samba utility functions
+ * Copyright (C) Andrew Tridgell 1992-1998
+ * Copyright (C) Jeremy Allison 2001-2007
+ * Copyright (C) Simo Sorce 2001
+ * Copyright (C) Jim McDonough <jmcd at us.ibm.com> 2003
+ * Copyright (C) James Peach 2006
+ *
+ * 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/>.
+ */
+
+#include "util_procid.h"
+#include "lib/util/debug.h"
+#include "lib/messages_dgm.h"
+
+pid_t procid_to_pid(const struct server_id *proc)
+{
+	return proc->pid;
+}
+
+static uint32_t my_vnn = NONCLUSTER_VNN;
+
+void set_my_vnn(uint32_t vnn)
+{
+	DEBUG(10, ("vnn pid %d = %u\n", (int)getpid(), (unsigned int)vnn));
+	my_vnn = vnn;
+}
+
+uint32_t get_my_vnn(void)
+{
+	return my_vnn;
+}
+
+struct server_id pid_to_procid(pid_t pid)
+{
+	uint64_t unique = 0;
+	int ret;
+
+	ret = messaging_dgm_get_unique(pid, &unique);
+	if (ret != 0) {
+		DBG_NOTICE("messaging_dgm_get_unique failed: %s\n",
+			   strerror(ret));
+	}
+
+	return (struct server_id) {
+		.pid = pid, .unique_id = unique, .vnn = my_vnn };
+}
+
+bool procid_valid(const struct server_id *pid)
+{
+	return (pid->pid != (uint64_t)-1);
+}
+
+bool procid_is_local(const struct server_id *pid)
+{
+	return pid->vnn == my_vnn;
+}
diff --git a/lib/util/sys_rw_data.h b/source3/lib/util_procid.h
similarity index 57%
copy from lib/util/sys_rw_data.h
copy to source3/lib/util_procid.h
index bda3795..9637363 100644
--- a/lib/util/sys_rw_data.h
+++ b/source3/lib/util_procid.h
@@ -1,10 +1,11 @@
 /*
  * Unix SMB/CIFS implementation.
- * Samba system utilities
+ * Samba utility functions
  * Copyright (C) Andrew Tridgell 1992-1998
- * Copyright (C) Jeremy Allison  1998-2005
- * Copyright (C) Timur Bakeyev        2005
- * Copyright (C) Bjoern Jacke    2006-2007
+ * Copyright (C) Jeremy Allison 2001-2007
+ * Copyright (C) Simo Sorce 2001
+ * Copyright (C) Jim McDonough <jmcd at us.ibm.com> 2003
+ * Copyright (C) James Peach 2006
  *
  * 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
@@ -20,15 +21,17 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-#ifndef __LIB_SYS_RW_DATA_H__
-#define __LIB_SYS_RW_DATA_H__
+#ifndef __LIB_UTIL_PROCID_H__
+#define __LIB_UTIL_PROCID_H__
 
-#include <unistd.h>
+#include "replace.h"
+#include "librpc/gen_ndr/server_id.h"
 
-struct iovec;
-
-ssize_t write_data_iov(int fd, const struct iovec *iov, int iovcnt);
-ssize_t write_data(int fd, const void *buffer, size_t n);
-ssize_t read_data(int fd, void *buffer, size_t n);
+pid_t procid_to_pid(const struct server_id *proc);
+void set_my_vnn(uint32_t vnn);
+uint32_t get_my_vnn(void);
+struct server_id pid_to_procid(pid_t pid);
+bool procid_valid(const struct server_id *pid);
+bool procid_is_local(const struct server_id *pid);
 
 #endif
diff --git a/source3/modules/vfs_acl_tdb.c b/source3/modules/vfs_acl_tdb.c
index c7acf43..62559a2 100644
--- a/source3/modules/vfs_acl_tdb.c
+++ b/source3/modules/vfs_acl_tdb.c
@@ -23,7 +23,7 @@
 #include "system/filesys.h"
 #include "librpc/gen_ndr/xattr.h"
 #include "librpc/gen_ndr/ndr_xattr.h"
-#include "../lib/crypto/crypto.h"
+#include "../lib/crypto/sha256.h"
 #include "dbwrap/dbwrap.h"
 #include "dbwrap/dbwrap_open.h"
 #include "auth.h"
diff --git a/source3/modules/vfs_acl_xattr.c b/source3/modules/vfs_acl_xattr.c
index 710fbf3..2338798 100644
--- a/source3/modules/vfs_acl_xattr.c
+++ b/source3/modules/vfs_acl_xattr.c
@@ -22,7 +22,7 @@
 #include "smbd/smbd.h"
 #include "librpc/gen_ndr/xattr.h"
 #include "librpc/gen_ndr/ndr_xattr.h"
-#include "../lib/crypto/crypto.h"
+#include "../lib/crypto/sha256.h"
 #include "auth.h"
 
 #undef DBGC_CLASS
diff --git a/source3/modules/vfs_cap.c b/source3/modules/vfs_cap.c
index b5a1906..ab17376 100644
--- a/source3/modules/vfs_cap.c
+++ b/source3/modules/vfs_cap.c
@@ -73,13 +73,12 @@ static struct dirent *cap_readdir(vfs_handle_struct *handle,
 	}
 	DEBUG(3,("cap: cap_readdir: %s\n", newname));
 	newnamelen = strlen(newname)+1;
-	newdirent = (struct dirent *)talloc_array(talloc_tos(),
-			char,
-			sizeof(struct dirent)+
-				newnamelen);
+	newdirent = talloc_size(
+		talloc_tos(), sizeof(struct dirent) + newnamelen);
 	if (!newdirent) {
 		return NULL;
 	}
+	talloc_set_name_const(newdirent, "struct dirent");
 	memcpy(newdirent, result, sizeof(struct dirent));
 	memcpy(&newdirent->d_name, newname, newnamelen);
 	return newdirent;
diff --git a/source3/modules/vfs_fruit.c b/source3/modules/vfs_fruit.c
index a09e288..bd71ff1 100644
--- a/source3/modules/vfs_fruit.c
+++ b/source3/modules/vfs_fruit.c
@@ -1839,7 +1839,7 @@ static NTSTATUS check_aapl(vfs_handle_struct *handle,
 	}
 
 	if (aapl->data.length != 24) {
-		DEBUG(1, ("unexpected AAPL ctxt legnth: %ju\n",
+		DEBUG(1, ("unexpected AAPL ctxt length: %ju\n",
 			  (uintmax_t)aapl->data.length));
 		return NT_STATUS_INVALID_PARAMETER;
 	}
diff --git a/source3/wscript_build b/source3/wscript_build
index 1f9f757..be749ef 100755
--- a/source3/wscript_build


-- 
Samba Shared Repository



More information about the samba-cvs mailing list