[SCM] Samba Shared Repository - branch master updated

Stefan Metzmacher metze at samba.org
Wed Aug 3 02:17:03 MDT 2011


The branch, master has been updated
       via  de71a67 s3:libsmb/clifile: make use of cli_set_timeout()
       via  71c695d s3:cli_np_tstream: make use of cli_set_timeout()
       via  2abe723 s3:torture: make use of cli_set_timeout()
       via  71cec7b s3:winbindd_cm: make use of cli_set_timeout()
       via  b7d5cd9 s3:libsmb/clidfs: make use of cli_state_encryption_on()
      from  f854209 s4-libcli: Fix the fd leak. Close open file descriptor before return.

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


- Log -----------------------------------------------------------------
commit de71a67a1c442a72a7ab88674430b44d371c09d5
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Aug 2 22:58:57 2011 +0200

    s3:libsmb/clifile: make use of cli_set_timeout()
    
    metze
    
    Autobuild-User: Stefan Metzmacher <metze at samba.org>
    Autobuild-Date: Wed Aug  3 10:16:18 CEST 2011 on sn-devel-104

commit 71c695d8d1ddcb4927daab4ad967f9fcfdff76c7
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Aug 2 22:56:52 2011 +0200

    s3:cli_np_tstream: make use of cli_set_timeout()
    
    metze

commit 2abe723e60bd6ab4e5f0fd41cb233cd1e9c1aa5e
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Aug 2 22:55:32 2011 +0200

    s3:torture: make use of cli_set_timeout()
    
    metze

commit 71cec7b37a221c42aeabe3b9c72878dd0714a60b
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Aug 2 22:55:00 2011 +0200

    s3:winbindd_cm: make use of cli_set_timeout()
    
    metze

commit b7d5cd90d5eed90023b0266db386515ece911652
Author: Stefan Metzmacher <metze at samba.org>
Date:   Tue Aug 2 22:54:28 2011 +0200

    s3:libsmb/clidfs: make use of cli_state_encryption_on()
    
    metze

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

Summary of changes:
 source3/libsmb/cli_np_tstream.c |    3 ++-
 source3/libsmb/clidfs.c         |    4 ++--
 source3/libsmb/clifile.c        |   34 ++++++++++++++++++++++------------
 source3/torture/torture.c       |    4 ++--
 source3/winbindd/winbindd_cm.c  |    2 +-
 5 files changed, 29 insertions(+), 18 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/libsmb/cli_np_tstream.c b/source3/libsmb/cli_np_tstream.c
