Subject: Fix for lprm
To: None <current-users@NetBSD.ORG>
From: Paul Sijben <sijben@acm.org>
List: current-users
Date: 03/07/1997 14:33:51
The current lprm can not remove jobs from a remote printerserver. This has
been the case for quite some time.

I checked the code and two bugs appear to be in
src/usr.sbin/lpr/common_source/rmjob.c


This is the fix:
351c351
<               (void)snprintf(cp, len - (cp - s) - 2, " %d", requ[i]);
---
>               (void)snprintf(cp, len - (cp - s) , " %d", requ[i]);
362,363c362,363
<       } else {
<               if (write(rem, s, len) != i)
---
>       } else { 
>               if (write(rem, s, len) != len)

The second prevents communication (the result is of the wrong length) and the
first sends only the printer and the user name (not the job that is to be
removed).


Paul Sijben


--
Paul Sijben                 University of Twente, The Netherlands    
tel.: +31-53-4893735        http://www.huygens.org/~sijben/
---------------------------------------------------------------------
              In 1997: niet meer, maar mooier  Loesje