Bug 92035 - magicfilter-t misidentifies PCL file as text
magicfilter-t misidentifies PCL file as text
Product: Red Hat Linux
Classification: Retired
Component: redhat-config-printer (Show other bugs)
All Linux
medium Severity medium
: ---
: ---
Assigned To: Tim Waugh
Depends On:
  Show dependency treegraph
Reported: 2003-06-01 05:53 EDT by Matthew Melvin
Modified: 2007-04-18 12:54 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2004-12-08 10:13:52 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description Matthew Melvin 2003-06-01 05:53:15 EDT
Description of problem:

I'm using HP DeskJet 950c connected locally to a redhat server shared to the 
local network via samba.  The local host can print fine but print jobs from 
remote hosts come out corrupted.  Sometimes raw PCL data is printed, sometimes 
the first few lines are printed okay but then the printer errors.  

The files being delivered to the redhat server are already in PCL format ready 
to be sent to the printer but they are being re-interpreted as if they were 
text.  If the files are cat'ed straight to /dev/lp0 the printed output is what 
is exected, but if passed through lpd and magicfilter they are corrupted.  

This happens with the files generated by both my win2k clients and my redhat 
linux client.  

Changing the text driver in mf.cfg from...

define(TEXTfilter, text "" \r\n\14 )dnl

... to ...

define(TEXTfilter, `cat')dnl

... causes remote print jobs to be printed as expected.

Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.  Use redhat-config-printer to setup printer queue 'lp' for a hp dj 950c 
using the hpijs driver.
2.  Share printer via samba.
3.  Print to shared printer from either windows or linux.
Actual results:

Correct output when printing from the local host.
Corrupted output when printing from remote clients.

Expected results:

Correct output when printing from the local host.
Correct output when printing from remote clients.

Additional info:

Capturing the various temp files (the print job as delivered 
to /var/spool/samba, and the printconf file created in /tmp) and running 
magicfilter-t in debug mode we see the files are being treated as text...

[root@localhost]# cat /tmp/fromlinux.pcl | magicfilter-t --
debug /tmp/printconf  > /dev/null
0: /text/ text [ 

[root@localhost]# cat /tmp/fromwindows.pcl | magicfilter-t --
debug /tmp/printconf  > /dev/null
0: /text/ text [ 


.... this seems to be due to leading nulls on the pcl files...

[root@localhost]# od -c fromlinux.pcl | head -4
0000000  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0
0025360  \0  \0  \0  \0  \0  \0  \0  \0 033   E 033   %   -   1   2   3
0025400   4   5   X   @   P   J   L       E   N   T   E   R       L   A
[root@localhost]# od -c fromwindows.pcl | head -4
0000000  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0  \0
0022600 033   E 033   %   -   1   2   3   4   5   X   @   P   J   L    
0022620   J   O   B       N   A   M   E       =       "   0   1   6   e

... confusing magic filter.  Run these files through magic filter with the 
nulls removed  and they are correclty identified...

[root@localhost ]# dd if=/tmp/fromlinux.pcl bs=1 skip=11000 | magicfilter-t --
debug /tmp/printconf  > /dev/null
0: /pcl/ cat 
1379818+0 records in
1379818+0 records out
[root@localhost ]# dd if=/tmp/fromwindows.pcl bs=1 skip=9600 | magicfilter-t --
debug /tmp/printconf  > /dev/null
0: /pcl/ cat 
429003+0 records in
429003+0 records out
[root@localhost ]# 

A bit of trial and error with dd told me the linux file has 11000 nulls and the 
windows file has 9600 nulls although I don't know if those are constants or 
just artifacts of these particular printjobs. The PCL fliles I'm using for my 
debugging are the test pages from their respective systmes.
Comment 1 Tim Waugh 2003-06-26 04:45:41 EDT
If you are sending raw data to the queue, you need to set it up as a raw queue.
 If you are using the hpijs driver, it is not a raw queue.
Comment 2 Matthew Melvin 2003-06-26 22:53:24 EDT
This would suggest I have two options.  I can either set the printer as a 'raw'
queue, in which case the remote hosts can print but the local host can not.  Or
I can setup the printer as a hpisj queue, in which case the local host can
print, but the remote hosts can not.  Isn't this what the ...

define(PCLfilter, `cat')dnl

.. directive is meant to addresss - "this file has already be prepared for the
printer - just send it without further modification'.  Except magicfilter isn't
making use of this directive becuase it thinks the file is text.

How can I configure the print queue so taht both local and remote printing
function at the same time?
Comment 3 Tim Waugh 2004-12-08 10:13:52 EST
magicfilter is no longer used.

Note You need to log in before you can comment on or make changes to this bug.