sysusers,tmpfiles: always mention error when failing to replace specifiers
This commit is contained in:
parent
2230e8f29d
commit
0f7e4b2888
|
@ -1443,7 +1443,7 @@ static int parse_line(const char *fname, unsigned line, const char *buffer) {
|
||||||
if (name) {
|
if (name) {
|
||||||
r = specifier_printf(name, specifier_table, NULL, &resolved_name);
|
r = specifier_printf(name, specifier_table, NULL, &resolved_name);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return log_error_errno(r, "[%s:%u] Failed to replace specifiers: %s", fname, line, name);
|
return log_error_errno(r, "[%s:%u] Failed to replace specifiers in '%s': %m", fname, line, name);
|
||||||
|
|
||||||
if (!valid_user_group_name(resolved_name, 0))
|
if (!valid_user_group_name(resolved_name, 0))
|
||||||
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
|
return log_error_errno(SYNTHETIC_ERRNO(EINVAL),
|
||||||
|
@ -1458,7 +1458,7 @@ static int parse_line(const char *fname, unsigned line, const char *buffer) {
|
||||||
if (id) {
|
if (id) {
|
||||||
r = specifier_printf(id, specifier_table, NULL, &resolved_id);
|
r = specifier_printf(id, specifier_table, NULL, &resolved_id);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return log_error_errno(r, "[%s:%u] Failed to replace specifiers: %s",
|
return log_error_errno(r, "[%s:%u] Failed to replace specifiers in '%s': %m",
|
||||||
fname, line, name);
|
fname, line, name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1469,7 +1469,7 @@ static int parse_line(const char *fname, unsigned line, const char *buffer) {
|
||||||
if (description) {
|
if (description) {
|
||||||
r = specifier_printf(description, specifier_table, NULL, &resolved_description);
|
r = specifier_printf(description, specifier_table, NULL, &resolved_description);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return log_error_errno(r, "[%s:%u] Failed to replace specifiers: %s",
|
return log_error_errno(r, "[%s:%u] Failed to replace specifiers in '%s': %m",
|
||||||
fname, line, description);
|
fname, line, description);
|
||||||
|
|
||||||
if (!valid_gecos(resolved_description))
|
if (!valid_gecos(resolved_description))
|
||||||
|
@ -1485,7 +1485,7 @@ static int parse_line(const char *fname, unsigned line, const char *buffer) {
|
||||||
if (home) {
|
if (home) {
|
||||||
r = specifier_printf(home, specifier_table, NULL, &resolved_home);
|
r = specifier_printf(home, specifier_table, NULL, &resolved_home);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return log_error_errno(r, "[%s:%u] Failed to replace specifiers: %s",
|
return log_error_errno(r, "[%s:%u] Failed to replace specifiers in '%s': %m",
|
||||||
fname, line, home);
|
fname, line, home);
|
||||||
|
|
||||||
if (!valid_home(resolved_home))
|
if (!valid_home(resolved_home))
|
||||||
|
@ -1501,7 +1501,7 @@ static int parse_line(const char *fname, unsigned line, const char *buffer) {
|
||||||
if (shell) {
|
if (shell) {
|
||||||
r = specifier_printf(shell, specifier_table, NULL, &resolved_shell);
|
r = specifier_printf(shell, specifier_table, NULL, &resolved_shell);
|
||||||
if (r < 0)
|
if (r < 0)
|
||||||
return log_error_errno(r, "[%s:%u] Failed to replace specifiers: %s",
|
return log_error_errno(r, "[%s:%u] Failed to replace specifiers in '%s': %m",
|
||||||
fname, line, shell);
|
fname, line, shell);
|
||||||
|
|
||||||
if (!valid_shell(resolved_shell))
|
if (!valid_shell(resolved_shell))
|
||||||
|
|
|
@ -2556,7 +2556,7 @@ static int parse_line(const char *fname, unsigned line, const char *buffer, bool
|
||||||
if (r < 0) {
|
if (r < 0) {
|
||||||
if (IN_SET(r, -EINVAL, -EBADSLT))
|
if (IN_SET(r, -EINVAL, -EBADSLT))
|
||||||
*invalid_config = true;
|
*invalid_config = true;
|
||||||
return log_error_errno(r, "[%s:%u] Failed to replace specifiers: %s", fname, line, path);
|
return log_error_errno(r, "[%s:%u] Failed to replace specifiers in '%s': %m", fname, line, path);
|
||||||
}
|
}
|
||||||
|
|
||||||
r = patch_var_run(fname, line, &i.path);
|
r = patch_var_run(fname, line, &i.path);
|
||||||
|
|
Loading…
Reference in a new issue