[SCM] Samba Shared Repository - branch master updated

Stefan Metzmacher metze at samba.org
Fri Aug 17 13:45:03 MDT 2012


The branch, master has been updated
       via  4f4bb1f s4:torture:basic: add more delete test - variants of deltest16 and deltest17
       via  c35bdb3 s3: add a debug message for failed execv in sys_popen()
       via  471a853 lib/util: add server_id_set_disconnected() and server_id_is_disconnected()
       via  3cdf441 lib/util: let server_id_str() skip the task_id if 0 in the cluster case too
       via  6457fb5 s3:lib: implement interpret_pid() as wrapper of server_id_from_string()
       via  d4a0aeb lib/util: add server_id_from_string()
       via  6a58c5f s3:lib: implement serverid_equal() as macro of server_id_equal()
       via  8149623 lib/util: add server_id_equal()
      from  f46c4df s3:vfs_tsmsm only send notifications when file was offline before

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


- Log -----------------------------------------------------------------
commit 4f4bb1f20d149e47ee1c6b5251b7376bb86ef530
Author: Michael Adam <obnox at samba.org>
Date:   Wed Aug 8 23:43:05 2012 +0200

    s4:torture:basic: add more delete test - variants of deltest16 and deltest17
    
    There seems to be a difference if the initial delete_on_close flag
    was set on a handle that created the file or if the handle if was
    for a file that already existed.
    
    Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>
    
    Autobuild-User(master): Stefan Metzmacher <metze at samba.org>
    Autobuild-Date(master): Fri Aug 17 21:44:24 CEST 2012 on sn-devel-104

commit c35bdb34da91504a6ed2abe5355aebcab8b73181
Author: Michael Adam <obnox at samba.org>
Date:   Wed Aug 1 15:42:49 2012 +0200

    s3: add a debug message for failed execv in sys_popen()
    
    Signed-off-by: Stefan Metzmacher <metze at samba.org>

commit 471a853e343e336adb14a219fba2d2ead9a1db62
Author: Michael Adam <obnox at samba.org>
Date:   Mon Aug 6 16:35:46 2012 +0200

    lib/util: add server_id_set_disconnected() and server_id_is_disconnected()
    
    Utility functions for handling the special placeholder server-id value
    for disconnected clients (to be used for durable handles).
    
    Pair-Programmed-With: Stefan Metzmacher <metze at samba.org>

commit 3cdf441da1ff0c969c89285cfd9fd0f968f1a4e9
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Aug 17 12:50:09 2012 +0200

    lib/util: let server_id_str() skip the task_id if 0 in the cluster case too
    
    server_id_from_string() already handles that case.
    
    metze

commit 6457fb5c39fd49fab2a804241de22e0e081093f4
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Aug 17 12:49:26 2012 +0200

    s3:lib: implement interpret_pid() as wrapper of server_id_from_string()
    
    metze

commit d4a0aeb49a3e7536b34d101cf7b70b48cfa5f4ba
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Aug 17 12:47:57 2012 +0200

    lib/util: add server_id_from_string()
    
    metze

commit 6a58c5fc648088c7c8930a0e653c2f1b01a90b13
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Aug 17 12:45:33 2012 +0200

    s3:lib: implement serverid_equal() as macro of server_id_equal()
    
    metze

commit 8149623ad4e07f03b92832972c6d36ada92cc810
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Aug 17 12:41:02 2012 +0200

    lib/util: add server_id_equal()
    
    metze

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

Summary of changes:
 lib/util/samba_util.h          |   15 +
 lib/util/server_id.c           |   99 +++++++-
 selftest/knownfail             |    8 +-
 source3/include/proto.h        |    2 +-
 source3/include/serverid.h     |    2 -
 source3/lib/serverid.c         |   21 --
 source3/lib/system.c           |    7 +-
 source3/lib/util.c             |   31 +--
 source4/torture/basic/delete.c |  622 ++++++++++++++++++++++++++++++++++++++++
 9 files changed, 750 insertions(+), 57 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/util/samba_util.h b/lib/util/samba_util.h
index 274dde8..4a6dd3b 100644
--- a/lib/util/samba_util.h
+++ b/lib/util/samba_util.h
@@ -899,6 +899,21 @@ char *data_path(TALLOC_CTX *mem_ctx, const char *name);
 const char *shlib_ext(void);
 
 struct server_id;
