Merge pull request #1695 from dibdot/regex-dhcphost

luci-base/util.lua: enhance checklib function
This commit is contained in:
Jo-Philipp Wich 2018-03-22 10:45:42 +01:00 committed by GitHub
commit 84b3ba46f8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -652,7 +652,8 @@ end
function checklib(fullpathexe, wantedlib)
local fs = require "nixio.fs"
local haveldd = fs.access('/usr/bin/ldd')
if not haveldd then
local haveexe = fs.access(fullpathexe)
if not haveldd or not haveexe then
return false
end
local libs = exec("/usr/bin/ldd " .. fullpathexe)