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

Re: gs shouldn't depend on svgalib



joost witteveen writes:

>However, if it proves to be really easy to modify the gs svga code,
>I'll make it give up it's setuid root privileges there (that would be
>best, but also the most work (if any work is needed in the first
>place -- maybe the code already does this)).

vga_init() does indeed already give up the root permissions, like
this:

    int vga_init(void)
    {
	open_devconsole();
	if (!checkconsole()) {
	    /* Return with error code. */
	    seteuid(getuid());
	    setegid(getgid());
	    return -1;
	}
	readconfigfile();
	vga_hasmode(TEXT);		/* Force driver message and initialization. */
	seteuid(getuid());		/* Don't need supervisor rights anymore. */
	setegid(getgid());
	return 0;
    }

Basically the first thing gs (and indeed any svgalib program) should
do is call vga_init or surrender root permissions by some other means.
If there's a situation in which it doesn't do this then it's a bug!

>>What we really need is some kernel support for graphics cards...
>We've got X, of cource -- I see svgalib only for the die-hards.

Having grown up on much smaller computers I find direct access to the
display hardware has a certain charm l-)

-- 
                                      Richard Kettlewell <richard@elmail.co.uk>
`It's all just a bad dream.'             http://www.elmail.co.uk/staff/richard/
`Really?  Is it?'
`Hell no, it's real; I was just telling you what you wanted to hear.'


Reply to: