From 8cf78ff55312768d0b454b1d7e0560e04e6296da Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 30 Apr 2009 15:26:43 -0700 Subject: Get medieval on our ass about SMB1 file descriptors being 16 bits, not an int. Convert all uses of cli_open(), cli_nt_createXXX to NTSTATUS versions. This is smaller than it looks, it just fixes a lot of old code. Next up, ensure all cli_XX functions return NTSTATUS. Jeremy. --- source3/client/clitar.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'source3/client/clitar.c') diff --git a/source3/client/clitar.c b/source3/client/clitar.c index fd375769e4..3cc1a25dbb 100644 --- a/source3/client/clitar.c +++ b/source3/client/clitar.c @@ -613,7 +613,7 @@ append one remote file to the tar file static void do_atar(const char *rname_in,char *lname,file_info *finfo1) { - int fnum = -1; + uint16_t fnum = (uint16_t)-1; uint64_t nread=0; char ftype; file_info2 finfo; @@ -660,9 +660,7 @@ static void do_atar(const char *rname_in,char *lname,file_info *finfo1) goto cleanup; } - fnum = cli_open(cli, rname, O_RDONLY, DENY_NONE); - - if (fnum == -1) { + if (!NT_STATUS_IS_OK(cli_open(cli, rname, O_RDONLY, DENY_NONE, &fnum))) { DEBUG(0,("%s opening remote file %s (%s)\n", cli_errstr(cli),rname, client_get_cur_dir())); goto cleanup; @@ -998,13 +996,14 @@ static int skip_file(int skipsize) static int get_file(file_info2 finfo) { - int fnum = -1, pos = 0, dsize = 0, bpos = 0; + uint16_t fnum; + int pos = 0, dsize = 0, bpos = 0; uint64_t rsize = 0; DEBUG(5, ("get_file: file: %s, size %.0f\n", finfo.name, (double)finfo.size)); if (ensurepath(finfo.name) && - (fnum=cli_open(cli, finfo.name, O_RDWR|O_CREAT|O_TRUNC, DENY_NONE)) == -1) { + (!NT_STATUS_IS_OK(cli_open(cli, finfo.name, O_RDWR|O_CREAT|O_TRUNC, DENY_NONE,&fnum)))) { DEBUG(0, ("abandoning restore\n")); return(False); } -- cgit