-/* $OpenBSD: kern_pledge.c,v 1.3 2015/10/09 02:44:22 deraadt Exp $ */
+/* $OpenBSD: kern_pledge.c,v 1.4 2015/10/09 05:30:03 deraadt Exp $ */
/*
* Copyright (c) 2015 Nicholas Marriott <nicm@openbsd.org>
case FIOGETOWN:
return (0);
case TIOCGETA:
+ if (fp->f_type == DTYPE_VNODE && (vp->v_flag & VISTTY))
+ return (0);
+ return (ENOTTY);
case TIOCGPGRP:
case TIOCGWINSZ: /* various programs */
if (fp->f_type == DTYPE_VNODE && (vp->v_flag & VISTTY))
break;
/* FALTHROUGH */
case TIOCGETA:
+ if (fp->f_type == DTYPE_VNODE && (vp->v_flag & VISTTY))
+ return (0);
+ return (ENOTTY);
case TIOCGPGRP:
case TIOCGWINSZ: /* various programs */
#if notyet
-/* $OpenBSD: sys_generic.c,v 1.104 2015/10/09 01:17:21 deraadt Exp $ */
+/* $OpenBSD: sys_generic.c,v 1.105 2015/10/09 05:30:03 deraadt Exp $ */
/* $NetBSD: sys_generic.c,v 1.24 1996/03/29 00:25:32 cgd Exp $ */
/*
fdp = p->p_fd;
fp = fd_getfile_mode(fdp, SCARG(uap, fd), FREAD|FWRITE);
- if (pledge_ioctl_check(p, com, fp))
+ error = pledge_ioctl_check(p, com, fp))
+ if (error)
return (pledge_fail(p, EPERM, PLEDGE_IOCTL));
if (fp == NULL)