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
This commit is contained in:
Thomas Moestl 2004-06-20 17:31:01 +00:00
parent fbb4e16a3b
commit 3971dcfa4b

View File

@ -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);