[Info-vax] Perl (for OpenSSL) v. me
Craig A. Berry
craigberry at nospam.mac.com
Sun Feb 7 18:25:35 EST 2016
On 2/7/16 10:23 AM, Steven Schweda wrote:
>> The problem with os.pl is that realpath is returning a device name
>> based on the volume label (DVI$_LOGVOLNAM I believe it's called), but
>> that's not what your current working directory is using. [...]
>
> Yup.
>
>> If there is a bug, it looks like it's in realpath:
>
> Agreed. I normally never use those DISK$ logical names, so it's not
> clear to me why anyone would drag them into the conversation without an
> explicit invitation.
Me either, but it wasn't me, it was the authors of LIB$FID_TO_NAME.
We have our own realpath implementation in Perl because the one in the
CRTL only works when you have a POSIX root and
DECC$POSIX_COMPLIANT_PATHNAMES defined, which means it's completely
useless for those of living in the ancient world of disks and directories.
Perl's realpath implementation (written by John Malmberg about 10 years
ago) first gets the device name by calling stat() and then passes the
st_devnam and st_ino fields to LIB$FID_TO_NAME. stat() gives you
something that looks like DVI$_FULLDEVNAM in st_devnam and
LIB$FID_TO_NAME gives you something that looks like DVI$_LOGVOLNAM in
the output file spec (these are my best guesses but I don't have the
sources or the time to test exhaustively).
All of that seems reasonable enough and it does give you a real path. It
does not necessarily, however, give you a path that corresponds to the
output of SHOW DEFAULT even if you are on the same disk as the file in
question. I think the cause may already be lost after the stat call
because that drills through any concealed logical names and gives you a
real device that may or may not match SYS$DISK even if they are really
the same device. ALLOCLASS and SHADOWING probably figure in here too
somewhere.
I'm open to suggestions on how to fix this. I see nothing in the standard at
<http://pubs.opengroup.org/onlinepubs/9699919799/functions/realpath.html>
that offers any clues about what realpath should do when devices can be
known by so many different names.
>> I will try to put that on my list of things to look at.
>
> If 5.10.1 really did work for OpenSSL, then I's guess that something
> changed (for the worse?) since then.
The behavior is the same under 5.10.0 (don't have 5.10.1 handy anywhere
at the moment). So yes, something changed, but I don't think it's Perl.
More information about the Info-vax
mailing list