void pcap_cache_reload(void);
bool pcap_printername_ok(const char *printername);
-/* The following definitions come from printing/printfsp.c */
-
-NTSTATUS print_fsp_open(struct smb_request *req, connection_struct *conn,
- const char *fname,
- uint16_t current_vuid, files_struct *fsp);
-void print_fsp_end(files_struct *fsp, enum file_close_type close_type);
-SMB_OFF_T printfile_offset(files_struct *fsp, SMB_OFF_T offset);
-
/* The following definitions come from printing/printing.c */
uint16 pjobid_to_rap(const char* sharename, uint32 jobid);
DEBUG(10, ("onefs_open_file_ntcreate: printer open fname=%s\n",
smb_fname_str_dbg(smb_fname)));
- 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,
return status;
}
-int print_spool_write(files_struct *fsp, const char *data, uint32_t size,
+int print_spool_write(files_struct *fsp,
+ const char *data, uint32_t size,
SMB_OFF_T offset, uint32_t *written)
{
SMB_STRUCT_STAT st;
*/
#include "includes.h"
+#include "printing.h"
#include "librpc/gen_ndr/messaging.h"
#include "smbd/globals.h"
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;
}
*/
#include "includes.h"
+#include "printing.h"
#include "smbd/globals.h"
static bool setup_write_cache(files_struct *, SMB_OFF_T);
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) {
*/
#include "includes.h"
+#include "printing.h"
#include "smbd/globals.h"
#include "librpc/gen_ndr/messaging.h"
#include "../librpc/gen_ndr/ndr_security.h"
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,
*/
#include "includes.h"
+#include "printing.h"
#include "smbd/globals.h"
/****************************************************************************
}
/* 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);
*/
#include "includes.h"
+#include "printing.h"
#include "smbd/globals.h"
#include "../libcli/smb/smb_common.h"
#include "../librpc/gen_ndr/ndr_security.h"
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);