1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-12-24 21:34:08 +03:00

coredump: rename COREDUMP_PKGMETA_ fields to COREDUMP_PACKAGE_

Follow-up for c546154a44
This commit is contained in:
Luca Boccassi 2021-04-07 10:31:31 +01:00
parent f216e74841
commit 671769c932
3 changed files with 10 additions and 19 deletions

View File

@ -353,9 +353,9 @@ flags: ...
</varlistentry>
<varlistentry>
<term><varname>COREDUMP_PKGMETA_PACKAGE=</varname></term>
<term><varname>COREDUMP_PKGMETA_PACKAGEVERSION=</varname></term>
<term><varname>COREDUMP_PKGMETA_JSON=</varname></term>
<term><varname>COREDUMP_PACKAGE_NAME=</varname></term>
<term><varname>COREDUMP_PACKAGE_VERSION=</varname></term>
<term><varname>COREDUMP_PACKAGE_JSON=</varname></term>
<listitem><para>If the executable contained .package metadata ELF notes, they will be
parsed and attached. The <varname>package</varname> and <varname>packageVersion</varname>

View File

@ -792,7 +792,7 @@ log:
if (r < 0)
return log_error_errno(r, "Failed to format JSON package metadata: %m");
(void) iovw_put_string_field(iovw, "COREDUMP_PKGMETA_JSON=", formatted_json);
(void) iovw_put_string_field(iovw, "COREDUMP_PACKAGE_JSON=", formatted_json);
}
JSON_VARIANT_OBJECT_FOREACH(module_name, module_json, json_metadata) {
@ -822,7 +822,6 @@ log:
w = json_variant_by_index(_state2.variant, _state2.idx + 1); \
true; }); \
_state2.idx += 2) {
_cleanup_free_ char *metadata_id = NULL, *key_upper = NULL;
if (!json_variant_is_string(w))
continue;
@ -830,17 +829,9 @@ log:
if (!STR_IN_SET(key, "package", "packageVersion"))
continue;
/* Journal metadata field names need to be upper case */
key_upper = strdup(key);
if (!key_upper)
return log_oom();
key_upper = ascii_strupper(key_upper);
metadata_id = strjoin("COREDUMP_PKGMETA_", key_upper, "=");
if (!metadata_id)
return log_oom();
(void) iovw_put_string_field(iovw, metadata_id, json_variant_string(w));
(void) iovw_put_string_field(iovw,
streq(key, "package") ? "COREDUMP_PACKAGE_NAME=" : "COREDUMP_PACKAGE_VERSION=",
json_variant_string(w));
}
}

View File

@ -575,9 +575,9 @@ static int print_info(FILE *file, sd_journal *j, bool need_space) {
RETRIEVE(d, l, "COREDUMP_FILENAME", filename);
RETRIEVE(d, l, "COREDUMP_TRUNCATED", truncated);
RETRIEVE(d, l, "COREDUMP", coredump);
RETRIEVE(d, l, "COREDUMP_PKGMETA_PACKAGE", pkgmeta_name);
RETRIEVE(d, l, "COREDUMP_PKGMETA_PACKAGEVERSION", pkgmeta_version);
RETRIEVE(d, l, "COREDUMP_PKGMETA_JSON", pkgmeta_json);
RETRIEVE(d, l, "COREDUMP_PACKAGE_NAME", pkgmeta_name);
RETRIEVE(d, l, "COREDUMP_PACKAGE_VERSION", pkgmeta_version);
RETRIEVE(d, l, "COREDUMP_PACKAGE_JSON", pkgmeta_json);
RETRIEVE(d, l, "_BOOT_ID", boot_id);
RETRIEVE(d, l, "_MACHINE_ID", machine_id);
RETRIEVE(d, l, "MESSAGE", message);