From d81d850651c326c48bcddd2ec82e8e0a686ad13f Mon Sep 17 00:00:00 2001 From: Michael Kerrisk Date: Wed, 19 Mar 2014 16:29:56 +0100 Subject: [PATCH] link.2: When AT_EMPTY_PATH is specified, 'olddirfd' must not refer to a directory Signed-off-by: Michael Kerrisk --- man2/link.2 | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/man2/link.2 b/man2/link.2 index 031109654..e76e28b51 100644 --- a/man2/link.2 +++ b/man2/link.2 @@ -29,7 +29,7 @@ .\" Modified 2004-06-23 by Michael Kerrisk .\" Modified 2005-04-04, as per suggestion by Michael Hardt for rename.2 .\" -.TH LINK 2 2014-02-21 "Linux" "Linux Programmer's Manual" +.TH LINK 2 2014-03-19 "Linux" "Linux Programmer's Manual" .SH NAME link, linkat \- make a new name for a file .SH SYNOPSIS @@ -135,7 +135,7 @@ is an empty string, create a link to the file referenced by flag). In this case, .I olddirfd -can refer to any type of file, not just a directory. +must refer to a file other than a directory. The caller must have the .BR CAP_DAC_READ_SEARCH capability in order to use this flag; @@ -300,6 +300,15 @@ or similar for .I newpath and .I newdirfd +.TP +.B EPERM +.BR AT_EMPTY_PATH +was specified in +.IR flags , +.I oldpath +is an empty string, and +.IR olddirfd +refers to a directory. .SH VERSIONS .BR linkat () was added to Linux in kernel 2.6.16;