smbclient, SMBwrite vs SMBwriteX

Richard Sharpe rsharpe at richardsharpe.com
Tue Oct 28 21:08:36 GMT 2003


On Tue, 28 Oct 2003, Chris Dunlop wrote:

> G'day,
> 
> I've been having trouble with a Konica copier/printer returning
> an error when trying to print, e.g.:
> 
>   $ smbclient //konica/print ' ' -c 'print -' < /tmp/tmp.ps
>   Error writing file: ERRSRV - 22
> 
> Examining the network traffic revealed that the printer returns
> the error when smbclient issues an SMBwriteX, and that the
> MS-Windows printer driver (which works of course) was using
> SMBwrite rather than SMBwriteX.
> 
> The patch below implements a '-w' flag for smbclient which makes
> it use SMBwrite rather than SMBwriteX. (The line numbering may
> be a bit off as I'm using the source from debian's
> samba-3.0.0final-1.)
> 
> With this patch I'm able to print to the Konica.
> 
> There looks there may be a smattering of these types of problems
> with other printers as well:
> 
>   http://www.google.com/search?q=smbclient+%22ERRSRV+22%22
> 
> Possibly these are all using the same buggy (or simply old?)
> underlying SMB implementation in their firmware.

OK, having looked at libsmb/clireadwrite.c, I can now see that it only 
issues WriteX commands and does not try to issue a command that is 
compatible with the protocol variant that the printer has told us it 
supports.

What would be useful would be if you could get us a capture of a session 
with the printer when a small file is being sent.

The support should be in clireadwrite.c and you should not have to add a 
new switch.

Regards
-----
Richard Sharpe, rsharpe[at]ns.aus.com, rsharpe[at]samba.org, 
sharpe[at]ethereal.com, http://www.richardsharpe.com




More information about the samba-technical mailing list