Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Sep 1999 17:51:21 -0400 (EDT)
From:      gad@santropez.acs.rpi.edu
To:        FreeBSD-gnats-submit@freebsd.org
Cc:        gad@eclipse.acs.rpi.edu
Subject:   bin/13549: Fix for 'lpc start queue' problem (see PR bin/9362)
Message-ID:  <199909022151.RAA20924@santropez.acs.rpi.edu>

next in thread | raw e-mail | index | archive | help

>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:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Thu Sep  2 15:00:01 PDT 1999
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-bugs" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199909022151.RAA20924>