From root@santropez.acs.rpi.edu Thu Sep  2 14:54:07 1999
Return-Path: <root@santropez.acs.rpi.edu>
Received: from santropez.acs.rpi.edu (santropez.acs.rpi.edu [128.113.24.162])
	by hub.freebsd.org (Postfix) with ESMTP id EF4691561F
	for <FreeBSD-gnats-submit@freebsd.org>; Thu,  2 Sep 1999 14:54:06 -0700 (PDT)
	(envelope-from root@santropez.acs.rpi.edu)
Received: (from root@localhost)
	by santropez.acs.rpi.edu (8.9.3/8.9.3) id RAA20924;
	Thu, 2 Sep 1999 17:51:21 -0400 (EDT)
	(envelope-from root)
Message-Id: <199909022151.RAA20924@santropez.acs.rpi.edu>
Date: Thu, 2 Sep 1999 17:51:21 -0400 (EDT)
From: gad@santropez.acs.rpi.edu
Sender: root@santropez.acs.rpi.edu
Reply-To: gad@eclipse.acs.rpi.edu
To: FreeBSD-gnats-submit@freebsd.org
Cc: gad@eclipse.acs.rpi.edu
Subject: Fix for 'lpc start queue' problem (see PR bin/9362)
X-Send-Pr-Version: 3.2

>Number:         13549
>Category:       bin
>Synopsis:       [PATCH] Fix for 'lpc start queue' problem (see PR bin/9362)
>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:   Thu Sep  2 15:00:01 PDT 1999
>Closed-Date:    Mon Jan 24 17:42:00 PST 2000
>Last-Modified:  Mon Jan 24 17:42:29 PST 2000
>Originator:     Garance A Drosehn
>Release:        FreeBSD 3.2-RELEASE i386
>Organization:
>Environment:

	Bug is in all releases after 3.1 (and probably earlier), including
	freebsd-current as of a week or so ago.

>Description:

	/usr/sbin/lpc start queuename
	will not in fact start the queue named.  It claims to, but it does
	not really do it.

>How-To-Repeat:

	Use lpc to stop a queue.  Use lpc to start a queue.  Use lpc to
	check the status of a queue, and you will see it isn't actually
	started.

>Fix:
	
	A patch is appended to this message.  (is this how I should submit
	patches?  it seems a bit messy to me).  This patch assumes you are
	in directory /usr/src/usr.sbin/lpr .  It was made against the lpr
	in Freebsd-current (as of a week or so ago), but should also apply
	to lpr in freebsd-stable.

	
*** lpc/cmds.c.orig	Fri Sep 11 14:49:31 1998
--- lpc/cmds.c	Thu Sep  2 17:31:22 1999
***************
*** 587,598 ****
  	printf("%s:\n", pp->printer);
  
  	/*
! 	 * Turn off the owner execute bit of the lock file to enable printing.
  	 */
  	seteuid(euid);
  	if (enable && stat(lf, &stbuf) >= 0) {
! 		mode_t bits = (enable == 2 ? 0
! 			       : (LFM_PRINT_DIS | LFM_QUEUE_DIS));
  		if (chmod(lf, stbuf.st_mode & (LOCK_FILE_MODE | bits)) < 0)
  			printf("\tcannot enable printing\n");
  		else
--- 587,599 ----
  	printf("%s:\n", pp->printer);
  
  	/*
! 	 * For enable==1 ('start'), turn off the LFM_PRINT_DIS bit of the lock
! 	 *   file to re-enable printing.  For enable==2 ('up'), also turn off
! 	 *   the LFM_QUEUE_DIS bit to re-enable queuing.
  	 */
  	seteuid(euid);
  	if (enable && stat(lf, &stbuf) >= 0) {
! 		mode_t bits = (enable == 2 ? 0 : LFM_QUEUE_DIS);
  		if (chmod(lf, stbuf.st_mode & (LOCK_FILE_MODE | bits)) < 0)
  			printf("\tcannot enable printing\n");
  		else


>Release-Note:
>Audit-Trail:
State-Changed-From-To: open->closed 
State-Changed-By: dillon 
State-Changed-When: Mon Jan 24 17:42:00 PST 2000 
State-Changed-Why:  
committed to -3.x and -4.x 
>Unformatted:
