{ 'w', specifier_os_version_id, NULL }, \
{ 'W', specifier_os_variant_id, NULL }
-
#define COMMON_CREDS_SPECIFIERS \
{ 'g', specifier_group_name, NULL }, \
{ 'G', specifier_group_id, NULL }, \
}
int specifier_escape_strv(char **l, char ***ret);
+
+/* A generic specifier table consisting of COMMON_SYSTEM_SPECIFIERS and COMMON_TMP_SPECIFIERS */
+extern const Specifier system_and_tmp_specifier_table[];
static int parse_line(const char *fname, unsigned line, const char *buffer) {
- static const Specifier specifier_table[] = {
- COMMON_SYSTEM_SPECIFIERS,
- COMMON_TMP_SPECIFIERS,
- {}
- };
-
_cleanup_free_ char *action = NULL,
*name = NULL, *resolved_name = NULL,
*id = NULL, *resolved_id = NULL,
name = mfree(name);
if (name) {
- r = specifier_printf(name, NAME_MAX, specifier_table, NULL, &resolved_name);
+ r = specifier_printf(name, NAME_MAX, system_and_tmp_specifier_table, NULL, &resolved_name);
if (r < 0)
return log_error_errno(r, "[%s:%u] Failed to replace specifiers in '%s': %m", fname, line, name);
id = mfree(id);
if (id) {
- r = specifier_printf(id, PATH_MAX-1, specifier_table, NULL, &resolved_id);
+ r = specifier_printf(id, PATH_MAX-1, system_and_tmp_specifier_table, NULL, &resolved_id);
if (r < 0)
return log_error_errno(r, "[%s:%u] Failed to replace specifiers in '%s': %m",
fname, line, name);
description = mfree(description);
if (description) {
- r = specifier_printf(description, LONG_LINE_MAX, specifier_table, NULL, &resolved_description);
+ r = specifier_printf(description, LONG_LINE_MAX, system_and_tmp_specifier_table, NULL, &resolved_description);
if (r < 0)
return log_error_errno(r, "[%s:%u] Failed to replace specifiers in '%s': %m",
fname, line, description);
home = mfree(home);
if (home) {
- r = specifier_printf(home, PATH_MAX-1, specifier_table, NULL, &resolved_home);
+ r = specifier_printf(home, PATH_MAX-1, system_and_tmp_specifier_table, NULL, &resolved_home);
if (r < 0)
return log_error_errno(r, "[%s:%u] Failed to replace specifiers in '%s': %m",
fname, line, home);
shell = mfree(shell);
if (shell) {
- r = specifier_printf(shell, PATH_MAX-1, specifier_table, NULL, &resolved_shell);
+ r = specifier_printf(shell, PATH_MAX-1, system_and_tmp_specifier_table, NULL, &resolved_shell);
if (r < 0)
return log_error_errno(r, "[%s:%u] Failed to replace specifiers in '%s': %m",
fname, line, shell);