/* This reads all files listed in /etc/tmpfiles.d/?*.conf and creates
* them in the file system. This is intended to be used to create
- * properly owned directories beneath /tmp, /var/tmp, /var/run and
- * /var/lock which are volatile and hence need to be recreated on
- * bootup. */
+ * properly owned directories beneath /tmp, /var/tmp, /run, which are
+ * volatile and hence need to be recreated on bootup. */
enum {
/* These ones take file names */
case CREATE_DIRECTORY:
u = umask(0);
+ mkdir_parents(i->path, 0755);
r = mkdir(i->path, i->mode);
umask(u);
break;
}
- if ((r = label_fix(i->path)) < 0)
+ if ((r = label_fix(i->path, false)) < 0)
goto finish;
log_debug("%s created successfully.", i->path);
return 0;
if (d->d_type != DT_REG &&
- d->d_type != DT_LNK)
+ d->d_type != DT_LNK &&
+ d->d_type != DT_UNKNOWN)
return 0;
return endswith(d->d_name, ".conf");
}
if (!arg_clean && !arg_create && !arg_remove) {
- log_error("You need to specify at leat one of --clean, --create or --remove.");
+ log_error("You need to specify at least one of --clean, --create or --remove.");
return -EINVAL;
}