index 7521181..37fd68a 100644
--- a/source3/libsmb/cli_np_tstream.c
+++ b/source3/libsmb/cli_np_tstream.c
@@ -194,7 +194,8 @@ NTSTATUS _tstream_cli_np_open_recv(struct tevent_req *req,
 	cli_nps->cli = state->cli;
 	cli_nps->npipe = talloc_move(cli_nps, &state->npipe);
 	cli_nps->fnum = state->fnum;
-	cli_nps->default_timeout = state->cli->timeout;
+	cli_nps->default_timeout = cli_set_timeout(state->cli, 0);
+	cli_set_timeout(state->cli, cli_nps->default_timeout);
 
 	talloc_set_destructor(cli_nps, tstream_cli_np_destructor);
 
diff --git a/source3/libsmb/clidfs.c b/source3/libsmb/clidfs.c
index e54da6f..a445649 100644
--- a/source3/libsmb/clidfs.c
+++ b/source3/libsmb/clidfs.c
@@ -857,7 +857,7 @@ NTSTATUS cli_resolve_path(TALLOC_CTX *ctx,
 			     "IPC$",
 			     dfs_auth_info,
 			     false,
-			     (rootcli->trans_enc_state != NULL),
+			     cli_state_encryption_on(rootcli),
 			     cli_state_protocol(rootcli),
 			     0,
 			     0x20,
@@ -908,7 +908,7 @@ NTSTATUS cli_resolve_path(TALLOC_CTX *ctx,
 			     share,
 			     dfs_auth_info,
 			     false,
-			     (rootcli->trans_enc_state != NULL),
+			     cli_state_encryption_on(rootcli),
 			     cli_state_protocol(rootcli),
 			     0,
 			     0x20,
diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c
index 812fcde..f9e3cbd 100644
--- a/source3/libsmb/clifile.c
+++ b/source3/libsmb/clifile.c
@@ -2594,7 +2594,8 @@ NTSTATUS cli_locktype(struct cli_state *cli, uint16_t fnum,
 	uint16_t vwv[8];
 	uint8_t bytes[10];
 	NTSTATUS status;
-	int saved_timeout;
+	unsigned int set_timeout = 0;
+	unsigned int saved_timeout = 0;
 
 	SCVAL(vwv + 0, 0, 0xff);
 	SCVAL(vwv + 0, 1, 0);
@@ -2610,17 +2611,21 @@ NTSTATUS cli_locktype(struct cli_state *cli, uint16_t fnum,
 	SIVAL(bytes, 2, offset);
 	SIVAL(bytes, 6, len);
 
-	saved_timeout = cli->timeout;
-
 	if (timeout != 0) {
-		cli->timeout = (timeout == -1)
-			? 0x7FFFFFFF : (timeout + 2*1000);
+		if (timeout == -1) {
+			set_timeout = 0x7FFFFFFF;
+		} else {
+			set_timeout = timeout + 2*1000;
+		}
+		saved_timeout = cli_set_timeout(cli, set_timeout);
 	}
 
 	status = cli_smb(talloc_tos(), cli, SMBlockingX, 0, 8, vwv,
 			 10, bytes, NULL, 0, NULL, NULL, NULL, NULL);
 
-	cli->timeout = saved_timeout;
+	if (saved_timeout != 0) {
+		cli_set_timeout(cli, saved_timeout);
+	}
 
 	return status;
 }
@@ -2761,7 +2766,8 @@ NTSTATUS cli_lock64(struct cli_state *cli, uint16_t fnum,
 {
 	uint16_t vwv[8];
 	uint8_t bytes[20];
-        int saved_timeout = cli->timeout;
+	unsigned int set_timeout = 0;
+	unsigned int saved_timeout = 0;
 	int ltype;
 	NTSTATUS status;
 
@@ -2786,17 +2792,21 @@ NTSTATUS cli_lock64(struct cli_state *cli, uint16_t fnum,
 	SOFF_T_R(bytes, 4, offset);
 	SOFF_T_R(bytes, 12, len);
 
-	saved_timeout = cli->timeout;
-
 	if (timeout != 0) {
-		cli->timeout = (timeout == -1)
-			? 0x7FFFFFFF : (timeout + 2*1000);
+		if (timeout == -1) {
+			set_timeout = 0x7FFFFFFF;
+		} else {
+			set_timeout = timeout + 2*1000;
+		}
+		saved_timeout = cli_set_timeout(cli, set_timeout);
 	}
 
 	status = cli_smb(talloc_tos(), cli, SMBlockingX, 0, 8, vwv,
 			 20, bytes, NULL, 0, NULL, NULL, NULL, NULL);
 
-	cli->timeout = saved_timeout;
+	if (saved_timeout != 0) {
+		cli_set_timeout(cli, saved_timeout);
+	}
 
 	return status;
 }
diff --git a/source3/torture/torture.c b/source3/torture/torture.c
index 03a0cdf..d5c2a56 100644
--- a/source3/torture/torture.c
+++ b/source3/torture/torture.c
@@ -191,7 +191,7 @@ static struct cli_state *open_nbt_connection(void)
 
 	c->use_kerberos = use_kerberos;
 
-	c->timeout = 120000; /* set a really long timeout (2 minutes) */
+	cli_set_timeout(c, 120000); /* set a really long timeout (2 minutes) */
 	if (use_oplocks) c->use_oplocks = True;
 	if (use_level_II_oplocks) c->use_level_II_oplocks = True;
 
@@ -374,7 +374,7 @@ static bool torture_open_connection_share(struct cli_state **c,
 		return False;
 	}
 
-	(*c)->timeout = 120000; /* set a really long timeout (2 minutes) */
+	cli_set_timeout(*c, 120000); /* set a really long timeout (2 minutes) */
 
 	if (do_encrypt) {
 		return force_cli_encryption(*c,
diff --git a/source3/winbindd/winbindd_cm.c b/source3/winbindd/winbindd_cm.c
index 3dd129f..26cd8bc 100644
--- a/source3/winbindd/winbindd_cm.c
+++ b/source3/winbindd/winbindd_cm.c
@@ -813,7 +813,7 @@ static NTSTATUS cm_prepare_connection(const struct winbindd_domain *domain,
 		goto done;
 	}
 
-	(*cli)->timeout = 10000; 	/* 10 seconds */
+	cli_set_timeout(*cli, 10000); /* 10 seconds */
 
 	(*cli)->use_kerberos = True;
 


-- 
Samba Shared Repository


More information about the samba-cvs mailing list