repart: resolve $TMP specifiers too
This might be useful for CopyFiles=, to reference some subdir of $TMP in a generic way. This allows us to use the new common system_and_tmp_specifier_table[].
This commit is contained in:
+5
-10
@@ -949,11 +949,6 @@ static int config_parse_type(
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const Specifier specifier_table[] = {
|
||||
COMMON_SYSTEM_SPECIFIERS,
|
||||
{}
|
||||
};
|
||||
|
||||
static int config_parse_label(
|
||||
const char *unit,
|
||||
const char *filename,
|
||||
@@ -976,7 +971,7 @@ static int config_parse_label(
|
||||
/* Nota bene: the empty label is a totally valid one. Let's hence not follow our usual rule of
|
||||
* assigning the empty string to reset to default here, but really accept it as label to set. */
|
||||
|
||||
r = specifier_printf(rvalue, GPT_LABEL_MAX, specifier_table, NULL, &resolved);
|
||||
r = specifier_printf(rvalue, GPT_LABEL_MAX, system_and_tmp_specifier_table, NULL, &resolved);
|
||||
if (r < 0) {
|
||||
log_syntax(unit, LOG_WARNING, filename, line, r,
|
||||
"Failed to expand specifiers in Label=, ignoring: %s", rvalue);
|
||||
@@ -1141,7 +1136,7 @@ static int config_parse_copy_files(
|
||||
if (!isempty(p))
|
||||
return log_syntax(unit, LOG_ERR, filename, line, SYNTHETIC_ERRNO(EINVAL), "Too many arguments: %s", rvalue);
|
||||
|
||||
r = specifier_printf(source, PATH_MAX-1, specifier_table, NULL, &resolved_source);
|
||||
r = specifier_printf(source, PATH_MAX-1, system_and_tmp_specifier_table, NULL, &resolved_source);
|
||||
if (r < 0) {
|
||||
log_syntax(unit, LOG_WARNING, filename, line, r,
|
||||
"Failed to expand specifiers in CopyFiles= source, ignoring: %s", rvalue);
|
||||
@@ -1152,7 +1147,7 @@ static int config_parse_copy_files(
|
||||
if (r < 0)
|
||||
return 0;
|
||||
|
||||
r = specifier_printf(target, PATH_MAX-1, specifier_table, NULL, &resolved_target);
|
||||
r = specifier_printf(target, PATH_MAX-1, system_and_tmp_specifier_table, NULL, &resolved_target);
|
||||
if (r < 0) {
|
||||
log_syntax(unit, LOG_WARNING, filename, line, r,
|
||||
"Failed to expand specifiers in CopyFiles= target, ignoring: %s", resolved_target);
|
||||
@@ -1201,7 +1196,7 @@ static int config_parse_copy_blocks(
|
||||
return 0;
|
||||
}
|
||||
|
||||
r = specifier_printf(rvalue, PATH_MAX-1, specifier_table, NULL, &d);
|
||||
r = specifier_printf(rvalue, PATH_MAX-1, system_and_tmp_specifier_table, NULL, &d);
|
||||
if (r < 0) {
|
||||
log_syntax(unit, LOG_WARNING, filename, line, r,
|
||||
"Failed to expand specifiers in CopyBlocks= source path, ignoring: %s", rvalue);
|
||||
@@ -1249,7 +1244,7 @@ static int config_parse_make_dirs(
|
||||
if (r == 0)
|
||||
return 0;
|
||||
|
||||
r = specifier_printf(word, PATH_MAX-1, specifier_table, NULL, &d);
|
||||
r = specifier_printf(word, PATH_MAX-1, system_and_tmp_specifier_table, NULL, &d);
|
||||
if (r < 0) {
|
||||
log_syntax(unit, LOG_WARNING, filename, line, r,
|
||||
"Failed to expand specifiers in MakeDirectories= parameter, ignoring: %s", word);
|
||||
|
||||
Reference in New Issue
Block a user