From 0ced5da0279dbacef6c8ab9a01ac70970a30d3be Mon Sep 17 00:00:00 2001 From: deraadt Date: Tue, 12 Jul 2016 06:06:34 +0000 Subject: [PATCH] remove more noisy messages in "sendfd" and "recvfd" --- sys/kern/kern_pledge.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/sys/kern/kern_pledge.c b/sys/kern/kern_pledge.c index 6dc9ab64979..6411cb6d992 100644 --- a/sys/kern/kern_pledge.c +++ b/sys/kern/kern_pledge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_pledge.c,v 1.177 2016/07/11 19:11:34 deraadt Exp $ */ +/* $OpenBSD: kern_pledge.c,v 1.178 2016/07/12 06:06:34 deraadt Exp $ */ /* * Copyright (c) 2015 Nicholas Marriott @@ -835,8 +835,7 @@ pledge_namei_wlpath(struct proc *p, struct nameidata *ni) int pledge_recvfd(struct proc *p, struct file *fp) { - struct vnode *vp = NULL; - char *vtypes[] = { VTYPE_NAMES }; + struct vnode *vp; if ((p->p_p->ps_flags & PS_PLEDGE) == 0) return (0); @@ -854,7 +853,6 @@ pledge_recvfd(struct proc *p, struct file *fp) return (0); break; } - printf("recvfd type %d %s\n", fp->f_type, vp ? vtypes[vp->v_type] : ""); return pledge_fail(p, EINVAL, PLEDGE_RECVFD); } @@ -864,16 +862,12 @@ pledge_recvfd(struct proc *p, struct file *fp) int pledge_sendfd(struct proc *p, struct file *fp) { - struct vnode *vp = NULL; - char *vtypes[] = { VTYPE_NAMES }; + struct vnode *vp; if ((p->p_p->ps_flags & PS_PLEDGE) == 0) return (0); - - if ((p->p_p->ps_pledge & PLEDGE_SENDFD) == 0) { - printf("sendmsg not allowed\n"); + if ((p->p_p->ps_pledge & PLEDGE_SENDFD) == 0) return pledge_fail(p, EPERM, PLEDGE_SENDFD); - } switch (fp->f_type) { case DTYPE_SOCKET: @@ -886,7 +880,6 @@ pledge_sendfd(struct proc *p, struct file *fp) return (0); break; } - printf("sendfd type %d %s\n", fp->f_type, vp ? vtypes[vp->v_type] : ""); return pledge_fail(p, EINVAL, PLEDGE_SENDFD); } -- 2.20.1