#include "includes.h"
-extern struct current_user current_user;
-
/***************************************************************************
open a print file and setup a fsp for it. This is a wrapper around
print_job_start().
***************************************************************************/
-NTSTATUS print_fsp_open(connection_struct *conn, const char *fname,
- files_struct **result)
+NTSTATUS print_fsp_open(struct smb_request *req, connection_struct *conn,
+ const char *fname,
+ uint16_t current_vuid, files_struct **result)
{
int jobid;
SMB_STRUCT_STAT sbuf;
fstring name;
NTSTATUS status;
- status = file_new(conn, &fsp);
+ status = file_new(req, conn, &fsp);
if(!NT_STATUS_IS_OK(status)) {
return status;
}
fstrcat(name, p);
}
- jobid = print_job_start(¤t_user, SNUM(conn), name, NULL);
+ jobid = print_job_start(conn->server_info, SNUM(conn), name, NULL);
if (jobid == -1) {
status = map_nt_error_from_unix(errno);
- file_free(fsp);
+ file_free(req, fsp);
return status;
}
if (fsp->rap_print_jobid == 0) {
/* We need to delete the entry in the tdb. */
pjob_delete(lp_const_servicename(SNUM(conn)), jobid);
- file_free(fsp);
+ file_free(req, fsp);
return NT_STATUS_ACCESS_DENIED; /* No errno around here */
}
/* setup a full fsp */
fsp->fh->fd = print_job_fd(lp_const_servicename(SNUM(conn)),jobid);
GetTimeOfDay(&fsp->open_time);
- fsp->vuid = current_user.vuid;
+ fsp->vuid = current_vuid;
fsp->fh->pos = -1;
fsp->can_lock = True;
fsp->can_read = False;