+bool server_id_equal(const struct server_id *p1, const struct server_id *p2);
 char *server_id_str(TALLOC_CTX *mem_ctx, const struct server_id *id);
+struct server_id server_id_from_string(uint32_t local_vnn,
+				       const char *pid_string);
+
+/**
+ * Set the serverid to the special value that represents a disconnected
+ * client for (e.g.) durable handles.
+ */
+void server_id_set_disconnected(struct server_id *id);
+
+/**
+ * check whether a serverid is the special placeholder for
+ * a disconnected client
+ */
+bool server_id_is_disconnected(const struct server_id *id);
 
 #endif /* _SAMBA_UTIL_H_ */
diff --git a/lib/util/server_id.c b/lib/util/server_id.c
index 195deea..a06891d 100644
--- a/lib/util/server_id.c
+++ b/lib/util/server_id.c
@@ -20,9 +20,32 @@
 #include "includes.h"
 #include "librpc/gen_ndr/server_id.h"
 
+bool server_id_equal(const struct server_id *p1, const struct server_id *p2)
+{
+	if (p1->pid != p2->pid) {
+		return false;
+	}
+
+	if (p1->task_id != p2->task_id) {
+		return false;
+	}
+
+	if (p1->vnn != p2->vnn) {
+		return false;
+	}
+
+	if (p1->unique_id != p2->unique_id) {
+		return false;
+	}
+
+	return true;
+}
+
 char *server_id_str(TALLOC_CTX *mem_ctx, const struct server_id *id)
 {
-	if (id->vnn == NONCLUSTER_VNN && id->task_id == 0) {
+	if (server_id_is_disconnected(id)) {
+		return talloc_strdup(mem_ctx, "disconnected");
+	} else if (id->vnn == NONCLUSTER_VNN && id->task_id == 0) {
 		return talloc_asprintf(mem_ctx,
 				       "%llu",
 				       (unsigned long long)id->pid);
@@ -31,6 +54,11 @@ char *server_id_str(TALLOC_CTX *mem_ctx, const struct server_id *id)
 				       "%llu.%u",
 				       (unsigned long long)id->pid,
 				       (unsigned)id->task_id);
+	} else if (id->task_id == 0) {
+		return talloc_asprintf(mem_ctx,
+				       "%u:%llu",
+				       (unsigned)id->vnn,
+				       (unsigned long long)id->pid);
 	} else {
 		return talloc_asprintf(mem_ctx,
 				       "%u:%llu.%u",
@@ -39,3 +67,72 @@ char *server_id_str(TALLOC_CTX *mem_ctx, const struct server_id *id)
 				       (unsigned)id->task_id);
 	}
 }
+
+struct server_id server_id_from_string(uint32_t local_vnn,
+				       const char *pid_string)
+{
+	struct server_id result;
+	unsigned long long pid;
+	unsigned int vnn, task_id = 0;
+
+	ZERO_STRUCT(result);
+
+	/*
+	 * We accept various forms with 1, 2 or 3 component forms
+	 * because the server_id_str() can print different forms, and
+	 * we want backwards compatibility for scripts that may call
+	 * smbclient.
+	 */
+	if (sscanf(pid_string, "%u:%llu.%u", &vnn, &pid, &task_id) == 3) {
+		result.vnn = vnn;
+		result.pid = pid;
+		result.task_id = task_id;
+	} else if (sscanf(pid_string, "%u:%llu", &vnn, &pid) == 2) {
+		result.vnn = vnn;
+		result.pid = pid;
+	} else if (sscanf(pid_string, "%llu.%u", &pid, &task_id) == 2) {
+		result.vnn = local_vnn;
+		result.pid = pid;
+		result.task_id = task_id;
+	} else if (sscanf(pid_string, "%llu", &pid) == 1) {
+		result.vnn = local_vnn;
+		result.pid = pid;
+	} else if (strcmp(pid_string, "disconnected") ==0) {
+		server_id_set_disconnected(&result);
+	} else {
+		result.vnn = NONCLUSTER_VNN;
+		result.pid = UINT64_MAX;
+	}
+	return result;
+}
+
+/**
+ * Set the serverid to the special value that represents a disconnected
+ * client for (e.g.) durable handles.
+ */
+void server_id_set_disconnected(struct server_id *id)
+{
+	SMB_ASSERT(id != NULL);
+
+	id->pid = UINT64_MAX;
+	id->task_id = UINT32_MAX;
+	id->vnn = NONCLUSTER_VNN;
+	id->unique_id = SERVERID_UNIQUE_ID_NOT_TO_VERIFY;
+
+	return;
+}
+
+/**
+ * check whether a serverid is the special placeholder for
+ * a disconnected client
+ */
+bool server_id_is_disconnected(const struct server_id *id)
+{
+	struct server_id dis;
+
+	SMB_ASSERT(id != NULL);
+
+	server_id_set_disconnected(&dis);
+
+	return server_id_equal(id, &dis);
+}
diff --git a/selftest/knownfail b/selftest/knownfail
index 9376264..1c72718 100644
--- a/selftest/knownfail
+++ b/selftest/knownfail
@@ -46,6 +46,8 @@
 ^samba3.raw.samba3checkfsp.samba3checkfsp\(s3dc\) # This test fails against an smbd environment with NT ACLs enabled
 ^samba3.raw.samba3closeerr.samba3closeerr\(s3dc\) # This test fails against an smbd environment with NT ACLs enabled
 ^samba3.raw.acls.generic\(s3dc\) # This fails against smbd
