From owner-freebsd-current@FreeBSD.ORG Sat Sep 26 21:31:31 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 94BFC106566C; Sat, 26 Sep 2009 21:31:31 +0000 (UTC) (envelope-from jilles@stack.nl) Received: from mx1.stack.nl (relay04.stack.nl [IPv6:2001:610:1108:5010::107]) by mx1.freebsd.org (Postfix) with ESMTP id 579AC8FC08; Sat, 26 Sep 2009 21:31:31 +0000 (UTC) Received: from snail.stack.nl (snail.stack.nl [IPv6:2001:610:1108:5010::131]) by mx1.stack.nl (Postfix) with ESMTP id 37D2F1DD625; Sat, 26 Sep 2009 23:31:30 +0200 (CEST) Received: by snail.stack.nl (Postfix, from userid 1677) id 26C50228CD; Sat, 26 Sep 2009 23:31:30 +0200 (CEST) Date: Sat, 26 Sep 2009 23:31:30 +0200 From: Jilles Tjoelker To: Steve Kargl Message-ID: <20090926213130.GA88702@stack.nl> References: <20090926185128.GA53658@troutmask.apl.washington.edu> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="+QahgC5+KEYLbs62" Content-Disposition: inline In-Reply-To: <20090926185128.GA53658@troutmask.apl.washington.edu> User-Agent: Mutt/1.5.18 (2008-05-17) Cc: gavin@freebsd.org, freebsd-current@freebsd.org, brian@freebsd.org Subject: Re: Revision 196634 of sh(1) breaks lp(1) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 26 Sep 2009 21:31:31 -0000 --+QahgC5+KEYLbs62 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Sat, Sep 26, 2009 at 11:51:28AM -0700, Steve Kargl wrote: > troutmask:sgk[208] cat .cshrc | lp -d pug > /usr/bin/lpr: cannot access > troutmask:sgk[209] uname -a > FreeBSD troutmask.apl.washington.edu 9.0-CURRENT FreeBSD 9.0-CURRENT #0 r197195M: > Mon Sep 14 11:11:46 PDT 2009 > kargl@troutmask.apl.washington.edu:/usr/obj/usr/src/sys/SPEW amd64 The problem seems not because of r196634 of sh(1), but because of r194171 of lp(1) (see also PR standards/129554). As of that revision, lp passes an empty filename to lpr if the new -t option is not used. lpr cannot access that file and prints the error message. The attached patch should fix the issue, and should also avoid invalid arguments to lpr if an empty title is given. I use CUPS and not FreeBSD lpr so I just checked that the lpr command looks right in sh -x. -- Jilles Tjoelker --+QahgC5+KEYLbs62 Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="lp-notitle.patch" Index: usr.sbin/lpr/lp/lp.sh =================================================================== --- usr.sbin/lpr/lp/lp.sh (revision 197481) +++ usr.sbin/lpr/lp/lp.sh (working copy) @@ -70,7 +70,7 @@ s) # (silent option) : ;; t) # title for banner page - title="-J${OPTARG}";; + title="${OPTARG}";; *) # (error msg printed by getopts) exit 2;; esac @@ -78,4 +78,4 @@ shift $(($OPTIND - 1)) -exec /usr/bin/lpr "-P${dest}" ${symlink} ${ncopies} ${mailafter} "${title}" "$@" +exec /usr/bin/lpr "-P${dest}" ${symlink} ${ncopies} ${mailafter} ${title:+-J"${title}"} "$@" --+QahgC5+KEYLbs62--