summaryrefslogtreecommitdiff
path: root/source3/smbd
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd')
-rw-r--r--source3/smbd/close.c4
-rw-r--r--source3/smbd/fileio.c18
-rw-r--r--source3/smbd/open.c5
-rw-r--r--source3/smbd/reply.c3
-rw-r--r--source3/smbd/smb2_create.c8
5 files changed, 18 insertions, 20 deletions
diff --git a/source3/smbd/close.c b/source3/smbd/close.c
index 24992fd0ec..fb0e20647e 100644
--- a/source3/smbd/close.c
+++ b/source3/smbd/close.c
@@ -20,6 +20,7 @@
*/
#include "includes.h"
+#include "printing.h"
#include "librpc/gen_ndr/messaging.h"
#include "smbd/globals.h"
@@ -604,7 +605,8 @@ static NTSTATUS close_normal_file(struct smb_request *req, files_struct *fsp,
status = ntstatus_keeperror(status, tmp);
if (fsp->print_file) {
- print_fsp_end(fsp, close_type);
+ /* FIXME: return spool errors */
+ print_spool_end(fsp, close_type);
file_free(req, fsp);
return NT_STATUS_OK;
}
diff --git a/source3/smbd/fileio.c b/source3/smbd/fileio.c
index f9fcc1be50..e5a288822e 100644
--- a/source3/smbd/fileio.c
+++ b/source3/smbd/fileio.c
@@ -20,6 +20,7 @@
*/
#include "includes.h"
+#include "printing.h"
#include "smbd/globals.h"
static bool setup_write_cache(files_struct *, SMB_OFF_T);
@@ -291,20 +292,15 @@ ssize_t write_file(struct smb_request *req,
int write_path = -1;
if (fsp->print_file) {
- uint32 jobid;
+ uint32_t t;
+ int ret;
- if (!rap_to_pjobid(fsp->print_file->rap_jobid, NULL, &jobid)) {
- DEBUG(3, ("write_file: "
- "Unable to map RAP jobid %u to jobid.\n",
- (unsigned int)fsp->print_file->rap_jobid));
- errno = EBADF;
+ ret = print_spool_write(fsp, data, n, pos, &t);
+ if (ret) {
+ errno = ret;
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);
+ return t;
}
if (!fsp->can_write) {
diff --git a/source3/smbd/open.c b/source3/smbd/open.c
index f1c32e0585..55ea8960de 100644
--- a/source3/smbd/open.c
+++ b/source3/smbd/open.c
@@ -20,6 +20,7 @@
*/
#include "includes.h"
+#include "printing.h"
#include "smbd/globals.h"
#include "librpc/gen_ndr/messaging.h"
#include "../librpc/gen_ndr/ndr_security.h"
@@ -1526,8 +1527,8 @@ static NTSTATUS open_file_ntcreate(connection_struct *conn,
return NT_STATUS_INTERNAL_ERROR;
}
- return print_fsp_open(req, conn, smb_fname->base_name,
- req->vuid, fsp);
+ return print_spool_open(fsp, smb_fname->base_name,
+ req->vuid);
}
if (!parent_dirname(talloc_tos(), smb_fname->base_name, &parent_dir,
diff --git a/source3/smbd/reply.c b/source3/smbd/reply.c
index 9b2c1e04da..dc7082964f 100644
--- a/source3/smbd/reply.c
+++ b/source3/smbd/reply.c
@@ -25,6 +25,7 @@
*/
#include "includes.h"
+#include "printing.h"
#include "smbd/globals.h"
/****************************************************************************
@@ -5053,7 +5054,7 @@ void reply_printopen(struct smb_request *req)
}
/* Open for exclusive use, write only. */
- status = print_fsp_open(req, conn, NULL, req->vuid, fsp);
+ status = print_spool_open(fsp, NULL, req->vuid);
if (!NT_STATUS_IS_OK(status)) {
file_free(req, fsp);
diff --git a/source3/smbd/smb2_create.c b/source3/smbd/smb2_create.c
index 47a85f8cf3..71e97a4040 100644
--- a/source3/smbd/smb2_create.c
+++ b/source3/smbd/smb2_create.c
@@ -20,6 +20,7 @@
*/
#include "includes.h"
+#include "printing.h"
#include "smbd/globals.h"
#include "../libcli/smb/smb_common.h"
#include "../librpc/gen_ndr/ndr_security.h"
@@ -486,11 +487,8 @@ static struct tevent_req *smbd_smb2_create_send(TALLOC_CTX *mem_ctx,
return tevent_req_post(req, ev);
}
- status = print_fsp_open(smb1req,
- smb1req->conn,
- in_name,
- smb1req->vuid,
- result);
+ status = print_spool_open(result, in_name,
+ smb1req->vuid);
if (!NT_STATUS_IS_OK(status)) {
file_free(smb1req, result);
tevent_req_nterror(req, status);