diff options
author | Jeremy Allison <jra@samba.org> | 1998-09-11 21:42:18 +0000 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 1998-09-11 21:42:18 +0000 |
commit | 9b20e5bac2a7b83f8e3dfdf3a274a1ce12dbd92c (patch) | |
tree | 645fd7c7d70c04e88018e1c1233dc8df52989562 /source3/smbd | |
parent | 27d0bef143fbc4d7547c022046c094bbdbd0bfc1 (diff) | |
download | samba-9b20e5bac2a7b83f8e3dfdf3a274a1ce12dbd92c.tar.gz samba-9b20e5bac2a7b83f8e3dfdf3a274a1ce12dbd92c.tar.bz2 samba-9b20e5bac2a7b83f8e3dfdf3a274a1ce12dbd92c.zip |
Ok so with this bugfix 64 bit file access actually seems to work :-).
Problems were just dumb bugs like (defining sys_lseek to return 'int' DOH !).
Jeremy.
(This used to be commit 54dd51176fbab18af0b21bdee71b53f8f86573a8)
Diffstat (limited to 'source3/smbd')
-rw-r--r-- | source3/smbd/fileio.c | 8 | ||||
-rw-r--r-- | source3/smbd/nttrans.c | 22 | ||||
-rw-r--r-- | source3/smbd/reply.c | 6 |
3 files changed, 27 insertions, 9 deletions
diff --git a/source3/smbd/fileio.c b/source3/smbd/fileio.c index f0bb5e45ac..d40c159798 100644 --- a/source3/smbd/fileio.c +++ b/source3/smbd/fileio.c @@ -36,6 +36,10 @@ SMB_OFF_T seek_file(files_struct *fsp,SMB_OFF_T pos) offset = 3; fsp->pos = (sys_lseek(fsp->fd_ptr->fd,pos+offset,SEEK_SET) - offset); + + DEBUG(10,("seek_file: requested pos = %.0f, new pos = %.0f\n", + (double)(pos+offset), (double)fsp->pos )); + return(fsp->pos); } @@ -62,7 +66,7 @@ ssize_t read_file(files_struct *fsp,char *data,SMB_OFF_T pos,size_t n) SMB_OFF_T num = (fsp->mmap_size > pos) ? (fsp->mmap_size - pos) : -1; num = MIN(n,num); #ifdef LARGE_SMB_OFF_T - if ((num > 0) && (num < (1<<(sizeof(size_t)*8))) { + if ((num > 0) && (num < (1LL<<(sizeof(size_t)*8)))) { #else /* LARGE_SMB_OFF_T */ if (num > 0) { #endif /* LARGE_SMB_OFF_T */ @@ -76,7 +80,7 @@ ssize_t read_file(files_struct *fsp,char *data,SMB_OFF_T pos,size_t n) #endif if (seek_file(fsp,pos) != pos) { - DEBUG(3,("Failed to seek to %.0f\n",(double)pos)); + DEBUG(3,("read_file: Failed to seek to %.0f\n",(double)pos)); return(ret); } diff --git a/source3/smbd/nttrans.c b/source3/smbd/nttrans.c index 81b3ff26d5..5052e6d52a 100644 --- a/source3/smbd/nttrans.c +++ b/source3/smbd/nttrans.c @@ -661,9 +661,16 @@ int reply_ntcreate_and_X(connection_struct *conn, put_long_date(p,sbuf.st_mtime); /* change time */ p += 8; SIVAL(p,0,fmode); /* File Attributes. */ - p += 12; + p += 4; +#ifdef LARGE_SMB_OFF_T + SIVAL(p,0, file_len); + SIVAL(p,4, file_len >> 32); +#else /* LARGE_SMB_OFF_T */ + SIVAL(p,0,file_len); +#endif /* LARGE_SMB_OFF_T */ + p += 8; #ifdef LARGE_SMB_OFF_T - SIVAL(p,0, file_len & 0xFFFFFFFF); + SIVAL(p,0, file_len); SIVAL(p,4, file_len >> 32); #else /* LARGE_SMB_OFF_T */ SIVAL(p,0,file_len); @@ -889,9 +896,16 @@ static int call_nt_transact_create(connection_struct *conn, put_long_date(p,sbuf.st_mtime); /* change time */ p += 8; SIVAL(p,0,fmode); /* File Attributes. */ - p += 12; + p += 4; +#ifdef LARGE_SMB_OFF_T + SIVAL(p,0, file_len); + SIVAL(p,4, (file_len >> 32)); +#else /* LARGE_SMB_OFF_T */ + SIVAL(p,0,file_len); +#endif /* LARGE_SMB_OFF_T */ + p += 8; #ifdef LARGE_SMB_OFF_T - SIVAL(p,0, file_len & 0xFFFFFFFF); + SIVAL(p,0, file_len); SIVAL(p,4, (file_len >> 32)); #else /* LARGE_SMB_OFF_T */ SIVAL(p,0,file_len); diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c index e956ab6cd9..38c39efad6 100644 --- a/source3/smbd/reply.c +++ b/source3/smbd/reply.c @@ -1792,7 +1792,7 @@ int reply_readbraw(connection_struct *conn, char *inbuf, char *outbuf, int dum_s startpos = IVAL(inbuf,smb_vwv1); #ifdef LARGE_SMB_OFF_T - if(SVAL(inbuf,smb_wct) == 10) { + if(CVAL(inbuf,smb_wct) == 10) { /* * This is a large offset (64 bit) read. */ @@ -2007,7 +2007,7 @@ int reply_read_and_X(connection_struct *conn, char *inbuf,char *outbuf,int lengt data = smb_buf(outbuf); #ifdef LARGE_SMB_OFF_T - if(SVAL(inbuf,smb_wct) == 12) { + if(CVAL(inbuf,smb_wct) == 12) { /* * This is a large offset (64 bit) read. */ @@ -2265,7 +2265,7 @@ int reply_write_and_X(connection_struct *conn, char *inbuf,char *outbuf,int leng data = smb_base(inbuf) + smb_doff; #ifdef LLARGE_SMB_OFF_T - if(SVAL(inbuf,smb_wct) == 14) { + if(CVAL(inbuf,smb_wct) == 14) { /* * This is a large offset (64 bit) write. */ |