Bug 57052 - [patch] graphics/svgalib checks wrong virtual console for ownership
Summary: [patch] graphics/svgalib checks wrong virtual console for ownership
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: freebsd-ports-bugs (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-09-21 10:20 UTC by Alexey Dokuchaev
Modified: 2003-09-24 09:14 UTC (History)
0 users

See Also:


Attachments
patch-am.patch (403 bytes, patch)
2003-09-21 10:20 UTC, Alexey Dokuchaev
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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!