For some reason (can anybody tell me why?) these flags are held in two
different places within the async_struct (flags and state->flags) and happen
to diverge for a non-root user.
Here's a small patch that fixes the problem:
--- serial.c.orig Tue Sep 1 19:32:13 1998
+++ serial.c Thu Oct 22 11:21:54 1998
@@ -32,6 +32,10 @@
* 4/98: Added changes to support the ARM architecture proposed by
* Russell King
*
+ * 10/98: Fixed bug in set_serial_info to allow non-privileged user
+ * to set/reset ASYNC_SPD_* flags
+ * Matthias Fengler <mfengler@iname.com>
+ *
* This module exports the following rs232 io functions:
*
* int rs_init(void);
@@ -1653,6 +1657,8 @@
return -EPERM;
state->flags = ((state->flags & ~ASYNC_USR_MASK) |
(new_serial.flags & ASYNC_USR_MASK));
+ info->flags = ((info->flags & ~ASYNC_USR_MASK) |
+ (new_serial.flags & ASYNC_USR_MASK));
state->custom_divisor = new_serial.custom_divisor;
goto check_and_exit;
}
And here is another small patch that allows root to set/reset ASYNC_SPD_VHI
and ASYNC_SPD_WARP. In this particular case a non-privileged user CAN
set/reset these flags, but root can't.
There is obviously one bit missing in the ASYNC_FLAGS mask that controls
those higher baud rates (230 kbps, 460 kbps). This bit is present in the
ASYNC_USR_MASK.
--- serial.h.orig Sat Apr 18 07:04:44 1998
+++ serial.h Thu Oct 22 11:30:33 1998
@@ -87,7 +87,7 @@
#define ASYNC_LOW_LATENCY 0x2000 /* Request low latency behaviour */
-#define ASYNC_FLAGS 0x2FFF /* Possible legal async flags */
+#define ASYNC_FLAGS 0x3FFF /* Possible legal async flags */
#define ASYNC_USR_MASK 0x3430 /* Legal flags that non-privileged
* users can set or reset */
Please let these patches go into 2.1.126
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/