Compare commits

..

No commits in common. "9d5dac4dce8721eaa14800039d8a31428c072d13" and "8cf85bb5750766cf0cff53b0b73be5a5a39279f5" have entirely different histories.

16 changed files with 33 additions and 41 deletions

View File

@ -302,8 +302,9 @@ EFI_STATUS tpm_log_event(UINT32 pcrindex, const EFI_PHYSICAL_ADDRESS buffer, UIN
EFI_TCG2 *tpm2; EFI_TCG2 *tpm2;
tpm2 = tcg2_interface_check(); tpm2 = tcg2_interface_check();
if (tpm2) if (tpm2) {
return tpm2_measure_to_pcr_and_event_log(tpm2, pcrindex, buffer, buffer_size, description); return tpm2_measure_to_pcr_and_event_log(tpm2, pcrindex, buffer, buffer_size, description);
}
tpm1 = tcg1_interface_check(); tpm1 = tcg1_interface_check();
if (tpm1) if (tpm1)

View File

@ -336,8 +336,9 @@ static char* merge_unit_ids(const char* unit_log_field, char **pairs) {
STRV_FOREACH_PAIR(unit_id, job_type, pairs) { STRV_FOREACH_PAIR(unit_id, job_type, pairs) {
next = strlen(unit_log_field) + strlen(*unit_id); next = strlen(unit_log_field) + strlen(*unit_id);
if (!GREEDY_REALLOC(ans, alloc, size + next + 1)) if (!GREEDY_REALLOC(ans, alloc, size + next + 1)) {
return mfree(ans); return mfree(ans);
}
sprintf(ans + size, "%s%s", unit_log_field, *unit_id); sprintf(ans + size, "%s%s", unit_log_field, *unit_id);
if (*(unit_id+1)) if (*(unit_id+1))

View File

@ -535,8 +535,9 @@ static int inspect_home(int argc, char *argv[], void *userdata) {
} }
r = bus_call_method(bus, &home_mgr, "GetUserRecordByName", &error, &reply, "s", *i); r = bus_call_method(bus, &home_mgr, "GetUserRecordByName", &error, &reply, "s", *i);
} else } else {
r = bus_call_method(bus, &home_mgr, "GetUserRecordByUID", &error, &reply, "u", (uint32_t) uid); r = bus_call_method(bus, &home_mgr, "GetUserRecordByUID", &error, &reply, "u", (uint32_t) uid);
}
if (r < 0) { if (r < 0) {
log_error_errno(r, "Failed to inspect home: %s", bus_error_message(&error, r)); log_error_errno(r, "Failed to inspect home: %s", bus_error_message(&error, r));

View File

@ -166,8 +166,9 @@ CurlGlue *curl_glue_unref(CurlGlue *g) {
if (g->curl) if (g->curl)
curl_multi_cleanup(g->curl); curl_multi_cleanup(g->curl);
while ((io = hashmap_steal_first(g->ios))) while ((io = hashmap_steal_first(g->ios))) {
sd_event_source_unref(io); sd_event_source_unref(io);
}
hashmap_free(g->ios); hashmap_free(g->ios);

View File

@ -116,8 +116,9 @@ static void test_catalog_import_merge(void) {
h = test_import(input, -1, 0); h = test_import(input, -1, 0);
assert_se(ordered_hashmap_size(h) == 1); assert_se(ordered_hashmap_size(h) == 1);
ORDERED_HASHMAP_FOREACH(payload, h, j) ORDERED_HASHMAP_FOREACH(payload, h, j) {
assert_se(streq(combined, payload)); assert_se(streq(combined, payload));
}
} }
static void test_catalog_import_merge_no_body(void) { static void test_catalog_import_merge_no_body(void) {
@ -148,8 +149,9 @@ static void test_catalog_import_merge_no_body(void) {
h = test_import(input, -1, 0); h = test_import(input, -1, 0);
assert_se(ordered_hashmap_size(h) == 1); assert_se(ordered_hashmap_size(h) == 1);
ORDERED_HASHMAP_FOREACH(payload, h, j) ORDERED_HASHMAP_FOREACH(payload, h, j) {
assert_se(streq(combined, payload)); assert_se(streq(combined, payload));
}
} }
static void test_catalog_update(const char *database) { static void test_catalog_update(const char *database) {

View File

@ -464,8 +464,8 @@ int dhcp6_option_parse_ia(DHCP6Option *iaoption, DHCP6IA *ia) {
if (status < 0) if (status < 0)
return status; return status;
if (status > 0) { if (status > 0) {
log_dhcp6_client(client, "IA status %s", log_dhcp6_client(client, "IA status %d",
dhcp6_message_status_to_string(status)); status);
return -EINVAL; return -EINVAL;
} }

View File

@ -89,8 +89,7 @@ enum {
DHCP6_STATUS_NO_BINDING = 3, DHCP6_STATUS_NO_BINDING = 3,
DHCP6_STATUS_NOT_ON_LINK = 4, DHCP6_STATUS_NOT_ON_LINK = 4,
DHCP6_STATUS_USE_MULTICAST = 5, DHCP6_STATUS_USE_MULTICAST = 5,
DHCP6_STATUS_NO_PREFIX_AVAIL = 6, _DHCP6_STATUS_MAX = 6,
_DHCP6_STATUS_MAX = 7,
}; };
enum { enum {

View File

@ -112,7 +112,6 @@ const char * dhcp6_message_status_table[_DHCP6_STATUS_MAX] = {
[DHCP6_STATUS_NO_BINDING] = "Binding unavailable", [DHCP6_STATUS_NO_BINDING] = "Binding unavailable",
[DHCP6_STATUS_NOT_ON_LINK] = "Not on link", [DHCP6_STATUS_NOT_ON_LINK] = "Not on link",
[DHCP6_STATUS_USE_MULTICAST] = "Use multicast", [DHCP6_STATUS_USE_MULTICAST] = "Use multicast",
[DHCP6_STATUS_NO_PREFIX_AVAIL] = "No prefix available",
}; };
DEFINE_STRING_TABLE_LOOKUP(dhcp6_message_status, int); DEFINE_STRING_TABLE_LOOKUP(dhcp6_message_status, int);

View File

@ -267,8 +267,9 @@ int x11_read_data(Context *c, sd_bus_message *m) {
else if (streq(a[1], "XkbOptions")) else if (streq(a[1], "XkbOptions"))
p = &c->x11_options; p = &c->x11_options;
if (p) if (p) {
free_and_replace(*p, a[2]); free_and_replace(*p, a[2]);
}
} }
} else if (!in_section && first_word(l, "Section")) { } else if (!in_section && first_word(l, "Section")) {

View File

@ -38,14 +38,7 @@ static int netdev_vxlan_fill_message_create(NetDev *netdev, Link *link, sd_netli
return log_netdev_error_errno(netdev, r, "Could not append IFLA_VXLAN_ID attribute: %m"); return log_netdev_error_errno(netdev, r, "Could not append IFLA_VXLAN_ID attribute: %m");
} }
if (in_addr_is_null(v->group_family, &v->group) == 0) { if (in_addr_is_null(v->remote_family, &v->remote) == 0) {
if (v->group_family == AF_INET)
r = sd_netlink_message_append_in_addr(m, IFLA_VXLAN_GROUP, &v->group.in);
else
r = sd_netlink_message_append_in6_addr(m, IFLA_VXLAN_GROUP6, &v->group.in6);
if (r < 0)
return log_netdev_error_errno(netdev, r, "Could not append IFLA_VXLAN_GROUP attribute: %m");
} else if (in_addr_is_null(v->remote_family, &v->remote) == 0) {
if (v->remote_family == AF_INET) if (v->remote_family == AF_INET)
r = sd_netlink_message_append_in_addr(m, IFLA_VXLAN_GROUP, &v->remote.in); r = sd_netlink_message_append_in_addr(m, IFLA_VXLAN_GROUP, &v->remote.in);
else else
@ -355,11 +348,6 @@ static int netdev_vxlan_verify(NetDev *netdev, const char *filename) {
if (!v->dest_port && v->generic_protocol_extension) if (!v->dest_port && v->generic_protocol_extension)
v->dest_port = 4790; v->dest_port = 4790;
if (in_addr_is_null(v->group_family, &v->group) == 0 && in_addr_is_null(v->remote_family, &v->remote) == 0)
return log_netdev_warning_errno(netdev, SYNTHETIC_ERRNO(EINVAL),
"%s: VXLAN both 'Group=' and 'Remote=' cannot be specified. Ignoring.",
filename);
return 0; return 0;
} }

View File

@ -1549,17 +1549,9 @@ static int link_status_one(
} }
if (IN_SET(info->vxlan_info.group_family, AF_INET, AF_INET6)) { if (IN_SET(info->vxlan_info.group_family, AF_INET, AF_INET6)) {
const char *p;
r = in_addr_is_multicast(info->vxlan_info.group_family, &info->vxlan_info.group);
if (r <= 0)
p = "Remote:";
else
p = "Group:";
r = table_add_many(table, r = table_add_many(table,
TABLE_EMPTY, TABLE_EMPTY,
TABLE_STRING, p, TABLE_STRING, "Group:",
info->vxlan_info.group_family == AF_INET ? TABLE_IN_ADDR : TABLE_IN6_ADDR, info->vxlan_info.group_family == AF_INET ? TABLE_IN_ADDR : TABLE_IN6_ADDR,
&info->vxlan_info.group); &info->vxlan_info.group);
if (r < 0) if (r < 0)

View File

@ -408,8 +408,9 @@ static void test_strv_split_newlines(void) {
l = strv_split_newlines(str); l = strv_split_newlines(str);
assert_se(l); assert_se(l);
STRV_FOREACH(s, l) STRV_FOREACH(s, l) {
assert_se(streq(*s, input_table_multiple[i++])); assert_se(streq(*s, input_table_multiple[i++]));
}
} }
static void test_strv_split_nulstr(void) { static void test_strv_split_nulstr(void) {

View File

@ -514,8 +514,9 @@ int main(int argc, char *argv[]) {
printf("ID_TYPE=generic\n"); printf("ID_TYPE=generic\n");
break; break;
} }
} else } else {
printf("ID_TYPE=disk\n"); printf("ID_TYPE=disk\n");
}
printf("ID_BUS=ata\n"); printf("ID_BUS=ata\n");
printf("ID_MODEL=%s\n", model); printf("ID_MODEL=%s\n", model);
printf("ID_MODEL_ENC=%s\n", model_enc); printf("ID_MODEL_ENC=%s\n", model_enc);
@ -523,8 +524,9 @@ int main(int argc, char *argv[]) {
if (serial[0] != '\0') { if (serial[0] != '\0') {
printf("ID_SERIAL=%s_%s\n", model, serial); printf("ID_SERIAL=%s_%s\n", model, serial);
printf("ID_SERIAL_SHORT=%s\n", serial); printf("ID_SERIAL_SHORT=%s\n", serial);
} else } else {
printf("ID_SERIAL=%s\n", model); printf("ID_SERIAL=%s\n", model);
}
if (id.command_set_1 & (1<<5)) { if (id.command_set_1 & (1<<5)) {
printf("ID_ATA_WRITE_CACHE=1\n"); printf("ID_ATA_WRITE_CACHE=1\n");

View File

@ -111,8 +111,9 @@ static char *get_value(char **buffer) {
*/ */
(*buffer)++; (*buffer)++;
end = quote_string; end = quote_string;
} else } else {
end = comma_string; end = comma_string;
}
val = strsep(buffer, end); val = strsep(buffer, end);
if (val && end == quote_string) if (val && end == quote_string)
/* /*

View File

@ -228,8 +228,9 @@ static bool test_pointers(sd_device *dev,
is_touchscreen = true; is_touchscreen = true;
else if (has_joystick_axes_or_buttons) else if (has_joystick_axes_or_buttons)
is_joystick = true; is_joystick = true;
} else if (has_joystick_axes_or_buttons) } else if (has_joystick_axes_or_buttons) {
is_joystick = true; is_joystick = true;
}
if (has_mt_coordinates) { if (has_mt_coordinates) {
if (stylus_or_pen) if (stylus_or_pen)

View File

@ -125,8 +125,9 @@ static int on_reboot(Context *c) {
#if HAVE_AUDIT #if HAVE_AUDIT
if (c->audit_fd >= 0) if (c->audit_fd >= 0)
if (audit_log_user_comm_message(c->audit_fd, AUDIT_SYSTEM_BOOT, "", "systemd-update-utmp", NULL, NULL, NULL, 1) < 0 && if (audit_log_user_comm_message(c->audit_fd, AUDIT_SYSTEM_BOOT, "", "systemd-update-utmp", NULL, NULL, NULL, 1) < 0 &&
errno != EPERM) errno != EPERM) {
r = log_error_errno(errno, "Failed to send audit message: %m"); r = log_error_errno(errno, "Failed to send audit message: %m");
}
#endif #endif
/* If this call fails it will return 0, which /* If this call fails it will return 0, which
@ -153,8 +154,9 @@ static int on_shutdown(Context *c) {
#if HAVE_AUDIT #if HAVE_AUDIT
if (c->audit_fd >= 0) if (c->audit_fd >= 0)
if (audit_log_user_comm_message(c->audit_fd, AUDIT_SYSTEM_SHUTDOWN, "", "systemd-update-utmp", NULL, NULL, NULL, 1) < 0 && if (audit_log_user_comm_message(c->audit_fd, AUDIT_SYSTEM_SHUTDOWN, "", "systemd-update-utmp", NULL, NULL, NULL, 1) < 0 &&
errno != EPERM) errno != EPERM) {
r = log_error_errno(errno, "Failed to send audit message: %m"); r = log_error_errno(errno, "Failed to send audit message: %m");
}
#endif #endif
q = utmp_put_shutdown(); q = utmp_put_shutdown();