"/run/tmpfiles.d",
"/usr/local/lib/tmpfiles.d",
"/usr/lib/tmpfiles.d",
+#ifdef HAVE_SPLIT_USR
+ "/lib/tmpfiles.d",
+#endif
NULL
};
sub_path = NULL;
if (asprintf(&sub_path, "%s/%s", p, dent->d_name) < 0) {
- log_error("Out of memory");
- r = -ENOMEM;
+ r = log_oom();
goto finish;
}
return -errno;
}
- return label_fix(path, false);
+ return label_fix(path, false, false);
}
static int recursive_relabel_children(Item *i, const char *path) {
case TRUNCATE_DIRECTORY:
case RECURSIVE_REMOVE_PATH:
- r = rm_rf(instance, false, i->type == RECURSIVE_REMOVE_PATH, false);
+ /* FIXME: we probably should use dir_cleanup() here
+ * instead of rm_rf() so that 'x' is honoured. */
+ r = rm_rf_dangerous(instance, false, i->type == RECURSIVE_REMOVE_PATH, false);
if (r < 0 && r != -ENOENT) {
log_error("rm_rf(%s): %s", instance, strerror(-r));
return r;
assert(buffer);
i = new0(Item, 1);
- if (!i) {
- log_error("Out of memory");
- return -ENOMEM;
- }
+ if (!i)
+ return log_oom();
if (sscanf(buffer,
"%c "
n += strspn(buffer+n, WHITESPACE);
if (buffer[n] != 0 && (buffer[n] != '-' || buffer[n+1] != 0)) {
i->argument = unquote(buffer+n, "\"");
- if (!i->argument) {
- log_error("Out of memory");
- return -ENOMEM;
- }
+ if (!i->argument)
+ return log_oom();
}
}
if (user && !streq(user, "-")) {
const char *u = user;
- r = get_user_creds(&u, &i->uid, NULL, NULL);
+ r = get_user_creds(&u, &i->uid, NULL, NULL, NULL);
if (r < 0) {
log_error("[%s:%u] Unknown user '%s'.", fname, line, user);
goto finish;
return strdup(fragment);
STRV_FOREACH(p, search_paths) {
- resolved_path = join(*p, "/", fragment, NULL);
+ resolved_path = strjoin(*p, "/", fragment, NULL);
if (resolved_path == NULL) {
- log_error("Out of memory");
+ log_oom();
return NULL;
}
globs = hashmap_new(string_hash_func, string_compare_func);
if (!items || !globs) {
- log_error("Out of memory");
+ log_oom();
r = EXIT_FAILURE;
goto finish;
}