From owner-freebsd-hackers Sun Dec 16 12:56:13 2001 Delivered-To: freebsd-hackers@freebsd.org Received: from science.slc.edu (Science.SLC.Edu [198.83.6.248]) by hub.freebsd.org (Postfix) with ESMTP id 20C5937B417 for ; Sun, 16 Dec 2001 12:56:07 -0800 (PST) Received: (from aschneid@localhost) by science.slc.edu (8.11.0/8.11.0) id fBGKrx934747; Sun, 16 Dec 2001 15:53:59 -0500 (EST) (envelope-from aschneid) Date: Sun, 16 Dec 2001 15:53:58 -0500 From: Anthony Schneider To: Andreas Klemm Cc: apsfilter-hackers@apsfilter.org, freebsd-hackers@FreeBSD.ORG Subject: Re: aps2file doesn't work on FreeBSD Message-ID: <20011216155358.A34707@mail.slc.edu> References: <20011216203550.GA7135@titan.klemm.gtn.com> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-md5; protocol="application/pgp-signature"; boundary="pf9I7BMVVzbSWLtt" Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20011216203550.GA7135@titan.klemm.gtn.com>; from andreas@apsfilter.org on Sun, Dec 16, 2001 at 09:35:50PM +0100 Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG --pf9I7BMVVzbSWLtt Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Well, I'm not sure if you really want to be "creating" /dev/stdout, but the $USER variable after an su is still your login name before the su. anthony:/home/anthony:24% su Password: flack# echo $USER anthony flack#=20 try it with an su -l, or explicitly set $USER to 'root', or even replace -n"$USER" with -n"root". this is all assuming that -n is specifying some sort of user privilege which you intend in this example to be root. if not, please forget this email. :) -Anthony. On Sun, Dec 16, 2001 at 09:35:50PM +0100, Andreas Klemm wrote: > No matter if root or not ... >=20 > root@titan[ttyp2]{139} ~ aps2file -D -P lp /etc/passwd > /usr/local/bin/aps2file: cannot create /dev/stdout: permission denied >=20 > andreas@titan[ttyp2]{1011} ~ aps2file -D -P lp /etc/passwd > /usr/local/bin/aps2file: cannot create /dev/stdout: permission denied >=20 > Cc: to FreeBSD-hackers, any idea why this doesn't work ??? >=20 > Here's the relevant piece of script. >=20 > print2file() > { > : ${INPUT_FILE:=3D/dev/stdin} ${OUTPUT_FILE:=3D/dev/stdout} >=20 > # start with an almost empty environment to emulate running under LPR= ng > env -i CONTROL=3Ddummy SPOOL_DIR=3D${SPOOL:-/var/spool/lpd/$QUEUE} \ > APS2FILE_CONTEXT=3Ddummy "$SHELL" $DEBUG "$APSFILTER" -h"$HOSTNAM= E" \ > -n"$USER" -f$(basename "$INPUT_FILE") $Z_OPTS \ > < "$INPUT_FILE" > "$OUTPUT_FILE" > } >=20 >=20 > Andreas /// >=20 > --=20 > Andreas Klemm > Apsfilter Homepage http://www.apsfilter.org > Support over mailing-lists (only!) http://www.apsfilter.org/support > Mailing-list archive http://www.apsfilter.org/Lists-A= rchives > Songs from our band >> 64Bits << http://www.64bits.de > Inofficial band pages with add-on stuff http://www.apsfilter.org/64bits.= html --pf9I7BMVVzbSWLtt Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.0.6 (FreeBSD) Comment: For info see http://www.gnupg.org iEYEARECAAYFAjwdCeQACgkQ+rDjkNht5F0yXgCfdcWmrvVPPfJ69Mr5ssPzLe3z nkQAniV6IKJtSI3GclzC4J1W20IjAyhh =hp3m -----END PGP SIGNATURE----- --pf9I7BMVVzbSWLtt-- To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message