FreeBSD Bugzilla – Attachment 37553 Details for
Bug 59739
[patch] [libc] rmdir(2) and mkdir(2) both return EISDIR for argument "/"
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
vfssyscalls.c.patch.txt
vfssyscalls.c.patch.txt (text/plain), 1.55 KB, created by
Alexander Best
on 2009-11-08 03:05:11 UTC
(
hide
)
Description:
vfssyscalls.c.patch.txt
Filename:
MIME Type:
Creator:
Alexander Best
Created:
2009-11-08 03:05:11 UTC
Size:
1.55 KB
patch
obsolete
>Index: sys/kern/vfs_syscalls.c >=================================================================== >--- sys/kern/vfs_syscalls.c (revision 199016) >+++ sys/kern/vfs_syscalls.c (working copy) >@@ -3587,8 +3587,12 @@ > AUDITVNODE1, pathseg, old, oldfd, td); > #endif > >- if ((error = namei(&fromnd)) != 0) >+ if ((error = namei(&fromnd)) != 0) { >+ /* Translate error code for rename("/", "dir2"). */ >+ if (error == EISDIR) >+ error = EINVAL; > return (error); >+ } > fvfslocked = NDHASGIANT(&fromnd); > tvfslocked = 0; > #ifdef MAC >@@ -3737,8 +3741,12 @@ > NDINIT_AT(&nd, CREATE, LOCKPARENT | SAVENAME | MPSAFE | AUDITVNODE1, > segflg, path, fd, td); > nd.ni_cnd.cn_flags |= WILLBEDIR; >- if ((error = namei(&nd)) != 0) >+ if ((error = namei(&nd)) != 0) { >+ /* Translate error code for mkdir("/"). */ >+ if (error == EISDIR) >+ error = EEXIST; > return (error); >+ } > vfslocked = NDHASGIANT(&nd); > vp = nd.ni_vp; > if (vp != NULL) { >@@ -3825,10 +3833,15 @@ > bwillwrite(); > NDINIT_AT(&nd, DELETE, LOCKPARENT | LOCKLEAF | MPSAFE | AUDITVNODE1, > pathseg, path, fd, td); >- if ((error = namei(&nd)) != 0) >+ if ((error = namei(&nd)) != 0) { >+ /* Translate error code for rmdir("/"). */ >+ if (error == EISDIR) >+ error = EBUSY; > return (error); >+ } > vfslocked = NDHASGIANT(&nd); > vp = nd.ni_vp; >+ /* XXX namei() takes care of this case. */ > if (vp->v_type != VDIR) { > error = ENOTDIR; > goto out; >@@ -3841,6 +3854,7 @@ > goto out; > } > /* >+ * XXX namei() takes care of this case. > * The root of a mounted filesystem cannot be deleted. > */ > if (vp->v_vflag & VV_ROOT) {
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 59739
:
37552
| 37553