[SCM] Samba Shared Repository - branch master updated

Volker Lendecke vlendec at samba.org
Mon May 23 08:55:01 MDT 2011


The branch, master has been updated
       via  18ec1da s3: Remove unused cli_get_nt_error
       via  502a992 s3: Remove unused cli_set_nt_error
       via  fddb944 s3: Remove unused cli_reset_error
       via  e77da2f s3: Remove a reference to cli->inbuf
       via  b1a7bdb s3: Remove two false references to cli->inbuf
       via  9514f96 s3: Fix a leftover from fstring removal in cli_state
      from  8167e84 selftest: create ncalrpcdir with 0755 permissions

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


- Log -----------------------------------------------------------------
commit 18ec1dab59b16db7cf353c0144c43969cfdc3be7
Author: Volker Lendecke <vl at samba.org>
Date:   Mon May 23 12:26:03 2011 +0200

    s3: Remove unused cli_get_nt_error
    
    Autobuild-User: Volker Lendecke <vlendec at samba.org>
    Autobuild-Date: Mon May 23 16:54:21 CEST 2011 on sn-devel-104

commit 502a9924ca825f286e759219757455245367ab6b
Author: Volker Lendecke <vl at samba.org>
Date:   Mon May 23 12:25:32 2011 +0200

    s3: Remove unused cli_set_nt_error

commit fddb944a04c94555b36b77e69d01ecb0dabbd79b
Author: Volker Lendecke <vl at samba.org>
Date:   Mon May 23 12:24:52 2011 +0200

    s3: Remove unused cli_reset_error

commit e77da2f408a92822c7c1b08cc004890e18c8fc68
Author: Volker Lendecke <vl at samba.org>
Date:   Mon May 23 12:22:41 2011 +0200

    s3: Remove a reference to cli->inbuf
    
    This is only used for utf16 alignment calculations, "rdata" is aligned the
    same way as cli->inbuf is.

commit b1a7bdb93c7fda54a29284f1691de1dc4f3bbf6b
Author: Volker Lendecke <vl at samba.org>
Date:   Mon May 23 12:21:17 2011 +0200

    s3: Remove two false references to cli->inbuf

commit 9514f96856ccf822b683b5362fd2eb4a4e9e418a
Author: Volker Lendecke <vl at samba.org>
Date:   Mon May 23 15:36:20 2011 +0200

    s3: Fix a leftover from fstring removal in cli_state
    
    Jeremy, please check!

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

Summary of changes:
 source3/libsmb/cliconnect.c |   13 ++++++++-----
 source3/libsmb/clierror.c   |   38 --------------------------------------
 source3/libsmb/clirap.c     |    2 +-
 source3/libsmb/proto.h      |    3 ---
 4 files changed, 9 insertions(+), 47 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/libsmb/cliconnect.c b/source3/libsmb/cliconnect.c
index 69d5ce6..a4a3c11 100644
--- a/source3/libsmb/cliconnect.c
+++ b/source3/libsmb/cliconnect.c
@@ -2646,11 +2646,14 @@ static void cli_negprot_done(struct tevent_req *subreq)
 		}
 		/* work out if they sent us a workgroup */
 		if (!(cli->capabilities & CAP_EXTENDED_SECURITY) &&
-		    smb_buflen(cli->inbuf) > 8) {
-			clistr_pull(cli->inbuf, cli->server_domain,
-				    bytes+8, sizeof(cli->server_domain),
-				    num_bytes-8,
-				    STR_UNICODE|STR_NOALIGN);
+		    smb_buflen(inbuf) > 8) {
+			ssize_t ret;
+			status = smb_bytes_talloc_string(
+				cli, (char *)inbuf, &cli->server_domain,
+				bytes + 8, num_bytes - 8, &ret);
+			if (tevent_req_nterror(req, status)) {
+				return;
+			}
 		}
 
 		/*
diff --git a/source3/libsmb/clierror.c b/source3/libsmb/clierror.c
index 145ce15..d5ac893 100644
--- a/source3/libsmb/clierror.c
+++ b/source3/libsmb/clierror.c
@@ -323,44 +323,6 @@ bool cli_is_dos_error(struct cli_state *cli)
         return cli_is_error(cli) && !(flgs2 & FLAGS2_32_BIT_ERROR_CODES);
 }
 
-/* Return the last error always as an NTSTATUS. */
-
-NTSTATUS cli_get_nt_error(struct cli_state *cli)
-{
-	if (cli_is_nt_error(cli)) {
-		return cli_nt_error(cli);
-	} else if (cli_is_dos_error(cli)) {
-		uint32 ecode;
-		uint8 eclass;
-		cli_dos_error(cli, &eclass, &ecode);
-		return dos_to_ntstatus(eclass, ecode);
-	} else {
-		/* Something went wrong, we don't know what. */
-		return NT_STATUS_UNSUCCESSFUL;
-	}
-}
-
-/* Push an error code into the inbuf to be returned on the next
- * query. */
-
-void cli_set_nt_error(struct cli_state *cli, NTSTATUS status)
-{
-	SSVAL(cli->inbuf,smb_flg2, SVAL(cli->inbuf,smb_flg2)|FLAGS2_32_BIT_ERROR_CODES);
-	SIVAL(cli->inbuf, smb_rcls, NT_STATUS_V(status));
-}
-
-/* Reset an error. */
-
-void cli_reset_error(struct cli_state *cli)
-{
-        if (SVAL(cli->inbuf,smb_flg2) & FLAGS2_32_BIT_ERROR_CODES) {
-		SIVAL(cli->inbuf, smb_rcls, NT_STATUS_V(NT_STATUS_OK));
-	} else {
-		SCVAL(cli->inbuf,smb_rcls,0);
-		SSVAL(cli->inbuf,smb_err,0);
-	}
-}
-
 bool cli_state_is_connected(struct cli_state *cli)
 {
 	if (cli == NULL) {
diff --git a/source3/libsmb/clirap.c b/source3/libsmb/clirap.c
index 5ecc854..a05903e 100644
--- a/source3/libsmb/clirap.c
+++ b/source3/libsmb/clirap.c
@@ -1079,7 +1079,7 @@ NTSTATUS cli_qfilename(struct cli_state *cli, uint16_t fnum, char *name,
 		return status;
 	}
 
-	clistr_pull(cli->inbuf, name, rdata+4, namelen, IVAL(rdata, 0),
+	clistr_pull(rdata, name, rdata+4, namelen, IVAL(rdata, 0),
 		    STR_UNICODE);
 	TALLOC_FREE(rdata);
 	return NT_STATUS_OK;
diff --git a/source3/libsmb/proto.h b/source3/libsmb/proto.h
index 923dd38..213b811 100644
--- a/source3/libsmb/proto.h
+++ b/source3/libsmb/proto.h
@@ -190,9 +190,6 @@ int cli_errno(struct cli_state *cli);
 bool cli_is_error(struct cli_state *cli);
 bool cli_is_nt_error(struct cli_state *cli);
 bool cli_is_dos_error(struct cli_state *cli);
-NTSTATUS cli_get_nt_error(struct cli_state *cli);
-void cli_set_nt_error(struct cli_state *cli, NTSTATUS status);
-void cli_reset_error(struct cli_state *cli);
 bool cli_state_is_connected(struct cli_state *cli);
 
 /* The following definitions come from libsmb/clifile.c  */


-- 
Samba Shared Repository


More information about the samba-cvs mailing list