From ted@emerald.plymouth.edu  Mon Dec  2 19:55:47 1996
Received: from emerald.plymouth.edu (emerald.plymouth.edu [158.136.75.151])
          by freefall.freebsd.org (8.7.5/8.7.3) with ESMTP id TAA05167
          for <FreeBSD-gnats-submit@freebsd.org>; Mon, 2 Dec 1996 19:55:46 -0800 (PST)
Received: (from ted@localhost) by emerald.plymouth.edu (8.8.2/8.8.2) id WAA06522; Mon, 2 Dec 1996 22:51:49 -0500 (EST)
Message-Id: <199612030351.WAA06522@emerald.plymouth.edu>
Date: Mon, 2 Dec 1996 22:51:49 -0500 (EST)
From: Ted Wisniewski <ted@emerald.plymouth.edu>
Reply-To: ted@emerald.plymouth.edu
To: FreeBSD-gnats-submit@freebsd.org
Subject: /usr/sbin/lpc cannot clean queues
X-Send-Pr-Version: 3.2

>Number:         2139
>Category:       bin
>Synopsis:       /usr/sbin/lpc cannot clean queues
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    freebsd-bugs
>State:          closed
>Quarter:
>Keywords:
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Mon Dec  2 20:00:01 PST 1996
>Closed-Date:    Thu Dec 5 17:47:46 PST 1996
>Last-Modified:  Sat Dec  7 04:00:02 PST 1996
>Originator:     Ted Wisniewski
>Release:        FreeBSD 2.2-ALPHA i386
>Organization:
Plymouth State College
>Environment:

	

>Description:

	/usr/sbin/lpc cannot be used to clean printer queues due to a logic
	error.

>How-To-Repeat:

	Stop a queue (lpc stop queuename)
	send  stuff to it (lpr -Pqueuname filename)
	Clean the queue (lpc clean queuename)

	Stuff is not deleted.

>Fix:
	
	Apply patch below to usr.sbin/lpr/lpc/cmds.c

*** usr.sbin/lpr/lpc/cmds.c.ori	Mon Dec  2 22:45:35 1996
--- usr.sbin/lpr/lpc/cmds.c	Mon Dec  2 22:45:53 1996
***************
*** 327,333 ****
  				i++;
  				n++;
  			}
! 			if (n == 0) {
  				strcpy(lp, cp);
  				unlinkf(line);
  			}
--- 327,333 ----
  				i++;
  				n++;
  			}
! 			if (n != 0) {
  				strcpy(lp, cp);
  				unlinkf(line);
  			}

>Release-Note:
>Audit-Trail:

From: Nate Williams <nate@mt.sri.com>
To: ted@emerald.plymouth.edu
Cc: FreeBSD-gnats-submit@freebsd.org
Subject: Re: bin/2139: /usr/sbin/lpc cannot clean queues
Date: Mon, 2 Dec 1996 22:33:54 -0700 (MST)

 Ted Wisniewski writes:
 > 
 > >Number:         2139
 > >Category:       bin
 > >Synopsis:       /usr/sbin/lpc cannot clean queues
 > 
 > >Description:
 > 
 > 	/usr/sbin/lpc cannot be used to clean printer queues due to a logic
 > 	error.
 > 
 > >How-To-Repeat:
 > 
 > 	Stop a queue (lpc stop queuename)
 > 	send  stuff to it (lpr -Pqueuname filename)
 > 	Clean the queue (lpc clean queuename)
 > 
 > 	Stuff is not deleted.
 > 
 > >Fix:
 
 Apparently, lpc is doing the 'documented' feature.  From the manpage:
 
      clean { all | printer }
              Remove any temporary files, data files, and control files that
              cannot be printed (i.e., do not form a complete printer job) from
              the specified printer queue(s) on the local machine.
 
 So, it won't 'clean' any jobs that are complete.  From my memory, older
 BSD implementations had 'clean' wiping out everything.
 
 In any case, I prefer the latter vs. the current implementation, but I'm
 not going to shove it into our tree w/out further support.
 
 
 Nate
State-Changed-From-To: open->closed 
State-Changed-By: nate 
State-Changed-When: Thu Dec 5 17:47:46 PST 1996 
State-Changed-Why:  
The code does what the man page documents. 


From: J Wunsch <j@uriah.heep.sax.de>
To: nate@mt.sri.com
Cc: ted@emerald.plymouth.edu, freebsd-gnats-submit@freebsd.org
Subject: Re: bin/2139: /usr/sbin/lpc cannot clean queues
Date: Sat, 7 Dec 1996 12:44:24 +0100 (MET)

 As Nate Williams wrote:
 
 >  Apparently, lpc is doing the 'documented' feature.  From the manpage:
 >  
 >       clean { all | printer }
 >               Remove any temporary files, data files, and control files that
 >               cannot be printed (i.e., do not form a complete printer job) from
 >               the specified printer queue(s) on the local machine.
 >  
 >  So, it won't 'clean' any jobs that are complete.  From my memory, older
 >  BSD implementations had 'clean' wiping out everything.
 >  
 >  In any case, I prefer the latter vs. the current implementation, but I'm
 >  not going to shove it into our tree w/out further support.
 
 Perhaps the man page should hint that ``lprm [-Pprinter] -'', executed
 by the superuser, cleans all complete jobs.
 
 -- 
 cheers, J"org
 
 joerg_wunsch@uriah.heep.sax.de -- http://www.sax.de/~joerg/ -- NIC: JW11-RIPE
 Never trust an operating system you don't have sources for. ;-)
>Unformatted:
