From: Lennart Poettering Date: Tue, 5 May 2020 20:48:50 +0000 (+0200) Subject: sysusers/tmpfiles: use --root=/ as way to force offline operation (i.e. without... X-Git-Tag: v246-rc1~410^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7dc6477dc941ff69a1cc6f31d22dcdd6f81521d3;p=thirdparty%2Fsystemd.git sysusers/tmpfiles: use --root=/ as way to force offline operation (i.e. without NSS) --- diff --git a/src/sysusers/sysusers.c b/src/sysusers/sysusers.c index 73a710bee7c..9a46c9fa6f3 100644 --- a/src/sysusers/sysusers.c +++ b/src/sysusers/sysusers.c @@ -1813,7 +1813,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; diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c index 37dde99ef0b..9b42f73b8eb 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;