__do_free char *n = NULL;
char *e, *p;
+ if (is_empty_string(name))
+ return ret_errno(EINVAL);
+
+ if (!abspath(name))
+ return ret_errno(EINVAL);
+
/* Make copy of the string since we'll be modifying it. */
n = strdup(name);
if (!n)
if (lxc_log_fd >= 0)
lxc_log_close();
- if (!fname)
+ if (is_empty_string(fname))
return ret_errno(EINVAL);
if (strlen(fname) == 0) {
if (*fd >= 0)
close_prot_errno_disarm(*fd);
+ if (is_empty_string(fname))
+ return ret_errno(EINVAL);
+
if (build_dir(fname))
return -errno;
return -1;
}
+ if (c->set_config_item(c, "lxc.log.file=", "./")) {
+ lxc_error("%s\n", "Managed to set to set invalid config item \"lxc.log.file\" to \"./\"");
+ return -1;
+ }
+
fret = EXIT_SUCCESS;
non_test_error: