summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortmm <tmm@FreeBSD.org>2004-06-20 17:31:01 +0000
committertmm <tmm@FreeBSD.org>2004-06-20 17:31:01 +0000
commit2dca765b97537157da7a9ca3a74a422ad3bdf595 (patch)
tree4f4aa9f86fd50b5ae4648bc9b9fca4b04d87f134
parent5c21bd33720a99e6cf3c62eec27d5d2dc648a7e3 (diff)
downloadFreeBSD-src-2dca765b97537157da7a9ca3a74a422ad3bdf595.zip
FreeBSD-src-2dca765b97537157da7a9ca3a74a422ad3bdf595.tar.gz
Initialize ni_cnd.cn_cred before calling lookup() (this is normally done
by namei(), which cannot easily be used here however). This fixes boot time crashes on sparc64 and probably other platforms. Reviewed by: phk
-rw-r--r--sys/kern/vfs_mount.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sys/kern/vfs_mount.c b/sys/kern/vfs_mount.c
index 57220ba..c3fc5dc 100644
--- a/sys/kern/vfs_mount.c
+++ b/sys/kern/vfs_mount.c
@@ -1488,6 +1488,7 @@ getdiskbyname(char *name)
UIO_SYSSPACE, cp, curthread);
nid.ni_startdir = vroot;
nid.ni_pathlen = strlen(cp);
+ nid.ni_cnd.cn_cred = curthread->td_ucred;
nid.ni_cnd.cn_nameptr = cp;
error = lookup(&nid);
OpenPOWER on IntegriCloud