Commit 05331a56 authored by Marek Vavrusa's avatar Marek Vavrusa

daemon: "-c -" doesn't ready any configuration

this includes default configuration, resolver
starts completely blank
parent 7f282a1d
......@@ -69,6 +69,7 @@ static int l_help(lua_State *L)
"cache\n network configuration\n"
"modules\n modules configuration\n"
"kres\n resolver services\n"
"trust_anchors\n configure trust anchors\n"
;
lua_pushstring(L, help_str);
return 1;
......@@ -570,6 +571,9 @@ static int engine_loadconf(struct engine *engine, const char *config_path)
return kr_error(ENOEXEC);
}
/* Load config file */
if (strcmp(config_path, "-") == 0) {
return ret; /* No config, no defaults. */
}
if(access(config_path, F_OK ) != -1 ) {
ret = l_dosandboxfile(engine->L, config_path);
}
......
......@@ -324,7 +324,7 @@ int main(int argc, char **argv)
kr_log_error("[system] rundir '%s': %s\n", rundir, strerror(errno));
return EXIT_FAILURE;
}
if(config && access(config, R_OK) != 0) {
if(config && strcmp(config, "-") != 0 && access(config, R_OK) != 0) {
kr_log_error("[system] rundir '%s'\n", rundir);
kr_log_error("[system] config '%s': %s\n", config, strerror(errno));
return EXIT_FAILURE;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment