From 0226428eb9d7c6d3a4984d571622f21e9c82e408 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 2 Apr 2011 11:46:30 +0200 Subject: s3: Use cli_writeall instead of cli_write Signed-off-by: Jeremy Allison --- source3/client/clitar.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'source3/client/clitar.c') diff --git a/source3/client/clitar.c b/source3/client/clitar.c index b46115becf3..645899a9ffb 100644 --- a/source3/client/clitar.c +++ b/source3/client/clitar.c @@ -1045,8 +1045,12 @@ static int get_file(file_info2 finfo) dsize = MIN(dsize, rsize); /* Should be only what is left */ DEBUG(5, ("writing %i bytes, bpos = %i ...\n", dsize, bpos)); - if (cli_write(cli, fnum, 0, buffer_p + bpos, pos, dsize) != dsize) { - DEBUG(0, ("Error writing remote file\n")); + status = cli_writeall(cli, fnum, 0, + (uint8_t *)(buffer_p + bpos), pos, + dsize, NULL); + if (!NT_STATUS_IS_OK(status)) { + DEBUG(0, ("Error writing remote file: %s\n", + nt_errstr(status))); return 0; } -- cgit From 7f66ebde2e2975b079f6c135b131d064dab38624 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 29 Apr 2011 11:36:14 +1000 Subject: s3-smb Use FILE_ATTRIBUTE_READONLY intead of aRONLY This means we use just one constant for this file attribute. Andrew Bartlett --- source3/client/clitar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/client/clitar.c') diff --git a/source3/client/clitar.c b/source3/client/clitar.c index 645899a9ffb..c29c084cce5 100644 --- a/source3/client/clitar.c +++ b/source3/client/clitar.c @@ -1405,7 +1405,7 @@ int cmd_setmode(void) direct=0; break; case 'r': - attra[direct]|=aRONLY; + attra[direct]|=FILE_ATTRIBUTE_READONLY; break; case 'h': attra[direct]|=aHIDDEN; -- cgit From 317e19aeb3fbdb21573b6ef1bc8c2af646a7e61e Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 29 Apr 2011 11:43:35 +1000 Subject: s3-smb Use FILE_ATTRIBUTE_HIDDEN intead of aHIDDEN This means we use just one constant for this file attribute. Andrew Bartlett --- source3/client/clitar.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/client/clitar.c') diff --git a/source3/client/clitar.c b/source3/client/clitar.c index c29c084cce5..eba9915e2a5 100644 --- a/source3/client/clitar.c +++ b/source3/client/clitar.c @@ -70,7 +70,7 @@ extern struct cli_state *cli; #define ATTRSET 1 #define ATTRRESET 0 -static uint16 attribute = aDIR | aSYSTEM | aHIDDEN; +static uint16 attribute = aDIR | aSYSTEM | FILE_ATTRIBUTE_HIDDEN; #ifndef CLIENT_TIMEOUT #define CLIENT_TIMEOUT (30*1000) @@ -692,7 +692,7 @@ static NTSTATUS do_atar(const char *rname_in, char *lname, } else if (!tar_system && (finfo.mode & aSYSTEM)) { DEBUG(4, ("skipping %s - system bit is set\n", finfo.name)); shallitime=0; - } else if (!tar_hidden && (finfo.mode & aHIDDEN)) { + } else if (!tar_hidden && (finfo.mode & FILE_ATTRIBUTE_HIDDEN)) { DEBUG(4, ("skipping %s - hidden bit is set\n", finfo.name)); shallitime=0; } else { @@ -1408,7 +1408,7 @@ int cmd_setmode(void) attra[direct]|=FILE_ATTRIBUTE_READONLY; break; case 'h': - attra[direct]|=aHIDDEN; + attra[direct]|=FILE_ATTRIBUTE_HIDDEN; break; case 's': attra[direct]|=aSYSTEM; -- cgit From 0a3c84b554f3862b3e558f62e67ceb8311b248ce Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 29 Apr 2011 13:23:14 +1000 Subject: s3-smb Use FILE_ATTRIBUTE_SYSTEM intead of aSYSTEM This means we use just one constant for this file attribute. Andrew Bartlett --- source3/client/clitar.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/client/clitar.c') diff --git a/source3/client/clitar.c b/source3/client/clitar.c index eba9915e2a5..c389cfa776a 100644 --- a/source3/client/clitar.c +++ b/source3/client/clitar.c @@ -70,7 +70,7 @@ extern struct cli_state *cli; #define ATTRSET 1 #define ATTRRESET 0 -static uint16 attribute = aDIR | aSYSTEM | FILE_ATTRIBUTE_HIDDEN; +static uint16 attribute = aDIR | FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN; #ifndef CLIENT_TIMEOUT #define CLIENT_TIMEOUT (30*1000) @@ -689,7 +689,7 @@ static NTSTATUS do_atar(const char *rname_in, char *lname, if (tar_inc && !(finfo.mode & aARCH)) { DEBUG(4, ("skipping %s - archive bit not set\n", finfo.name)); shallitime=0; - } else if (!tar_system && (finfo.mode & aSYSTEM)) { + } else if (!tar_system && (finfo.mode & FILE_ATTRIBUTE_SYSTEM)) { DEBUG(4, ("skipping %s - system bit is set\n", finfo.name)); shallitime=0; } else if (!tar_hidden && (finfo.mode & FILE_ATTRIBUTE_HIDDEN)) { @@ -1411,7 +1411,7 @@ int cmd_setmode(void) attra[direct]|=FILE_ATTRIBUTE_HIDDEN; break; case 's': - attra[direct]|=aSYSTEM; + attra[direct]|=FILE_ATTRIBUTE_SYSTEM; break; case 'a': attra[direct]|=aARCH; -- cgit From 0eca33bbf620678759bbe39efaa74f33f96efb74 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 29 Apr 2011 11:57:02 +1000 Subject: s3-smb Use FILE_ATTRIBUTE_DIRECTORY intead of aDIR This means we use just one constant for this file attribute. Andrew Bartlett --- source3/client/clitar.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/client/clitar.c') diff --git a/source3/client/clitar.c b/source3/client/clitar.c index c389cfa776a..ebda5af5e34 100644 --- a/source3/client/clitar.c +++ b/source3/client/clitar.c @@ -70,7 +70,7 @@ extern struct cli_state *cli; #define ATTRSET 1 #define ATTRRESET 0 -static uint16 attribute = aDIR | FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN; +static uint16 attribute = FILE_ATTRIBUTE_DIRECTORY | FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_HIDDEN; #ifndef CLIENT_TIMEOUT #define CLIENT_TIMEOUT (30*1000) @@ -294,7 +294,7 @@ of link other than a GNUtar Longlink - ignoring\n")); if ((unoct(hb->dbuf.mode, sizeof(hb->dbuf.mode)) & S_IFDIR) || (*(finfo->name+strlen(finfo->name)-1) == '\\')) { - finfo->mode=aDIR; + finfo->mode=FILE_ATTRIBUTE_DIRECTORY; } else { finfo->mode=0; /* we don't care about mode at the moment, we'll * just make it a regular file */ @@ -852,7 +852,7 @@ static NTSTATUS do_tar(struct cli_state *cli_state, struct file_info *finfo, TALLOC_FREE(exclaim); } - if (finfo->mode & aDIR) { + if (finfo->mode & FILE_ATTRIBUTE_DIRECTORY) { char *saved_curdir = NULL; char *new_cd = NULL; char *mtar_mask = NULL; -- cgit From 0520da2bbe246c45d89bfdec0d399862ecb867ba Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Fri, 29 Apr 2011 12:00:57 +1000 Subject: s3-smb Use FILE_ATTRIBUTE_ARCHIVE intead of aARCH This means we use just one constant for this file attribute. Andrew Bartlett --- source3/client/clitar.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/client/clitar.c') diff --git a/source3/client/clitar.c b/source3/client/clitar.c index ebda5af5e34..289e57801b2 100644 --- a/source3/client/clitar.c +++ b/source3/client/clitar.c @@ -686,7 +686,7 @@ static NTSTATUS do_atar(const char *rname_in, char *lname, DEBUG(3,("file %s attrib 0x%X\n",finfo.name,finfo.mode)); - if (tar_inc && !(finfo.mode & aARCH)) { + if (tar_inc && !(finfo.mode & FILE_ATTRIBUTE_ARCHIVE)) { DEBUG(4, ("skipping %s - archive bit not set\n", finfo.name)); shallitime=0; } else if (!tar_system && (finfo.mode & FILE_ATTRIBUTE_SYSTEM)) { @@ -784,7 +784,7 @@ static NTSTATUS do_atar(const char *rname_in, char *lname, /* if shallitime is true then we didn't skip */ if (tar_reset && !dry_run) - (void) do_setrattr(finfo.name, aARCH, ATTRRESET); + (void) do_setrattr(finfo.name, FILE_ATTRIBUTE_ARCHIVE, ATTRRESET); clock_gettime_mono(&tp_end); this_time = (tp_end.tv_sec - tp_start.tv_sec)*1000 + (tp_end.tv_nsec - tp_start.tv_nsec)/1000000; @@ -1414,7 +1414,7 @@ int cmd_setmode(void) attra[direct]|=FILE_ATTRIBUTE_SYSTEM; break; case 'a': - attra[direct]|=aARCH; + attra[direct]|=FILE_ATTRIBUTE_ARCHIVE; break; default: DEBUG(0, ("setmode \n")); -- cgit From 6f7c4a0539844d448b4ef7e6c4767b48a9f508f4 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 3 May 2011 14:51:25 -0700 Subject: Convert safe_strXX to strlXXX. Clean up off-by-ones. --- source3/client/clitar.c | 48 +++++++++++++++++------------------------------- 1 file changed, 17 insertions(+), 31 deletions(-) (limited to 'source3/client/clitar.c') diff --git a/source3/client/clitar.c b/source3/client/clitar.c index 289e57801b2..61af481e85f 100644 --- a/source3/client/clitar.c +++ b/source3/client/clitar.c @@ -136,23 +136,6 @@ static void unfixtarname(char *tptr, char *fp, int l, bool first); * tar specific utitlities */ -/******************************************************************* -Create a string of size size+1 (for the null) -*******************************************************************/ - -static char *string_create_s(int size) -{ - char *tmp; - - tmp = (char *)SMB_MALLOC(size+1); - - if (tmp == NULL) { - DEBUG(0, ("Out of memory in string_create_s\n")); - } - - return(tmp); -} - /**************************************************************************** Write a tar header to buffer ****************************************************************************/ @@ -197,7 +180,7 @@ static void writetarheader(int f, const char *aname, uint64_t size, time_t mtime /* write out a "standard" tar format header */ hb.dbuf.name[NAMSIZ-1]='\0'; - safe_strcpy(hb.dbuf.mode, amode, sizeof(hb.dbuf.mode)-1); + strlcpy(hb.dbuf.mode, amode, sizeof(hb.dbuf.mode)); oct_it((uint64_t)0, 8, hb.dbuf.uid); oct_it((uint64_t)0, 8, hb.dbuf.gid); oct_it((uint64_t) size, 13, hb.dbuf.size); @@ -263,12 +246,12 @@ static long readtarheader(union hblock *hb, file_info2 *finfo, const char *prefi return -1; } - if ((finfo->name = string_create_s(strlen(prefix) + strlen(hb -> dbuf.name) + 3)) == NULL) { + if ((finfo->name = SMB_MALLOC(strlen(prefix) + strlen(hb -> dbuf.name) + 4)) == NULL) { DEBUG(0, ("Out of space creating file_info2 for %s\n", hb -> dbuf.name)); return(-1); } - safe_strcpy(finfo->name, prefix, strlen(prefix) + strlen(hb -> dbuf.name) + 3); + strlcpy(finfo->name, prefix, strlen(prefix) + strlen(hb -> dbuf.name) + 4); /* use l + 1 to do the null too; do prefix - prefcnt to zap leading slash */ unfixtarname(finfo->name + strlen(prefix), hb->dbuf.name, @@ -521,14 +504,15 @@ static bool ensurepath(const char *fname) /* ensures path exists */ char *partpath, *ffname; + size_t fnamelen = strlen(fname)+1; const char *p=fname; char *basehack; char *saveptr; DEBUG(5, ( "Ensurepath called with: %s\n", fname)); - partpath = string_create_s(strlen(fname)); - ffname = string_create_s(strlen(fname)); + partpath = SMB_MALLOC(fnamelen); + ffname = SMB_MALLOC(fnamelen); if ((partpath == NULL) || (ffname == NULL)){ DEBUG(0, ("Out of memory in ensurepath: %s\n", fname)); @@ -541,7 +525,7 @@ static bool ensurepath(const char *fname) /* fname copied to ffname so can strtok_r */ - safe_strcpy(ffname, fname, strlen(fname)); + strlcpy(ffname, fname, fnamelen); /* do a `basename' on ffname, so don't try and make file name directory */ if ((basehack=strrchr_m(ffname, '\\')) == NULL) { @@ -555,7 +539,7 @@ static bool ensurepath(const char *fname) p=strtok_r(ffname, "\\", &saveptr); while (p) { - safe_strcat(partpath, p, strlen(fname) + 1); + strlcat(partpath, p, fnamelen); if (!NT_STATUS_IS_OK(cli_chkpath(cli, partpath))) { if (!NT_STATUS_IS_OK(cli_mkdir(cli, partpath))) { @@ -568,7 +552,7 @@ static bool ensurepath(const char *fname) } } - safe_strcat(partpath, "\\", strlen(fname) + 1); + strlcat(partpath, "\\", fnamelen); p = strtok_r(NULL, "/\\", &saveptr); } @@ -675,15 +659,13 @@ static NTSTATUS do_atar(const char *rname_in, char *lname, goto cleanup; } - finfo.name = string_create_s(strlen(rname)); + finfo.name = smb_xstrdup(rname); if (finfo.name == NULL) { DEBUG(0, ("Unable to allocate space for finfo.name in do_atar\n")); status = NT_STATUS_NO_MEMORY; goto cleanup; } - safe_strcpy(finfo.name,rname, strlen(rname)); - DEBUG(3,("file %s attrib 0x%X\n",finfo.name,finfo.mode)); if (tar_inc && !(finfo.mode & FILE_ATTRIBUTE_ARCHIVE)) { @@ -934,9 +916,12 @@ static void unfixtarname(char *tptr, char *fp, int l, bool first) fp++; l--; } + if (l <= 0) { + return; + } } - safe_strcpy(tptr, fp, l); + strlcpy(tptr, fp, l); string_replace(tptr, '/', '\\'); } @@ -1170,7 +1155,8 @@ static char *get_longfilename(file_info2 finfo) return(NULL); } - unfixtarname(longname + offset, buffer_p, MIN(TBLOCK, finfo.size), first--); + unfixtarname(longname + offset, buffer_p, + namesize - offset, first--); DEBUG(5, ("UnfixedName: %s, buffer: %s\n", longname, buffer_p)); offset += TBLOCK; @@ -1721,7 +1707,7 @@ static int read_inclusion_file(char *filename) } } - safe_strcpy(inclusion_buffer + inclusion_buffer_sofar, buf, inclusion_buffer_size - inclusion_buffer_sofar); + strlcpy(inclusion_buffer + inclusion_buffer_sofar, buf, inclusion_buffer_size - inclusion_buffer_sofar); inclusion_buffer_sofar += strlen(buf) + 1; clipn++; } -- cgit From df023b8657cab232df88d3656aa5d87676bb7254 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Tue, 3 May 2011 16:42:17 -0700 Subject: Tidy up some missing checks for NULL in strlcpy. --- source3/client/clitar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/client/clitar.c') diff --git a/source3/client/clitar.c b/source3/client/clitar.c index 61af481e85f..80968a64d77 100644 --- a/source3/client/clitar.c +++ b/source3/client/clitar.c @@ -180,7 +180,7 @@ static void writetarheader(int f, const char *aname, uint64_t size, time_t mtime /* write out a "standard" tar format header */ hb.dbuf.name[NAMSIZ-1]='\0'; - strlcpy(hb.dbuf.mode, amode, sizeof(hb.dbuf.mode)); + strlcpy(hb.dbuf.mode, amode ? amode : "", sizeof(hb.dbuf.mode)); oct_it((uint64_t)0, 8, hb.dbuf.uid); oct_it((uint64_t)0, 8, hb.dbuf.gid); oct_it((uint64_t) size, 13, hb.dbuf.size); -- cgit From f85e095dd29638dcb4819f60a7239bc37e8a41ca Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 5 May 2011 14:36:55 -0700 Subject: More simple const fixups. --- source3/client/clitar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/client/clitar.c') diff --git a/source3/client/clitar.c b/source3/client/clitar.c index 80968a64d77..efbe5ff47fa 100644 --- a/source3/client/clitar.c +++ b/source3/client/clitar.c @@ -101,7 +101,7 @@ char tar_type='\0'; static char **cliplist=NULL; static int clipn=0; static bool must_free_cliplist = False; -extern const char *cmd_ptr; +extern char *cmd_ptr; extern bool lowercase; extern uint16 cnum; -- cgit From 9eee6e2fd2fcb1dcf19541d1bdc72eb048b3ba4a Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 5 May 2011 14:56:30 -0700 Subject: More const fixes... getting near the end now. Autobuild-User: Jeremy Allison Autobuild-Date: Fri May 6 00:57:00 CEST 2011 on sn-devel-104 --- source3/client/clitar.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'source3/client/clitar.c') diff --git a/source3/client/clitar.c b/source3/client/clitar.c index efbe5ff47fa..f04071f2dc5 100644 --- a/source3/client/clitar.c +++ b/source3/client/clitar.c @@ -1291,7 +1291,7 @@ int cmd_block(void) char *buf; int block; - if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) { + if (!next_token_talloc(ctx, (const char **)&cmd_ptr,&buf,NULL)) { DEBUG(0, ("blocksize \n")); return 1; } @@ -1316,7 +1316,7 @@ int cmd_tarmode(void) TALLOC_CTX *ctx = talloc_tos(); char *buf; - while (next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) { + while (next_token_talloc(ctx, (const char **)&cmd_ptr,&buf,NULL)) { if (strequal(buf, "full")) tar_inc=False; else if (strequal(buf, "inc")) @@ -1366,7 +1366,7 @@ int cmd_setmode(void) attra[0] = attra[1] = 0; - if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) { + if (!next_token_talloc(ctx, (const char **)&cmd_ptr,&buf,NULL)) { DEBUG(0, ("setmode <[+|-]rsha>\n")); return 1; } @@ -1379,7 +1379,7 @@ int cmd_setmode(void) return 1; } - while (next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) { + while (next_token_talloc(ctx, (const char **)&cmd_ptr,&buf,NULL)) { q=buf; while(*q) { @@ -1481,7 +1481,7 @@ int cmd_tar(void) int argcl = 0; int ret; - if (!next_token_talloc(ctx, &cmd_ptr,&buf,NULL)) { + if (!next_token_talloc(ctx, (const char **)&cmd_ptr,&buf,NULL)) { DEBUG(0,("tar [IXbgan] \n")); return 1; } -- cgit From 27022587e31769718ab53f4d114e03ac2f205f27 Mon Sep 17 00:00:00 2001 From: Günther Deschner Date: Fri, 6 May 2011 11:47:43 +0200 Subject: s3-libsmb: move protos to libsmb/proto.h Guenther --- source3/client/clitar.c | 1 + 1 file changed, 1 insertion(+) (limited to 'source3/client/clitar.c') diff --git a/source3/client/clitar.c b/source3/client/clitar.c index f04071f2dc5..2a78a187c88 100644 --- a/source3/client/clitar.c +++ b/source3/client/clitar.c @@ -38,6 +38,7 @@ #include "system/filesys.h" #include "clitar.h" #include "client/client_proto.h" +#include "libsmb/libsmb.h" static int clipfind(char **aret, int ret, char *tok); -- cgit From 26f7c0771bfba85c0d203996aee1d3ada04e56b6 Mon Sep 17 00:00:00 2001 From: Björn Baumbach Date: Mon, 7 Feb 2011 11:27:02 +0100 Subject: s3-client/clitar.c: Fix cli_errstr() usage (part of bug #7864) Convert cli_errstr() to nt_errstr() Signed-off-by: Stefan Metzmacher --- source3/client/clitar.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) (limited to 'source3/client/clitar.c') diff --git a/source3/client/clitar.c b/source3/client/clitar.c index 2a78a187c88..4dc202e17ea 100644 --- a/source3/client/clitar.c +++ b/source3/client/clitar.c @@ -509,6 +509,7 @@ static bool ensurepath(const char *fname) const char *p=fname; char *basehack; char *saveptr; + NTSTATUS status; DEBUG(5, ( "Ensurepath called with: %s\n", fname)); @@ -542,11 +543,13 @@ static bool ensurepath(const char *fname) while (p) { strlcat(partpath, p, fnamelen); - if (!NT_STATUS_IS_OK(cli_chkpath(cli, partpath))) { - if (!NT_STATUS_IS_OK(cli_mkdir(cli, partpath))) { + status = cli_chkpath(cli, partpath); + if (!NT_STATUS_IS_OK(status)) { + status = cli_mkdir(cli, partpath); + if (!NT_STATUS_IS_OK(status)) { SAFE_FREE(partpath); SAFE_FREE(ffname); - DEBUG(0, ("Error mkdir %s\n", cli_errstr(cli))); + DEBUG(0, ("Error mkdir %s\n", nt_errstr(status))); return False; } else { DEBUG(3, ("mkdirhiering %s\n", partpath)); @@ -581,6 +584,7 @@ static int padit(char *buf, uint64_t bufsize, uint64_t padsize) static void do_setrattr(char *name, uint16 attr, int set) { uint16 oldattr; + NTSTATUS status; if (!NT_STATUS_IS_OK(cli_getatr(cli, name, &oldattr, NULL, NULL))) { return; @@ -592,8 +596,9 @@ static void do_setrattr(char *name, uint16 attr, int set) attr = oldattr & ~attr; } - if (!NT_STATUS_IS_OK(cli_setatr(cli, name, attr, 0))) { - DEBUG(1,("setatr failed: %s\n", cli_errstr(cli))); + status = cli_setatr(cli, name, attr, 0); + if (!NT_STATUS_IS_OK(status)) { + DEBUG(1, ("setatr failed: %s\n", nt_errstr(status))); } } @@ -656,7 +661,7 @@ static NTSTATUS do_atar(const char *rname_in, char *lname, status = cli_open(cli, rname, O_RDONLY, DENY_NONE, &fnum); if (!NT_STATUS_IS_OK(status)) { DEBUG(0,("%s opening remote file %s (%s)\n", - cli_errstr(cli),rname, client_get_cur_dir())); + nt_errstr(status),rname, client_get_cur_dir())); goto cleanup; } @@ -1082,10 +1087,10 @@ static int get_file(file_info2 finfo) } /* Now close the file ... */ - - if (!NT_STATUS_IS_OK(cli_close(cli, fnum))) { + status = cli_close(cli, fnum); + if (!NT_STATUS_IS_OK(status)) { DEBUG(0, ("Error %s closing remote file\n", - cli_errstr(cli))); + nt_errstr(status))); return(False); } -- cgit