chiark / gitweb /
dbus-unit: expose PartOf/ConsistsOf properties
[elogind.git] / src / tmpfiles / tmpfiles.c
index 841d1635239e25a81fc596c99dadb594be013f4d..f8d89218c9a4f3825a2b3c1c087b58a8ce546949 100644 (file)
@@ -107,6 +107,9 @@ static const char * const conf_file_dirs[] = {
         "/run/tmpfiles.d",
         "/usr/local/lib/tmpfiles.d",
         "/usr/lib/tmpfiles.d",
+#ifdef HAVE_SPLIT_USR
+        "/lib/tmpfiles.d",
+#endif
         NULL
 };
 
@@ -257,7 +260,7 @@ static int dir_cleanup(
                 sub_path = NULL;
 
                 if (asprintf(&sub_path, "%s/%s", p, dent->d_name) < 0) {
-                        log_error("Out of memory");
+                        log_error("Out of memory.");
                         r = -ENOMEM;
                         goto finish;
                 }
@@ -469,7 +472,7 @@ static int item_set_perms(Item *i, const char *path) {
                         return -errno;
                 }
 
-        return label_fix(path, false);
+        return label_fix(path, false, false);
 }
 
 static int recursive_relabel_children(Item *i, const char *path) {
@@ -843,7 +846,9 @@ static int remove_item_instance(Item *i, const char *instance) {
 
         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;
@@ -965,7 +970,7 @@ static int parse_line(const char *fname, unsigned line, const char *buffer) {
 
         i = new0(Item, 1);
         if (!i) {
-                log_error("Out of memory");
+                log_error("Out of memory.");
                 return -ENOMEM;
         }
 
@@ -994,7 +999,7 @@ static int parse_line(const char *fname, unsigned line, const char *buffer) {
                 if (buffer[n] != 0 && (buffer[n] != '-' || buffer[n+1] != 0)) {
                         i->argument = unquote(buffer+n, "\"");
                         if (!i->argument) {
-                                log_error("Out of memory");
+                                log_error("Out of memory.");
                                 return -ENOMEM;
                         }
                 }
@@ -1074,7 +1079,7 @@ static int parse_line(const char *fname, unsigned line, const char *buffer) {
         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;
@@ -1295,9 +1300,9 @@ static char *resolve_fragment(const char *fragment, const char **search_paths) {
                 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_error("Out of memory.");
                         return NULL;
                 }
 
@@ -1332,7 +1337,7 @@ int main(int argc, char *argv[]) {
         globs = hashmap_new(string_hash_func, string_compare_func);
 
         if (!items || !globs) {
-                log_error("Out of memory");
+                log_error("Out of memory.");
                 r = EXIT_FAILURE;
                 goto finish;
         }