[PATCH] mxser.c: capable, look at put_user return

Arnaldo Carvalho de Melo (acme@conectiva.com.br)
Tue, 9 Jan 2001 14:19:33 -0200


Hi,

Please consider applying.

- Arnaldo

--- linux-2.4.0-ac4/drivers/char/mxser.c Tue Dec 19 11:25:34 2000
+++ linux-2.4.0-ac4.acme/drivers/char/mxser.c Tue Jan 9 14:16:21 2001
@@ -1671,7 +1671,7 @@
*/
if (inb(info->base + UART_LSR) == 0xff) {
restore_flags(flags);
- if (suser()) {
+ if (capable(CAP_SYS_ADMIN)) {
if (info->tty)
set_bit(TTY_IO_ERROR, &info->tty->flags);
return (0);
@@ -2188,8 +2188,7 @@
status = inb(info->base + UART_LSR);
restore_flags(flags);
result = ((status & UART_LSR_TEMT) ? TIOCSER_TEMT : 0);
- put_user(result, value);
- return (0);
+ return put_user(result, value);
}

/*
@@ -2229,8 +2228,7 @@
((status & UART_MSR_RI) ? TIOCM_RNG : 0) |
((status & UART_MSR_DSR) ? TIOCM_DSR : 0) |
((status & UART_MSR_CTS) ? TIOCM_CTS : 0);
- put_user(result, value);
- return (0);
+ return put_user(result, value);
}

static int mxser_set_modem_info(struct mxser_struct *info, unsigned int cmd,
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/