sysusers: add a generic specifier table for common cases

This moves the definition of the specifier table consisting only of
system and /tmp specifiers into generic code so that we can share it.
This patch only adds one user of it for now. Follow-up patches will add
more.
This commit is contained in:
Lennart Poettering
2021-05-26 17:20:36 +02:00
parent 3dfeb04491
commit 2caed041c0
3 changed files with 14 additions and 12 deletions
+6
View File
@@ -364,3 +364,9 @@ int specifier_escape_strv(char **l, char ***ret) {
return 0;
}
const Specifier system_and_tmp_specifier_table[] = {
COMMON_SYSTEM_SPECIFIERS,
COMMON_TMP_SPECIFIERS,
{}
};
+3 -1
View File
@@ -80,7 +80,6 @@ int specifier_var_tmp_dir(char specifier, const void *data, const void *userdata
{ '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 }, \
@@ -96,3 +95,6 @@ static inline char* specifier_escape(const char *string) {
}
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[];