From 3dd9b3710a6724538c9b87581a1d7182808f3ba3 Mon Sep 17 00:00:00 2001 From: Jonathan Aillet Date: Tue, 3 Dec 2019 19:10:58 +0100 Subject: Improve plugin search path In controller 'plugin' section, use only paths available with 'spath' key to search for plugins. Multiple paths can be specified using ':' character as separator. Environment variables can be used in paths. If a path is not absolute, it will be added two times to search paths list, one with binder root directory as prefix, and one with binding parent directory. BUG-AGL: SPEC-3011 Change-Id: I1e3fd64d523d36a0e0982bbd31d66ae8d9960d3c Signed-off-by: Jonathan Aillet --- ctl-lib/ctl-lua.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'ctl-lib/ctl-lua.c') diff --git a/ctl-lib/ctl-lua.c b/ctl-lib/ctl-lua.c index 5509385..f3f0dce 100644 --- a/ctl-lib/ctl-lua.c +++ b/ctl-lib/ctl-lua.c @@ -713,7 +713,7 @@ static int LuaAfbGetRootDir(lua_State* luaState) { } // extract and return afbSource from timer handle - lua_pushstring(luaState, GetBindingDirPath(source->api)); + lua_pushstring(luaState, GetAFBRootDirPath(source->api)); return 1; // return argument } @@ -1377,7 +1377,7 @@ int LuaConfigLoad(afb_api_t apiHandle, const char *prefix) { // set package.path lua variable use the CONTROL_PLUGIN_PATH as it could // have to find external lua packages in those directories - spath = GetDefaultPluginSearchPath(apiHandle, prefix); + spath = GetDefaultPluginSearchPath(apiHandle); base_len = strlen(LUA_PATH_VALUE); spath_len = strlen(spath); -- cgit 1.2.3-korg