[SCM] Samba Shared Repository - branch v4-3-test updated

Karolin Seeger kseeger at samba.org
Wed Oct 28 13:02:05 UTC 2015


The branch, v4-3-test has been updated
       via  5cbbd24 selftest: Avoid system krb5.conf in "none" test env
       via  beece43 selftest: Avoid system krb5.conf in some test envs that don't use kerberos
       via  40c617b selftest: Avoid system krb5.conf in testenv provisioning
       via  3fb7397 auth: gensec: Parameters out_mem_ctx and ev are passed in the wrong order to gensec_spnego_server_try_fallback().
       via  374a288 async_req: fix non-blocking connect()
       via  536733f selftest: add a test for async_connect_send()
       via  5f1fb61 s3-torture: Remove (incorrect) samba3-specific behavior in samba3.raw.unlink now the server is correct
       via  4110956 s3-torture: Add WILDDELETE test to smbtorture3 to test old wildcard delete with zero attribute
       via  5945fee s3-smbd: Fix old DOS client doing wildcard delete - gives a attribute type of zero
       via  3abfde0 smbd: Send SMB2 oplock breaks unencrypted
       via  2d39d04 s4:lib/messaging: use correct path for names.tdb
      from  05e381f dcerpc.idl: accept invalid dcerpc_bind_nak pdus

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


- Log -----------------------------------------------------------------
commit 5cbbd242fb4f9dc32e55fe85ed276d7574a4f71e
Author: Uri Simchoni <uri at samba.org>
Date:   Mon Oct 26 07:38:08 2015 +0200

    selftest: Avoid system krb5.conf in "none" test env
    
    Some torture tests do not perform Kerberos activity and do not
    run against a server (hence the "none" test env), but do create
    a krb5 context, and that causes the Kerberos libs to read
    krb5.conf and choke if they don't understand it.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11576
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    
    (cherry picked from commit f9d6be3b749313a03e9097d848ce078f19197a0a)
    
    Autobuild-User(v4-3-test): Karolin Seeger <kseeger at samba.org>
    Autobuild-Date(v4-3-test): Wed Oct 28 14:01:49 CET 2015 on sn-devel-104

commit beece43ea4aafbf8f805527dc9050eab9c6cc120
Author: Uri Simchoni <uri at samba.org>
Date:   Sun Oct 25 15:02:17 2015 +0200

    selftest: Avoid system krb5.conf in some test envs that don't use kerberos
    
    Some test envs don't use kerberos (e.g. nt4_dc). However, the client
    tools are built with Kerberos support and may get upset if hitting
    a krb5.conf file they don't understand.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11576
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    
    (cherry picked from commit 8d3106b1a4d9da5bf8b127fa70a77076d3dfeca8)

commit 40c617b9f43162d0fe8cab77130391bf5cdfa5d2
Author: Uri Simchoni <uri at samba.org>
Date:   Sat Oct 24 00:41:23 2015 +0300

    selftest: Avoid system krb5.conf in testenv provisioning
    
    Some provisioning commands don't necessarily need a krb5.conf,
    but they still must cause samba's Kerberos libraries to avoid
    looking at the system krb5.conf, as this file may not be understood
    by samba's Kerberos libs and fail the env provisioning.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11576
    
    Signed-off-by: Uri Simchoni <uri at samba.org>
    Reviewed-by: Andrew Bartlett <abartlet at samba.org>
    
    (cherry picked from commit 63c891938a2d3e1c222898d6dea5c640822b0191)

commit 3fb73973023a95d7080c5f1d45b61fc154c72e05
Author: Jeremy Allison <jra at samba.org>
Date:   Wed Oct 21 11:13:46 2015 -0700

    auth: gensec: Parameters out_mem_ctx and ev are passed in the wrong order to gensec_spnego_server_try_fallback().
    
    Fix suggested by <lev at zadarastorage.com>. Fixes a memory leak.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11565
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Volker Lendecke <vl at samba.org>
    
    Autobuild-User(master): Volker Lendecke <vl at samba.org>
    Autobuild-Date(master): Thu Oct 22 11:27:19 CEST 2015 on sn-devel-104
    
    (cherry picked from commit d4059e1a53ea8940b1b147d797efa1b39a5cabd1)

commit 374a28802248e71491deddcafe2085932d06cb33
Author: Ralph Boehme <slow at samba.org>
Date:   Sun Oct 18 22:21:10 2015 +0200

    async_req: fix non-blocking connect()
    
    According to Stevens UNIX Network Programming and various other sources,
    the correct handling for non-blocking connect() is:
    
    - when the initial connect() return -1/EINPROGRESS polling the socket
      for *writeability*
    
    - in the poll handler call getsocktopt() with SO_ERROR to get the
      finished connect() return value
    
    Simply calling connect() a second time without error checking is
    probably wrong and not portable. For a successfull connect() Linux
    returns 0, but Solaris will return EISCONN:
    
    24254:   0.0336  0.0002 connect(4, 0xFEFFECAC, 16, SOV_DEFAULT) Err#150 EINPROGRESS
    24254:          AF_INET  name = 10.10.10.143  port = 1024
    24254:   0.0349  0.0001 port_associate(3, 4, 0x00000004, 0x0000001D,0x080648A8) = 0
    24254:   0.0495  0.0146 port_getn(3, 0xFEFFEB50, 1, 1, 0xFEFFEB60) = 1 [0]
    24254:   0.0497  0.0002 connect(4, 0x080646E4, 16, SOV_DEFAULT) Err#133 EISCONN
    24254:          AF_INET  name = 10.10.10.143  port = 1024
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11564
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit 05d4dbda8357712cb81008e0d611fdb0e7239587)

commit 536733fb9dc342926e84f3b435ab58d6ce5bb42d
Author: Ralph Boehme <slow at samba.org>
Date:   Sun Oct 18 22:23:20 2015 +0200

    selftest: add a test for async_connect_send()
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11564
    
    Also includes:
    
    selftest: Fix memset parameters in test for async_connect_send()
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Jeremy Allison <jra at samba.org>
    (cherry picked from commit aa96c75346a9bad60471a206d65c7b7049b9ca83)
    (cherry picked from commit 7cf45539da9cba25130457941814da12d0a828c3)

commit 5f1fb6178a8e181376ef15a6080830fe29df687d
Author: Jeremy Allison <jra at samba.org>
Date:   Tue Oct 20 12:31:03 2015 -0700

    s3-torture: Remove (incorrect) samba3-specific behavior in samba3.raw.unlink now the server is correct
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11452
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    (cherry picked from commit e4054f211872168ac4cf022e2d961e8979610920)

commit 4110956c2764e89c663d7ed4f2e9e61b59af86d8
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Oct 19 16:06:01 2015 -0700

    s3-torture: Add WILDDELETE test to smbtorture3 to test old wildcard delete with zero attribute
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11452
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    (cherry picked from commit 618d3dd5990e7477d45220cf7183c5cdaa548f1a)

commit 5945fee90e881c808ece3ad9fec3c2b13d48be1a
Author: Jeremy Allison <jra at samba.org>
Date:   Mon Oct 19 16:04:02 2015 -0700

    s3-smbd: Fix old DOS client doing wildcard delete - gives a attribute type of zero
    
    In the wildcard delete path we forgot to map 0 -> FILE_ATTRIBUTE_NORMAL
    as we do in the non-wildcard delete path.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11452
    
    Signed-off-by: Jeremy Allison <jra at samba.org>
    Reviewed-by: Andreas Schneider <asn at samba.org>
    (cherry picked from commit 1d51119f8acaa586e9ec09d14f10b43ed0053df5)

