Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 11 Feb 2023 07:04:11 GMT
From:      Fedor Uporov <fsu@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: cbac1f346495 - main - Fix pjfstest issue tests/rename/09.t
Message-ID:  <202302110704.31B74Bvm047614@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by fsu:

URL: https://cgit.FreeBSD.org/src/commit/?id=cbac1f3464956185cf95955344b6009e2cc3ae40

commit cbac1f3464956185cf95955344b6009e2cc3ae40
Author:     Fedor Uporov <fsu@FreeBSD.org>
AuthorDate: 2023-02-02 10:13:02 +0000
Commit:     Fedor Uporov <fsu@FreeBSD.org>
CommitDate: 2023-02-11 07:01:16 +0000

    Fix pjfstest issue tests/rename/09.t
    
    Fix rename when renamed directory not owned by user,
    but when user owns the sticky parent directory.
    
    Reviewed by:    kib
    MFC after:      2 week
    Differential revision:  https://reviews.freebsd.org/D38245
---
 sys/fs/tmpfs/tmpfs_vnops.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/sys/fs/tmpfs/tmpfs_vnops.c b/sys/fs/tmpfs/tmpfs_vnops.c
index 55f0beebc848..28de8c989487 100644
--- a/sys/fs/tmpfs/tmpfs_vnops.c
+++ b/sys/fs/tmpfs/tmpfs_vnops.c
@@ -1129,6 +1129,13 @@ tmpfs_rename(struct vop_rename_args *v)
 		if (de->td_node->tn_type == VDIR) {
 			struct tmpfs_node *n;
 
+			error = VOP_ACCESS(fvp, VWRITE, tcnp->cn_cred, curthread);
+			if (error) {
+				if (newname != NULL)
+					free(newname, M_TMPFSNAME);
+				goto out_locked;
+			}
+
 			/*
 			 * Ensure the target directory is not a child of the
 			 * directory being moved.  Otherwise, we'd end up



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202302110704.31B74Bvm047614>