1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

bug 770; correct fix this time; Make sure that we send the SMBjobid for unix jobs back to the client. Allows windows client to remove print jobs submitted from lpr

(This used to be commit 5145611188)
This commit is contained in:
Gerald Carter 2004-01-14 20:56:26 +00:00
parent e7615b5776
commit bb104f31d5
2 changed files with 19 additions and 10 deletions

View File

@ -529,7 +529,8 @@ enum {LPQ_QUEUED=0,LPQ_PAUSED,LPQ_SPOOLING,LPQ_PRINTING,LPQ_ERROR,LPQ_DELETING,
typedef struct _print_queue_struct
{
int job;
int job; /* normally the SMB jobid -- see note in
printing.c:traverse_fn_delete() */
int size;
int page_count;
int status;

View File

@ -671,11 +671,13 @@ static int traverse_fn_delete(TDB_CONTEXT *t, TDB_DATA key, TDB_DATA data, void
DEBUG(10,("traverse_fn_delete: pjob %u deleted due to !smbjob\n",
(unsigned int)jobid ));
pjob_delete(ts->snum, jobid);
} else
ts->total_jobs++;
return 0;
}
/* need to continue the the bottom of the function to
save the correct attributes */
}
/* maybe it hasn't been spooled yet */
if (!pjob.spooled) {
/* if a job is not spooled and the process doesn't
@ -690,11 +692,15 @@ static int traverse_fn_delete(TDB_CONTEXT *t, TDB_DATA key, TDB_DATA data, void
return 0;
}
/* this check only makes sense for jobs submitted from Windows clients */
if ( pjob.smbjob ) {
for (i=0;i<ts->qcount;i++) {
uint32 curr_jobid = print_parse_jobid(ts->queue[i].fs_file);
if (jobid == curr_jobid)
break;
}
}
/* The job isn't in the system queue - we have to assume it has
completed, so delete the database entry. */
@ -720,6 +726,8 @@ static int traverse_fn_delete(TDB_CONTEXT *t, TDB_DATA key, TDB_DATA data, void
}
/* Save the pjob attributes we will store. */
/* FIXME!!! This is the only place where queue->job
represents the SMB jobid --jerry */
ts->queue[i].job = jobid;
ts->queue[i].size = pjob.size;
ts->queue[i].page_count = pjob.page_count;