Bug 25544

Summary: [MFC] lprm - fails for remote printers
Product: Base System Reporter: Andre Albsmeier <Andre.Albsmeier>
Component: binAssignee: Garance A Drosehn <gad>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: 4.2-STABLE   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description Andre Albsmeier 2001-03-05 16:40:01 UTC
When using "lprm -" to remove all jobs in a remote print queue, rmjob()
is called from lprm. To indicate that all jobs should be deleted, the
global variable users is set to -1. rmjob() then constructs an iovec 
struct array to talk to the remote lpd. Here iov[3].iov_base is set to
the string "-all". The size of this array is calculated from the variable
users (among others). This is done wrongly which turns out that the
"-all" never makes it to the destination lpd and it complains.

Fix: Don't let a negative value users incorrectly shrink the number
of iov's. Since users won't be uses anymore we can safely set it
to 0.
How-To-Repeat: 
Issue a "lprm -" command for a remote printer.
Comment 1 Garance A Drosehn freebsd_committer freebsd_triage 2001-03-12 00:02:13 UTC
Responsible Changed
From-To: freebsd-bugs->gad

I'll commit a fix for this.
Comment 2 Garance A Drosehn freebsd_committer freebsd_triage 2001-03-13 03:43:18 UTC
State Changed
From-To: open->suspended

I wrote an update to lpr/common_source/rmjob.c which fixes this 
problem, and committed it to -current.  So, the solution to this 
PR is awaiting MFC.
Comment 3 Garance A Drosehn freebsd_committer freebsd_triage 2001-03-13 20:43:10 UTC
State Changed
From-To: suspended->closed

The fix for this 'lprm -' problem has been MFC-ed (in time for 4.3-release)