The following issue has been SUBMITTED.
======================================================================
https://austingroupbugs.net/view.php?id=1831
======================================================================
Reported By: philip-guenther
Assigned To:
======================================================================
Project: 1003.1(2016/18)/Issue7+TC2
Issue ID: 1831
Category: System Interfaces
Type: Clarification Requested
Severity: Objection
Priority: normal
Status: New
Name: Philip Guenther
Organization: OpenBSD
User Reference:
Section: pathconf
Page Number: 902-907
Line Number: 30519
Interp Status: ---
Final Accepted Text:
======================================================================
Date Submitted: 2024-05-15 08:10 UTC
Last Modified: 2024-05-15 08:10 UTC
======================================================================
Summary: how do you get the timestamp resolution of a
symlink?
Description:
The description of pathconf() doesn't contain any specific wording about
how it should handle a path which names a symlink. Contrast rename()'s
description which says
If either the old or new argument names a symbolic link, rename()
shall
operate on the symbolic link itself, and shall not resolve the last
component of the argument.
and unlink()'s description which says
If path names a symbolic link, unlink() shall remove the symbolic link
named by path and shall not affect any file or directory named by the
contents of the symbolic link.
It thus appears that pathconf() is expected to completely follow symlinks
and report the values appropriate for the final result of the pathname
resolution.
However, it would be useful to be able to get the timestamp resolution
(_PC_TIMESTAMP_RESOLUTION) for a symlink, even if it's dangling or points
to a path on a filesystem with a different timestamp resolution.
(This was encountered when trying to fix a pax implementation's handling of
timestamp comparison for -u when the target filesystem had courser
resolution that the source filesystem by using
pathconf(_PC_TIMESTAMP_RESOLUTION) on the target path to handle the loss of
high-precision time info...but the symlink pointed to a location with
high-precision timestamps so it couldn't know to round the times when doing
the comparison...)
Desired Action:
Got me! Change pathconf() to never follow a final symlink, ala rename(),
unlink(), open(O_NOFOLLOW)? Never follow a terminal symlink when the
second argument is _PC_TIMESTAMP_RESOLUTION? A new
_PC_TIMESTAMP_RESOLUTION_NOFOLLOW???
(cries)
======================================================================
Issue History
Date Modified Username Field Change
======================================================================
2024-05-15 08:10 philip-guentherNew Issue
2024-05-15 08:10 philip-guentherName => Philip Guenther
2024-05-15 08:10 philip-guentherOrganization => OpenBSD
2024-05-15 08:10 philip-guentherSection => pathconf
2024-05-15 08:10 philip-guentherPage Number => 902-907
2024-05-15 08:10 philip-guentherLine Number => 30519
======================================================================