+^samba3.base.delete.deltest16a
+^samba3.base.delete.deltest17a
 ^samba3.unix.whoami anonymous connection.whoami\(plugin_s4_dc\) # We need to resolve if we should be including SID_NT_WORLD and SID_NT_NETWORK in this token
 ^samba3.unix.whoami anonymous connection.whoami\(s3member\) # smbd maps anonymous logins to domain guest in the local domain, not SID_NT_ANONYMOUS
 # these show that we still have some differences between our system
@@ -54,7 +56,11 @@
 ^samba.vfstest.acl.vfstest\(s3dc:local\) #until we get the fake_acls module into selftest
 ^samba4.local.convert_string_handle.system.iconv.gd_ascii
 ^samba4.local.convert_string_handle.system.iconv.gd_iso8859_cp850
-^samba4..*base.delete.*.deltest17
+^samba4..*base.delete.*.deltest17\(
+^samba4..*base.delete.*.deltest17b
+^samba4..*base.delete.*.deltest17c
+^samba4..*base.delete.*.deltest17e
+^samba4..*base.delete.*.deltest17f
 ^samba4..*base.delete.*.deltest20a
 ^samba4..*base.delete.*.deltest20b
 ^samba4.raw.session.reauth
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 9af72a1..00dbab8 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -454,7 +454,7 @@ void set_my_unique_id(uint64_t unique_id);
 struct server_id pid_to_procid(pid_t pid);
 struct server_id procid_self(void);
 struct server_id *new_server_id_task(TALLOC_CTX *mem_ctx);
-bool serverid_equal(const struct server_id *p1, const struct server_id *p2);
+#define serverid_equal(p1, p2) server_id_equal(p1,p2)
 bool procid_is_me(const struct server_id *pid);
 struct server_id interpret_pid(const char *pid_string);
 char *procid_str_static(const struct server_id *pid);
diff --git a/source3/include/serverid.h b/source3/include/serverid.h
index ed8d17f..1833f53 100644
--- a/source3/include/serverid.h
+++ b/source3/include/serverid.h
@@ -75,6 +75,4 @@ bool serverid_parent_init(TALLOC_CTX *mem_ctx);
  */
 uint64_t serverid_get_random_unique_id(void);
 
-bool serverid_equal(const struct server_id *p1, const struct server_id *p2);
-
 #endif
diff --git a/source3/lib/serverid.c b/source3/lib/serverid.c
index 3068d77..3c5402e 100644
--- a/source3/lib/serverid.c
+++ b/source3/lib/serverid.c
@@ -458,24 +458,3 @@ uint64_t serverid_get_random_unique_id(void)
 
 	return unique_id;
 }
-
-bool serverid_equal(const struct server_id *p1, const struct server_id *p2)
-{
-	if (p1->pid != p2->pid) {
-		return false;
-	}
-
-	if (p1->task_id != p2->task_id) {
-		return false;
-	}
-
-	if (p1->vnn != p2->vnn) {
-		return false;
-	}
-
-	if (p1->unique_id != p2->unique_id) {
-		return false;
-	}
-
-	return true;
-}
diff --git a/source3/lib/system.c b/source3/lib/system.c
index 270d0f5..2881fd6 100644
--- a/source3/lib/system.c
+++ b/source3/lib/system.c
@@ -1159,6 +1159,7 @@ int sys_popen(const char *command)
 	int pipe_fds[2];
 	popen_list *entry = NULL;
 	char **argl = NULL;
