From bfe1f15bac88af5227cf0b1ced01850deace5579 Mon Sep 17 00:00:00 2001 From: truckman Date: Sun, 22 Jan 2006 19:49:37 +0000 Subject: [PATCH] Back out the previous change to rename.2. The previous rename() behaviour of returning EINVAL when ".." is passed as either argument has been restored. rmdir("..") now returns EINVAL instead of EPERM. Document the previously undocumented behaviour of rmdir(".") returning EINVAL as required by POSIX and SUSv3. Bump the man page change date. undelete("..") now returns EINVAL instead of EPERM. Bump the man page change date. MFC after: 3 days --- lib/libc/sys/rename.2 | 3 --- lib/libc/sys/rmdir.2 | 8 +++++--- lib/libc/sys/undelete.2 | 6 +++--- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/lib/libc/sys/rename.2 b/lib/libc/sys/rename.2 index 6df3046d9250..0080f409f6dd 100644 --- a/lib/libc/sys/rename.2 +++ b/lib/libc/sys/rename.2 @@ -145,9 +145,6 @@ is marked sticky, and neither the containing directory nor .Fa to are owned by the effective user ID. -.It Bq Er EPERM -After expanding any symbolic links, the last component of either path is -.Ql .. . .It Bq Er ELOOP Too many symbolic links were encountered in translating either pathname. .It Bq Er ENOTDIR diff --git a/lib/libc/sys/rmdir.2 b/lib/libc/sys/rmdir.2 index 187b977dd213..f98b952053b9 100644 --- a/lib/libc/sys/rmdir.2 +++ b/lib/libc/sys/rmdir.2 @@ -32,7 +32,7 @@ .\" @(#)rmdir.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd June 4, 1993 +.Dd January 22, 2006 .Dt RMDIR 2 .Os .Sh NAME @@ -85,8 +85,10 @@ to be removed. The directory containing the directory to be removed is marked sticky, and neither the containing directory nor the directory to be removed are owned by the effective user ID. -.It Bq Er EPERM -After expanding any symbolic links, the last component of the path is +.It Bq Er EINVAL +The last component of the path is +.Ql .\& +or .Ql .. . .It Bq Er EBUSY The directory to be removed is the mount point diff --git a/lib/libc/sys/undelete.2 b/lib/libc/sys/undelete.2 index 3f8442415122..c52cc029077e 100644 --- a/lib/libc/sys/undelete.2 +++ b/lib/libc/sys/undelete.2 @@ -33,7 +33,7 @@ .\" @(#)undelete.2 8.4 (Berkeley) 10/18/94 .\" $FreeBSD$ .\" -.Dd October 18, 1994 +.Dd January 22, 2006 .Dt UNDELETE 2 .Os .Sh NAME @@ -86,8 +86,8 @@ Too many symbolic links were encountered in translating the pathname. .It Bq Er EPERM The directory containing the name is marked sticky, and the containing directory is not owned by the effective user ID. -.It Bq Er EPERM -After expanding any symbolic links, the last component of the path is +.It Bq Er EINVAL +The last component of the path is .Ql .. . .It Bq Er EIO An I/O error occurred while updating the directory entry.