Reinhard Kotucha wrote:

>>>>>>"Giuseppe" == Giuseppe Ghibò <[EMAIL PROTECTED]> writes:
>>>>>
>
>     > Furthermore in output pipe we could have different level of
>     > security, so to have both tex users as well as unix sysadmin
>     > happy (the latter mainly because dvips is for instance used in
>     > some printer filter which could run with root privileges):
>
> Are there any systems where printer filters has to run with root
> privileges?  On my sytem it's run as user "lp" which is, of course,
> more secure.
>
> zarniwoop:# su - lp
> lp@zarniwoop:~$ touch /etc/passwd
> touch: /etc/passwd: Permission denied
>
> Furthermore, it doesn't make much sense to run dvips from a printer
> filter if it receives the dvi file from a pipe.  In this case,
> included graphics get lost.
>
> Reinhard
>

For a typical filter see the file dvi-to-ps.fpi of many distributions:
it should have -R -f instead of -f so to avoid special{psfile="`rm -rf ..."}:

#!/bin/sh
#
# convert TeX dvi to Postscript
#
# tricky because dvips needs a seekable input file when acting
# as filter with -f option.
#
# will want to source print options for dvips
[ -f ${SPOOLDIR}/postscript.cfg ] && . ${SPOOLDIR}/postscript.cfg

if [ "$PAPERSIZE" != "" ]; then
	DVIPS_OPTIONS="-t $PAPERSIZE"
if [ -z "$RESOLUTION" ]; then
	DVIPSRES="600x600"
fi

case "$RESOLUTION" in
	120x72)
	DVIPSRES="-X 120 -Y 72 -mode epsdraft"
.
.
.
.

DVIPS_OPTIONS="-P generic $DVIPSRES $DVIPS_OPTIONS"

TMP_FILE=`mktemp /tmp/rhsprintfilter.XXXXXX` || exit 1
cat > $TMP_FILE
dvips -f $DVIPS_OPTIONS < $TMP_FILE

if [ -f "$TMP_FILE" ]; then
      rm -f $TMP_FILE
fi

exit 0


Reply via email to