+	int ret;
 
 	if (pipe(pipe_fds) < 0)
 		return -1;
@@ -1213,7 +1214,11 @@ int sys_popen(const char *command)
 		for (p = popen_chain; p; p = p->next)
 			close(p->fd);
 
-		execv(argl[0], argl);
+		ret = execv(argl[0], argl);
+		if (ret == -1) {
+			DEBUG(0, ("sys_popen: ERROR executing dfree command "
+				  "'%s': %s\n", command, strerror(errno)));
+		}
 		_exit (127);
 	}
 
diff --git a/source3/lib/util.c b/source3/lib/util.c
index b8513f6..242fb10 100644
--- a/source3/lib/util.c
+++ b/source3/lib/util.c
@@ -2106,36 +2106,7 @@ bool procid_is_me(const struct server_id *pid)
 
 struct server_id interpret_pid(const char *pid_string)
 {
-	struct server_id result;
-	unsigned long long pid;
-	unsigned int vnn, task_id = 0;
-
-	ZERO_STRUCT(result);
-
-	/* We accept various forms with 1, 2 or 3 component forms
-	 * because the server_id_str() can print different forms, and
-	 * we want backwards compatibility for scripts that may call
-	 * smbclient. */
-	if (sscanf(pid_string, "%u:%llu.%u", &vnn, &pid, &task_id) == 3) {
-		result.vnn = vnn;
-		result.pid = pid;
-		result.task_id = task_id;
-	} else if (sscanf(pid_string, "%u:%llu", &vnn, &pid) == 2) {
-		result.vnn = vnn;
-		result.pid = pid;
-		result.task_id = 0;
-	} else if (sscanf(pid_string, "%llu.%u", &pid, &task_id) == 2) {
-		result.vnn = get_my_vnn();
-		result.pid = pid;
-		result.task_id = task_id;
-	} else if (sscanf(pid_string, "%llu", &pid) == 1) {
-		result.vnn = get_my_vnn();
-		result.pid = pid;
-	} else {
-		result.vnn = NONCLUSTER_VNN;
-		result.pid = (uint64_t)-1;
-	}
-	return result;
+	return server_id_from_string(get_my_vnn(), pid_string);
 }
 
 char *procid_str_static(const struct server_id *pid)
diff --git a/source4/torture/basic/delete.c b/source4/torture/basic/delete.c
index 7fb9345..e3d830d 100644
--- a/source4/torture/basic/delete.c
+++ b/source4/torture/basic/delete.c
@@ -883,6 +883,95 @@ static bool deltest16(struct torture_context *tctx, struct smbcli_state *cli1, s
 	return correct;
 }
 
