aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2010-07-23 23:14:50 +0500
committerWaqas Hussain <waqas20@gmail.com>2010-07-23 23:14:50 +0500
commit1cbe0cea9b54b640b79b7cf91633015750396318 (patch)
treedf97cbffbf51736969dc96e55abc69d992259670
parent56bdddaebbfb3ccede367a0f10dbd2d91c381206 (diff)
downloadprosody-1cbe0cea9b54b640b79b7cf91633015750396318.tar.gz
prosody-1cbe0cea9b54b640b79b7cf91633015750396318.zip
prosody.resolve_relative_path: Updated to take a parent path to resolve against.
-rw-r--r--core/certmanager.lua9
-rwxr-xr-xprosody4
2 files changed, 7 insertions, 6 deletions
diff --git a/core/certmanager.lua b/core/certmanager.lua
index f640a430..eadddd78 100644
--- a/core/certmanager.lua
+++ b/core/certmanager.lua
@@ -15,6 +15,7 @@ local setmetatable, tostring = setmetatable, tostring;
local prosody = prosody;
local resolve_path = prosody.resolve_relative_path;
+local config_path = prosody.paths.config;
module "certmanager"
@@ -31,11 +32,11 @@ function create_context(host, mode, config)
local ssl_config = {
mode = mode;
protocol = user_ssl_config.protocol or "sslv23";
- key = resolve_path(user_ssl_config.key);
+ key = resolve_path(config_path, user_ssl_config.key);
password = user_ssl_config.password;
- certificate = resolve_path(user_ssl_config.certificate);
- capath = resolve_path(user_ssl_config.capath or default_capath);
- cafile = resolve_path(user_ssl_config.cafile);
+ certificate = resolve_path(config_path, user_ssl_config.certificate);
+ capath = resolve_path(config_path, user_ssl_config.capath or default_capath);
+ cafile = resolve_path(config_path, user_ssl_config.cafile);
verify = user_ssl_config.verify or "none";
options = user_ssl_config.options or "no_sslv2";
ciphers = user_ssl_config.ciphers;
diff --git a/prosody b/prosody
index 6ec9131e..3be2e53a 100755
--- a/prosody
+++ b/prosody
@@ -165,7 +165,7 @@ function init_global_state()
local path_sep = package.config:sub(1,1);
local rel_path_start = ".."..path_sep;
- function prosody.resolve_relative_path(path)
+ function prosody.resolve_relative_path(parent_path, path)
if path then
local is_relative;
if path_sep == "/" and path:sub(1,1) ~= "/" then
@@ -174,7 +174,7 @@ function init_global_state()
is_relative = true;
end
if is_relative then
- return CFG_CONFIGDIR..path_sep..path;
+ return parent_path..path_sep..path;
end
end
return path;