int error;
context.vc_proc = p;
- context.vc_ucred = proc_ucred(p); /* XXX kauth_cred_get() ??? proxy */
+ context.vc_ucred = kauth_cred_proc_ref(p); /* XXX kauth_cred_get() ??? proxy */
NDINIT(&nd, CREATE, LOCKPARENT, UIO_SYSSPACE32, CAST_USER_ADDR_T(path), &context);
error = namei(&nd);
if (error) {
DBG_VOP(("vn_mkdir: error from namei, error = %d.\n", error));
+ kauth_cred_unref(&context.vc_ucred);
return (error);
};
vp = nd.ni_vp;
vnode_put(nd.ni_vp);
nameidone(&nd);
+ kauth_cred_unref(&context.vc_ucred);
return (error);
}
int error;
context.vc_proc = p;
- context.vc_ucred = proc_ucred(p); /* XXX kauth_cred_get() ??? proxy */
+ context.vc_ucred = kauth_cred_proc_ref(p); /* XXX kauth_cred_get() ??? proxy */
NDINIT(&nd, CREATE, LOCKPARENT, UIO_SYSSPACE32, CAST_USER_ADDR_T(link), &context);
- if ((error = namei(&nd))) return error;
+ if ((error = namei(&nd))) {
+ kauth_cred_unref(&context.vc_ucred);
+ return error;
+ }
if (nd.ni_vp == NULL) {
VATTR_INIT(&va);
vnode_put(nd.ni_vp);
nameidone(&nd);
+ kauth_cred_unref(&context.vc_ucred);
return (error);
}