Adjust LPdir_unix.c on VMS for OpenSSL expectations
authorRichard Levitte <levitte@openssl.org>
Sun, 11 Mar 2018 22:48:04 +0000 (23:48 +0100)
committerRichard Levitte <levitte@openssl.org>
Mon, 12 Mar 2018 22:01:02 +0000 (23:01 +0100)
commita5829ae282f47c39d1dd0642e4a84c0a6f3d80f4
tree9931f3a2fbf116858ee736b4f0beb01bdbb72180
parent86a227ee1b7cae68dfbe5737bf3193a8f03eb138
Adjust LPdir_unix.c on VMS for OpenSSL expectations

When OPENSSL_DIR_read implemented by LPdir_unix.c gets a Unixy path,
it will return file names like you'd expect them on Unix.

However, if given a path with VMS syntax, such as "[.foo]", it returns
file names with generation numbers, such as "bar.txt;1", which makes
sense for VMS expectations, but can be surprising for OpenSSL.

Our solution is to simply shave off the generation number if
OPENSSL_DIR_read() expects there should be one, and make sure not to
return the same file name twice.  Note that VMS filesystems are case
insensitive, so the check for duplicate file names are done without
regard to character case.

Reviewed-by: Tim Hudson <tjh@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5587)
crypto/LPdir_unix.c