commit 3abfde02f840e67dc6b416bdb3ae60ecd0b65000
Author: Volker Lendecke <vl at samba.org>
Date:   Tue Oct 6 16:10:43 2015 +0200

    smbd: Send SMB2 oplock breaks unencrypted
    
    This is not what Windows server does, but it seems that Windows
    clients expect.  Windows->Windows never runs into this issue, because
    an encryption-enabled SMB3 connection will always use leases, and lease
    breaks *are* unencrypted...
    
    You can reproduce the issue Windows->Windows by disabling leases on the
    Windows server. Disable leases using the registry key:
    
    HKLM\SYSTEM\CurrentControlSet\Services\LanmanServer\DisableLeasing
    
    Dochelp confirmed that this is a valid workaround for Windows clients
    dropping encrypted oplock breaks.
    
    BUG: https://bugzilla.samba.org/show_bug.cgi?id=11570
    
    Signed-off-by: Volker Lendecke <vl at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    
    Autobuild-User(master): Jeremy Allison <jra at samba.org>
    Autobuild-Date(master): Sat Oct 24 05:01:32 CEST 2015 on sn-devel-104
    
    (cherry picked from commit 0a924d13cf4bb570cce3955cf0de9d8678b37dbe)

commit 2d39d049a902b4c7eb7cfef7224a5493c92f2e90
Author: Ralph Boehme <slow at samba.org>
Date:   Wed Oct 14 12:40:03 2015 +0200

    s4:lib/messaging: use correct path for names.tdb
    
    source3 messaging_init() calls server_id_db_init() (where names.tdb is
    created) with lock_path. source4 imessaging_init() otoh wrongly used the
    special lock_path subdirectory "msg.lock":
    
    > find /opt/samba/ -name names.tdb
    /opt/samba/var/lock/msg.lock/names.tdb
    /opt/samba/var/lock/names.tdb
    
    > tdbdump /opt/samba/var/lock/names.tdb
    {
    key(14) = "notify-daemon\00"
    data(27) = "28609/12756565486113779780\00"
    }
    
    > tdbdump /opt/samba/var/lock/msg.lock/names.tdb
    {
    key(15) = "winbind_server\00"
    data(8) = "28593/0\00"
    }
    
    With this patch both source3 and source4 messaging now use the same
    names.tdb which is what we want:
    
    > find /opt/samba/ -name names.tdb
    /opt/samba/var/lock/names.tdb
    
    > tdbdump /opt/samba/var/lock/names.tdb
    {
    key(15) = "winbind_server\00"
    data(8) = "26434/0\00"
    }
    {
    key(14) = "notify-daemon\00"
    data(26) = "26452/3454520012124001687\00"
    }
    
    Bug: https://bugzilla.samba.org/show_bug.cgi?id=11562
    
    Signed-off-by: Ralph Boehme <slow at samba.org>
    Reviewed-by: Stefan Metzmacher <metze at samba.org>
    (cherry picked from commit 79ec9cbff9b8b84ac80c6d2a8220b37561415271)

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

Summary of changes:
 auth/gensec/spnego.c                    |   2 +-
 lib/async_req/async_connect_send_test.c | 130 ++++++++++++++++++++++++++++++++
 lib/async_req/async_sock.c              |  56 +++++++-------
 lib/async_req/wscript_build             |   4 +
 selftest/selftest.pl                    |   5 +-
 selftest/target/Samba3.pm               |  14 ++++
 selftest/target/Samba4.pm               |  34 +++++++--
 source3/script/tests/test_async_req.sh  |  11 +++
 source3/selftest/tests.py               |   5 +-
 source3/smbd/reply.c                    |   3 +
 source3/smbd/smb2_server.c              |   2 +-
 source3/torture/torture.c               |  67 ++++++++++++++++
 source4/lib/messaging/messaging.c       |   8 +-
 source4/torture/raw/unlink.c            |   7 +-
 14 files changed, 300 insertions(+), 48 deletions(-)
 create mode 100644 lib/async_req/async_connect_send_test.c
 create mode 100755 source3/script/tests/test_async_req.sh


Changeset truncated at 500 lines:

diff --git a/auth/gensec/spnego.c b/auth/gensec/spnego.c
index 85c70e1..fe2ec43 100644
--- a/auth/gensec/spnego.c
+++ b/auth/gensec/spnego.c
@@ -738,7 +738,7 @@ static NTSTATUS gensec_spnego_update(struct gensec_security *gensec_security, TA
 			len = spnego_read_data(gensec_security, in, &spnego);
 			if (len == -1) {
 				return gensec_spnego_server_try_fallback(gensec_security, spnego_state,
-									 out_mem_ctx, ev, in, out);
+									 ev, out_mem_ctx, in, out);
 			}
 			/* client sent NegTargetInit, we send NegTokenTarg */
 
diff --git a/lib/async_req/async_connect_send_test.c b/lib/async_req/async_connect_send_test.c
new file mode 100644
index 0000000..34ea6b7
--- /dev/null
+++ b/lib/async_req/async_connect_send_test.c
@@ -0,0 +1,130 @@
+/*
+ * Test async connect
+ * Copyright (C) Ralph Boehme 2015
+ *
+ * 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 "replace.h"
+#include "lib/tevent/tevent.h"
+#include "lib/async_req/async_sock.h"
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/wait.h>
+
+int main(int argc, const char *argv[])
+{
+	int result, listen_sock, status, exit_status;
+	uint16_t port;
+	struct sockaddr_in addr = { 0 };
+	pid_t pid;
+
+	listen_sock = socket(PF_INET, SOCK_STREAM, 0);
+	if (listen_sock == -1) {
+		perror("socket() failed");
+		exit(1);
+	}
+
+	addr.sin_family = AF_INET;
+	addr.sin_addr.s_addr = inet_addr("127.0.0.1");
+
+	for (port = 1024; port < UINT16_MAX; port++) {
+		addr.sin_port = htons(port);
+		result = bind(listen_sock, (struct sockaddr *)&addr, sizeof(addr));
+		if (result == 0) {
+			break;
+		}
+	}
+
+	if (port == UINT16_MAX) {
+		printf("Huh, no free port?\n");
+		return 1;
+	}
+
+	result = listen(listen_sock, 1);
+	if (result == -1) {
+		perror("listen() failed");
+		close(listen_sock);
+		return 1;
+	}
+
+	pid = fork();
+	if (pid == -1) {
+		perror("fork");
+		return 1;
+	}
+
+	if (pid == 0) {
+		struct tevent_context *ev;
+		struct tevent_req *req;
+		int fd;
+
+		ev = tevent_context_init(NULL);
+		if (ev == NULL) {
+			fprintf(stderr, "tevent_context_init failed\n");
+			return 1;
+		}
+
+		fd = socket(PF_INET, SOCK_STREAM, 0);
+		if (fd == -1) {
+			perror("socket");
+			return 1;
+		}
+
+		memset(&addr, 0, sizeof(addr));
+		addr.sin_family = AF_INET;
+		addr.sin_port = htons(port);
+		addr.sin_addr.s_addr = inet_addr("127.0.0.1");
+
+		req = async_connect_send(ev, ev, fd,
+					 (struct sockaddr *)&addr,
+					 sizeof(struct sockaddr_in),
+					 NULL, NULL, NULL);
+
+		if (!tevent_req_poll(req, ev)) {
+			perror("tevent_req_poll() failed");
+			return 1;
+		}
+
+		status = 0;
+		result = async_connect_recv(req, &status);
+		if (result != 0) {
+			return status;
+		}
+		return 0;
+	}
+
+	result = waitpid(pid, &status, 0);
+	if (result == -1) {
+		perror("waitpid");
+		return 1;
+	}
+
+	if (!WIFEXITED(status)) {
+		printf("child status: %d\n", status);
+		return 2;
+	}
+
+	exit_status = WEXITSTATUS(status);
+	printf("test done: status=%d\n", exit_status);
+
+	if (exit_status != 0) {
+		return exit_status;
+	}
+
+	return 0;
+}
diff --git a/lib/async_req/async_sock.c b/lib/async_req/async_sock.c
index bc3780c..c0ad8f3 100644
--- a/lib/async_req/async_sock.c
+++ b/lib/async_req/async_sock.c
@@ -127,24 +127,17 @@ struct tevent_req *async_connect_send(
 		return tevent_req_post(req, ev);
 	}
 
-	/**
-	 * A number of error messages show that something good is progressing
-	 * and that we have to wait for readability.
-	 *
-	 * If none of them are present, bail out.
+	/*
+	 * The only errno indicating that the connect is still in
+	 * flight is EINPROGRESS, everything else is an error
 	 */
 
