Module Name:    src
Committed By:   christos
Date:           Sat Oct  1 04:42:55 UTC 2016

Modified Files:
        src/sys/kern: tty.c

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


To generate a diff of this commit:
cvs rdiff -u -r1.273 -r1.274 src/sys/kern/tty.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/kern/tty.c
diff -u src/sys/kern/tty.c:1.273 src/sys/kern/tty.c:1.274
--- src/sys/kern/tty.c:1.273	Fri Sep 30 23:46:00 2016
+++ src/sys/kern/tty.c	Sat Oct  1 00:42:54 2016
@@ -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 @@ ttioctl(struct tty *tp, u_long cmd, void
 				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;

Reply via email to