[SCM] Samba Shared Repository - branch v4-2-stable updated

Karolin Seeger kseeger at samba.org
Tue Sep 8 10:41:10 UTC 2015


The branch, v4-2-stable has been updated
       via  413fb83 VERSION: Disable git snapshots for the 4.2.4 release.
       via  a10eacd WHATSNEW: Add release notes for Samba 4.2.4.
       via  e806635 s4:torture:vfs_fruit: created empty resourceforks
       via  1f796a5 s4:torture:vfs_fruit: add a resource fork truncation test
       via  33bc5d2 vfs_fruit: delete ._ file when deleting the basefile
       via  aeda612 vfs_fruit: split and simplify fruit_ftruncate
       via  09653dc vfs_fruit: handling of empty resource fork
       via  9bc968a samr4: Use <SID=%s> in GetGroupsForUser
       via  08bbbbc s3-util: Compare the maximum allowed length of a NetBIOS name
       via  f2a2ac4 s3-auth: Fix a memory leak in make_server_info_info3()
       via  175e73d s3-auth: Pass nt_username to check_account()
       via  281bd2f s3-auth: Fix 'map to guest = Bad Uid' support
       via  7e43c43 s3: winbindd: Fix TALLOC_FREE of uninitialized groups variable.
       via  b688f57 s4:rpc_server/netlogon: fix bugs in dcesrv_netr_DsRGetDCNameEx2()
       via  75e2768 ctdb-daemon: Correctly process the exit code from failed eventscripts
       via  bbaef4d ctdb-daemon: Improve error handling for running event scripts
       via  0d36fba ctdb-tool: Correctly print timed out event scripts output
       via  1f7e86d s3:lib: fix some corner cases of open_socket_out_cleanup()
       via  7ad714e lib: Fix rundown of open_socket_out()
       via  e9d22f1 s4:torture:vfs_fruit: add a test for stream names
       via  d6ed2f9 s4:torture:vfs_fruit: pass xattr name as arg to torture_setup_local_xattr()
       via  7ed25fc vfs_catia: run translation on stream names
       via  b827f28 vfs_streams_xattr: stream names may contain colons
       via  34fc0cd s4:torture:vfs_fruit: copyfile
       via  9f7ca62 vfs:fruit: implement copyfile style copy_chunk
       via  bb56c5f smb2:ioctl: support for OS X AAPL copyfile style copy_chunk
       via  9923741 s3:util: add internal function for transfer_file that uses pread/pwrite
       via  baf5328 ctdb-build: Fix building of PCP PMDA module
       via  a156ca8 ctdb-daemon: Check if updates are in flight when releasing all IPs
       via  864ca13 ctdb-banning: If node is already banned, do not run ctdb_local_node_got_banned()
       via  dc65591 s3-net: use talloc array in share allowedusers
       via  65f09ac s4:rpc_server/netlogon: Fix for NetApp
       via  98ac8fc s3-passdb: Respect LOOKUP_NAME_GROUP flag in sid lookup.
       via  f90c55b lib: replace: Add strsep function (missing on Solaris).
       via  20fba40 s3-auth: Fix a possible null pointer dereference
       via  d00db84 s3-smbd: Leave sys_disk_free() if dfree command is used
       via  30fd8d1 ctdb-tests: Add some 10.interfaces VLAN tests
       via  1168579 ctdb-tests: Add VLAN support to the "ip link" stub
       via  215f15b ctdb-tests: Interface number in "ip link show" stub defaults to 42
       via  27f1550 ctdb-scripts: Support monitoring of interestingly named VLANs on bonds
       via  fede929 ctdb-scripts: Fix regression in VLAN interface support
       via  44fddac auth/credentials: if credentials have principal set, they are not anonymous anymore
       via  c0fb5fc ctdb-daemon: Return correct sequence number for CONTROL_GET_DB_SEQNUM
       via  ebde3fe s3-smbd: reset protocol in smbXsrv_connection_init_tables failure paths.
       via  a759cd6 s3:libsmb: Fix a bug in conversion of ea list to ea array.
       via  f33d7fa smbd:trans2: treat new SMB_SIGNING_DESIRED in case
       via  8be6d09 docs:smb.conf: explain effect of new setting 'desired' of smb encrypt
       via  9817f8c smbd:smb2: use encryption_desired in send_break
       via  90ee73b smbd:smb2: only enable encryption in tcon if desired
       via  8e06f18 smbd:smb2: only enable encryption in session if desired
       via  6cb67e5 smbd:smb2: separate between encryption required and enc desired
       via  6429747 smbXsrv: add bools encryption_desired to session and tcon
       via  872668a Introduce setting "desired" for 'smb encrypt' and 'client/server signing'
       via  b1cd2fe smbd: Make SMB3 clients use encryption with "smb encrypt = auto"
       via  274513b VERSION: Bump version up to 4.2.4...
      from  baf4349 VERSION: Disable git snapshots for the 4.2.3 release.

https://git.samba.org/?p=samba.git;a=shortlog;h=v4-2-stable


- Log -----------------------------------------------------------------
-----------------------------------------------------------------------

Summary of changes:
 VERSION                                            |   2 +-
 WHATSNEW.txt                                       | 116 ++-
 auth/credentials/credentials.c                     |   5 +
 ctdb/config/events.d/10.interface                  |  28 +-
 ctdb/config/functions                              |   3 +-
 ctdb/server/ctdb_banning.c                         |   7 +-
 ctdb/server/ctdb_event_helper.c                    |  44 +-
 ctdb/server/ctdb_persistent.c                      |   5 +-
 ctdb/server/ctdb_takeover.c                        |  18 +-
 ctdb/server/eventscript.c                          |  10 +-
 .../tests/eventscripts/10.interface.monitor.017.sh |  20 +
 .../tests/eventscripts/10.interface.monitor.018.sh |  20 +
 ctdb/tests/eventscripts/stubs/ip                   |  50 +-
 ctdb/tools/ctdb.c                                  |   8 +
 ctdb/wscript                                       |   2 +-
 docs-xml/manpages/vfs_fruit.8.xml                  |  12 +
 docs-xml/smbdotconf/security/smbencrypt.xml        |  66 +-
 lib/param/loadparm.c                               |   1 +
 lib/param/param_table.c                            |   1 +
 lib/replace/replace.c                              |  20 +
 lib/replace/replace.h                              |   5 +
 lib/replace/wscript                                |   4 +-
 libcli/smb/smbXcli_base.c                          |   6 +
 libcli/smb/smb_constants.h                         |   1 +
 selftest/target/Samba3.pm                          |   6 +-
 selftest/target/Samba4.pm                          |   6 +-
 source3/auth/auth_ntlmssp.c                        |   4 +-
 source3/auth/auth_util.c                           |  48 +-
 source3/include/transfer_file.h                    |   6 +
 source3/include/vfs.h                              |   1 +
 source3/lib/util.c                                 |   2 +-
 source3/lib/util_sock.c                            |  48 +-
 source3/lib/util_transfer_file.c                   |  83 +-
 source3/librpc/idl/smbXsrv.idl                     |   2 +
 source3/libsmb/cli_smb2_fnum.c                     |   2 +-
 source3/modules/vfs_catia.c                        |  58 +-
 source3/modules/vfs_fruit.c                        | 402 ++++++++--
 source3/modules/vfs_streams_xattr.c                |  16 +-
 source3/passdb/lookup_sid.c                        |   4 +-
 source3/passdb/lookup_sid.h                        |   2 +-
 source3/smbd/dfree.c                               |  29 +-
 source3/smbd/globals.h                             |   3 +
 source3/smbd/process.c                             |   7 +-
 source3/smbd/smb2_ioctl_network_fs.c               |  39 +-
 source3/smbd/smb2_server.c                         |  22 +-
 source3/smbd/smb2_sesssetup.c                      |   8 +-
 source3/smbd/smb2_tcon.c                           |  10 +-
 source3/smbd/trans2.c                              |   1 +
 source3/smbd/vfs.c                                 |  18 +-
 source3/utils/net_rpc.c                            |  24 +-
 source3/winbindd/winbindd_dual_srv.c               |   2 +-
 source4/rpc_server/netlogon/dcerpc_netlogon.c      |  44 +-
 source4/rpc_server/samr/dcesrv_samr.c              |  10 +-
 source4/smb_server/smb2/negprot.c                  |   1 +
 source4/torture/vfs/fruit.c                        | 840 ++++++++++++++++++++-
 55 files changed, 2004 insertions(+), 198 deletions(-)
 create mode 100755 ctdb/tests/eventscripts/10.interface.monitor.017.sh
 create mode 100755 ctdb/tests/eventscripts/10.interface.monitor.018.sh


Changeset truncated at 500 lines:

diff --git a/VERSION b/VERSION
index 5485ba5..381f62e 100644
--- a/VERSION
+++ b/VERSION
@@ -25,7 +25,7 @@
 ########################################################
 SAMBA_VERSION_MAJOR=4
 SAMBA_VERSION_MINOR=2
-SAMBA_VERSION_RELEASE=3
+SAMBA_VERSION_RELEASE=4
 
 ########################################################
 # If a official release has a serious bug              #
diff --git a/WHATSNEW.txt b/WHATSNEW.txt
index c56935c..4d01c77 100644
--- a/WHATSNEW.txt
+++ b/WHATSNEW.txt
@@ -1,4 +1,116 @@
                    =============================
+                   Release Notes for Samba 4.2.4
+                         September 8, 2015
+                   =============================
+
+
+This is the latest stable release of Samba 4.2.
+
+
+Changes since 4.2.3:
+--------------------
+
+o   Michael Adam <obnox at samba.org>
+    * BUG 11372: smbd: Fix SMB3 functionality of "smb encrypt".
+
+
+o   Jeremy Allison <jra at samba.org>
+    * BUG 11359: lib: replace: Add strsep function (missing on Solaris).
+
+
+o   Ralph Boehme <slow at samba.org>
+    * BUG 11278: Fix stream names with colon with "fruit:encoding = native".
+    * BUG 11317: vfs:fruit: Implement copyfile style copy_chunk.
+    * BUG 11426: s3-net: Use talloc array in share allowedusers.
+    * BUG 11467: vfs_fruit: Handling of empty resource fork.
+
+
+o   Alexander Bokovoy <ab at samba.org>
+    * BUG 11265: auth/credentials: If credentials have principal set, they are
+      not anonymous anymore.
+
+
+o   Günther Deschner <gd at samba.org>
+    * BUG 11373: s3-smbd: Reset protocol in smbXsrv_connection_init_tables
+      failure paths.
+
+
+o   Amitay Isaacs <amitay at gmail.com>
+    * BUG 11398: ctdb-daemon: Return correct sequence number for
+      CONTROL_GET_DB_SEQNUM.
+    * BUG 11431: ctdb-daemon: Improve error handling for running event scripts.
+
+
+o   Volker Lendecke <vl at samba.org>
+    * BUG 11316: lib: Fix rundown of open_socket_out().
+    * BUG 11488: Avoid quoting problems in user's DNs.
+
+
+o   Justin Maggard <jmaggard at netgear.com>
+    * BUG 11320: s3-passdb: Respect LOOKUP_NAME_GROUP flag in sid lookup.
+
+
+o   Roel van Meer <roel at 1afa.com>
+    * BUG 11427: s3-util: Compare the maximum allowed length of a NetBIOS name.
+
+
+o   Stefan Metzmacher <metze at samba.org>
+    * BUG 11316: s3:lib: Fix some corner cases of open_socket_out_cleanup().
+    * BUG 11454: Backport dcesrv_netr_DsRGetDCNameEx2 fixes.
+
+
+o   Anubhav Rakshit <anubhav.rakshit at gmail.com>
+    * BUG 11361: s3:libsmb: Fix a bug in conversion of ea list to ea array.
+
+
+o   Arvid Requate <requate at univention.de>
+    * BUG 11291: s4:rpc_server/netlogon: Fix for NetApp.
+
+
+o   Andreas Schneider <asn at samba.org>
+    * BUG 9862: s3-auth: Fix "map to guest = Bad uid".
+    * BUG 11403: s3-smbd: Leave sys_disk_free() if dfree command is used.
+    * BUG 11404: s3-auth: Fix a possible null pointer dereference.
+
+
+o   Martin Schwenke <martin at meltin.net>
+    * BUG 11399: ctdb-scripts: Support monitoring of interestingly named VLANs
+      on bonds.
+    * BUG 11432: ctdb-daemon: Check if updates are in flight when releasing all
+      IPs.
+    * BUG 11435: ctdb-build: Fix building of PCP PMDA module.
+
+
+o   Wei Zhong <wweyeww at gmail.com>
+    * BUG 10823: s3: winbindd: Fix TALLOC_FREE of uninitialized groups variable.
+
+
+#######################################
+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.2 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.2.3
                            July 14, 2015
                    =============================
@@ -149,10 +261,8 @@ database (https://bugzilla.samba.org/).
 ======================================================================
 
 
-Release notes for older releases follow:
-----------------------------------------
+----------------------------------------------------------------------
 
-======================================================================
 
                    =============================
                    Release Notes for Samba 4.2.2
diff --git a/auth/credentials/credentials.c b/auth/credentials/credentials.c
index 78b5955..e988d2d 100644
--- a/auth/credentials/credentials.c
+++ b/auth/credentials/credentials.c
@@ -921,6 +921,11 @@ _PUBLIC_ bool cli_credentials_is_anonymous(struct cli_credentials *cred)
 						    cred->machine_account_pending_lp_ctx);
 	}
 
+	/* if principal is set, it's not anonymous */
+	if ((cred->principal != NULL) && cred->principal_obtained >= cred->username_obtained) {
+		return false;
+	}
+
 	username = cli_credentials_get_username(cred);
 	
 	/* Yes, it is deliberate that we die if we have a NULL pointer
diff --git a/ctdb/config/events.d/10.interface b/ctdb/config/events.d/10.interface
index 51d1b97..bcd5cf9 100755
--- a/ctdb/config/events.d/10.interface
+++ b/ctdb/config/events.d/10.interface
@@ -52,6 +52,30 @@ get_all_interfaces ()
     all_interfaces=$(echo $all_interfaces $ctdb_ifaces | tr ' ' '\n' | sort -u)
 }
 
+get_real_iface ()
+{
+    # Output of "ip link show <iface>"
+    _iface_info="$1"
+
+    # Extract the full interface description to see if it is a VLAN
+    _t=$(echo "$_iface_info" |
+		awk 'NR == 1 { iface = $2; sub(":$", "", iface) ; \
+			       print iface }')
+    case "$_t" in
+	*@*)
+	    # VLAN: use the underlying interface, after the '@'
+	    echo "${_t##*@}"
+	    ;;
+	*)
+	    # Not a regular VLAN.  For backward compatibility, assume
+	    # there is some other sort of VLAN that doesn't have the
+	    # '@' in the output and only use what is before a '.'.  If
+	    # there is no '.' then this will be the whole interface
+	    # name.
+	    echo "${_t%%.*}"
+    esac
+}
+
 monitor_interfaces()
 {
 	get_all_interfaces
@@ -65,7 +89,7 @@ monitor_interfaces()
 	# problem with an interface then set fail=true and continue.
 	for iface in $all_interfaces ; do
 
-	    ip link show $iface 2>/dev/null >/dev/null || {
+	    _iface_info=$(ip link show $iface 2>&1) || {
 		echo "ERROR: Interface $iface does not exist but it is used by public addresses."
 		mark_down $iface
 		continue
@@ -74,7 +98,7 @@ monitor_interfaces()
 	    # These interfaces are sometimes bond devices
 	    # When we use VLANs for bond interfaces, there will only
 	    # be an entry in /proc for the underlying real interface
-	    realiface=`echo $iface |sed -e 's/\..*$//'`
+	    realiface=$(get_real_iface "$_iface_info")
 	    bi=$(get_proc "net/bonding/$realiface" 2>/dev/null) && {
 		echo "$bi" | grep -q 'Currently Active Slave: None' && {
 			echo "ERROR: No active slaves for bond device $realiface"
diff --git a/ctdb/config/functions b/ctdb/config/functions
index e0270a3..6b38844 100755
--- a/ctdb/config/functions
+++ b/ctdb/config/functions
@@ -895,7 +895,8 @@ ip_maskbits_iface ()
 
     ip addr show to "${_addr}/${_bits}" 2>/dev/null | \
 	awk -v family="${_family}" \
-	    'NR == 1 { iface = $2; sub(":$", "", iface) } \
+	    'NR == 1 { iface = $2; sub(":$", "", iface) ; \
+		       sub("@.*", "", iface) } \
              $1 ~ /inet/ { mask = $2; sub(".*/", "", mask); \
                            print mask, iface, family }'
 }
diff --git a/ctdb/server/ctdb_banning.c b/ctdb/server/ctdb_banning.c
index a9d1891..d8f7ab1 100644
--- a/ctdb/server/ctdb_banning.c
+++ b/ctdb/server/ctdb_banning.c
@@ -80,6 +80,7 @@ void ctdb_local_node_got_banned(struct ctdb_context *ctdb)
 int32_t ctdb_control_set_ban_state(struct ctdb_context *ctdb, TDB_DATA indata)
 {
 	struct ctdb_ban_time *bantime = (struct ctdb_ban_time *)indata.dptr;
+	bool already_banned;
 
 	DEBUG(DEBUG_INFO,("SET BAN STATE\n"));
 
@@ -107,9 +108,11 @@ int32_t ctdb_control_set_ban_state(struct ctdb_context *ctdb, TDB_DATA indata)
 		return 0;
 	}
 
+	already_banned = false;
 	if (ctdb->banning_ctx != NULL) {
 		talloc_free(ctdb->banning_ctx);
 		ctdb->banning_ctx = NULL;
+		already_banned = true;
 	}
 
 	if (bantime->time == 0) {
@@ -136,7 +139,9 @@ int32_t ctdb_control_set_ban_state(struct ctdb_context *ctdb, TDB_DATA indata)
 
 	event_add_timed(ctdb->ev, ctdb->banning_ctx, timeval_current_ofs(bantime->time,0), ctdb_ban_node_event, ctdb);
 
-	ctdb_local_node_got_banned(ctdb);
+	if (!already_banned) {
+		ctdb_local_node_got_banned(ctdb);
+	}
 	return 0;
 }
 
diff --git a/ctdb/server/ctdb_event_helper.c b/ctdb/server/ctdb_event_helper.c
index 9ff763c..a1b5318 100644
--- a/ctdb/server/ctdb_event_helper.c
+++ b/ctdb/server/ctdb_event_helper.c
@@ -67,7 +67,7 @@ int main(int argc, char *argv[])
 {
 	int log_fd, write_fd;
 	pid_t pid;
-	int status, output;
+	int status, output, ret;
 
 	progname = argv[0];
 
@@ -99,33 +99,51 @@ int main(int argc, char *argv[])
 
 	pid = fork();
 	if (pid < 0) {
+		int save_errno = errno;
 		fprintf(stderr, "Failed to fork - %s\n", strerror(errno));
-		exit(errno);
+		sys_write(write_fd, &save_errno, sizeof(save_errno));
+		exit(1);
 	}
 
 	if (pid == 0) {
-		int save_errno;
-
-		execv(argv[3], &argv[3]);
-		if (errno == EACCES) {
-			save_errno = check_executable(argv[3]);
-		} else {
-			save_errno = errno;
+		ret = check_executable(argv[3]);
+		if (ret != 0) {
+			_exit(ret);
+		}
+		ret = execv(argv[3], &argv[3]);
+		if (ret != 0) {
+			int save_errno = errno;
 			fprintf(stderr, "Error executing '%s' - %s\n",
-				argv[3], strerror(errno));
+				argv[3], strerror(save_errno));
 		}
-		_exit(save_errno);
+		/* This should never happen */
+		_exit(ENOEXEC);
 	}
 
-	waitpid(pid, &status, 0);
+	ret = waitpid(pid, &status, 0);
+	if (ret == -1) {
+		output = -errno;
+		fprintf(stderr, "waitpid() failed - %s\n", strerror(errno));
+		sys_write(write_fd, &output, sizeof(output));
+		exit(1);
+	}
 	if (WIFEXITED(status)) {
 		output = WEXITSTATUS(status);
+		/* Only errors should be returned as -ve values */
 		if (output == ENOENT || output == ENOEXEC) {
 			output = -output;
 		}
 		sys_write(write_fd, &output, sizeof(output));
-		exit(output);
+		exit(0);
+	}
+	if (WIFSIGNALED(status)) {
+		output = -EINTR;
+		fprintf(stderr, "Process terminated with signal - %d\n",
+			WTERMSIG(status));
+		sys_write(write_fd, &output, sizeof(output));
+		exit(0);
 	}
 
+	fprintf(stderr, "waitpid() status=%d\n", status);
 	exit(1);
 }
diff --git a/ctdb/server/ctdb_persistent.c b/ctdb/server/ctdb_persistent.c
index e28622f..5c54b9e 100644
--- a/ctdb/server/ctdb_persistent.c
+++ b/ctdb/server/ctdb_persistent.c
@@ -369,14 +369,11 @@ int32_t ctdb_control_get_db_seqnum(struct ctdb_context *ctdb,
 	}
 
 	outdata->dsize = sizeof(uint64_t);
-	outdata->dptr = (uint8_t *)talloc_zero(outdata, uint64_t);
+	outdata->dptr = talloc_memdup(outdata, &seqnum, sizeof(uint64_t));
 	if (outdata->dptr == NULL) {
 		ret = -1;
-		goto done;
 	}
 
-	*(outdata->dptr) = seqnum;
-
 done:
 	return ret;
 }
diff --git a/ctdb/server/ctdb_takeover.c b/ctdb/server/ctdb_takeover.c
index f8369da..4b9ab38 100644
--- a/ctdb/server/ctdb_takeover.c
+++ b/ctdb/server/ctdb_takeover.c
@@ -3242,9 +3242,6 @@ void ctdb_takeover_client_destructor_hook(struct ctdb_client *client)
 }
 
 
-/*
-  release all IPs on shutdown
- */
 void ctdb_release_all_ips(struct ctdb_context *ctdb)
 {
 	struct ctdb_vnn *vnn;
@@ -3259,6 +3256,20 @@ void ctdb_release_all_ips(struct ctdb_context *ctdb)
 			continue;
 		}
 
+		/* Don't allow multiple releases at once.  Some code,
+		 * particularly ctdb_tickle_sentenced_connections() is
+		 * not re-entrant */
+		if (vnn->update_in_flight) {
+			DEBUG(DEBUG_WARNING,
+			      (__location__
+			       " Not releasing IP %s/%u on interface %s, an update is already in progess\n",
+				    ctdb_addr_to_str(&vnn->public_address),
+				    vnn->public_netmask_bits,
+				    ctdb_vnn_iface_string(vnn)));
+			continue;
+		}
+		vnn->update_in_flight = true;
+
 		DEBUG(DEBUG_INFO,("Release of IP %s/%u on interface %s node:-1\n",
 				    ctdb_addr_to_str(&vnn->public_address),
 				    vnn->public_netmask_bits,
@@ -3270,6 +3281,7 @@ void ctdb_release_all_ips(struct ctdb_context *ctdb)
 				  vnn->public_netmask_bits);
 		release_kill_clients(ctdb, &vnn->public_address);
 		ctdb_vnn_unassign_iface(ctdb, vnn);
+		vnn->update_in_flight = false;
 		count++;
 	}
 
