security fix from George Goble
authorKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Tue, 11 Sep 1984 09:16:33 +0000 (01:16 -0800)
committerKirk McKusick <mckusick@ucbvax.Berkeley.EDU>
Tue, 11 Sep 1984 09:16:33 +0000 (01:16 -0800)
SCCS-vsn: sys/kern/tty_pty.c 6.7
SCCS-vsn: sys/kern/tty.c 6.11

usr/src/sys/kern/tty.c
usr/src/sys/kern/tty_pty.c

index 2b1e6fe..824e5d5 100644 (file)
@@ -1,4 +1,4 @@
-/*     tty.c   6.10    84/08/29        */
+/*     tty.c   6.11    84/09/10        */
 
 #include "../machine/reg.h"
 
 
 #include "../machine/reg.h"
 
@@ -360,6 +360,8 @@ ttioctl(tp, com, data, flag)
         * Simulate typing of a character at the terminal.
         */
        case TIOCSTI:
         * Simulate typing of a character at the terminal.
         */
        case TIOCSTI:
+               if (u.u_uid && (flag & FREAD) == 0)
+                       return (EPERM);
                if (u.u_uid && u.u_ttyp != tp)
                        return (EACCES);
                (*linesw[tp->t_line].l_rint)(*(char *)data, tp);
                if (u.u_uid && u.u_ttyp != tp)
                        return (EACCES);
                (*linesw[tp->t_line].l_rint)(*(char *)data, tp);
index 5aa4319..0d7b007 100644 (file)
@@ -1,4 +1,4 @@
-/*     tty_pty.c       6.6     84/08/29        */
+/*     tty_pty.c       6.7     84/09/10        */
 
 /*
  * Pseudo-teletype Driver
 
 /*
  * Pseudo-teletype Driver
@@ -443,7 +443,7 @@ ptyioctl(dev, cmd, data, flag)
                                ;
                        break;
                }
                                ;
                        break;
                }
-       error = ttioctl(tp, cmd, data, dev);
+       error = ttioctl(tp, cmd, data, flag);
        if (error < 0)
                error = ENOTTY;
        { int stop = (tp->t_stopc == ('s'&037) &&
        if (error < 0)
                error = ENOTTY;
        { int stop = (tp->t_stopc == ('s'&037) &&