lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20080119155315.eklhad@comcast.net>
Date:	Tue, 19 Feb 2008 15:53:15 -0500
From:	Karl Dahlke <eklhad@...cast.net>
To:	linux-kernel@...r.kernel.org
CC:	dmitry.torokhov@...il.com
Subject: [PATCH] put ledstate in the keyboard notifier

I think there is general agreement, including myself,
that led state should be part of the key event, like shiftstate,
and not grabbed asynchronously after the fact.
So here is the patch that would do this.
I tested it with my keyboard modules and it works.
It only changes a couple lines of code, and will really help.
Thanks.

--- include/linux/keyboard.h	2008-02-19 14:56:02.000000000 -0500
+++ include/linux/keyboard.h.new	2008-02-19 14:55:50.000000000 -0500
@@ -33,6 +33,7 @@ struct keyboard_notifier_param {
 	struct vc_data *vc;	/* VC on which the keyboard press was done */
 	int down;		/* Pressure of the key? */
 	int shift;		/* Current shift mask */
+	int ledstate;		/* Current led state */
 	unsigned int value;	/* keycode, unicode value or keysym */
 };
 
--- drivers/char/keyboard.c	2008-02-18 21:05:23.000000000 -0500
+++ drivers/char/keyboard.c.new	2008-02-19 15:00:58.000000000 -0500
@@ -1238,6 +1238,7 @@ static void kbd_keycode(unsigned int key
 	}
 
 	param.shift = shift_final = (shift_state | kbd->slockstate) ^ kbd->lockstate;
+	param.ledstate = getledstate();
 	key_map = key_maps[shift_final];
 
 	if (atomic_notifier_call_chain(&keyboard_notifier_list, KBD_KEYCODE, &param) == NOTIFY_STOP || !key_map) {
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