1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-10-30 06:25:25 +03:00

journal: also consider audit fields with '-' valid

This commit is contained in:
Lennart Poettering 2014-11-04 00:48:32 +01:00
parent 0aa281df2c
commit 9833a66c7e

View File

@ -172,7 +172,7 @@ static int map_generic_field(const char *prefix, const char **p, struct iovec **
if (!((*e >= 'a' && *e <= 'z') ||
(*e >= 'A' && *e <= 'Z') ||
(*e >= '0' && *e <= '9') ||
(*e == '_')))
*e == '_' || *e == '-'))
return 0;
}
@ -182,8 +182,18 @@ static int map_generic_field(const char *prefix, const char **p, struct iovec **
c = alloca(strlen(prefix) + (e - *p) + 2);
t = stpcpy(c, prefix);
for (f = *p; f < e; f++)
*(t++) = *f >= 'a' && *f <= 'z' ? ((*f - 'a') + 'A') : *f;
for (f = *p; f < e; f++) {
char x;
if (*f >= 'a' && *f <= 'z')
x = (*f - 'a') + 'A'; /* uppercase */
else if (*f == '-')
x = '_'; /* dashes → underscores */
else
x = *f;
*(t++) = x;
}
strcpy(t, "=");
e ++;