Date: Mon, 27 Dec 1999 17:44:53 -0500 (EST) From: SanTropez Root <root@santropez.acs.rpi.edu> To: FreeBSD-gnats-submit@freebsd.org Cc: gad@eclipse.acs.rpi.edu Subject: bin/15728: [PATCH] Fix for 'lpc start queue' problem Message-ID: <199912272244.RAA52217@santropez.acs.rpi.edu>
next in thread | raw e-mail | index | archive | help
>Number: 15728 >Category: bin >Synopsis: in /usr/sbin/lpc, the 'start queue' command does not work >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: Mon Dec 27 14:50:01 PST 1999 >Closed-Date: >Last-Modified: >Originator: SanTropez & >Release: All versions of FreeBSD from 3.1-release to 4.0-current >Organization: Rensselaer Polytechnic Institute >Environment: Bug is for anyone using 'lpc' (part of lpr) in any recent version of FreeBSD, including the latest snapshot of current. >Description: Do the following commands: lpc stop somequeue lpc status somequeue lpc start somequeue lpc status somequeue and you will see that even though the third command CLAIMS that it has enabled printing, it has in fact done nothing. You have to: lpc up somequeue to get printing enabled again. >How-To-Repeat: See the description. >Fix: The following is basically a repeat of the patch included in bin/13549 and reinterated (by someone else) in bin/14975. Note the version in bin/14975 is somewhat "backwards", so it's easy to glance at that & the original code and think that the patch has already been applied. This patch had not been applied as of Dec 20th or so. Index: lpc/cmds.c =================================================================== RCS file: /Users/cvsdepot/lpr-fbsd/lpc/cmds.c,v retrieving revision 1.1.1.1 diff -U5 -r1.1.1.1 cmds.c --- cmds.c 1999/08/28 01:16:51 1.1.1.1 +++ cmds.c 1999/12/27 22:24:21 @@ -585,16 +585,17 @@ lock_file_name(pp, lf, sizeof lf); printf("%s:\n", pp->printer); /* - * Turn off the owner execute bit of the lock file to enable printing. + * 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 queueing. */ seteuid(euid); if (enable && stat(lf, &stbuf) >= 0) { - mode_t bits = (enable == 2 ? 0 - : (LFM_PRINT_DIS | LFM_QUEUE_DIS)); + 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 printf("\tprinting enabled\n"); } =================================================================== >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?199912272244.RAA52217>