[SCM] Samba Shared Repository - branch master updated

Stefan Metzmacher metze at samba.org
Fri Jul 8 07:22:03 MDT 2011


The branch, master has been updated
       via  d6cd1ee s3:libsmb: remove unused cli->inbuf and cli->bufsize
       via  fccc607 s3:client: use an inbuf on the stack in readline_callback()
       via  fc7359b s3:libsmb: clistr_pull_talloc() doesn't need base_ptr and flags2 with STR_ASCII
       via  7d757d6 s3:libsmb: remove unused smb_dos_errstr()
       via  83301d8 s3:libsmb/smberr: make global const arrays static
       via  235aeda s3:libsmb: don't use the cli->inbuf to store the last error
       via  0342b69 s3:torture: use cli_is_nt/dos_error() in run_error_map_extract()
       via  2c16022 s3:libsmb: don't call cli_set_error() in cli_echo()
       via  f0e6e5c s3:libsmb: remove unused enum smb_read_errors infrastructure
       via  2b8e148 s3:client: close the socket if receive_smb_raw() fails
       via  0ecd15a s3:client: use cli_nt_error() in order to avoid cli_errstr()
       via  f5b0bbf s3:client: avoid cli_errstr() where we already have an NTSTATUS
       via  5cc279e s3:clitar: avoid usage of cli_errstr()
       via  06247a7 s3:libsmb: remove use of cli_errstr() in SMBC_server_internal()
       via  a7b9c62 s3:auth_server: use cli->is_guestlogin instead of parsing cli->inbuf.
       via  ce75194 s3:auth: remove unused variable
       via  f0085ee s3:auth_unix: remove unused var
      from  dbfb88a s3:smb2_server: add some comments about change_to_user() and change_to_root_user()

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


- Log -----------------------------------------------------------------
commit d6cd1ee03296a809a98031ca52de72a7757b4058
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jul 8 13:02:51 2011 +0200

    s3:libsmb: remove unused cli->inbuf and cli->bufsize
    
    metze
    
    Autobuild-User: Stefan Metzmacher <metze at samba.org>
    Autobuild-Date: Fri Jul  8 15:21:46 CEST 2011 on sn-devel-104

commit fccc607a5dd9b9df8d6c4edac0376e819a97c301
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jul 8 12:41:20 2011 +0200

    s3:client: use an inbuf on the stack in readline_callback()
    
    metze

commit fc7359befb8939691d384824760ade97e6a74803
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jul 8 12:35:36 2011 +0200

    s3:libsmb: clistr_pull_talloc() doesn't need base_ptr and flags2 with STR_ASCII
    
    interpret_short_filename() always parses OEM_Strings (in DOS charset).
    
    metze

commit 7d757d6ac3be143bb08d2deb61a4b2211b4d22cd
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jul 8 11:05:31 2011 +0200

    s3:libsmb: remove unused smb_dos_errstr()
    
    metze

commit 83301d8b5a96823a90ab3f25effd2d4c28a6d8c9
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jul 8 10:54:53 2011 +0200

    s3:libsmb/smberr: make global const arrays static
    
    metze

commit 235aedae5030dac138fbaa5726022f5007586cd2
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jul 8 10:52:22 2011 +0200

    s3:libsmb: don't use the cli->inbuf to store the last error
    
    We keep the raw error in cli->raw_status now, until we fixed all
    caller to get the NTSTATUS from the function calls.
    
    metze

commit 0342b69f36acdb9418f4b85ed48f3c6b78ef553f
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jul 8 13:34:38 2011 +0200

    s3:torture: use cli_is_nt/dos_error() in run_error_map_extract()
    
    Callers should avoid using cli->inbuf directly!
    
    metze

commit 2c160224c2bcf241653e313445e21746e772b424
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jul 8 10:27:41 2011 +0200

    s3:libsmb: don't call cli_set_error() in cli_echo()
    
    cli_smb_recv() already does it.
    
    metze

commit f0e6e5c37d5921450d030acb98c794f0cf7224a6
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jul 8 09:45:05 2011 +0200

    s3:libsmb: remove unused enum smb_read_errors infrastructure
    
    metze

