summaryrefslogtreecommitdiff
path: root/source3/printing/printfsp.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2002-12-05 03:59:56 +0000
committerJeremy Allison <jra@samba.org>2002-12-05 03:59:56 +0000
commit76e685e628ef2c7bf12d378d992d465525c309e5 (patch)
treeb474ba0845cb25146dee73d98fee293d61fe3477 /source3/printing/printfsp.c
parentc77586e2978f0f8c56e7c893e389571ae6106d8a (diff)
downloadsamba-76e685e628ef2c7bf12d378d992d465525c309e5.tar.gz
samba-76e685e628ef2c7bf12d378d992d465525c309e5.tar.bz2
samba-76e685e628ef2c7bf12d378d992d465525c309e5.zip
The element in fsp->print_job should be a RAP jobid, not a uint32 RPC
jobid. This was causing Win9x client "set name" calls to fail. Still need one cleanup fix to finish. Jeremy. (This used to be commit 15f0bad1fc72ff44cd195d34fd530c25a739f42d)
Diffstat (limited to 'source3/printing/printfsp.c')
-rw-r--r--source3/printing/printfsp.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/source3/printing/printfsp.c b/source3/printing/printfsp.c
index 8a4e7ea073..4ae74e27ec 100644
--- a/source3/printing/printfsp.c
+++ b/source3/printing/printfsp.c
@@ -52,8 +52,15 @@ files_struct *print_fsp_open(connection_struct *conn, char *fname)
return NULL;
}
+ /* Convert to RAP id. */
+ fsp->rap_print_jobid = pjobid_to_rap(SNUM(conn), jobid);
+ if (fsp->rap_print_jobid == 0) {
+ /* We need to delete the entry in the tdb here ! FIXME ! JRA */
+ file_free(fsp);
+ return NULL;
+ }
+
/* setup a full fsp */
- fsp->print_jobid = jobid;
fsp->fd = print_job_fd(SNUM(conn),jobid);
GetTimeOfDay(&fsp->open_time);
fsp->vuid = current_user.vuid;
@@ -88,6 +95,9 @@ print a file - called on closing the file
****************************************************************************/
void print_fsp_end(files_struct *fsp, BOOL normal_close)
{
+ uint32 jobid;
+ int snum;
+
if (fsp->share_mode == FILE_DELETE_ON_CLOSE) {
/*
* Truncate the job. print_job_end will take
@@ -96,9 +106,15 @@ void print_fsp_end(files_struct *fsp, BOOL normal_close)
sys_ftruncate(fsp->fd, 0);
}
- print_job_end(SNUM(fsp->conn),fsp->print_jobid, normal_close);
-
if (fsp->fsp_name) {
string_free(&fsp->fsp_name);
}
+
+ if (!rap_to_pjobid(fsp->rap_print_jobid, &snum, &jobid)) {
+ DEBUG(3,("print_fsp_end: Unable to convert RAP jobid %u to print jobid.\n",
+ (unsigned int)fsp->rap_print_jobid ));
+ return;
+ }
+
+ print_job_end(SNUM(fsp->conn),jobid, normal_close);
}