summaryrefslogtreecommitdiffstats
path: root/src/tmpfiles
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2020-05-05 22:48:50 +0200
committerLennart Poettering <lennart@poettering.net>2020-05-07 16:35:20 +0200
commit7dc6477dc941ff69a1cc6f31d22dcdd6f81521d3 (patch)
tree5f877058c7d260b17ef019a85cb2f5726b7939fb /src/tmpfiles
parenttmpfiles: optionally, read /etc/passwd + /etc/group without NSS (diff)
downloadsystemd-7dc6477dc941ff69a1cc6f31d22dcdd6f81521d3.tar.xz
systemd-7dc6477dc941ff69a1cc6f31d22dcdd6f81521d3.zip
sysusers/tmpfiles: use --root=/ as way to force offline operation (i.e. without NSS)
Diffstat (limited to 'src/tmpfiles')
-rw-r--r--src/tmpfiles/tmpfiles.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
index 37dde99ef0..9b42f73b8e 100644
--- a/src/tmpfiles/tmpfiles.c
+++ b/src/tmpfiles/tmpfiles.c
@@ -2666,7 +2666,7 @@ static int parse_line(
case COPY_FILES:
if (!i.argument) {
- i.argument = path_join(arg_root, "/usr/share/factory", i.path);
+ i.argument = path_join("/usr/share/factory", i.path);
if (!i.argument)
return log_oom();
@@ -2674,7 +2674,9 @@ static int parse_line(
*invalid_config = true;
return log_syntax(NULL, LOG_ERR, fname, line, SYNTHETIC_ERRNO(EBADMSG), "Source path '%s' is not absolute.", i.argument);
- } else if (arg_root) {
+ }
+
+ if (!empty_or_root(arg_root)) {
char *p;
p = path_join(arg_root, i.argument);
@@ -2765,7 +2767,7 @@ static int parse_line(
return log_syntax(NULL, LOG_ERR, fname, line, r, "Failed to substitute specifiers in argument: %m");
}
- if (arg_root) {
+ if (!empty_or_root(arg_root)) {
char *p;
p = path_join(arg_root, i.path);
@@ -2993,7 +2995,7 @@ static int parse_argv(int argc, char *argv[]) {
break;
case ARG_ROOT:
- r = parse_path_argument_and_warn(optarg, true, &arg_root);
+ r = parse_path_argument_and_warn(optarg, /* suppress_root= */ false, &arg_root);
if (r < 0)
return r;
break;