mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-17 08:00:48 +01:00
Fixed the errno returned by rename("dir1", "dir2/."). It was EISDIR
(duh); translate it to EINVAL which is the errno for other renames to ".".
This commit is contained in:
parent
24f7e33dfd
commit
75a85811c1
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=12372
@ -36,7 +36,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94
|
||||
* $Id: vfs_syscalls.c,v 1.39 1995/11/13 08:22:21 bde Exp $
|
||||
* $Id: vfs_syscalls.c,v 1.40 1995/11/14 09:19:16 phk Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -1880,6 +1880,10 @@ rename(p, uap, retval)
|
||||
tond.ni_cnd.cn_flags |= WILLBEDIR;
|
||||
error = namei(&tond);
|
||||
if (error) {
|
||||
/* Translate error code for rename("dir1", "dir2/."). */
|
||||
if (error == EISDIR && fvp->v_type == VDIR)
|
||||
error = EINVAL;
|
||||
|
||||
VOP_ABORTOP(fromnd.ni_dvp, &fromnd.ni_cnd);
|
||||
vrele(fromnd.ni_dvp);
|
||||
vrele(fvp);
|
||||
|
@ -36,7 +36,7 @@
|
||||
* SUCH DAMAGE.
|
||||
*
|
||||
* @(#)vfs_syscalls.c 8.13 (Berkeley) 4/15/94
|
||||
* $Id: vfs_syscalls.c,v 1.39 1995/11/13 08:22:21 bde Exp $
|
||||
* $Id: vfs_syscalls.c,v 1.40 1995/11/14 09:19:16 phk Exp $
|
||||
*/
|
||||
|
||||
#include <sys/param.h>
|
||||
@ -1880,6 +1880,10 @@ rename(p, uap, retval)
|
||||
tond.ni_cnd.cn_flags |= WILLBEDIR;
|
||||
error = namei(&tond);
|
||||
if (error) {
|
||||
/* Translate error code for rename("dir1", "dir2/."). */
|
||||
if (error == EISDIR && fvp->v_type == VDIR)
|
||||
error = EINVAL;
|
||||
|
||||
VOP_ABORTOP(fromnd.ni_dvp, &fromnd.ni_cnd);
|
||||
vrele(fromnd.ni_dvp);
|
||||
vrele(fvp);
|
||||
|
Loading…
Reference in New Issue
Block a user