From cdr@cosmonet.org Thu Nov 18 07:42:21 1999
Return-Path: <cdr@cosmonet.org>
Received: from planar.cosmonet.org (kubo.j-phone.ne.jp [210.226.164.37])
	by hub.freebsd.org (Postfix) with ESMTP id 6770215436
	for <FreeBSD-gnats-submit@freebsd.org>; Thu, 18 Nov 1999 07:42:17 -0800 (PST)
	(envelope-from cdr@cosmonet.org)
Received: from prunus.r-panda.private (dmax001-pool036.tokyo2.tnis.egg.or.jp [210.129.251.37])
	by planar.cosmonet.org (8.8.8/3.7W) with ESMTP id AAA20763
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 19 Nov 1999 00:38:52 +0900 (JST)
Received: (from cdr@localhost)
	by prunus.r-panda.private (8.8.8/3.7W) id AAA15180;
	Fri, 19 Nov 1999 00:41:16 +0900 (JST)
Message-Id: <199911181538.AAA20763@planar.cosmonet.org>
Date: Fri, 19 Nov 1999 00:41:16 +0900 (JST)
From: Tatsuya Kudoh <cdr@cosmonet.org>
To: FreeBSD-gnats-submit@freebsd.org
Subject: problem of lprm(1)
X-Send-Pr-Version: 3.2

>Number:         14978
>Category:       bin
>Synopsis:       [MFC] lprm(1) does not kill active daemon if hostname is too long
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gad
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Nov 18 07:50:00 PST 1999
>Closed-Date:    Wed Dec 27 09:09:55 PST 2000
>Last-Modified:  Wed Dec 27 09:11:12 PST 2000
>Originator:     Tatsuya Kudoh
>Release:        FreeBSD 2.2.8-RELEASE (up to 4.2-RELEASE) i386
>Organization:
University of Electro-Communications(UEC)
>Environment:
>Description:

When hostname is too long, lprm(1) fails to judge if the job is active or
inactive. As a result, active daemon and filter process executed by daemon
are not terminated.

The cause is that a spool file that has over 39 characters-length filename
causes buffer-overflow.

>How-To-Repeat:

Use long and long hostname.
(I use 35 characters length hostname.)

>Fix:

At easy way,
/usr/src/usr.sbin/lpr/common_source/rmjob.c, line 66:

static char     current[40];            /* active control file name */

Make this array more big. I changed this size to 256.

( In FreeBSD 3.2, this array is at line 72.
  But I don't know if this problem happens in FreeBSD 3.x.)

>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->suspended 
State-Changed-By: gad 
State-Changed-When: Sat Nov 4 19:27:21 PST 2000 
State-Changed-Why:  
I have applied a patch to current which is similar to the one suggested 
here, and which should fix the reported problem.  Patch is awaiting MFC. 


Responsible-Changed-From-To: freebsd-bugs->gad 
Responsible-Changed-By: gad 
Responsible-Changed-When: Sat Nov 4 19:27:21 PST 2000 
Responsible-Changed-Why:  
I'm trying to take care of lpr-related PR's. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=14978 
State-Changed-From-To: suspended->closed 
State-Changed-By: gad 
State-Changed-When: Wed Dec 27 09:09:55 PST 2000 
State-Changed-Why:  
Fix has been applied on both -current (5.x) and -stable (post 4.2) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=14978 
>Unformatted:
