summaryrefslogtreecommitdiff
path: root/source3/smbd/trans2.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2003-08-14 21:16:06 +0000
committerJeremy Allison <jra@samba.org>2003-08-14 21:16:06 +0000
commit4e8b36a5749f4801022617b8fec1fe5d48529fef (patch)
tree8075e7b7c5ca55b0ae5e82fe9fc9de9b551763fb /source3/smbd/trans2.c
parent11777e6a3085a996ab2c5fa3db34d8834401c24e (diff)
downloadsamba-4e8b36a5749f4801022617b8fec1fe5d48529fef.tar.gz
samba-4e8b36a5749f4801022617b8fec1fe5d48529fef.tar.bz2
samba-4e8b36a5749f4801022617b8fec1fe5d48529fef.zip
Fix SMBseek and get/set position information SMBs. Works against
Samba4 tester. You will need a make clean; make all after this ! Jeremy. (This used to be commit 10d90171ed58bee3e5ab6476341059b585034134)
Diffstat (limited to 'source3/smbd/trans2.c')
-rw-r--r--source3/smbd/trans2.c25
1 files changed, 22 insertions, 3 deletions
diff --git a/source3/smbd/trans2.c b/source3/smbd/trans2.c
index f81486b1ad..8adac1930f 100644
--- a/source3/smbd/trans2.c
+++ b/source3/smbd/trans2.c
@@ -1821,9 +1821,7 @@ static int call_trans2qfilepathinfo(connection_struct *conn,
DEBUG(3,("fstat of fnum %d failed (%s)\n", fsp->fnum, strerror(errno)));
return(UNIXERROR(ERRDOS,ERRbadfid));
}
- if((pos = SMB_VFS_LSEEK(fsp,fsp->fd,0,SEEK_CUR)) == -1)
- return(UNIXERROR(ERRDOS,ERRnoaccess));
-
+ pos = fsp->position_information;
delete_pending = fsp->delete_on_close;
}
} else {
@@ -2702,6 +2700,27 @@ static int call_trans2setfilepathinfo(connection_struct *conn,
break;
}
+ case SMB_FILE_POSITION_INFORMATION:
+ {
+ SMB_BIG_UINT position_information;
+
+ if (total_data < 8)
+ return(ERROR_DOS(ERRDOS,ERRinvalidparam));
+
+ position_information = (SMB_BIG_UINT)IVAL(pdata,0);
+#ifdef LARGE_SMB_OFF_T
+ position_information |= (((SMB_BIG_UINT)IVAL(pdata,4)) << 32);
+#else /* LARGE_SMB_OFF_T */
+ if (IVAL(pdata,4) != 0) /* more than 32 bits? */
+ return ERROR_DOS(ERRDOS,ERRunknownlevel);
+#endif /* LARGE_SMB_OFF_T */
+ DEBUG(10,("call_trans2setfilepathinfo: Set file position information for file %s to %.0f\n",
+ fname, (double)position_information ));
+ if (fsp)
+ fsp->position_information = position_information;
+ break;
+ }
+
/*
* CIFS UNIX extensions.
*/