From genfs_rename.c:

* XXX Want a better equality test.  `tcnp->cn_cred == cred'
         * hoses p2k because puffs transmits the creds separately and
         * allocates distinct but equivalent structures for them.

Fixes rename crash in rump_msdos.
This commit is contained in:
mlelstv 2024-05-04 05:49:39 +00:00
parent 7c4812b990
commit 6d4f51a741
1 changed files with 3 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: msdosfs_rename.c,v 1.3 2021/10/23 16:58:17 thorpej Exp $ */
/* $NetBSD: msdosfs_rename.c,v 1.4 2024/05/04 05:49:39 mlelstv Exp $ */
/*-
* Copyright (c) 2011 The NetBSD Foundation, Inc.
@ -34,7 +34,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: msdosfs_rename.c,v 1.3 2021/10/23 16:58:17 thorpej Exp $");
__KERNEL_RCSID(0, "$NetBSD: msdosfs_rename.c,v 1.4 2024/05/04 05:49:39 mlelstv Exp $");
#include <sys/param.h>
#include <sys/buf.h>
@ -127,7 +127,7 @@ msdosfs_rename(void *v)
KASSERT(tdvp->v_type == VDIR);
cred = fcnp->cn_cred;
KASSERT(tcnp->cn_cred == cred);
KASSERT(kauth_cred_uidmatch(cred, tcnp->cn_cred));
/*
* Sanitize our world from the VFS insanity. Unlock the target