Module Name:    src
Committed By:   uwe
Date:           Sat Jul 20 13:12:19 UTC 2024

Modified Files:
        src/lib/libc/sys: link.2

Log Message:
link(2): links to directories are refused at the VFS level

Drop the condition that "the caller is the super-user and the file
system ... supports linking to directories."

>From nabijaczleweli.


To generate a diff of this commit:
cvs rdiff -u -r1.33 -r1.34 src/lib/libc/sys/link.2

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/lib/libc/sys/link.2
diff -u src/lib/libc/sys/link.2:1.33 src/lib/libc/sys/link.2:1.34
--- src/lib/libc/sys/link.2:1.33	Sun Sep  1 19:52:32 2019
+++ src/lib/libc/sys/link.2	Sat Jul 20 13:12:19 2024
@@ -1,4 +1,4 @@
-.\"	$NetBSD: link.2,v 1.33 2019/09/01 19:52:32 sevan Exp $
+.\"	$NetBSD: link.2,v 1.34 2024/07/20 13:12:19 uwe Exp $
 .\"
 .\" Copyright (c) 1980, 1991, 1993, 2011
 .\"	The Regents of the University of California.  All rights reserved.
@@ -29,7 +29,7 @@
 .\"
 .\"     @(#)link.2	8.3 (Berkeley) 1/12/94
 .\"
-.Dd September 1, 2019
+.Dd July 20, 2024
 .Dt LINK 2
 .Os
 .Sh NAME
@@ -78,8 +78,7 @@ and
 .Fa name2
 must be in the same file system.
 .Fa name1
-may not be a directory unless the caller is the super-user
-and the file system containing it supports linking to directories.
+may not be a directory.
 .Pp
 .Fn linkat
 works the same way as
@@ -188,11 +187,7 @@ does not support links.
 .It Bq Er EPERM
 The file named by
 .Fa name1
-is a directory and the effective
-user ID is not super-user,
-or the file system containing the file does not permit the use of
-.Fn link
-on a directory.
+is a directory.
 .It Bq Er EROFS
 The requested link requires writing in a directory on a read-only file
 system.

Reply via email to