Source-Changes-HG archive

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

[src/trunk]: src/sys/kern Require exact credential match; this way even if we...



details:   https://anonhg.NetBSD.org/src/rev/7c85a9715bc6
branches:  trunk
changeset: 348022:7c85a9715bc6
user:      christos <christos%NetBSD.org@localhost>
date:      Sat Oct 01 04:42:54 2016 +0000

description:
Require exact credential match; this way even if we su to the original user
that created the session, we won't match his credentials.

diffstat:

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

diffs (30 lines):

diff -r 4be1f802921d -r 7c85a9715bc6 sys/kern/tty.c
--- a/sys/kern/tty.c    Sat Oct 01 03:46:00 2016 +0000
+++ b/sys/kern/tty.c    Sat Oct 01 04:42:54 2016 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: tty.c,v 1.273 2016/10/01 03:46:00 christos Exp $       */
+/*     $NetBSD: tty.c,v 1.274 2016/10/01 04:42:54 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.273 2016/10/01 03:46:00 christos Exp $");
+__KERNEL_RCSID(0, "$NetBSD: tty.c,v 1.274 2016/10/01 04:42:54 christos Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_compat_netbsd.h"
@@ -1246,10 +1246,8 @@
                                return EPERM;
                        if (!isctty(p, tp))
                                return EACCES;
-                       if (!proc_uidmatch(tp->t_session->s_leader->p_cred,
-                           p->p_cred))
+                       if (tp->t_session->s_leader->p_cred != p->p_cred)
                                return error;
-                       return error;
                }
                (*tp->t_linesw->l_rint)(*(u_char *)data, tp);
                break;



Home | Main Index | Thread Index | Old Index