From owner-svn-src-all@freebsd.org Fri Sep 15 20:12:40 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 19F94E07036; Fri, 15 Sep 2017 20:12:40 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DB57976E2A; Fri, 15 Sep 2017 20:12:39 +0000 (UTC) (envelope-from emaste@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v8FKCd8D050686; Fri, 15 Sep 2017 20:12:39 GMT (envelope-from emaste@FreeBSD.org) Received: (from emaste@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v8FKCdDA050685; Fri, 15 Sep 2017 20:12:39 GMT (envelope-from emaste@FreeBSD.org) Message-Id: <201709152012.v8FKCdDA050685@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: emaste set sender to emaste@FreeBSD.org using -f From: Ed Maste Date: Fri, 15 Sep 2017 20:12:39 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r323623 - head/lib/libc/sys X-SVN-Group: head X-SVN-Commit-Author: emaste X-SVN-Commit-Paths: head/lib/libc/sys X-SVN-Commit-Revision: 323623 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 15 Sep 2017 20:12:40 -0000 Author: emaste Date: Fri Sep 15 20:12:38 2017 New Revision: 323623 URL: https://svnweb.freebsd.org/changeset/base/323623 Log: rename(2): document capability mode errors Reviewed by: allanjude MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D12339 Modified: head/lib/libc/sys/rename.2 Modified: head/lib/libc/sys/rename.2 ============================================================================== --- head/lib/libc/sys/rename.2 Fri Sep 15 20:05:55 2017 (r323622) +++ head/lib/libc/sys/rename.2 Fri Sep 15 20:12:38 2017 (r323623) @@ -28,7 +28,7 @@ .\" @(#)rename.2 8.1 (Berkeley) 6/4/93 .\" $FreeBSD$ .\" -.Dd April 10, 2008 +.Dd September 15, 2017 .Dt RENAME 2 .Os .Sh NAME @@ -252,6 +252,9 @@ The .Fa to argument is a directory and is not empty. +.It Bq Er ECAPMODE +.Fn rename +was called and the process is in capability mode. .El .Pp In addition to the errors returned by the @@ -288,6 +291,26 @@ argument is not an absolute path and is neither .Dv AT_FDCWD nor a file descriptor associated with a directory. +.It Bq Er ECAPMODE +.Dv AT_FDCWD +is specified and the process is in capability mode. +.It Bq Er ENOTCAPABLE +.Fa path +is an absolute path or contained a ".." component leading to a directory +outside of the directory hierarchy specified by +.Fa fromfd +or +.Fa tofd . +.It Bq Er ENOTCAPABLE +The +.Fa fromfd +file descriptor lacks the +.Dv CAP_RENAMEAT_SOURCE +right, or the +.Fa tofd +file descriptor lacks the +.Dv CAP_RENAMEAT_TARGET +right. .El .Sh SEE ALSO .Xr chflags 2 ,