diff --git a/ctdb/server/eventscript.c b/ctdb/server/eventscript.c
index e3131b3..1f16580 100644
--- a/ctdb/server/eventscript.c
+++ b/ctdb/server/eventscript.c
@@ -379,6 +379,8 @@ static void ctdb_event_script_handler(struct event_context *ev, struct fd_event
 	r = sys_read(state->fd[0], &current->status, sizeof(current->status));
 	if (r < 0) {
 		current->status = -errno;
+	} else if (r == 0) {
+		current->status = -EINTR;
 	} else if (r != sizeof(current->status)) {
 		current->status = -EIO;
 	}
@@ -396,8 +398,12 @@ static void ctdb_event_script_handler(struct event_context *ev, struct fd_event
 
 	/* Aborted or finished all scripts?  We're done. */
 	if (status != 0 || state->current+1 == state->scripts->num_scripts) {
-		DEBUG(DEBUG_INFO,(__location__ " Eventscript %s %s finished with state %d\n",
-				  ctdb_eventscript_call_names[state->call], state->options, status));
+		if (status != 0) {
+			DEBUG(DEBUG_INFO,
+			      ("Eventscript %s %s finished with state %d\n",
+			       ctdb_eventscript_call_names[state->call],
+			       state->options, status));
+		}
 
 		ctdb->event_script_timeouts = 0;
 		talloc_free(state);
diff --git a/ctdb/tests/eventscripts/10.interface.monitor.017.sh b/ctdb/tests/eventscripts/10.interface.monitor.017.sh
new file mode 100755
index 0000000..6e30040
--- /dev/null
+++ b/ctdb/tests/eventscripts/10.interface.monitor.017.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+. "${TEST_SCRIPTS_DIR}/unit.sh"
+
+define_test "1 VLAN, link down"
+
+setup_ctdb
+
+iface=$(ctdb_get_1_interface)
+
+ethtool_interfaces_down "$iface"
+
+# This just exercises the VLAN checking code, which will allow us to
+# determine that real0 is not a bond.
+realiface="real0"
+ip link add link "$realiface" name "$iface" type vlan id 11
+ip link set "${iface}@${realiface}" up
+
+required_result 1 "ERROR: No link on the public network interface ${iface}"
+simple_test
diff --git a/ctdb/tests/eventscripts/10.interface.monitor.018.sh b/ctdb/tests/eventscripts/10.interface.monitor.018.sh
new file mode 100755
index 0000000..aac23b8
--- /dev/null
+++ b/ctdb/tests/eventscripts/10.interface.monitor.018.sh
@@ -0,0 +1,20 @@
+#!/bin/sh
+
+. "${TEST_SCRIPTS_DIR}/unit.sh"
+
+define_test "VLAN on bond, active slaves, link down"
+
+setup_ctdb
+
+iface=$(ctdb_get_1_interface)
+
+bond="bond0"
+
+setup_bond "$bond" "" "down"
+
+ip link add link "$bond" name "$iface" type vlan id 11
+ip link set "${iface}@${bond}" up
+
+required_result 1 "ERROR: public network interface ${bond} is down"
+
+simple_test
diff --git a/ctdb/tests/eventscripts/stubs/ip b/ctdb/tests/eventscripts/stubs/ip
index e8f17d8..2021758 100755
--- a/ctdb/tests/eventscripts/stubs/ip
+++ b/ctdb/tests/eventscripts/stubs/ip
@@ -23,15 +23,58 @@ ip_link ()
 	    esac
 	    ;;
 	show) shift ; ip_link_show "$@" ;;
+	add*) shift ; ip_link_add "$@" ;;
 	del*) shift ; ip_link_delete "$@" ;;
 	*) not_implemented "$*" ;;
     esac
 }
 
+ip_link_add ()
+{


-- 
Samba Shared Repository



More information about the samba-cvs mailing list