commit 2b8e1480840db7ef8128352b1808a5ee91a03ca1
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jul 8 09:30:58 2011 +0200

    s3:client: close the socket if receive_smb_raw() fails
    
    metze

commit 0ecd15abe612347e3e3f579d6038220a29833a21
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jul 8 09:29:29 2011 +0200

    s3:client: use cli_nt_error() in order to avoid cli_errstr()
    
    metze

commit f5b0bbf1087b4b7eae1e5b1da3ef6b7e97f87710
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jul 8 09:16:20 2011 +0200

    s3:client: avoid cli_errstr() where we already have an NTSTATUS
    
    metze

commit 5cc279eb34d60ae11e42fe7ff266720a76a7d5a6
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jul 8 02:13:23 2011 +0200

    s3:clitar: avoid usage of cli_errstr()
    
    metze

commit 06247a7a094b30229fda26844526c5217ba6fe0c
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jul 8 01:55:26 2011 +0200

    s3:libsmb: remove use of cli_errstr() in SMBC_server_internal()
    
    metze

commit a7b9c628af3155f0ad406830a975c84845d34b3b
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jul 8 12:59:32 2011 +0200

    s3:auth_server: use cli->is_guestlogin instead of parsing cli->inbuf.
    
    cli->inbuf is not the valid response buffer of the session setup response.
    
    metze

commit ce751946dda9f4b99c03cb060bc6a2be6f5750e7
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jul 8 13:57:33 2011 +0200

    s3:auth: remove unused variable
    
    metze

commit f0085eedf03d5b8964985e7dd6abc9f1c90b11c9
Author: Stefan Metzmacher <metze at samba.org>
Date:   Fri Jul 8 11:24:19 2011 +0200

    s3:auth_unix: remove unused var
    
    metze

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

Summary of changes:
 source3/auth/auth.c            |    1 -
 source3/auth/auth_server.c     |    2 +-
 source3/auth/auth_unix.c       |    1 -
 source3/client/client.c        |  144 +++++++++++++++++++++---------------
 source3/client/clitar.c        |    3 +-
 source3/include/async_smb.h    |   12 ---
 source3/include/client.h       |    5 +-
 source3/include/proto.h        |    5 -
 source3/include/smb.h          |   13 ---
 source3/lib/util_sock.c        |   20 -----
 source3/libsmb/async_smb.c     |   50 ++++---------
 source3/libsmb/cliconnect.c    |    9 --
 source3/libsmb/clientgen.c     |   24 +-----
 source3/libsmb/clierror.c      |  161 ++++++++--------------------------------
 source3/libsmb/clilist.c       |    4 +-
 source3/libsmb/libsmb_server.c |   11 ++-
 source3/libsmb/smberr.c        |   50 +-----------
 source3/torture/torture.c      |   22 +++---
 18 files changed, 162 insertions(+), 375 deletions(-)


Changeset truncated at 500 lines:

diff --git a/source3/auth/auth.c b/source3/auth/auth.c
index 0f661a9..0bdce9d 100644
--- a/source3/auth/auth.c
+++ b/source3/auth/auth.c
@@ -285,7 +285,6 @@ static NTSTATUS check_ntlm_password(const struct auth_context *auth_context,
 		unix_username = (*server_info)->unix_name;
 		if (!(*server_info)->guest) {
 			char *rhost;
-			int rc;
 
 			rhost = tsocket_address_inet_addr_string(user_info->remote_host,
 								 talloc_tos());
diff --git a/source3/auth/auth_server.c b/source3/auth/auth_server.c
index da380db..d50ed7a 100644
--- a/source3/auth/auth_server.c
+++ b/source3/auth/auth_server.c
@@ -350,7 +350,7 @@ static NTSTATUS check_smbserver_security(const struct auth_context *auth_context
 			 */
 			tested_password_server = True;
 
-			if ((SVAL(cli->inbuf,smb_vwv2) & 1) == 0) {
+			if (!cli->is_guestlogin) {
 				DEBUG(0,("server_validate: password server %s allows users as non-guest \
 with a bad password.\n", cli->desthost));
 				DEBUG(0,("server_validate: This is broken (and insecure) behaviour. Please do not \
diff --git a/source3/auth/auth_unix.c b/source3/auth/auth_unix.c
index f0a5215..6f232ec 100644
--- a/source3/auth/auth_unix.c
+++ b/source3/auth/auth_unix.c
@@ -40,7 +40,6 @@ static NTSTATUS check_unix_security(const struct auth_context *auth_context,
 	NTSTATUS nt_status;
 	struct passwd *pass = NULL;
 	char *rhost;
-	int rc;
 
 	DEBUG(10, ("Check auth for: [%s]\n", user_info->mapped.account_name));
 
diff --git a/source3/client/client.c b/source3/client/client.c
index 82dc8c4..4a5a31a 100644
--- a/source3/client/client.c
+++ b/source3/client/client.c
@@ -588,10 +588,10 @@ static NTSTATUS display_finfo(struct cli_state *cli_state, struct file_info *fin
 			struct security_descriptor *sd = NULL;
 			sd = cli_query_secdesc(cli_state, fnum, ctx);
 			if (!sd) {
+				status = cli_nt_error(cli_state);
 				DEBUG( 0, ("display_finfo() failed to "
 					"get security descriptor: %s",
-					cli_errstr(cli_state)));
-				status = cli_nt_error(cli_state);
+					nt_errstr(status)));
 			} else {
 				display_sec_desc(sd);
 			}
@@ -2237,7 +2237,9 @@ static int do_cancel(int job)
 		d_printf("Job %d cancelled\n",job);
 		return 0;
 	} else {
-		d_printf("Error cancelling job %d : %s\n",job,cli_errstr(cli));
+		NTSTATUS status = cli_nt_error(cli);
+		d_printf("Error cancelling job %d : %s\n",
+			 job, nt_errstr(status));
 		return 1;
 	}
 }
@@ -2472,15 +2474,20 @@ static int cmd_open(void)
 		return 1;
 	}
 
-	if (!NT_STATUS_IS_OK(cli_ntcreate(targetcli, targetname, 0,
+	status = cli_ntcreate(targetcli, targetname, 0,
 			FILE_READ_DATA|FILE_WRITE_DATA, 0,
-			FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OPEN, 0x0, 0x0, &fnum))) {
-		if (NT_STATUS_IS_OK(cli_ntcreate(targetcli, targetname, 0,
+			FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OPEN,
+			0x0, 0x0, &fnum);
+	if (!NT_STATUS_IS_OK(status)) {
+		status = cli_ntcreate(targetcli, targetname, 0,
 				FILE_READ_DATA, 0,
-				FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OPEN, 0x0, 0x0, &fnum))) {
+				FILE_SHARE_READ|FILE_SHARE_WRITE, FILE_OPEN,
+				0x0, 0x0, &fnum);
+		if (NT_STATUS_IS_OK(status)) {
 			d_printf("open file %s: for read/write fnum %d\n", targetname, fnum);
 		} else {
-			d_printf("Failed to open file %s. %s\n", targetname, cli_errstr(cli));
+			d_printf("Failed to open file %s. %s\n",
+				 targetname, nt_errstr(status));
 		}
 	} else {
 		d_printf("open file %s: for read/write fnum %d\n", targetname, fnum);
@@ -2625,8 +2632,10 @@ static int cmd_posix_mkdir(void)
 		return 1;
 	}
 
-	if (!NT_STATUS_IS_OK(cli_posix_mkdir(targetcli, targetname, mode))) {
-		d_printf("Failed to open file %s. %s\n", targetname, cli_errstr(cli));
+	status = cli_posix_mkdir(targetcli, targetname, mode);
+	if (!NT_STATUS_IS_OK(status)) {
+		d_printf("Failed to open file %s. %s\n",
+			 targetname, nt_errstr(status));
 	} else {
 		d_printf("posix_mkdir created directory %s\n", targetname);
 	}
@@ -2661,8 +2670,10 @@ static int cmd_posix_unlink(void)
 		return 1;
 	}
 
-	if (!NT_STATUS_IS_OK(cli_posix_unlink(targetcli, targetname))) {
-		d_printf("Failed to unlink file %s. %s\n", targetname, cli_errstr(cli));
+	status = cli_posix_unlink(targetcli, targetname);
+	if (!NT_STATUS_IS_OK(status)) {
+		d_printf("Failed to unlink file %s. %s\n",
+			 targetname, nt_errstr(status));
 	} else {
 		d_printf("posix_unlink deleted file %s\n", targetname);
 	}
@@ -2698,8 +2709,10 @@ static int cmd_posix_rmdir(void)
 		return 1;
 	}
 
-	if (!NT_STATUS_IS_OK(cli_posix_rmdir(targetcli, targetname))) {
-		d_printf("Failed to unlink directory %s. %s\n", targetname, cli_errstr(cli));
+	status = cli_posix_rmdir(targetcli, targetname);
+	if (!NT_STATUS_IS_OK(status)) {
+		d_printf("Failed to unlink directory %s. %s\n",
+			 targetname, nt_errstr(status));
 	} else {
 		d_printf("posix_rmdir deleted directory %s\n", targetname);
 	}
@@ -2712,6 +2725,7 @@ static int cmd_close(void)
 	TALLOC_CTX *ctx = talloc_tos();
 	char *buf = NULL;
 	int fnum;
+	NTSTATUS status;
 
 	if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) {
 		d_printf("close <fnum>\n");
@@ -2720,8 +2734,9 @@ static int cmd_close(void)
 
 	fnum = atoi(buf);
 	/* We really should use the targetcli here.... */
-	if (!NT_STATUS_IS_OK(cli_close(cli, fnum))) {
-		d_printf("close %d: %s\n", fnum, cli_errstr(cli));
+	status = cli_close(cli, fnum);
+	if (!NT_STATUS_IS_OK(status)) {
+		d_printf("close %d: %s\n", fnum, nt_errstr(status));
 		return 1;
 	}
 	return 0;
@@ -2839,6 +2854,7 @@ static int cmd_lock(void)
 	uint64_t start, len;
 	enum brl_type lock_type;
 	int fnum;
+	NTSTATUS status;
 
 	if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) {
 		d_printf("lock <fnum> [r|w] <hex-start> <hex-len>\n");
@@ -2874,8 +2890,9 @@ static int cmd_lock(void)
 
 	len = (uint64_t)strtol(buf, (char **)NULL, 16);
 
-	if (!NT_STATUS_IS_OK(cli_posix_lock(cli, fnum, start, len, true, lock_type))) {
-		d_printf("lock failed %d: %s\n", fnum, cli_errstr(cli));
+	status = cli_posix_lock(cli, fnum, start, len, true, lock_type);
+	if (!NT_STATUS_IS_OK(status)) {
+		d_printf("lock failed %d: %s\n", fnum, nt_errstr(status));
 	}
 
 	return 0;
@@ -2887,6 +2904,7 @@ static int cmd_unlock(void)
 	char *buf = NULL;
 	uint64_t start, len;
 	int fnum;
+	NTSTATUS status;
 
 	if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) {
 		d_printf("unlock <fnum> <hex-start> <hex-len>\n");
@@ -2908,8 +2926,9 @@ static int cmd_unlock(void)
 
 	len = (uint64_t)strtol(buf, (char **)NULL, 16);
 
-	if (!NT_STATUS_IS_OK(cli_posix_unlock(cli, fnum, start, len))) {
-		d_printf("unlock failed %d: %s\n", fnum, cli_errstr(cli));
+	status = cli_posix_unlock(cli, fnum, start, len);
+	if (!NT_STATUS_IS_OK(status)) {
+		d_printf("unlock failed %d: %s\n", fnum, nt_errstr(status));
 	}
 
 	return 0;
@@ -2948,9 +2967,10 @@ static int cmd_rmdir(void)
 		return 1;
 	}
 
-	if (!NT_STATUS_IS_OK(cli_rmdir(targetcli, targetname))) {
+	status = cli_rmdir(targetcli, targetname);
+	if (!NT_STATUS_IS_OK(status)) {
 		d_printf("%s removing remote directory file %s\n",
-			 cli_errstr(targetcli),mask);
+			 nt_errstr(status), mask);
 	}
 
 	return 0;
@@ -3003,8 +3023,10 @@ static int cmd_link(void)
 		return 1;
 	}
 
-	if (!NT_STATUS_IS_OK(cli_posix_hardlink(targetcli, targetname, newname))) {
-		d_printf("%s linking files (%s -> %s)\n", cli_errstr(targetcli), newname, oldname);
+	status = cli_posix_hardlink(targetcli, targetname, newname);
+	if (!NT_STATUS_IS_OK(status)) {
+		d_printf("%s linking files (%s -> %s)\n",
+			 nt_errstr(status), newname, oldname);
 		return 1;
 	}
 	return 0;
@@ -3048,10 +3070,10 @@ static int cmd_readlink(void)
 		return 1;
 	}
 
-	if (!NT_STATUS_IS_OK(cli_posix_readlink(targetcli, name,
-			linkname, PATH_MAX+1))) {
+	status = cli_posix_readlink(targetcli, name, linkname, PATH_MAX+1);
+	if (!NT_STATUS_IS_OK(status)) {
 		d_printf("%s readlink on file %s\n",
-			cli_errstr(targetcli), name);
+			 nt_errstr(status), name);
 		return 1;
 	}
 
@@ -3154,9 +3176,10 @@ static int cmd_chmod(void)
 		return 1;
 	}
 
-	if (!NT_STATUS_IS_OK(cli_posix_chmod(targetcli, targetname, mode))) {
+	status = cli_posix_chmod(targetcli, targetname, mode);
+	if (!NT_STATUS_IS_OK(status)) {
 		d_printf("%s chmod file %s 0%o\n",
-			cli_errstr(targetcli), src, (unsigned int)mode);
+			 nt_errstr(status), src, (unsigned int)mode);
 		return 1;
 	}
 
@@ -3324,15 +3347,17 @@ static int cmd_getfacl(void)
 		return 1;
 	}
 
+	status = cli_posix_stat(targetcli, targetname, &sbuf);
 	if (!NT_STATUS_IS_OK(cli_posix_stat(targetcli, targetname, &sbuf))) {
 		d_printf("%s getfacl doing a stat on file %s\n",
-			cli_errstr(targetcli), src);
+			 nt_errstr(status), src);
 		return 1;
 	}
 
-	if (!NT_STATUS_IS_OK(cli_posix_getfacl(targetcli, targetname, ctx, &rb_size, &retbuf))) {
+	status = cli_posix_getfacl(targetcli, targetname, ctx, &rb_size, &retbuf);
+	if (!NT_STATUS_IS_OK(status)) {
 		d_printf("%s getfacl file %s\n",
-			cli_errstr(targetcli), src);
+			 nt_errstr(status), src);
 		return 1;
 	}
 
@@ -3584,9 +3609,10 @@ static int cmd_stat(void)
 		return 1;
 	}
 
-	if (!NT_STATUS_IS_OK(cli_posix_stat(targetcli, targetname, &sbuf))) {
+	status = cli_posix_stat(targetcli, targetname, &sbuf);
+	if (!NT_STATUS_IS_OK(status)) {
 		d_printf("%s stat file %s\n",
-			cli_errstr(targetcli), src);
+			 nt_errstr(status), src);
 		return 1;
 	}
 
@@ -3691,9 +3717,10 @@ static int cmd_chown(void)
 		return 1;
 	}
 
-	if (!NT_STATUS_IS_OK(cli_posix_chown(targetcli, targetname, uid, gid))) {
+	status = cli_posix_chown(targetcli, targetname, uid, gid);
+	if (!NT_STATUS_IS_OK(status)) {
 		d_printf("%s chown file %s uid=%d, gid=%d\n",
-			cli_errstr(targetcli), src, (int)uid, (int)gid);
+			 nt_errstr(status), src, (int)uid, (int)gid);
 		return 1;
 	}
 
@@ -3750,9 +3777,10 @@ static int cmd_rename(void)
 		return 1;
 	}
 
-	if (!NT_STATUS_IS_OK(cli_rename(targetcli, targetsrc, targetdest))) {
+	status = cli_rename(targetcli, targetsrc, targetdest);
+	if (!NT_STATUS_IS_OK(status)) {
 		d_printf("%s renaming files %s -> %s \n",
-			cli_errstr(targetcli),
+			nt_errstr(status),
 			targetsrc,
 			targetdest);
 		return 1;
@@ -3827,8 +3855,10 @@ static int cmd_hardlink(void)
 		return 1;
 	}
 
-	if (!NT_STATUS_IS_OK(cli_nt_hardlink(targetcli, targetname, dest))) {
-		d_printf("%s doing an NT hard link of files\n",cli_errstr(targetcli));
+	status = cli_nt_hardlink(targetcli, targetname, dest);
+	if (!NT_STATUS_IS_OK(status)) {
+		d_printf("%s doing an NT hard link of files\n",
+			 nt_errstr(status));
 		return 1;
 	}
 
@@ -4167,8 +4197,11 @@ static bool browse_host(bool sort)
 		return true;
 	}
 
-	if((ret = cli_RNetShareEnum(cli, browse_fn, NULL)) == -1)
-		d_printf("Error returning browse list: %s\n", cli_errstr(cli));
+	if((ret = cli_RNetShareEnum(cli, browse_fn, NULL)) == -1) {
+		NTSTATUS status = cli_nt_error(cli);
+		d_printf("Error returning browse list: %s\n",
+			 nt_errstr(status));
+	}
 
 	return (ret != -1);
 }
@@ -4901,35 +4934,26 @@ static void readline_callback(void)
 	ret = poll_intr_one_fd(cli->fd, POLLIN|POLLHUP, 0, &revents);
 
 	if ((ret > 0) && (revents & (POLLIN|POLLHUP|POLLERR))) {
+		char inbuf[CLI_SAMBA_MAX_LARGE_READX_SIZE + LARGE_WRITEX_HDR_SIZE];
 		NTSTATUS status;
 		size_t len;
 
-		set_smb_read_error(&cli->smb_rw_error, SMB_READ_OK);
-
-		status = receive_smb_raw(cli->fd, cli->inbuf, cli->bufsize, 0, 0, &len);
+		status = receive_smb_raw(cli->fd, inbuf, sizeof(inbuf), 0, 0, &len);
 
 		if (!NT_STATUS_IS_OK(status)) {
+			if (cli->fd != -1) {
+				close(cli->fd);
+				cli->fd = -1;
+			}
+
 			DEBUG(0, ("Read from server failed, maybe it closed "
-				  "the connection\n"));
+				  "the connection: %s\n", nt_errstr(status)));
 
 			finished = true;
 			smb_readline_done();
-			if (NT_STATUS_EQUAL(status, NT_STATUS_END_OF_FILE)) {
-				set_smb_read_error(&cli->smb_rw_error,
-						   SMB_READ_EOF);
-				return;
-			}
-
-			if (NT_STATUS_EQUAL(status, NT_STATUS_IO_TIMEOUT)) {
-				set_smb_read_error(&cli->smb_rw_error,
-						   SMB_READ_TIMEOUT);
-				return;
-			}
-
-			set_smb_read_error(&cli->smb_rw_error, SMB_READ_ERROR);
 			return;
 		}
-		if(CVAL(cli->inbuf,0) != SMBkeepalive) {
+		if(CVAL(inbuf,0) != SMBkeepalive) {
 			DEBUG(0, ("Read from server "
 				"returned unexpected packet!\n"));
 			return;
diff --git a/source3/client/clitar.c b/source3/client/clitar.c
index 4dc202e..a5de8eb 100644
--- a/source3/client/clitar.c
+++ b/source3/client/clitar.c
@@ -696,8 +696,9 @@ static NTSTATUS do_atar(const char *rname_in, char *lname,
 			datalen = cli_read(cli, fnum, data, nread, read_size);
 
 			if (datalen == -1) {
-				DEBUG(0,("Error reading file %s : %s\n", rname, cli_errstr(cli)));
 				status = cli_nt_error(cli);
+				DEBUG(0,("Error reading file %s : %s\n",
+					 rname, nt_errstr(status)));
 				break;
 			}
 
diff --git a/source3/include/async_smb.h b/source3/include/async_smb.h
index 1685d49..40da862 100644
--- a/source3/include/async_smb.h
+++ b/source3/include/async_smb.h
@@ -22,18 +22,6 @@
 
 struct cli_state;
 
-/*
- * Fetch an error out of a NBT packet
- */
-
-NTSTATUS cli_pull_error(char *buf);
-
-/*
- * Compatibility helper for the sync APIs: Fake NTSTATUS in cli->inbuf
- */
-
-void cli_set_error(struct cli_state *cli, NTSTATUS status);
-
 struct tevent_req *cli_smb_req_create(TALLOC_CTX *mem_ctx,
 				      struct event_context *ev,
 				      struct cli_state *cli,
diff --git a/source3/include/client.h b/source3/include/client.h
index 2f8a572..4fb785e 100644
--- a/source3/include/client.h
+++ b/source3/include/client.h
@@ -53,8 +53,6 @@ struct cli_state {
         struct cli_state *prev, *next;
 	int port;
 	int fd;
-	/* Last read or write error. */
-	enum smb_read_errors smb_rw_error;
 	uint16 cnum;
 	uint16 pid;
 	uint16 mid;
@@ -62,6 +60,7 @@ struct cli_state {
 	int protocol;
 	int sec_mode;
 	int rap_error;
+	NTSTATUS raw_status; /* maybe via NT_STATUS_DOS() */
 	int privileges;
 
 	char *desthost;
@@ -95,8 +94,6 @@ struct cli_state {
 	int timeout; /* in milliseconds. */
 	size_t max_xmit;
 	size_t max_mux;
-	char *inbuf;
-	unsigned int bufsize;
 	int initialised;
 	int win95;
 	bool is_samba;
diff --git a/source3/include/proto.h b/source3/include/proto.h
index 715641f..5d15e4e 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -731,10 +731,6 @@ int get_socket_port(int fd);
 const char *client_addr(int fd, char *addr, size_t addrlen);
 const char *client_socket_addr(int fd, char *addr, size_t addr_len);
 int client_socket_port(int fd);
-void set_smb_read_error(enum smb_read_errors *pre,
-			enum smb_read_errors newerr);
-void cond_set_smb_read_error(enum smb_read_errors *pre,
-			enum smb_read_errors newerr);
 bool is_a_socket(int fd);
 void set_socket_options(int fd, const char *options);
 ssize_t read_udp_v4_socket(int fd,
@@ -1139,7 +1135,6 @@ bool netsamlogon_cache_have(const struct dom_sid *user_sid);
 const char *smb_dos_err_name(uint8 e_class, uint16 num);
 const char *get_dos_error_msg(WERROR result);
 const char *smb_dos_err_class(uint8 e_class);
-char *smb_dos_errstr(char *inbuf);
 WERROR map_werror_from_unix(int error);
 
 /* The following definitions come from libsmb/trustdom_cache.c  */
diff --git a/source3/include/smb.h b/source3/include/smb.h
index 0c1a76e..11664b3 100644
--- a/source3/include/smb.h
+++ b/source3/include/smb.h
@@ -71,19 +71,6 @@
 /* how long to wait for secondary SMB packets (milli-seconds) */
 #define SMB_SECONDARY_WAIT (60*1000)
 
-/* this defines the error codes that receive_smb can put in smb_read_error */
-enum smb_read_errors {
-	SMB_READ_OK = 0,
-	SMB_READ_TIMEOUT,
-	SMB_READ_EOF,
-	SMB_READ_ERROR,
-	SMB_WRITE_ERROR, /* This error code can go into the client smb_rw_error. */
-	SMB_READ_BAD_SIG,
-	SMB_NO_MEMORY,
-	SMB_DO_NOT_DO_TDIS, /* cli_close_connection() check for this when smbfs wants to keep tree connected */
-	SMB_READ_BAD_DECRYPT
-};
-
 #define DIR_STRUCT_SIZE 43
 
 /* deny modes */
diff --git a/source3/lib/util_sock.c b/source3/lib/util_sock.c
index 867646b..da84d76 100644
--- a/source3/lib/util_sock.c
+++ b/source3/lib/util_sock.c
@@ -48,26 +48,6 @@ int client_socket_port(int fd)
 #endif
 
 /****************************************************************************
- Accessor functions to make thread-safe code easier later...
-****************************************************************************/


-- 
Samba Shared Repository


More information about the samba-cvs mailing list