Skip to content

Commit

Permalink
dlopen: fix handling of versioned libraries (#503)
Browse files Browse the repository at this point in the history
Support multi-parts versions, like `libcrypto.so.1.1`.
  • Loading branch information
benoit-pierre authored Aug 7, 2024
1 parent ccb2fc0 commit f3e663c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions assets/dl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ function dl.dlopen(library, load_func, depth)
end

local ok, lib = pcall(Elf.open, lname)
if not ok and lname:find("%.so%.%d+$") then
lname = lname:gsub("%.so%.%d+$", "%.so")
if not ok and lname:find("%.so%.%d[.%d]*$") then
lname = lname:gsub("%.so%.%d[.%d]*$", "%.so")
ok, lib = pcall(Elf.open, lname)
end
if ok then
Expand Down

0 comments on commit f3e663c

Please sign in to comment.