no document info sent to samba (was re: printing spool mods)

Andy Bakun abakun at reac.com
Wed Jan 13 17:22:48 GMT 1999


I did do packet traces when printing from WinNT4 Workstation SP4 to
Samba-2.0.0beta4 and from WinNT4 Workstation SP4 to WinNT4 Server SP4.  These
are my findings.

As far as I can tell, the client is NOT sending any information about the print
job to Samba.  I chalked this up to an unknown SMB.  It just opens the file,
sends data, and when the file is closed, samba queues it for printing.  If it
used to work, as Andrew says, then I suspect it could be that it wants to use NT
SMBs or something -- admittedly, this is half a wild guess and half an educated
guess.

When printing to WinNT Server, it sends everything you see in the Print Queue
window from Windows, all strings are in UNICODE.

Being able to grab this and use it as a macro substitution would be cool, but it
would be even nicer if samba used the passed filename as the actual filename
when saving the document, and pass it along to lpq, perhaps prefixed with the
username or something.  I have not had much time to work this out (as I don't
need this capability right now), and I'd have to learn to use tcpdump and
company better anyway, and take a close look at ipc.c.

Andy.

Andrew Tridgell wrote:

> > My main remaining problem is this:  is there ANY ANY ANY way for smbd to
> > learn what the filename that was printed was.  E.g - if Windows prints "My
> > long named document.doc" I'd like to be able to grab that in smbd, and use
> > it for another % expansion on this new parameter.
>
> This used to work with Samba. It it isn't working for you then it's
> worth spending some time finding out why.
>
> The way it is supposed to work is that the client opens the file,
> sends some print data then calls an IPC request telling the server the
> full file name and possbly the application doing the printing. This is
> handled in Samba by the api_PrintJobInfo() function 0xb in ipc.c which
> does a rename on the print file.
>
> You need to capture a print from a windows client then look though the
> packets to see whether such a packet was sent. Maybe it's using a
> PrintJobInfo sublevel that Samba doesn't know about. If so then it
> should be easy to add.
>
> I suggest you work this out before adding changes to the rest of the
> code. Be aware that the ipc.c code is quite ugly, but hopefully you
> can work out how it works :)



More information about the samba-technical mailing list