Set the credentials to be used in the NDINIT macro so that syscalls can
hijack them.
This commit is contained in:
parent
ece8acc29b
commit
51d673156c
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: vfs_lookup.c,v 1.35 2000/08/03 20:41:23 thorpej Exp $ */
|
/* $NetBSD: vfs_lookup.c,v 1.36 2001/09/08 02:02:04 christos Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1982, 1986, 1989, 1993
|
* Copyright (c) 1982, 1986, 1989, 1993
|
||||||
|
@ -92,7 +92,6 @@ namei(ndp)
|
||||||
int error, linklen;
|
int error, linklen;
|
||||||
struct componentname *cnp = &ndp->ni_cnd;
|
struct componentname *cnp = &ndp->ni_cnd;
|
||||||
|
|
||||||
ndp->ni_cnd.cn_cred = ndp->ni_cnd.cn_proc->p_ucred;
|
|
||||||
#ifdef DIAGNOSTIC
|
#ifdef DIAGNOSTIC
|
||||||
if (!cnp->cn_cred || !cnp->cn_proc)
|
if (!cnp->cn_cred || !cnp->cn_proc)
|
||||||
panic ("namei: bad cred/proc");
|
panic ("namei: bad cred/proc");
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: namei.h,v 1.20 2000/11/24 07:25:52 chs Exp $ */
|
/* $NetBSD: namei.h,v 1.21 2001/09/08 02:02:05 christos Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1985, 1989, 1991, 1993
|
* Copyright (c) 1985, 1989, 1991, 1993
|
||||||
|
@ -149,6 +149,7 @@ struct nameidata {
|
||||||
(ndp)->ni_segflg = segflg; \
|
(ndp)->ni_segflg = segflg; \
|
||||||
(ndp)->ni_dirp = namep; \
|
(ndp)->ni_dirp = namep; \
|
||||||
(ndp)->ni_cnd.cn_proc = p; \
|
(ndp)->ni_cnd.cn_proc = p; \
|
||||||
|
(ndp)->ni_cnd.cn_cred = p->p_ucred; \
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue