From c975014e20cd16ea8c2b774d806a94418f47c4ed Mon Sep 17 00:00:00 2001 From: deraadt Date: Fri, 16 Oct 2015 17:03:31 +0000 Subject: [PATCH] Repair the pty check for kernels without pty support. --- sys/kern/kern_pledge.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/sys/kern/kern_pledge.c b/sys/kern/kern_pledge.c index 38473c94c3d..5752df12122 100644 --- a/sys/kern/kern_pledge.c +++ b/sys/kern/kern_pledge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_pledge.c,v 1.38 2015/10/16 15:39:14 nicm Exp $ */ +/* $OpenBSD: kern_pledge.c,v 1.39 2015/10/16 17:03:31 deraadt Exp $ */ /* * Copyright (c) 2015 Nicholas Marriott @@ -52,6 +52,8 @@ #include #include +#include "pty.h" + int canonpath(const char *input, char *buf, size_t bufsize); const u_int pledge_syscalls[SYS_MAXSYSCALL] = { @@ -1074,6 +1076,7 @@ pledge_ioctl_check(struct proc *p, long com, void *v) if ((p->p_p->ps_pledge & PLEDGE_TTY)) { switch (com) { +#if NPTY > 0 case PTMGET: if ((p->p_p->ps_pledge & PLEDGE_RPATH) == 0) break; @@ -1084,6 +1087,7 @@ pledge_ioctl_check(struct proc *p, long com, void *v) if (cdevsw[major(vp->v_rdev)].d_open != ptmopen) break; return (0); +#endif /* NPTY > 0 */ #if notyet case TIOCSTI: /* ksh? csh? */ if (fp->f_type == DTYPE_VNODE && (vp->v_flag & VISTTY)) -- 2.20.1