From tedm@nat-rtr.freebsd-corp-net-guide.com  Fri Nov 26 15:56:28 2004
Return-Path: <tedm@nat-rtr.freebsd-corp-net-guide.com>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 8510216A4CE
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 26 Nov 2004 15:56:28 +0000 (GMT)
Received: from nat-rtr.freebsd-corp-net-guide.com (nat-rtr.freebsd-corp-net-guide.com [65.75.197.130])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 2536E43D60
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 26 Nov 2004 15:56:28 +0000 (GMT)
	(envelope-from tedm@nat-rtr.freebsd-corp-net-guide.com)
Received: from nat-rtr.freebsd-corp-net-guide.com (localhost.freebsd-corp-net-guide.com [127.0.0.1])
	by nat-rtr.freebsd-corp-net-guide.com (8.12.9p2/8.12.9) with ESMTP id iAQFuRq9042549
	for <FreeBSD-gnats-submit@freebsd.org>; Fri, 26 Nov 2004 07:56:27 -0800 (PST)
	(envelope-from tedm@nat-rtr.freebsd-corp-net-guide.com)
Received: (from root@localhost)
	by nat-rtr.freebsd-corp-net-guide.com (8.12.9p2/8.12.9/Submit) id iAQFuQ2A042548;
	Fri, 26 Nov 2004 07:56:26 -0800 (PST)
	(envelope-from tedm)
Message-Id: <200411261556.iAQFuQ2A042548@nat-rtr.freebsd-corp-net-guide.com>
Date: Fri, 26 Nov 2004 07:56:26 -0800 (PST)
From: Ted Mittelstaedt <tedm@toybox.placo.com>
Reply-To: Ted Mittelstaedt <tedm@toybox.placo.com>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: lpd creates lock file with bad permissions under remote LPR
X-Send-Pr-Version: 3.113
X-GNATS-Notify:

>Number:         74418
>Category:       bin
>Synopsis:       lpd creates lock file with bad permissions under remote LPR
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    gad
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Nov 26 16:00:56 GMT 2004
>Closed-Date:    Wed Dec 29 03:13:10 GMT 2004
>Last-Modified:  Wed Dec 29 03:13:10 GMT 2004
>Originator:     Ted Mittelstaedt
>Release:        FreeBSD 4.9-RELEASE i386
>Organization:
>Environment:
System: FreeBSD nat-rtr.freebsd-corp-net-guide.com 4.9-RELEASE FreeBSD 4.9-RELEASE #3: Fri Dec 5 00:52:56 PST 2003 tedm@nat-rtr.freebsd-corp-net-guide.com:/usr/src/sys/compile/MAIL i386


	
>Description:

When a brand new print queue is defined for lpd, (ie: /var/spool/output/new-lp)
it does not contain a .seq, lock or status file.  These files are automatically
created by the lpd daemon when it gets it's first job and are reused by
subsequent jobs.

If the job originates locally, the files are created as follows:

-rw-r----x  1 root  daemon    4 Nov 26 07:39 .seq
-rw-rw-r--  1 root  daemon   30 Nov 26 07:40 lock
-rw-rw-r--  1 root  daemon   24 Nov 26 07:40 status

If the job is a remote job that is sent via the lpr protocol to the system,
the lock file is created as such:

------xr--  1 root  daemon   30 Nov 26 07:41 lock

Because lpd cannot modify the lock file this stops future jobs to the
queue.

If permissions are manually modified to the lock file,  chmod 664, 
then everything works fine.  The problem will not recurr unless the
lock file is manually deleted and recreated by lpd with a lpr job.

The remote system sending to the FreeBSD system in this case was a
Solaris 2.5.1 system, I don't know if that has any bearing on it or
not.

	
>How-To-Repeat:
	
>Fix:

workaround is when creating a new queue, to run a local job through it
first.  Or fix the lock file permissions manually.

	


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->gad 
Responsible-Changed-By: gad 
Responsible-Changed-When: Sun Dec 19 05:02:22 GMT 2004 
Responsible-Changed-Why:  
I have occassionally seen this problem, even though I can not seem to 
reproduce it at the moment.  However, I can add an appropriate call to 
umask() in 6.x-current which will fix this, and I will later MFC that to 
5.3-stable.  I have no plans to MFC it into the 4.x-branch -- certainly 
not into 4.9! 

http://www.freebsd.org/cgi/query-pr.cgi?pr=74418 
State-Changed-From-To: open->closed 
State-Changed-By: gad 
State-Changed-When: Wed Dec 29 03:11:49 GMT 2004 
State-Changed-Why:  
I have committed a patch to both 6.x-CURRENT and 5.3-STABLE which should 
fix this problem. 

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