Hi,

The function unveil_add_vnode() does not use the parameter rootvnode.
It is even more confusing as rootvnode is also a global variable.

ok?

bluhm

Index: kern/kern_unveil.c
===================================================================
RCS file: /data/mirror/openbsd/cvs/src/sys/kern/kern_unveil.c,v
retrieving revision 1.27
diff -u -p -r1.27 kern_unveil.c
--- kern/kern_unveil.c  14 Jul 2019 03:26:02 -0000      1.27
+++ kern/kern_unveil.c  16 Jul 2019 22:59:58 -0000
@@ -439,7 +439,7 @@ unveil_setflags(u_char *flags, u_char nf
 }

 struct unveil *
-unveil_add_vnode(struct process *pr, struct vnode *vp, struct vnode *rootvnode)
+unveil_add_vnode(struct process *pr, struct vnode *vp)
 {
        struct unveil *uv = NULL;
        ssize_t i, j;
@@ -504,8 +504,7 @@ unveil_add_traversed_vnodes(struct proc
                        if (unveil_lookup(vp, p, NULL) == NULL) {
                                vref(vp);
                                vp->v_uvcount++;
-                               uv = unveil_add_vnode(p->p_p, vp,
-                                   ndp->ni_rootdir);
+                               uv = unveil_add_vnode(p->p_p, vp);
                        }
                }
        }
@@ -600,7 +599,7 @@ unveil_add(struct proc *p, struct nameid
                /*
                 * New unveil involving this directory vnode.
                 */
-               uv = unveil_add_vnode(pr, vp, ndp->ni_rootdir);
+               uv = unveil_add_vnode(pr, vp);
        }

        /*

Reply via email to