diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-10-16 17:03:32 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2015-10-16 17:03:32 +0000 |
commit | 98633bfd88d83af50bb79d9b6daaa137fc319805 (patch) | |
tree | 9d11e3543d35535efc3f1159e9877f92ef428593 /sys | |
parent | c63e7a592c2bade541347c9afcaab4553c88a365 (diff) |
Repair the pty check for kernels without pty support.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/kern/kern_pledge.c | 6 |
1 files changed, 5 insertions, 1 deletions
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 <nicm@openbsd.org> @@ -52,6 +52,8 @@ #include <sys/systm.h> #include <sys/pledge.h> +#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)) |