Skip site navigation (1)Skip section navigation (2)
Date:      20 Sep 2003 21:15:26 -0000
From:      cpressey@catseye.mine.nu
To:        FreeBSD-gnats-submit@FreeBSD.org
Cc:        danfe@regency.nsu.ru
Subject:   ports/57146: [patch] graphics/svgalib checks wrong virtual console for ownership
Message-ID:  <20030920211526.27598.qmail@catseye.mine.nu>
Resent-Message-ID: <200309240620.h8O6KJch007960@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         57146
>Category:       ports
>Synopsis:       [patch] graphics/svgalib checks wrong virtual console for ownership
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Sep 23 23:20:19 PDT 2003
>Closed-Date:
>Last-Modified:
>Originator:     Chris Pressey <cpressey@catseye.mine.nu>
>Release:        FreeBSD 4.9-PRERELEASE i386
>Organization:
Cat's Eye Technologies
>Environment:
System: FreeBSD catseye.mine.nu 4.9-PRERELEASE FreeBSD 4.9-PRERELEASE #0: Thu Aug 28 11:26:32 CDT 2003 root@catseye.mine.nu:/usr/obj/usr/src/sys/CATSEYE i386
>Description:
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].
>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 ports/svgalib (such as seejpeg.)
	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.
>Fix:
Apply the following patch to ports/graphics/svgalib/files/patch-am
	(CVS revision 1.3):

--- patch-am.patch begins here ---
--- files/patch-am.orig	Sat Sep 20 13:06:12 2003
+++ files/patch-am	Sat Sep 20 13:06:30 2003
@@ -83,7 +83,7 @@
          return 1;               /* root can do it always */
  #endif
 -    sprintf(fname, "/dev/tty%d", vc);
-+    sprintf(fname, "/dev/ttyv%x", vc);
++    sprintf(fname, "/dev/ttyv%x", vc - 1);
      if ((stat(fname, &sbuf) >= 0) && (getuid() == sbuf.st_uid)) {
          return 1;
      }
--- patch-am.patch ends here ---


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030920211526.27598.qmail>