Skip to content

Commit a5d795d

Browse files
author
Erlang/OTP
committed
Merge branch 'kuba/maint-24/ssl/fix_cacertfile_relative_symlink/OTP-18266' into maint-24
* kuba/maint-24/ssl/fix_cacertfile_relative_symlink/OTP-18266: ssl: fix for symlink resolving to relative path with CA certs
2 parents 849b16c + 97aedb9 commit a5d795d

File tree

2 files changed

+734
-177
lines changed

2 files changed

+734
-177
lines changed

lib/ssl/src/ssl.erl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2859,7 +2859,13 @@ unambiguous_path(Value) ->
28592859
AbsName = filename:absname(Value),
28602860
case file:read_link(AbsName) of
28612861
{ok, PathWithNoLink} ->
2862-
PathWithNoLink;
2862+
case filename:pathtype(PathWithNoLink) of
2863+
relative ->
2864+
Dirname = filename:dirname(AbsName),
2865+
filename:join([Dirname, PathWithNoLink]);
2866+
_ ->
2867+
PathWithNoLink
2868+
end;
28632869
_ ->
28642870
AbsName
28652871
end.

0 commit comments

Comments
 (0)