[Samba] Can not cancel print job

Andrew Watkins andrew at dcs.bbk.ac.uk
Tue Mar 14 14:07:53 GMT 2006

Thanks for the reply and yes it would be great if printing was updated, 
but it is the old story of priority to the code which needs doing.

Anyway, I have fixed my problem by editing the code in the function 
unpack_pjob in printing.c, so that it strips out any @hostname from the
printer queue (pjob->user). It is not how it should be done, but it will
keep me and my users happy.

diff printing/printing.c printing/printing.orig
<       /* Remove any @hostname from print jobs         */
<       /* e.g. andrew at medusa.dcs.bbk.ac.uk => andrew   */
<         sscanf(pjob->user, "%[a-z0-9]*s@", pjob->user);


Andrew Watkins

Gerald (Jerry) Carter wrote:
 > Samba assumes that root can remove the job.  The print queue management
 > design is based on that assumption.  However, if you are spooling
 > to printers on other servers, this doesn't necessarily hold true.
 > Honestly I think the printing layer in smbd should be rewritten to
 > support some of the newer features of systems like cups and lprng.
 > But for now, the current design generally works.
> Andrew Watkins wrote:
>> I think I may have found one problem and it could be a BUG in samba or a
>> problem with the
>> Solaris printing system.
>> If you setup printers on samba host which is not the real print server
>> then you get it problems
>> with the solaris printing system adding on @hostname.
>> For example:
>> Step1)    "\\medusa\lp131"  is allowing printing, but the real  printer
>> server is on another machine.
>> Step 2)    If you send a few jobs to this printer you see this on the
>> unix front:
>>               medusa# lpstat
>>                lp131-530              andrew at medusa.dcs.bbk.ac.uk  
>> 48651   Mar 09 19:45
>>                lp131-526              andrew at medusa.dcs.bbk.ac.uk  
>> 48651   Mar 09 19:45
>> Step 3) But when you try to cancel the jobs samba thinks you are not the
>> owner
>>            looking at printing.c
>>                "is_owner"  will return false, since "pjob->user"  =
>> "andrew at medusa.dcs.bbk.ac.uk"
>>                 so it ends up comparing  "user at host"  with  "user".
>> Any thoughts?

> cheers, jerry
> Version: GnuPG v1.4.2 (GNU/Linux)
> Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
> iD8DBQFEFK3LIR7qMdg1EfYRAq3tAJkB3j2lafijB2xfl4W2pQrp+Rhn1QCePzeY
> N0ixUt2Ti/19aPZXdaxiqGM=
> =tSW0

More information about the samba mailing list