Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/kern Weaken the test a bit to still allow non-root to us...



details:   https://anonhg.NetBSD.org/src/rev/66af740f59c4
branches:  trunk
changeset: 818163:66af740f59c4
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Oct 01 03:46:00 2016 +0000

description:
Weaken the test a bit to still allow non-root to use TIOCSTI; we need to have
the same creds as the session leader process for the tty session.

diffstat:

 sys/kern/tty.c |  7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diffs (28 lines):

diff -r ed74e9193295 -r 66af740f59c4 sys/kern/tty.c
--- a/sys/kern/tty.c    Fri Sep 30 16:52:17 2016 +0000
+++ b/sys/kern/tty.c    Sat Oct 01 03:46:00 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tty.c,v 1.272 2016/09/29 21:46:32 christos Exp $       */
+/*     $NetBSD: tty.c,v 1.273 2016/10/01 03:46:00 christos Exp $       */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -63,7 +63,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: tty.c,v 1.272 2016/09/29 21:46:32 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tty.c,v 1.273 2016/10/01 03:46:00 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -1246,6 +1246,9 @@
                                return EPERM;
                        if (!isctty(p, tp))
                                return EACCES;
+                       if (!proc_uidmatch(tp->t_session->s_leader->p_cred,
+                           p->p_cred))
+                               return error;
                        return error;
                }
                (*tp->t_linesw->l_rint)(*(u_char *)data, tp);



Home | Main Index | Thread Index | Old Index