>>> You can always pass the original verbatim exec path to realpath(3) >>> if you want to canonicalize it, >> True, though that - at best - returns the hard path at the time of >> realpath (or more precisely with pieces fetched at various times >> scattered throughout the execution of realpath), which may not be >> the same as the one at the time of exec. > If the path resolution may have concurrently changed between the > execve call and the realpath call, it may as well have concurrently > changed between the execve call and the open call.
Good point. Since (at least as far as I recall) we don't know why anyone (putatively) wants the original path, we don't know whether this matters. But for most likely purposes I would expect it would. Maybe what this wants is a way to flag the executable such that it automatically gets something like a descriptor open on the directory containing the executable? I'm not sure that's quite the right semantic, but maybe it's close enough to be a useful starting point. /~\ The ASCII Mouse \ / Ribbon Campaign X Against HTML [email protected] / \ Email! 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B
