summaryrefslogtreecommitdiff
path: root/source3/client/clitar.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-04-30 15:26:43 -0700
committerJeremy Allison <jra@samba.org>2009-04-30 15:26:43 -0700
commit8cf78ff55312768d0b454b1d7e0560e04e6296da (patch)
tree0a2180f063e3bb9872c2565c92075dfb5dccac81 /source3/client/clitar.c
parentab4b8c9c0438bc5afca17e3ebf05dde6f98bc0aa (diff)
downloadsamba-8cf78ff55312768d0b454b1d7e0560e04e6296da.tar.gz
samba-8cf78ff55312768d0b454b1d7e0560e04e6296da.tar.bz2
samba-8cf78ff55312768d0b454b1d7e0560e04e6296da.zip
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.
Diffstat (limited to 'source3/client/clitar.c')
-rw-r--r--source3/client/clitar.c11
1 files changed, 5 insertions, 6 deletions
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);
}