summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2010-04-28 19:42:04 -0400
committerJeremy Allison <jra@samba.org>2010-04-30 11:52:39 -0700
commitdffeb12f3dcb339bc258a7fbc38bbf9ec8dd928e (patch)
treeb9e26e4bd2aad5f419ac42e4979f7c85d884a8e0 /source3/smbd
parentb9a97cf8649141dcd13f09cd1866d60f090d0bbe (diff)
downloadsamba-dffeb12f3dcb339bc258a7fbc38bbf9ec8dd928e.tar.gz
samba-dffeb12f3dcb339bc258a7fbc38bbf9ec8dd928e.tar.bz2
samba-dffeb12f3dcb339bc258a7fbc38bbf9ec8dd928e.zip
smbd: move printfile_offset() within write_file()
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/fileio.c3
-rw-r--r--source3/smbd/reply.c16
2 files changed, 7 insertions, 12 deletions
diff --git a/source3/smbd/fileio.c b/source3/smbd/fileio.c
index da72e5a5f0..92b7d3ed9e 100644
--- a/source3/smbd/fileio.c
+++ b/source3/smbd/fileio.c
@@ -301,6 +301,9 @@ ssize_t write_file(struct smb_request *req,
return -1;
}
+ /* support seeks for print files bigger than 4G */
+ pos = printfile_offset(fsp, pos);
+
return print_job_write(SNUM(fsp->conn), jobid, data, pos, n);
}
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 6469ad8306..571b8a8ab0 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -3832,9 +3832,7 @@ void reply_writebraw(struct smb_request *req)
return;
}
- if (fsp->print_file) {
- startpos = printfile_offset(fsp, startpos);
- } else {
+ if (!fsp->print_file) {
init_strict_lock_struct(fsp, (uint32)req->smbpid,
(uint64_t)startpos, (uint64_t)tcount, WRITE_LOCK,
&lock);
@@ -4036,9 +4034,7 @@ void reply_writeunlock(struct smb_request *req)
startpos = IVAL_TO_SMB_OFF_T(req->vwv+2, 0);
data = (const char *)req->buf + 3;
- if (fsp->print_file) {
- startpos = printfile_offset(fsp, startpos);
- } else if (numtowrite) {
+ if (!fsp->print_file && numtowrite > 0) {
init_strict_lock_struct(fsp, (uint32)req->smbpid,
(uint64_t)startpos, (uint64_t)numtowrite, WRITE_LOCK,
&lock);
@@ -4159,9 +4155,7 @@ void reply_write(struct smb_request *req)
startpos = IVAL_TO_SMB_OFF_T(req->vwv+2, 0);
data = (const char *)req->buf + 3;
- if (fsp->print_file) {
- startpos = printfile_offset(fsp, startpos);
- } else {
+ if (!fsp->print_file) {
init_strict_lock_struct(fsp, (uint32)req->smbpid,
(uint64_t)startpos, (uint64_t)numtowrite, WRITE_LOCK,
&lock);
@@ -4779,9 +4773,7 @@ void reply_writeclose(struct smb_request *req)
mtime = convert_time_t_to_timespec(srv_make_unix_date3(req->vwv+4));
data = (const char *)req->buf + 1;
- if (fsp->print_file) {
- startpos = printfile_offset(fsp, startpos);
- } else if (numtowrite) {
+ if (!fsp->print_file) {
init_strict_lock_struct(fsp, (uint32)req->smbpid,
(uint64_t)startpos, (uint64_t)numtowrite, WRITE_LOCK,
&lock);