summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_syscalls.c
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2008-09-01 10:11:39 +0000
committerpjd <pjd@FreeBSD.org>2008-09-01 10:11:39 +0000
commit9f3f0743406b7186e6780d53c0e68af9ed71ca72 (patch)
treeb1e30acf3c99c05b9ff163980ce3bf7e9dd95925 /sys/kern/vfs_syscalls.c
parent83f4db13b687609d0fe189f19e33f1d6f0f51382 (diff)
downloadFreeBSD-src-9f3f0743406b7186e6780d53c0e68af9ed71ca72.zip
FreeBSD-src-9f3f0743406b7186e6780d53c0e68af9ed71ca72.tar.gz
When setting error to EINVAL in 'fvp == tdvp' case, jump to out label,
because if not, the error will be later overwritten by mac_vnode_check_rename_to() call. Reviewed by: rwatson
Diffstat (limited to 'sys/kern/vfs_syscalls.c')
-rw-r--r--sys/kern/vfs_syscalls.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/kern/vfs_syscalls.c b/sys/kern/vfs_syscalls.c
index 5a3ba14..ad40318 100644
--- a/sys/kern/vfs_syscalls.c
+++ b/sys/kern/vfs_syscalls.c
@@ -3592,8 +3592,10 @@ kern_renameat(struct thread *td, int oldfd, char *old, int newfd, char *new,
goto out;
}
}
- if (fvp == tdvp)
+ if (fvp == tdvp) {
error = EINVAL;
+ goto out;
+ }
/*
* If the source is the same as the destination (that is, if they
* are links to the same vnode), then there is nothing to do.
OpenPOWER on IntegriCloud