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#
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 ...
>
> root@titan[ttyp2]{139} ~ aps2file -D -P lp /etc/passwd
> /usr/local/bin/aps2file: cannot create /dev/stdout: permission denied
>
> andreas@titan[ttyp2]{1011} ~ aps2file -D -P lp /etc/passwd
> /usr/local/bin/aps2file: cannot create /dev/stdout: permission denied
>
> Cc: to FreeBSD-hackers, any idea why this doesn't work ???
>
> Here's the relevant piece of script.
>
> print2file()
> {
> : ${INPUT_FILE:=/dev/stdin} ${OUTPUT_FILE:=/dev/stdout}
>
> # start with an almost empty environment to emulate running under LPRng
> env -i CONTROL=dummy SPOOL_DIR=${SPOOL:-/var/spool/lpd/$QUEUE} \
> APS2FILE_CONTEXT=dummy "$SHELL" $DEBUG "$APSFILTER" -h"$HOSTNAME" \
> -n"$USER" -f$(basename "$INPUT_FILE") $Z_OPTS \
> < "$INPUT_FILE" > "$OUTPUT_FILE"
> }
>
>
> Andreas ///
>
> --
> 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-Archives
> Songs from our band >> 64Bits << http://www.64bits.de
> Inofficial band pages with add-on stuff http://www.apsfilter.org/64bits.html
msg30189/pgp00000.pgp
Description: PGP signature

