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

Bug#47060: marked as done (non-root users should be able to read-only open mouse devices if possible.)

Your message dated Fri, 24 May 2002 03:17:21 -0400
with message-id <E17B9KD-0006nH-00@auric.debian.org>
and subject line Bug#47060: fixed in svgalib 1:1.4.3-8
has caused the attached Bug report to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere.  Please contact me immediately.)

Debian bug tracking system administrator
(administrator, Debian Bugs database)

Received: (at submit) by bugs.debian.org; 10 Oct 1999 08:48:47 +0000
Received: (qmail 31571 invoked from network); 10 Oct 1999 08:48:45 -0000
Received: from d217-64.res.umontreal.ca (HELO blackhole.ppp.res.UMontreal.CA) (
  by master.debian.org with SMTP; 10 Oct 1999 08:48:45 -0000
Received: from localhost (void@localhost)
	by blackhole.ppp.res.UMontreal.CA (8.9.3/8.9.3/Debian/GNU) with ESMTP id EAA01827
	for <submit@bugs.debian.org>; Sun, 10 Oct 1999 04:48:39 -0400
Date: Sun, 10 Oct 1999 04:48:39 -0400 (EDT)
From: Adel Belhouane <void@pipo.com>
X-Sender: void@blackhole.ppp.res.UMontreal.CA
To: submit@bugs.debian.org
Subject: non-root users should be able to read-only open mouse devices if
Message-ID: <Pine.LNX.4.10.9910100427120.1818-100000@blackhole.ppp.res.UMontreal.CA>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII

Package: svgalibg1
Version: 1:1.4.0-1
Severity: wishlist

Many mouses need only read access to work. Write access is to configure some
of them at opening. Obviously the pipe file /dev/gpmdata doesn't need
initialisation. Svgalib always open /dev/mouse read/write even if it knows
it won't need to write to it (src/mouse/ms.c , variable m_modem_ctl) for
some mouses (bus,ps2,gpm output,...). So non- (real)root users will get
errors with mouse unless the /dev file is writable by them.
example: svncviewer(3.3.2r2-4), file /usr/doc/svncviewer/README.gz

I can see three solutions:
* have the mouse device opened when suid program has still root privileges 
  (I think it should be the best, but some search to do, and surely
  problems for devices that don't allow multiple opens).
* allow writing to devices (world or group), (/dev/MAKEDEV creates
  mouse devices with root root 0660 access, gpm /dev/gpmdata with 0622)
* open read only for devices that can stand it (I think all for which ms.c
  sets m_modem_ctl=0 ). It will work for some (there's still need to
change the 0660 access into 0662), and "gpm -R" can always be there.

Here's a patch for 3rd solution (assuming my guess about
"devices that can stand it" is right). I moved the open() after
m_modem_ctl had a chance to be set to 0, and added a test to open it
either read-only either read-write. It works for me when using
/dev/gpmdata with svncviewer.

--- svgalib-1.4.0/src/mouse/ms.c	Sun Oct 10 01:48:59 1999
+++ svgalib/src/mouse/ms.c	Sun Oct 10 02:01:01 1999
@@ -444,15 +444,19 @@
         m_wheel_delta = 0;
+    if (m_type == MOUSE_BUSMOUSE || m_type == MOUSE_PS2 || m_type == MOUSE_IMPS2 || m_type == MOUSE_GPM)
+	m_modem_ctl = 0;
     /* Added O_NDELAY here. */
-    if ((__svgalib_mouse_fd = open(m_dev, O_RDWR | O_NDELAY )) < 0)
+/* HACK: if no signal will change there is no need to open read write:
+ * for example programs can use /dev/gpmdata without write access
+ */
+    if ((__svgalib_mouse_fd = 
+       open(m_dev, (m_modem_ctl ? O_RDWR : O_RDONLY) | O_NDELAY )) < 0)
 	return -1;
-    if (m_type == MOUSE_BUSMOUSE || m_type == MOUSE_PS2 || m_type == MOUSE_IMPS2 || m_type == MOUSE_GPM)
-	m_modem_ctl = 0;
     /* If no signal will change there is no need to restore
        or safe original settings. */

-- System Information
Debian Release: potato
Kernel Version: Linux quartz 2.2.13pre15 #2 mar oct 5 15:12:05 EDT 1999 i686 unknown

Versions of the packages svgalibg1 depends on:
ii  libc6           2.1.2-5        GNU C Library: Shared libraries and timezone

--- Begin /etc/vga/libvga.config (modified conffile)
mouse gpm
				# threshold but delta is multiplied by
				# mouse_accel_mult if more. Originally done by
				# Mike Chapman mike@paranoia.com
mouse_accel_type	power	# The acceleration factor is a power function
				# of delta until it reaches m_accel_mult. It
				# starts from the coordinate 
				# [1, 1 + m_accel_offset] and goes to
				# [m_accel_thresh, m_accel_mult]. If delta
				# is bigger then m_accel_thresh it is a plain
				# constant (m_accel_mult). It is the f(delta)
				# function with which the delta itself will be
				# multiplied. m_accel_offset is 1 by default,
				# so for delta = 1 the accelerated delta will
				# remain 1 (You don't lose resolution). The
				# starting point of the f(delta) function
				# might be moved along the Y axis up/down with
				# m_accel_offset thus defining the initial
				# minimum acceleration (for delta = 1).
				# Basically it's like the normal mode but the
				# acceleration factor grows as you move your
				# mouse faster and faster, not just turns in
				# and out. Threshold is the point from where
				# the f(delta) function gets linear.
				# This is the one I use for *uaking... =)
mouse_accel_mult	4	# This is the number with which delta will
				# be multiplied. Basically it's the number
				# that defines how big the acceleration will
				# be
mouse_accel_thresh	2	# This is the threshold. See description by
				# power
mouse_accel_power	0.8	# This is the second parameter of the power
				# function used in power mode. Used only by
				# the power mode
mouse_accel_offset	1	# This is the offset of the starting point
				# on the Y axis. With this you can define the
				# number that will multiply delta = 1 so it's
				# the initial acceleration.
				# the acceleration was applied
				# before the acceleration. With this one you
				# can limit the biggest valid delta that
				# comes from the mouse.
				# By default svgalib prints an error if any
				# of the numbers are somhow out of the
				# reasonable limit, (Like a negative mult :)
				# and uses the default that's in vgamouse.h
mdev /dev/gpmdata
mouse_wheel_steps 18		# For MS IntelliMouse (default)
modeline "1024x768@75"  85 1024 1048 1376 1400   768  771  780  806
HorizSync 29 65
VertRefresh 42 93.5
chipset VESA          # nicely behaved Vesa Bioses
		      # problems.
		      # problems with VESA driver. Legal values: 0-15
		      # from X. Good fo using dumpreg under X, but
		      # probably bad for standard usage.

--- End /etc/vga/libvga.config

Received: (at 47060-close) by bugs.debian.org; 24 May 2002 07:38:02 +0000
>From katie@auric.debian.org Fri May 24 02:38:02 2002
Return-path: <katie@auric.debian.org>
Received: from auric.debian.org [] (mail)
	by master.debian.org with esmtp (Exim 3.12 1 (Debian))
	id 17B9eE-0005t2-00; Fri, 24 May 2002 02:38:02 -0500
Received: from katie by auric.debian.org with local (Exim 3.12 1 (Debian))
	id 17B9KD-0006nH-00; Fri, 24 May 2002 03:17:21 -0400
From: Robert Luberda <robert@debian.org>
To: 47060-close@bugs.debian.org
X-Katie: $Revision: 1.21 $
Subject: Bug#47060: fixed in svgalib 1:1.4.3-8
Message-Id: <E17B9KD-0006nH-00@auric.debian.org>
Sender: Archive Administrator <katie@auric.debian.org>
Date: Fri, 24 May 2002 03:17:21 -0400
Delivered-To: 47060-close@bugs.debian.org

We believe that the bug you reported is fixed in the latest version of
svgalib, which is due to be installed in the Debian FTP archive:

  to pool/main/s/svgalib/svgalib-bin_1.4.3-8_i386.deb
  to pool/main/s/svgalib/svgalib1-altdev_1.4.3-8_i386.deb
  to pool/main/s/svgalib/svgalib1_1.4.3-8_i386.deb
  to pool/main/s/svgalib/svgalib_1.4.3-8.diff.gz
  to pool/main/s/svgalib/svgalib_1.4.3-8.dsc
  to pool/main/s/svgalib/svgalibg1-dev_1.4.3-8_i386.deb
  to pool/main/s/svgalib/svgalibg1_1.4.3-8_i386.deb

A summary of the changes between this version and the previous one is

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 47060@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
Robert Luberda <robert@debian.org> (supplier of updated svgalib package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)

Hash: SHA1

Format: 1.7
Date: Thu, 23 May 2002 08:26:20 +0200
Source: svgalib
Binary: svgalib1 svgalib1-altdev svgalibg1-dev svgalib-bin svgalibg1
Architecture: source i386
Version: 1:1.4.3-8
Distribution: unstable
Urgency: low
Maintainer: Debian QA Group <packages@qa.debian.org>
Changed-By: Robert Luberda <robert@debian.org>
 svgalib-bin - Console SVGA display utilities
 svgalib1   - SVGA display utilities [libc5 compat]
 svgalib1-altdev - Shared, non-x, graphics library used by Ghostscript et al.
 svgalibg1  - Console SVGA display utilities
 svgalibg1-dev - Shared, non-x, graphics library used by Ghostscript et al.
Closes: 13985 47060 143181
 svgalib (1:1.4.3-8) unstable; urgency=low
   * QA upload.
   * Install updated r128 driver. Quoted from upstream homepage:
      ` The r128 driver in 1.4.3 has serious bugs that might cause system hang
        on console switch and sync lose on some mode changes. Please use this
        driver, r128.c, instead of the one in the distribution.'
   * Svgalib programs can use the mouse device even when the device is only readable
     by root since svgalib version 1.4.2 (closes: #13985, #47060).
   * Fix typo in libvga.config (closes: #143181).
   * Repackaged with debhelper v4.
   * Don't use dpkg-statoverride or suid(un)register, just install some
     programs suid.
   * Package svgalib-bin: 'Conflicts: suidregister (<< 0.52)'.
   * debian/control: use ${shlibs:Depends}, ${misc:Depends} and ${perl:Depends}
     to get proper, versioned dependencies.
   * Add linitan override files for setuid binaries and /usr/i486-linuxlibc1
     directory. All packages are lintian clean now.
 a47747d00f33d55534d8091f9ff30be0 651 graphics optional svgalib_1.4.3-8.dsc
 4f8446083cd16cbbace809a370b04fd6 37415 graphics optional svgalib_1.4.3-8.diff.gz
 2f112546a113332349e874b9e44093e4 22150 graphics optional svgalib-bin_1.4.3-8_i386.deb
 938f1ee18c5af54a8941dc0b73eeac98 307122 libs optional svgalibg1_1.4.3-8_i386.deb
 313031d161b5653292571c558ecdb331 585420 devel optional svgalibg1-dev_1.4.3-8_i386.deb
 c700b4b5f5cf7d746fa58aeda43963ff 179418 oldlibs optional svgalib1_1.4.3-8_i386.deb
 864286a45d3a324bf5c407cc6487c930 236024 oldlibs extra svgalib1-altdev_1.4.3-8_i386.deb

Version: GnuPG v1.0.7 (GNU/Linux)


To UNSUBSCRIBE, email to debian-qa-packages-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Reply to: