diff options
author | jhb <jhb@FreeBSD.org> | 2001-01-23 23:59:38 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2001-01-23 23:59:38 +0000 |
commit | 80649f2bc14466af487fac64c40a88ede7c20efc (patch) | |
tree | 781ea883b6ed60cc23e615d8c1d3f2f82b901dd5 /sys/i386/ibcs2/ibcs2_util.c | |
parent | f5fbc62142d116619713e03561896c38676e6f5c (diff) | |
download | FreeBSD-src-80649f2bc14466af487fac64c40a88ede7c20efc.zip FreeBSD-src-80649f2bc14466af487fac64c40a88ede7c20efc.tar.gz |
Proc locking.
Diffstat (limited to 'sys/i386/ibcs2/ibcs2_util.c')
-rw-r--r-- | sys/i386/ibcs2/ibcs2_util.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/sys/i386/ibcs2/ibcs2_util.c b/sys/i386/ibcs2/ibcs2_util.c index 0a361fd..1d710be 100644 --- a/sys/i386/ibcs2/ibcs2_util.c +++ b/sys/i386/ibcs2/ibcs2_util.c @@ -62,6 +62,7 @@ ibcs2_emul_find(p, sgp, prefix, path, pbuf, cflag) struct nameidata ndroot; struct vattr vat; struct vattr vatroot; + struct ucred *uc; int error; char *ptr, *buf, *cp; size_t sz, len; @@ -140,14 +141,20 @@ ibcs2_emul_find(p, sgp, prefix, path, pbuf, cflag) return error; } - if ((error = VOP_GETATTR(nd.ni_vp, &vat, p->p_ucred, p)) != 0) { + PROC_LOCK(p); + uc = p->p_ucred; + crhold(uc); + PROC_UNLOCK(p); + if ((error = VOP_GETATTR(nd.ni_vp, &vat, uc, p)) != 0) { + crfree(uc); goto done; } - if ((error = VOP_GETATTR(ndroot.ni_vp, &vatroot, p->p_ucred, p)) - != 0) { + if ((error = VOP_GETATTR(ndroot.ni_vp, &vatroot, uc, p)) != 0) { + crfree(uc); goto done; } + crfree(uc); if (vat.va_fsid == vatroot.va_fsid && vat.va_fileid == vatroot.va_fileid) { |