From 29d8770983674f161aac390a73b74c3c2318f38f Mon Sep 17 00:00:00 2001 From: Dirk Brenken Date: Thu, 22 Mar 2018 09:19:51 +0100 Subject: [PATCH 1/1] luci-base/util.lua: enhance checklib function * enhance the checklib function in util.lua to check the 'fullpathexe' as well, e.g. this fixes runtime errors on the dhcp/dns template in environments without dnsmasq Signed-off-by: Dirk Brenken --- modules/luci-base/luasrc/util.lua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/luci-base/luasrc/util.lua b/modules/luci-base/luasrc/util.lua index 0e7334be8..28c126621 100644 --- a/modules/luci-base/luasrc/util.lua +++ b/modules/luci-base/luasrc/util.lua @@ -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) -- 2.11.0