owner of print file is "daemon" with magicfilter (WAS: Filtering output to remote printers)

From: Dan Kirkpatrick <dkirk_at_suhep.phy.syr.edu>
Date: Thu, 23 Apr 1998 13:52:01 -0400

Regarding magicfilter... we're using it now, the problem is, we can no
longer do print accounting or have banner pages since once it goes into
magic filter, it is owned by "daemon" instead of the originating user.

Thanks!

>SUMMARY: Filtering output to remote printers WAS: LPRng on DUNIX?
>
>The original question is below. It turned out that LPRng was overkill for
what
>I wanted to do. I received many helpful hints and I appreciate them all. As
>usual the list came throught with flying colors!! The one that I chose to
>implement uses the "magicfilter" software available from
>http://www.fr.debian.org/Packages/unstable/text/magicfilter.html (probably
>other places too). Since the lpd in Digital UNIX does not directly support
>filtering to remote printers, I have kludged it so that the filter decides
what
>to send on to the printer, and sends it directly to the real queue. The
>downside of this is that it requires either a separate filter for each
printer
>or some clever work with linked files which look at the how the script is
>called. And of course since there is a real queue, people with PCs who
figure
>out the name of the real or send directly to the printer instead of going
>through the spooling system can circumvent the file checking. We may get
>clever with links later, but since we do not have many printers at the
moment,
>we are currently using a separate filter for each printer. Since we primarly
>use a single system to spool to our printers, this works well for us. I will
>append the README file that I made as well as an example of the printcap
>entries for the remote printer and excerpts from the lw5-filter script.
If you
>have individual questions, I will be glad to try to answer them.
>
>
>---README FILE----
>This directory contains filters which check output to remote printers to
>be sure that bizarre binary file types are not sent to the printer,
>instead email messages are sent to the user with an error message.
>Because filtering to remote printers is not actually supported, a dummy
>queue is set up which checks the file to see that it is not a "bad"
>file, then sends it on the the real queue. The filter is actually a
>config file to be executed by the program "magicfilter" which screens
>files on the basis of the "magic" number of the file. New filetypes can
>be added to the config file if the "magic" number is known.
>
>
>To use the magicfilter with remote printers which accept text, postscript and
>PCL:
>
>Copy Proto-filter to <printerName>-filter
>Edit <printerName>-filter to replace all instances of the string
>PRINTERNAME to the real name of the printer. Make sure that this file
>is executable.
>
>Edit /etc/printcap as follows:
>
>Append -real to the end of the printer queue name.
>
>Make a new queue entry with the old printer queue name (what it was
>before you appended -real to the name) so that you have the following:
>
>
>lw5-real|LaserWriter in 333:\
> :lp=:mx#0:rm=lw5:rp=raw:sd=/var/spool/lw5-real
>lw5-text|lw5text|lw5 magicfilter:\
> :ct=dev:\
> :lp=/dev/null:mx#0:\
> :sd=/var/spool/lw5-text:\
> :if=/usr/local/etc/filters/lw5-filter:\
> :dev=/dev/null:
>lw5| lw5 with magicfilter:\
> :ct=dev:\
> :lp=/dev/null:mx#0:\
> :sd=/var/spool/lw5:\
> :if=/usr/local/etc/filters/lw5-filter:\
> :dev=/dev/null:

>
>Here are relevant excerpts from the lw5-filter file, the file is much larger:
>
>#! /usr/local/lib/magicfilter/bin/magicfilter
>#
>#
>
># PostScript
>0 %! pipe cat | lpr -Plw5-real
>0 \004%! pipe cat | lpr -Plw5-real
>
># compress'd data
>0 \037\235 reject Cannot print compress'd data
>0 \377\037 reject Cannot print compacted data
>
>596 \130\337\377\377 reject Cannot print Ultrix core file
>
># Default entry -- for normal (text) files. MUST BE LAST.
>default pipe /usr/local/bin/enscript -B -p- |lpr -Plw5-real
>
>--end excerpts from lw5-filter---
>
>
>On Mar 11, 2:20pm, Sheila Hollenbaugh wrote:
>> Subject: LPRng on DUNIX?
>> This question appears in the archives, but as far as I can find, there
was no
>> answer given. Has anyone successfully compiled LPRng on Digital UNIX?
I am
>> particularly interested in filtering output to network printers, which does
>not
>> appear to be supported by the lpd which comes with DUNIX. If you are
>> successfully using this or other software which allows filtering to remote
>> printers, please let me know.
>>
>> Thanks!!
>>
>> --Sheila
>>
>> --
>> Sheila Hollenbaugh Sr. Computer Systems Engineer (O-)
>> Wright State University College of Engineering & Computer Science
>> Dayton, OH 45435 http://www.cs.wright.edu/people/staff/shollen/
>> shollen_at_cs.wright.edu Voice: (937) 775-5077 FAX: (937) 775-5009
>>-- End of excerpt from Sheila Hollenbaugh

====================================
Dan Kirkpatrick dkirk_at_physics.syr.edu
Systems Administrator          
Department of Physics
Syracuse University, Syracuse, NY

http://www.phy.syr.edu Fax: (315) 443-9103
====================================
Received on Thu Apr 23 1998 - 19:56:56 NZST

This archive was generated by hypermail 2.4.0 : Wed Nov 08 2023 - 11:53:37 NZDT