apsfilter warning: unknown option 'myhost.mydomain.com'

Andreas Klemm andreas at apsfilter.org
Wed Apr 23 09:50:11 PDT 2003


On Tue, Apr 22, 2003 at 10:09:10AM -0400, jef moskot wrote:
> I am having the exact same problem mentioned here:
> http://www.apsfilter.org/Lists-Archives/apsfilter-stable-0211/msg00020.html
> 
> This is a fresh install of the FreeBSD port: apsfilter-7.2.5_1
> The OS is also a fresh install of FreeBSD 4.8-RELEASE.
> Was a solution ever found for this issue?

[ Cc'd to FreeBSD-STABLE mailinglist
  folks, did something change in -STABLE concerning writing of
  the printer control file ? apsfilter now gets the FQDN as 
  print option which causes an apsfilter warning.
  I could workaround this, but question myself if I overlooked
  it the last years or if something changed in -stable ??? ]

Well, its only a warning, you could simply comment out the
code segment.

Strange, something seem to have changed, since I can't remember,
that we noticed these warnings, when we implemented in apsfilter
the code to use lprs -C option (-Z when using lprng) for apsfilter
commands.

Something seem to have changed in the way FreeBSD handles
writing print control files or we simply overlooked them in the
logfile.

Here what happens:

=====================================================================
Case 1: lpr without -C options
	produces apsfilter warning
	apsfilter warning: unknown option 'titan.klemm.apsfilter.org'
=====================================================================

root# cd /var/spool/lpd/lp
root# lpr /etc/passwd
root# cat cf*

Htitan.klemm.apsfilter.org
Proot
Ctitan.klemm.apsfilter.org
 ^^^^^^^^^^^^^^^^^^^^^^^^^ <--- if no -C option, then hostname
				will be inserted automatically !!!!
				this option isn't understood as a
				valid apsfilter command.
fdfA015titan.klemm.apsfilter.org
UdfA015titan.klemm.apsfilter.org
N/etc/passwd

=====================================================================
Case 2: lpr with -C options
	don't produce any warning
=====================================================================

root# cd /var/spool/lpd/lp
root# lpr -C header:border /etc/passwd
root# cat cfA016titan.klemm.apsfilter.org

Htitan.klemm.apsfilter.org
Proot
Cheader:border
 ^^^^^^^^^^^^^ <--- now the hostname vanishes and you only see the
			print options for apsfilter. Therefore no
			warning here.
fdfA016titan.klemm.apsfilter.org
UdfA016titan.klemm.apsfilter.org
N/etc/passwd

====================================
Apsfilter code segment
====================================
#-----------------------------------------------------------------------------
# Parse the command line options (via -C, -Z and -o).
#-----------------------------------------------------------------------------

if [ "$CLASS$Z_OPTS" ]; then
  old_ifs="$IFS"
  IFS=:,
  set -- $CLASS $Z_OPTS
  IFS="$old_ifs"
  unset old_ifs

  for option; do
    case "$option" in
      lo|low)                           # printing quality
        QUALITY=low ;;
    ...
    ...
      *)                                # unknown option
        echo >&2 "apsfilter warning: unknown option '$option'" ;;
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^     !!!!
				the unknown option in this case is
				the hostname if -C isn't used as
				lpr command line option.
    esac
  done
  unset option
fi

Well to be honest ... apsfilter "misuses" the -C
option of the lpr command for own purposes.

Normally used for the burst page only.
And if -C is left out prints the hostname on burstpage.

 -C class
             Job classification to use on the burst page.  For example,
                   lpr -C EECS foo.c
             causes the system name (the name returned by hostname(1)) to be
             replaced on the burst page by EECS, and the file foo.c to be
             printed.

Simple workaround would be to remove the last case in apsfilter
and to silently ifnore unknown apsfilter options.

	Andreas ///

-- 
Andreas Klemm
Apsfilter Homepage                  http://www.apsfilter.org
Support over mailing-lists (only!)  http://www.apsfilter.org/support
Mailing-list archive                http://www.apsfilter.org/Lists-Archives
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-stable/attachments/20030423/aecbd6e0/attachment.bin


More information about the freebsd-stable mailing list