linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Allow unimap change on non fg console
@ 2003-11-29 20:12 Kurt Garloff
  0 siblings, 0 replies; only message in thread
From: Kurt Garloff @ 2003-11-29 20:12 UTC (permalink / raw)
  To: Andries Brouwer; +Cc: Linux kernel list, Andrew Morton


[-- Attachment #1.1: Type: text/plain, Size: 1086 bytes --]

Hi Andries,

The comment in front of vt_ioctl() reads
/*
 * We handle the console-specific ioctl's here.  We allow the
 * capability to modify any console, not just the fg_console. 
 */

Unfortunately, this does not apply to PIO_UNIMAPCLR, nor
GIO_/PIO_UNIMAP. They always operate on the current foreground
console, which is inconsistent at least. For most ioctls, the
comment is applicable.

It also causes problems, as setfont can't do the full job on
the non-fg consoles. (OK, our setfont is slightly changed to
even try it ... as you know.)

The attached patch does fix this.
Please consider applying to 2.6.x.

I have a similar patch for 2.4, but it never got merged :-(
because not many people seem to care and I submitted in the middle
of the 2.4 series ...
It has been in UnitedLinux/SUSE kernels for ages, though.

Regards,
-- 
Kurt Garloff                   <kurt@garloff.de>             [Koeln, DE]
Physics:Plasma modeling <garloff@plasimo.phys.tue.nl> [TU Eindhoven, NL]
Linux:SCSI, Security           <garloff@suse.de>    [SUSE Nuernberg, DE]

[-- Attachment #1.2: unimap_set --]
[-- Type: text/plain, Size: 1730 bytes --]

Binary files linux-2.6.0-test11/drivers/char/.vt.c.rej.swp and linux-2.6.0-test11.unimap/drivers/char/.vt.c.rej.swp differ
Binary files linux-2.6.0-test11/drivers/char/.vt.c.swp and linux-2.6.0-test11.unimap/drivers/char/.vt.c.swp differ
diff -uNr linux-2.6.0-test11/drivers/char/vt_ioctl.c linux-2.6.0-test11.unimap/drivers/char/vt_ioctl.c
--- linux-2.6.0-test11/drivers/char/vt_ioctl.c	2003-11-26 21:44:53.000000000 +0100
+++ linux-2.6.0-test11.unimap/drivers/char/vt_ioctl.c	2003-11-28 11:25:57.671670301 +0100
@@ -332,7 +332,7 @@
 }
 
 static inline int 
-do_unimap_ioctl(int cmd, struct unimapdesc *user_ud,int perm)
+do_unimap_ioctl(int cmd, struct unimapdesc *user_ud, int perm, unsigned int console)
 {
 	struct unimapdesc tmp;
 	int i = 0; 
@@ -348,9 +348,11 @@
 	case PIO_UNIMAP:
 		if (!perm)
 			return -EPERM;
-		return con_set_unimap(fg_console, tmp.entry_ct, tmp.entries);
+		return con_set_unimap(console, tmp.entry_ct, tmp.entries);
 	case GIO_UNIMAP:
-		return con_get_unimap(fg_console, tmp.entry_ct, &(user_ud->entry_ct), tmp.entries);
+		if (!perm && fg_console != console)
+			return -EPERM;
+		return con_get_unimap(console, tmp.entry_ct, &(user_ud->entry_ct), tmp.entries);
 	}
 	return 0;
 }
@@ -966,13 +968,13 @@
 			return -EPERM;
 		i = copy_from_user(&ui, (void *)arg, sizeof(struct unimapinit));
 		if (i) return -EFAULT;
-		con_clear_unimap(fg_console, &ui);
+		con_clear_unimap(console, &ui);
 		return 0;
 	      }
 
 	case PIO_UNIMAP:
 	case GIO_UNIMAP:
-		return do_unimap_ioctl(cmd, (struct unimapdesc *)arg, perm);
+		return do_unimap_ioctl(cmd, (struct unimapdesc *)arg, perm, console);
 
 	case VT_LOCKSWITCH:
 		if (!capable(CAP_SYS_TTY_CONFIG))

[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-11-29 20:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-29 20:12 [PATCH] Allow unimap change on non fg console Kurt Garloff

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).