in reply to https://bugs.launchpad.net/ubuntu/+source/cupsys/+bug/255161

There was once a bug that only surfaced if you were trying to print a document from OpenOffice to a Brother MFC420CN on a Tuesday.

OpenOffice would add a CreationDate header that would contain the string “Tue” when the document was printed on a Tuesday. The cups driver for the printer would rewrite the file before sending on to a postscript check. The postscript check would use libmagic (the unix file command that looks at bytes and patterns in a file to determine their type) to check the file looked like a postscript file. However if the bytes “Tue” appear at byte 4 in a file, libmagic would report the file type as ERLANG JAM, and the computer would refuse to print jam.

You could print any other day, and in any other app. But OpenOffice wouldn’t print to a Brother MFC420CN on a Tuesday.

What a fascinating bug!! My wife has complained that open office will never print on Tuesdays!?! Then she demonstrated it. Sure enough, won’t print on Tuesday. Other applications print. I think this is the same bug. Here is my guess:

Print to a postscript file. Observe the line:

%%CreationDate: (Tue Mar 3 19:47:42 2009)

Change “Tue” to anything else:

%%CreationDate: (XTue Mar 3 19:47:42 2009)

Save the file and it prints. Tools like evince work because they simply omit the “CreationDate” tag to begin with.

Now something odd happens when my cups script (I am using the Brother MFC420CN) copies the file to a temp file. Some of the code is rearranged, not sure how or why, but it uses a command called “file” to identify the file as “PostScript”. This check would work on the original file you printed, but by the time it runs the check on the temp file, it misidentifies. Normally it would return:

PostScript document text conforming at level 3.0

But there is another check that happens before the PostScript check. If it finds “Tue” at the fourth byte of the file, it identifies it as:

Jan 22 14:32:44 MET 1991\011Erlang JAM file – version 4.2

So it’s not a problem w/ openoffice.org, cups, or the brother printer drivers. It is a bug in the file utility, and documented at https://bugs.launchpad.net/ubuntu/+source/file/+bug/248619.

Now, I cannot recommend a fix, but here is my workaround hack:

make a change in file /usr/local/Brother/lpd/filterMFC420CN

change:

cat > $INPUT_TEMP

to:

cat | sed -e ‘s/^%%CreationDate: (Tue/%%CreationDate: (tue/’ > $INPUT_TEMP

This will identify a pattern that matches “%%CreationDate: (Tue” at the start of a line, and change “Tue” to “tue”.

Leave a Reply

Your email address will not be published. Required fields are marked *

The maximum upload file size: 100 MB. You can upload: image, audio, video. Links to YouTube, Facebook, Twitter and other services inserted in the comment text will be automatically embedded. Drop files here