+/* Test 16 ... */
+static bool deltest16a(struct torture_context *tctx, struct smbcli_state *cli1, struct smbcli_state *cli2)
+{
+	int fnum1 = -1;
+	int fnum2 = -1;
+	bool correct = true;
+
+	del_clean_area(cli1, cli2);
+
+	/* Test 16. */
+
+	/* Ensure the file doesn't already exist. */
+	smbcli_close(cli1->tree, fnum1);
+	smbcli_close(cli1->tree, fnum2);
+	smbcli_setatr(cli1->tree, fname, 0, 0);
+	smbcli_unlink(cli1->tree, fname);
+
+	/* Firstly open and create with all access */
+	fnum1 = smbcli_nt_create_full(cli1->tree, fname, 0,
+				      SEC_RIGHTS_FILE_ALL,
+				      FILE_ATTRIBUTE_NORMAL,
+				      NTCREATEX_SHARE_ACCESS_READ|
+				      NTCREATEX_SHARE_ACCESS_WRITE|
+				      NTCREATEX_SHARE_ACCESS_DELETE,
+				      NTCREATEX_DISP_CREATE,
+				      0, 0);
+	torture_assert(tctx, fnum1 != -1, talloc_asprintf(tctx, "open - 1 of %s failed (%s)",
+		       fname, smbcli_errstr(cli1->tree)));
+
+	/* And close - just to create the file. */
+	smbcli_close(cli1->tree, fnum1);
+
+	/* Firstly create with all access, but delete on close. */
+	fnum1 = smbcli_nt_create_full(cli1->tree, fname, 0,
+				      SEC_RIGHTS_FILE_ALL,
+				      FILE_ATTRIBUTE_NORMAL,
+				      NTCREATEX_SHARE_ACCESS_READ|
+				      NTCREATEX_SHARE_ACCESS_WRITE|
+				      NTCREATEX_SHARE_ACCESS_DELETE,
+				      NTCREATEX_DISP_OPEN,
+				      NTCREATEX_OPTIONS_DELETE_ON_CLOSE, 0);
+
+	torture_assert (tctx, fnum1 != -1, talloc_asprintf(tctx, "open - 1 of %s failed (%s)", fname, smbcli_errstr(cli1->tree)));
+
+	/* The delete on close bit is *not* reported as being set. */
+	correct &= check_delete_on_close(tctx, cli1, fnum1, fname, false, __location__);
+
+	/* The delete on close bit is *not* reported as being set. */
+	correct &= check_delete_on_close(tctx, cli1, -1, fname, false, __location__);
+	correct &= check_delete_on_close(tctx, cli2, -1, fname, false, __location__);
+
+	/* Now try opening again for read-only. */
+	fnum2 = smbcli_nt_create_full(cli2->tree, fname, 0,
+				      SEC_RIGHTS_FILE_READ,
+				      FILE_ATTRIBUTE_NORMAL,
+				      NTCREATEX_SHARE_ACCESS_READ|
+				      NTCREATEX_SHARE_ACCESS_WRITE|
+				      NTCREATEX_SHARE_ACCESS_DELETE,
+				      NTCREATEX_DISP_OPEN,
+				      0, 0);
+
+	/* Should work. */
+	torture_assert(tctx, fnum2 != -1, talloc_asprintf(tctx, "open - 1 of %s failed (%s)",
+		      fname, smbcli_errstr(cli1->tree)));
+
+	correct &= check_delete_on_close(tctx, cli1, fnum1, fname, false, __location__);
+	correct &= check_delete_on_close(tctx, cli1, -1, fname, false, __location__);
+	correct &= check_delete_on_close(tctx, cli2, fnum2, fname, false, __location__);
+	correct &= check_delete_on_close(tctx, cli2, -1, fname, false, __location__);
+
+	smbcli_close(cli1->tree, fnum1);
+
+	correct &= check_delete_on_close(tctx, cli2, fnum2, fname, false, __location__);
+	correct &= check_delete_on_close(tctx, cli2, -1, fname, false, __location__);
+
+	smbcli_close(cli2->tree, fnum2);
+
+	/* And the file should be deleted ! */
+	fnum1 = smbcli_open(cli1->tree, fname, O_RDWR, DENY_NONE);
+	torture_assert(tctx, fnum1 != -1, talloc_asprintf(tctx, "open of %s failed (%s)",
+		       fname, smbcli_errstr(cli1->tree)));
+
+	smbcli_close(cli1->tree, fnum1);
+	smbcli_setatr(cli1->tree, fname, 0, 0);
+	smbcli_unlink(cli1->tree, fname);
+
+	return correct;
+}
+
 /* Test 17 ... */
 static bool deltest17(struct torture_context *tctx, struct smbcli_state *cli1, struct smbcli_state *cli2)
 {
@@ -967,6 +1056,532 @@ static bool deltest17(struct torture_context *tctx, struct smbcli_state *cli1, s
 	return correct;
 }
 
+/* Test 17a - like 17, but the delete on close handle is closed last */
+static bool deltest17a(struct torture_context *tctx, struct smbcli_state *cli1, struct smbcli_state *cli2)
+{
+	int fnum1 = -1;
+	int fnum2 = -1;
+	bool correct = true;
+
+	del_clean_area(cli1, cli2);
+
+	/* Ensure the file doesn't already exist. */
+	smbcli_close(cli1->tree, fnum1);
+	smbcli_close(cli1->tree, fnum2);
+	smbcli_setatr(cli1->tree, fname, 0, 0);
+	smbcli_unlink(cli1->tree, fname);
+
+	/* Firstly open and create with all access */
+	fnum1 = smbcli_nt_create_full(cli1->tree, fname, 0,
+				      SEC_RIGHTS_FILE_ALL,
+				      FILE_ATTRIBUTE_NORMAL,
+				      NTCREATEX_SHARE_ACCESS_READ|
+				      NTCREATEX_SHARE_ACCESS_WRITE|
+				      NTCREATEX_SHARE_ACCESS_DELETE,
+				      NTCREATEX_DISP_CREATE,
+				      0, 0);
+	torture_assert(tctx, fnum1 != -1, talloc_asprintf(tctx, "open - 1 of %s failed (%s)",
+		       fname, smbcli_errstr(cli1->tree)));
+
+	/* And close - just to create the file. */
+	smbcli_close(cli1->tree, fnum1);
+
+	/* Next open with all access, but add delete on close. */
+	fnum1 = smbcli_nt_create_full(cli1->tree, fname, 0,
+				      SEC_RIGHTS_FILE_ALL,
+				      FILE_ATTRIBUTE_NORMAL,
+				      NTCREATEX_SHARE_ACCESS_READ|
+				      NTCREATEX_SHARE_ACCESS_WRITE|
+				      NTCREATEX_SHARE_ACCESS_DELETE,
+				      NTCREATEX_DISP_OPEN,
+				      NTCREATEX_OPTIONS_DELETE_ON_CLOSE, 0);
+
+	torture_assert(tctx, fnum1 != -1, talloc_asprintf(tctx, "open - 1 of %s failed (%s)",
+		       fname, smbcli_errstr(cli1->tree)));
+
+	/* The delete on close bit is *not* reported as being set. */
+	correct &= check_delete_on_close(tctx, cli1, fnum1, fname, false, __location__);
+
+	/* Now try opening again for read-only. */
+	fnum2 = smbcli_nt_create_full(cli1->tree, fname, 0,
+				      SEC_RIGHTS_FILE_READ|
+				      SEC_STD_DELETE,
+				      FILE_ATTRIBUTE_NORMAL,
+				      NTCREATEX_SHARE_ACCESS_READ|
+				      NTCREATEX_SHARE_ACCESS_WRITE|
+				      NTCREATEX_SHARE_ACCESS_DELETE,
+				      NTCREATEX_DISP_OPEN,
+				      0, 0);
+
+	/* Should work. */
+	torture_assert(tctx, fnum2 != -1, talloc_asprintf(tctx, "open - 2 of %s failed (%s)",
+		       fname, smbcli_errstr(cli1->tree)));
+
+	/* still not reported as being set on either */
+	correct &= check_delete_on_close(tctx, cli1, fnum1, fname, false, __location__);
+	correct &= check_delete_on_close(tctx, cli1, fnum2, fname, false, __location__);
+
+	smbcli_close(cli1->tree, fnum2);
+
+	correct &= check_delete_on_close(tctx, cli1, fnum1, fname, false, __location__);
+
+	smbcli_close(cli1->tree, fnum1);
+
+	/*
+	 * The file is still there:
+	 * The second open seems to have removed the initial
+	 * delete on close flag from the first handle
+	 */
+	fnum1 = smbcli_open(cli1->tree, fname, O_RDWR, DENY_NONE);
+	torture_assert(tctx, fnum1 != -1, talloc_asprintf(tctx, "open - 3 of %s failed (%s)",
+		       fname, smbcli_errstr(cli1->tree)));
+
+	smbcli_close(cli1->tree, fnum1);
+	smbcli_setatr(cli1->tree, fname, 0, 0);
+	smbcli_unlink(cli1->tree, fname);
+
+	return correct;
+}
+
+/* Test 17b - like 17a, but the initial delete on close is set on the second handle */
+static bool deltest17b(struct torture_context *tctx, struct smbcli_state *cli1, struct smbcli_state *cli2)
+{
+	int fnum1 = -1;
+	int fnum2 = -1;
+	bool correct = true;
+
+	del_clean_area(cli1, cli2);
+
+	/* Ensure the file doesn't already exist. */
+	smbcli_close(cli1->tree, fnum1);
+	smbcli_close(cli1->tree, fnum2);
+	smbcli_setatr(cli1->tree, fname, 0, 0);
+	smbcli_unlink(cli1->tree, fname);


-- 
Samba Shared Repository


More information about the samba-cvs mailing list