From owner-freebsd-questions Wed Jun 21 9:35:19 2000 Delivered-To: freebsd-questions@freebsd.org Received: from oberon.dnai.com (oberon.dnai.com [207.181.194.97]) by hub.freebsd.org (Postfix) with ESMTP id 9BD0637BBB3 for ; Wed, 21 Jun 2000 09:35:16 -0700 (PDT) (envelope-from kmarx@bigshed.com) Received: from azoth.dnai.com (azoth.dnai.com [207.181.194.94]) by oberon.dnai.com (8.9.3/8.9.3) with ESMTP id JAA84756 for ; Wed, 21 Jun 2000 09:35:16 -0700 (PDT) Received: from bigshed.com (dnai-216-15-97-193.cust.dnai.com [216.15.97.193]) by azoth.dnai.com (8.9.3/8.9.3) with ESMTP id JAA31762 for ; Wed, 21 Jun 2000 09:35:15 -0700 (PDT) Message-ID: <3950F065.74366D5F@bigshed.com> Date: Wed, 21 Jun 2000 09:42:13 -0700 From: Ken Marx X-Mailer: Mozilla 4.5 [en] (X11; I; FreeBSD 2.2.8-RELEASE i386) X-Accept-Language: en MIME-Version: 1.0 To: freebsd-questions@FreeBSD.ORG Subject: lpr -s -r (again) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Hi, More on this lpr -r -s thing... I'd like to suggest a change to the lpd code, and get some feedback. Again, there's this thing with lpr where specifying both -s and -r together results in the '-r' not being honored. That is, the file is not removed after printing. I looked more at the lpr and lpd code and found that the behavior is due to lpd refusing to unlink the file if it's pathname begins with '/'. This happens to be the case when -s is used, since lpr has to tell lpd the full pathname to delete. (Note: when -s is *not* used, lpr does the delete of the file, not lpd.) I'm not sure why lpd has this 'safety' code in there. I can certainly make the -r -s combination work correctly by making the following change in lpd's printjob.c: --- printjob.c Wed Jun 21 08:55:52 2000 *************** *** 499,506 **** continue; case 'U': - if (strchr(line+1, '/')) - continue; (void) unlink(line+1); } /* --- 499,504 ---- That is, delete the check for '/', and allow the unlink in all cases. Is there some reason not to make this change permanent? Note that lpr has code that will protect files from being deleted if permissions would disallow it. I tested this for local printing, but not remote. Any thoughts appreciated. Thanks, k. -- Ken Marx, kmarx@bigshed.com Revise the expectations surrounding the problem space!! - http://cgi.bigshed.com/~kmarx/cgi-bin/speak.cgi To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message