Bug 57052

Summary: [patch] graphics/svgalib checks wrong virtual console for ownership
Product: Ports & Packages Reporter: Alexey Dokuchaev <danfe>
Component: Individual Port(s)Assignee: freebsd-ports-bugs (Nobody) <ports-bugs>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
patch-am.patch none

Description Alexey Dokuchaev 2003-09-21 10:20:19 UTC
graphics/svgalib contains an off-by-one error in the code that checks
that the user is the owner of the current virtual terminal.  Instead
of checking /dev/ttyv[X], it checks /dev/ttyv[X+1].

Submitted by:	Chris Pressey <cpressey@catseye.mine.nu>

This happens because svgalib was written for Linnex, and they start tty
numbering from 1, contrary to FreeBSD, which does it from 0.  I
always knew that FreeBSD is better: who counts from 1 in this world?! ;-)

How-To-Repeat: Log in as a non-root user on ttyv0.  Make sure that this user is not
also logged in on ttyv1.  Run a program that uses graphics/svgalib (such
as seejpeg, or Quake game).  SVGAlib will produce an error to the effect
that you are not the owner of the current virtual console.  Log in as
the same user on ttyv1.  Switch back to ttyv0 and try running seejpeg a
second time.  This time it should work, as the user on ttyv0 also owns
ttyv1.
Comment 1 Edwin Groothuis freebsd_committer 2003-09-24 09:14:17 UTC
State Changed
From-To: open->closed

Commited, thanks!