[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: print, gs and svgalib.



On Mon, 15 Sep 1997, joost witteveen wrote:
> > I'm using magicfilter to print, which in turns uses gs-aladdin, which uses
> > svgalib.
> > The problem is svgalib keeps writing things like 'Using VGA driver' or
> > other messages. Those get back to lpr and end up printed at the beginning
> > of whatever it was I wanted to print.
> > everything I want to print ?
> 
> If I remember correctly, when gs is run as non-root, it doesn't
> print that svgalib message.

Well, it did :) Perhaps lpr automatically runs the filter as root, but
since lpr is not suid root, I don't see how it would.

> > (At the moment, I'm using cat file.ps |
> > filter > /dev/lp1, which is somewhat more annoying than lpr file.ps).
> 
> When you do "lpr file.ps", what difference is there with 
> "cat fil.ps|filter>/dev/lp1"? The only difference I can see, is that
> your lpr is setup to start "filter" as root. That shouldn't be done
> (gs can be used to read/write arbitrary[1] files on your system, so
> if lpr starts gs as root, any user on your system can erase /etc/passwd).

Well, let me explain the different steps I used.
First, I used a simple lpr and nothing happened except gs coredumped in my
spool directory. I think it was a problem with the rights of the spool
directory (as setup by magicfilterconfig). I changed them to rwsrwsr-x,
owner root, group lp, which is what the defaut /var/spool/lpd/lp has.
The coredumps disappeared, but nothing was printed. If I used the
"cat file.ps | filter > /dev/lp1" (after authorizing anyone to write to
/dev/lp1), it worked but I did have the "Using VGA driver" message.
I added a grep -v "Using VGA driver" in the filter so that this method
would work OK. Still, the lpr problem was annoying.
I tried to chmod +s /usr/bin/gs.real (the filter uses -dSAFER and I'm the
only user of the machine, so I'm not overly concerned with security). Now,
it prints when I do a "lpr file.ps". However, I get a new message:
"You must be the owner of the current console to use svgalib. Not running
in a graphics capable console, and unable to find one."
Sure, I could add another grep -v in my filter, or perhaps redirect stderr
to /dev/null in the output of gs (I do hope svgalib prints its messages to
stderr and not stdout), yet I can't help but think there is a simpler (and
better) solution. I don't know how magicfilter manages redirection anyway.
I couldn't find a config option to tell svgalib to shut up (there is a
'quiet' option, but it doesn't do anything), and I don't fancy patching
every release of the package to disable error messages.

Hmmm... guess that's all :)

					Mat



--
TO UNSUBSCRIBE FROM THIS MAILING LIST: e-mail the word "unsubscribe" to
debian-devel-request@lists.debian.org . 
Trouble?  e-mail to templin@bucknell.edu .


Reply to: