mirror of
https://github.com/lxsang/ant-http
synced 2024-11-16 00:28:21 +01:00
Infer plugin realpath from configuration
All checks were successful
gitea-sync/ant-http/pipeline/head This commit looks good
All checks were successful
gitea-sync/ant-http/pipeline/head This commit looks good
This commit is contained in:
parent
0d9d6b5497
commit
91461f0b21
@ -110,12 +110,21 @@ static int config_handler(void *conf, const char *section, const char *name,
|
|||||||
// trim(name,' ');
|
// trim(name,' ');
|
||||||
// char * ppath = NULL;
|
// char * ppath = NULL;
|
||||||
if (MATCH("SERVER", "plugins"))
|
if (MATCH("SERVER", "plugins"))
|
||||||
|
{
|
||||||
|
if (stat(value, &st) == -1)
|
||||||
|
mkdirp(value, 0755);
|
||||||
|
tmp = realpath(value, NULL);
|
||||||
|
if(!tmp)
|
||||||
|
{
|
||||||
|
ERROR("Unable to query real path for %s: %s", value, strerror(errno));
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
if (pconfig->plugins_dir)
|
if (pconfig->plugins_dir)
|
||||||
free(pconfig->plugins_dir);
|
free(pconfig->plugins_dir);
|
||||||
pconfig->plugins_dir = strdup(value);
|
pconfig->plugins_dir = tmp;
|
||||||
if (stat(pconfig->plugins_dir, &st) == -1)
|
LOG("Database root is %s", pconfig->plugins_dir);
|
||||||
mkdirp(pconfig->plugins_dir, 0755);
|
}
|
||||||
}
|
}
|
||||||
else if (MATCH("SERVER", "plugins_ext"))
|
else if (MATCH("SERVER", "plugins_ext"))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user