Change-Id: I50ca411b3268fdc25d1cb58a19f1dc8aa9752bbb
Signed-off-by: Michal Bloch <m.bloch@samsung.com>
assert(!inotify_path);
const char *const extra_config_path = log_config_get(config, DYNAMIC_CONFIG_CONF_KEY);
- if (!extra_config_path)
+ if (!extra_config_path || extra_config_path[0] != '/')
return false;
if (asprintf(&inotify_path, "%s/%s", extra_config_path, DYNAMIC_CONFIG_FILENAME) < 0) {
printf("Dynamic config is disabled (\"%s\" not defined in config)\n", DYNAMIC_CONFIG_CONF_KEY);
return EXIT_SUCCESS;
}
+ if (extra_config_path[0] != '/') {
+ printf("Dynamic config: invalid path in (is \"%s\" but has to be absolute)\n", extra_config_path);
+ return EXIT_FAILURE;
+ }
__attribute__ ((cleanup(free_ptr))) char *full_inotify_path = NULL;
if (asprintf(&full_inotify_path, "%s/%s", extra_config_path, DYNAMIC_CONFIG_FILENAME) < 0) {