summaryrefslogtreecommitdiffstats
path: root/sys/kern/vfs_extattr.c
diff options
context:
space:
mode:
authortruckman <truckman@FreeBSD.org>2006-01-22 19:37:02 +0000
committertruckman <truckman@FreeBSD.org>2006-01-22 19:37:02 +0000
commit7ef6769a305dc959cce68afe547680fe8e76d4c9 (patch)
tree1f137df98706250ca8a0f67306a482b45f352e82 /sys/kern/vfs_extattr.c
parent4cb2c843478de47c5cdc1a861c8358dfd7964c1a (diff)
downloadFreeBSD-src-7ef6769a305dc959cce68afe547680fe8e76d4c9.zip
FreeBSD-src-7ef6769a305dc959cce68afe547680fe8e76d4c9.tar.gz
Tweak previous vfs_lookup.c commit to return an EINVAL error from
lookup() instead of EPERM when a DELETE or RENAME operation is attempted on "..". In kern_unlink(), remap EINVAL errors returned from namei() to EPERM to match existing (and POSIX required) behaviour. Discussed with: bde MFC after: 3 days
Diffstat (limited to 'sys/kern/vfs_extattr.c')
-rw-r--r--sys/kern/vfs_extattr.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/kern/vfs_extattr.c b/sys/kern/vfs_extattr.c
index 98ee355..2d61977 100644
--- a/sys/kern/vfs_extattr.c
+++ b/sys/kern/vfs_extattr.c
@@ -1633,7 +1633,7 @@ restart:
bwillwrite();
NDINIT(&nd, DELETE, LOCKPARENT | LOCKLEAF | MPSAFE, pathseg, path, td);
if ((error = namei(&nd)) != 0)
- return (error);
+ return (error == EINVAL ? EPERM : error);
vfslocked = NDHASGIANT(&nd);
vp = nd.ni_vp;
if (vp->v_type == VDIR)
OpenPOWER on IntegriCloud