-	if (!(errno == EINPROGRESS || errno == EALREADY ||
-#ifdef EISCONN
-	      errno == EISCONN ||
-#endif
-	      errno == EAGAIN || errno == EINTR)) {
+	if (errno != EINPROGRESS) {
 		tevent_req_error(req, errno);
 		return tevent_req_post(req, ev);
 	}
 
-	state->fde = tevent_add_fd(ev, state, fd,
-				   TEVENT_FD_READ | TEVENT_FD_WRITE,
+	state->fde = tevent_add_fd(ev, state, fd, TEVENT_FD_WRITE,
 				   async_connect_connected, req);
 	if (state->fde == NULL) {
 		tevent_req_error(req, ENOMEM);
@@ -189,27 +182,32 @@ static void async_connect_connected(struct tevent_context *ev,
 	struct async_connect_state *state =
 		tevent_req_data(req, struct async_connect_state);
 	int ret;
-
-	if (state->before_connect != NULL) {
-		state->before_connect(state->private_data);
-	}
-
-	ret = connect(state->fd, (struct sockaddr *)(void *)&state->address,
-		      state->address_len);
-
-	if (state->after_connect != NULL) {
-		state->after_connect(state->private_data);
-	}
-
-	if (ret == 0) {
-		tevent_req_done(req);
+	int socket_error = 0;
+	socklen_t slen = sizeof(socket_error);
+
+	ret = getsockopt(state->fd, SOL_SOCKET, SO_ERROR,
+			 &socket_error, &slen);
+
+	if (ret != 0) {
+		/*
+		 * According to Stevens this is the Solaris behaviour
+		 * in case the connection encountered an error:
+		 * getsockopt() fails, error is in errno
+		 */
+		tevent_req_error(req, errno);
 		return;
 	}
-	if (errno == EINPROGRESS) {
-		/* Try again later, leave the fde around */
+
+	if (socket_error != 0) {
+		/*
+		 * Berkeley derived implementations (including) Linux
+		 * return the pending error via socket_error.
+		 */
+		tevent_req_error(req, socket_error);
 		return;
 	}
-	tevent_req_error(req, errno);
+
+	tevent_req_done(req);
 	return;
 }
 
diff --git a/lib/async_req/wscript_build b/lib/async_req/wscript_build
index e8af569..9c25223 100644
--- a/lib/async_req/wscript_build
+++ b/lib/async_req/wscript_build
@@ -7,3 +7,7 @@ bld.SAMBA_SUBSYSTEM('LIBASYNC_REQ',
 	deps='tevent-util socket-blocking'
 	)
 
+bld.SAMBA_BINARY('async_connect_send_test',
+                 source='async_connect_send_test.c',
+                 deps='LIBASYNC_REQ'
+)
diff --git a/selftest/selftest.pl b/selftest/selftest.pl
index 779847f..db5da05 100755
--- a/selftest/selftest.pl
+++ b/selftest/selftest.pl
@@ -831,9 +831,7 @@ sub setup_env($$)
 
 	$option = "client" if $option eq "";
 
-	if ($envname eq "none") {
-		$testenv_vars = {};
-	} elsif (defined(get_running_env($envname))) {
+	if (defined(get_running_env($envname))) {
 		$testenv_vars = get_running_env($envname);
 		if (not $testenv_vars->{target}->check_env($testenv_vars)) {
 			print $testenv_vars->{target}->getlog_env($testenv_vars);
@@ -901,7 +899,6 @@ sub getlog_env($)
 sub check_env($)
 {
 	my ($envname) = @_;
-	return 1 if ($envname eq "none");
 	my $env = get_running_env($envname);
 	return $env->{target}->check_env($env);
 }
diff --git a/selftest/target/Samba3.pm b/selftest/target/Samba3.pm
index 32f8f3d..774d7a0 100755
--- a/selftest/target/Samba3.pm
+++ b/selftest/target/Samba3.pm
@@ -172,6 +172,13 @@ sub setup_env($$$)
 	        return $self->{vars}->{$envname};
 	}
 
+	#
+	# Avoid hitting system krb5.conf -
+	# An env that needs Kerberos will reset this to the real
+	# value.
+	#
+	$ENV{KRB5_CONFIG} = "$path/no_krb5.conf";
+
 	if ($envname eq "nt4_dc") {
 		return $self->setup_nt4_dc("$path/nt4_dc");
 	} elsif ($envname eq "nt4_dc_schannel") {
@@ -1610,6 +1617,13 @@ domadmins:X:$gid_domadmins:
 	$ret{LOCAL_PATH} = "$shrdir";
         $ret{LOGDIR} = $logdir;
 
+	#
+	# Avoid hitting system krb5.conf -
+	# An env that needs Kerberos will reset this to the real
+	# value.
+	#
+	$ret{KRB5_CONFIG} = abs_path($prefix) . "/no_krb5.conf";
+
 	return \%ret;
 }
 
diff --git a/selftest/target/Samba4.pm b/selftest/target/Samba4.pm
index 16d4b28..65308e2 100755
--- a/selftest/target/Samba4.pm
+++ b/selftest/target/Samba4.pm
@@ -646,6 +646,7 @@ sub provision_raw_prepare($$$$$$$$$$$)
 	$ctx->{smb_conf_extra_options} = "";
 
 	my @provision_options = ();
+	push (@provision_options, "KRB5_CONFIG=\"$ctx->{krb5_config}\"");
 	push (@provision_options, "NSS_WRAPPER_PASSWD=\"$ctx->{nsswrap_passwd}\"");
 	push (@provision_options, "NSS_WRAPPER_GROUP=\"$ctx->{nsswrap_group}\"");
 	push (@provision_options, "NSS_WRAPPER_HOSTS=\"$ctx->{nsswrap_hosts}\"");
@@ -896,14 +897,18 @@ sub provision_raw_step2($$$)
 	}
 
 	my $testallowed_account = "testallowed";
-	my $samba_tool_cmd = Samba::bindir_path($self, "samba-tool") 
+	my $samba_tool_cmd = "";
+	$samba_tool_cmd .= "KRB5_CONFIG=\"$ret->{KRB5_CONFIG}\" ";
+	$samba_tool_cmd .= Samba::bindir_path($self, "samba-tool")
 	    . " user add --configfile=$ctx->{smb_conf} $testallowed_account $ctx->{password}";
 	unless (system($samba_tool_cmd) == 0) {
 		warn("Unable to add testallowed user: \n$samba_tool_cmd\n");
 		return undef;
 	}
 
-	my $ldbmodify = Samba::bindir_path($self, "ldbmodify");
+	my $ldbmodify = "";
+	$ldbmodify .= "KRB5_CONFIG=\"$ret->{KRB5_CONFIG}\" ";
+	$ldbmodify .= Samba::bindir_path($self, "ldbmodify");
 	my $base_dn = "DC=".join(",DC=", split(/\./, $ctx->{realm}));
 
 	if ($ctx->{server_role} ne "domain controller") {
@@ -932,7 +937,9 @@ servicePrincipalName: host/testallowed
 ";
 	close(LDIF);
 
-	$samba_tool_cmd = Samba::bindir_path($self, "samba-tool") 
+	$samba_tool_cmd = "";
+	$samba_tool_cmd .= "KRB5_CONFIG=\"$ret->{KRB5_CONFIG}\" ";
+	$samba_tool_cmd .= Samba::bindir_path($self, "samba-tool")
 	    . " user add --configfile=$ctx->{smb_conf} testdenied $ctx->{password}";
 	unless (system($samba_tool_cmd) == 0) {
 		warn("Unable to add testdenied user: \n$samba_tool_cmd\n");
@@ -949,7 +956,9 @@ userPrincipalName: testdenied_upn\@$ctx->{realm}.upn
 ";
 	close(LDIF);
 
-	$samba_tool_cmd = Samba::bindir_path($self, "samba-tool") 
+	$samba_tool_cmd = "";
+	$samba_tool_cmd .= "KRB5_CONFIG=\"$ret->{KRB5_CONFIG}\" ";
+	$samba_tool_cmd .= Samba::bindir_path($self, "samba-tool")
 	    . " group addmembers --configfile=$ctx->{smb_conf} 'Allowed RODC Password Replication Group' '$testallowed_account'";
 	unless (system($samba_tool_cmd) == 0) {
 		warn("Unable to add '$testallowed_account' user to 'Allowed RODC Password Replication Group': \n$samba_tool_cmd\n");
@@ -1990,8 +1999,11 @@ sub getlog_env($$)
 sub check_env($$)
 {
 	my ($self, $envvars) = @_;
+	my $samba_pid = $envvars->{SAMBA_PID};
 
-	my $childpid = Samba::cleanup_child($envvars->{SAMBA_PID}, "samba");
+	return 1 if $samba_pid == -1;
+
+	my $childpid = Samba::cleanup_child($samba_pid, "samba");
 
 	return ($childpid == 0);
 }
@@ -2068,6 +2080,8 @@ sub setup_env($$$)
 		}
 		return $target3->setup_admember_rfc2307("$path/ad_member_rfc2307",
 							$self->{vars}->{ad_dc_ntvfs}, 34);
+	} elsif ($envname eq "none") {
+		return $self->setup_none("$path/none");
 	} else {
 		return "UNKNOWN";
 	}
@@ -2470,4 +2484,14 @@ sub setup_ad_dc($$)
 	return $env;
 }
 
+sub setup_none($$)
+{
+	my ($self, $path) = @_;
+
+	my $ret = {
+		KRB5_CONFIG => abs_path($path) . "/no_krb5.conf",
+		SAMBA_PID => -1,
+	}
+}
+
 1;
diff --git a/source3/script/tests/test_async_req.sh b/source3/script/tests/test_async_req.sh
new file mode 100755
index 0000000..a92f990
--- /dev/null
+++ b/source3/script/tests/test_async_req.sh
@@ -0,0 +1,11 @@
+#!/bin/sh
+
+incdir=`dirname $0`/../../../testprogs/blackbox
+. $incdir/subunit.sh
+
+failed=0
+
+testit "async_connect_send" $VALGRIND $BINDIR/async_connect_send_test ||
+	failed=`expr $failed + 1`
+
+testok $0 $failed
diff --git a/source3/selftest/tests.py b/source3/selftest/tests.py
index be3cf0e..630927b 100755
--- a/source3/selftest/tests.py
+++ b/source3/selftest/tests.py
@@ -48,7 +48,7 @@ tests = ["FDPASS", "LOCK1", "LOCK2", "LOCK3", "LOCK4", "LOCK5", "LOCK6", "LOCK7"
         "UNLINK", "BROWSE", "ATTR", "TRANS2", "TORTURE",
         "OPLOCK1", "OPLOCK2", "OPLOCK4", "STREAMERROR",
         "DIR", "DIR1", "DIR-CREATETIME", "TCON", "TCONDEV", "RW1", "RW2", "RW3", "LARGE_READX", "RW-SIGNING",
-        "OPEN", "XCOPY", "RENAME", "DELETE", "DELETE-LN", "PROPERTIES", "W2K",
+        "OPEN", "XCOPY", "RENAME", "DELETE", "DELETE-LN", "WILDDELETE", "PROPERTIES", "W2K",
         "TCON2", "IOCTL", "CHKPATH", "FDSESS", "CHAIN1", "CHAIN2",
         "CHAIN3",
         "GETADDRINFO", "UID-REGRESSION-TEST", "SHORTNAME-TEST",
@@ -248,6 +248,9 @@ plantestsuite(
     "samba3.pthreadpool", "nt4_dc",
     [os.path.join(samba3srcdir, "script/tests/test_pthreadpool.sh")])
 
+plantestsuite("samba3.async_req", "nt4_dc",
+              [os.path.join(samba3srcdir, "script/tests/test_async_req.sh")])
+
 #smbtorture4 tests
 
 base = ["base.attr", "base.charset", "base.chkpath", "base.defer_open", "base.delaywrite", "base.delete",
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index b1b91e1..20c793f 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -2915,6 +2915,9 @@ NTSTATUS unlink_internals(connection_struct *conn, struct smb_request *req,
 			status = NT_STATUS_OBJECT_NAME_INVALID;
 			goto out;
 		}
+		if (dirtype == 0) {
+			dirtype = FILE_ATTRIBUTE_NORMAL;
+		}
 
 		if (strequal(fname_mask,"????????.???")) {
 			TALLOC_FREE(fname_mask);
diff --git a/source3/smbd/smb2_server.c b/source3/smbd/smb2_server.c
index 2ea997e..40f3f2d 100644
--- a/source3/smbd/smb2_server.c
+++ b/source3/smbd/smb2_server.c
@@ -2976,7 +2976,7 @@ NTSTATUS smbd_smb2_send_oplock_break(struct smbXsrv_connection *xconn,
 	SBVAL(body, 0x08, op->global->open_persistent_id);
 	SBVAL(body, 0x10, op->global->open_volatile_id);
 
-	return smbd_smb2_send_break(xconn, session, tcon, body, sizeof(body));
+	return smbd_smb2_send_break(xconn, NULL, NULL, body, sizeof(body));
 }
 
 NTSTATUS smbd_smb2_send_lease_break(struct smbXsrv_connection *xconn,
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index bfd04f4..7bb776f 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -4410,6 +4410,72 @@ static bool run_deletetest(int dummy)
 	return correct;
 }
 
+
+/*
+  Test wildcard delete.
+ */
+static bool run_wild_deletetest(int dummy)
+{
+	struct cli_state *cli = NULL;
+	const char *dname = "\\WTEST";
+	const char *fname = "\\WTEST\\A";
+	const char *wunlink_name = "\\WTEST\\*";
+	uint16_t fnum1 = (uint16_t)-1;
+	bool correct = false;
+	NTSTATUS status;
+
+	printf("starting wildcard delete test\n");
+
+	if (!torture_open_connection(&cli, 0)) {
+		return false;
+	}
+
+	smbXcli_conn_set_sockopt(cli->conn, sockops);
+
+	cli_unlink(cli, fname, 0);
+	cli_rmdir(cli, dname);
+	status = cli_mkdir(cli, dname);
+	if (!NT_STATUS_IS_OK(status)) {
+		printf("mkdir of %s failed %s!\n", dname, nt_errstr(status));
+		goto fail;
+	}
+	status = cli_openx(cli, fname, O_CREAT|O_RDONLY, DENY_NONE, &fnum1);
+	if (!NT_STATUS_IS_OK(status)) {
+		printf("open of %s failed %s!\n", fname, nt_errstr(status));
+		goto fail;


-- 
Samba Shared Repository



More information about the samba-cvs mailing list