Re: link(2) allows directory hard links, man page says otherwise
site_archiver@lists.apple.com Delivered-To: darwin-dev@lists.apple.com Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=yob4VeNKMJ5urJUmL2diXrw+D0da6VTWXOLCA6c5KkU=; b=r4Pk/vLROktlAPPvIQtDV1NPkY5AQstDE9DRaBoTRu/PPIjZWNkJAZ7Hu6SJWFI7YGfvTu/gFiKN5EnpT7h5veHPahPzw29vXHWIdfMxo+/MiweSMFZ96QNLRuCI2/lI6yP3TB2hKFF5YiFr88cLeQFKsBTYr4HHQ5YmfUhcnGM= Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=gFafCdcrtfpu4vAATQgEd61NJR+y4IgflWWHx45EgNmlIVQYtMEeFvZI44EBov9EQ10Ky3HIokKy9hHBYVSPwsrTiiv92pX7Rn16JhICzCaCPnlwKbowBh3BDRc5AXB9ojcC0J1OFHdN1lgup9cko7f20tAbx6keToavO7w5p2k= On Dec 12, 2007 6:12 PM, Rosyna <rosyna@unsanity.com> wrote:
The actual implementation of link() on 10.5 allows for directory hard links on HFS+ as long as they follow these rules:
- Source parent and destination parent cannot match - A link is not permitted in the root directory - Parent of 'pointed at' directory is not the root directory - The 'pointed at' directory (source) is not an ancestor of the new directory hard link (destination). - No ancestor of the new directory hard link (destination) is a directory hard link.
The man page for link(2) says (in various places):
As mandated by POSIX.1, path1 may not be a directory.
[EPERM] The file named by path1 is a directory.
STANDARDS The link() function is expected to conform to IEEE Std 1003.1-1988 (``POSIX.1'').
But actually calling link() allows for directory hard links. Is this an error in the documentation, an error in the function, or am I connecting two things that shouldn't be?
the POSIX standard you reference is outdated. please refer to: http://www.opengroup.org/onlinepubs/009695399/functions/link.html where it quotes: If path1 names a directory, link() shall fail unless the process has appropriate privileges and the implementation supports using link() on directories. and under errors it states: [EPERM] The file named by path1 is a directory and either the calling process does not have appropriate privileges or the implementation prohibits using link() on directories. -mike _______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (Darwin-dev@lists.apple.com) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/darwin-dev/site_archiver%40lists.appl... This email sent to site_archiver@lists.apple.com
participants (1)
-
Mike Frysinger