iscsi-initiator-utils/open-iscsi-2.0-870.1-490515-workaround.patch
Hans de Goede 599c1c817e - libiscsi: use fwparam_ibft_sysfs() instead of fw_get_entry(), as the
latter causes stack corruption (workaround #490515)
2009-03-20 14:24:54 +00:00

40 lines
1.2 KiB
Diff

--- open-iscsi-2.0-870.1/libiscsi/libiscsi.c 2009-03-20 15:21:24.000000000 +0100
+++ new/libiscsi/libiscsi.c 2009-03-20 15:21:11.000000000 +0100
@@ -196,10 +196,10 @@
*found_nodes = NULL;
memset(&fw_entry, 0, sizeof fw_entry);
- rc = fw_get_entry(&fw_entry, NULL);
+ rc = fwparam_ibft_sysfs(&fw_entry, NULL);
if (rc) {
strcpy(context->error_str, "Could not read fw values.");
- return rc;
+ return ENODEV;
}
memset(&rec, 0, sizeof rec);
@@ -535,8 +535,10 @@
memset(config, 0, sizeof *config);
memset(&fw_entry, 0, sizeof fw_entry);
- if (fw_get_entry(&fw_entry, NULL))
+ if (fwparam_ibft_sysfs(&fw_entry, NULL)) {
+ strcpy(context->error_str, "Could not read fw values.");
return ENODEV;
+ }
config->dhcp = strlen(fw_entry.dhcp) ? 1 : 0;
strncpy(config->iface_name, fw_entry.iface, sizeof fw_entry.iface);
@@ -557,8 +559,10 @@
memset(initiatorname, 0, LIBISCSI_VALUE_MAXLEN);
memset(&fw_entry, 0, sizeof fw_entry);
- if (fw_get_entry(&fw_entry, NULL))
+ if (fwparam_ibft_sysfs(&fw_entry, NULL)) {
+ strcpy(context->error_str, "Could not read fw values.");
return ENODEV;
+ }
strncpy(initiatorname, fw_entry.initiatorname,
sizeof fw_entry.initiatorname);