diff --git a/fcoe-utils-1.0.33.tar.gz b/fcoe-utils-1.0.33.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..c7c434d196cda700b6b2792b68290804a54eb7dc Binary files /dev/null and b/fcoe-utils-1.0.33.tar.gz differ diff --git a/fcoe-utils-fix-gcc9-build-error-1.patch b/fcoe-utils-fix-gcc9-build-error-1.patch new file mode 100644 index 0000000000000000000000000000000000000000..58bba232b16d0331f7d73a98a0bf6182b51e96e4 --- /dev/null +++ b/fcoe-utils-fix-gcc9-build-error-1.patch @@ -0,0 +1,38 @@ +diff a/fcoemon.c b/fcoemon.c +--- a/fcoemon.c ++++ b/fcoemon.c +@@ -1101,9 +1101,12 @@ static void fcm_vlan_dev_real_dev(char *vlan_ifname, char *real_ifname) + FCM_LOG_ERR(ENOSPC, "no room for vlan ifname"); + goto close_fd; + } +- strncpy(ifv.device1, vlan_ifname, sizeof(ifv.device1)); +- if (ioctl(fd, SIOCGIFVLAN, &ifv) == 0) ++ strncpy(ifv.device1, vlan_ifname, sizeof(ifv.device1) - 1); ++ ifv.device1[sizeof(ifv.device1) - 1] = '\0'; ++ if (ioctl(fd, SIOCGIFVLAN, &ifv) == 0) { + strncpy(real_ifname, ifv.u.device2, IFNAMSIZ-1); ++ real_ifname[IFNAMSIZ - 1] = '\0'; ++ } + close_fd: + close(fd); + } +@@ -1655,8 +1658,10 @@ static void fcm_process_link_msg(struct ifinfomsg *ip, int len, unsigned type) + /* try to find the real device name */ + real_dev[0] = '\0'; + fcm_vlan_dev_real_dev(ifname, real_dev); +- if (strlen(real_dev)) ++ if (strlen(real_dev)) { + strncpy(p->real_ifname, real_dev, IFNAMSIZ-1); ++ p->real_ifname[IFNAMSIZ - 1] = '\0'; ++ } + if (p->ready) + update_fcoe_port_state(p, type, operstate, + FCP_CFG_IFNAME); +@@ -1669,6 +1674,7 @@ static void fcm_process_link_msg(struct ifinfomsg *ip, int len, unsigned type) + p->ifindex = ifindex; + memcpy(p->mac, mac, ETHER_ADDR_LEN); + strncpy(p->real_ifname, ifname, IFNAMSIZ-1); ++ p->real_ifname[IFNAMSIZ - 1] = '\0'; + update_fcoe_port_state(p, type, operstate, + FCP_REAL_IFNAME); + } diff --git a/fcoe-utils-fix-gcc9-build-error.patch b/fcoe-utils-fix-gcc9-build-error.patch index 8461f7bc05e067fdd24295593f9a14f20238422a..8a30b8f668c61a7c64ed310f76bf9a322a027702 100644 --- a/fcoe-utils-fix-gcc9-build-error.patch +++ b/fcoe-utils-fix-gcc9-build-error.patch @@ -29,7 +29,7 @@ diff --git a/fcoemon.c b/fcoemon.c index 9a400c5..9572836 100644 --- a/fcoemon.c +++ b/fcoemon.c -@@ -518,8 +518,8 @@ static int fcm_read_config_files(void) +@@ -516,8 +516,8 @@ static int fcm_read_config_files(void) dp->d_name); continue; } @@ -40,46 +40,7 @@ index 9a400c5..9572836 100644 fp = fopen(file, "r"); if (!fp) { FCM_LOG_ERR(errno, "Failed to read %s\n", file); -@@ -1089,9 +1089,12 @@ static void fcm_vlan_dev_real_dev(char *vlan_ifname, char *real_ifname) - - memset(&ifv, 0, sizeof(ifv)); - ifv.cmd = GET_VLAN_REALDEV_NAME_CMD; -- strncpy(ifv.device1, vlan_ifname, strlen(vlan_ifname)+1); -- if (ioctl(fd, SIOCGIFVLAN, &ifv) == 0) -- strncpy(real_ifname, ifv.u.device2, strlen(ifv.u.device2)+1); -+ strncpy(ifv.device1, vlan_ifname, sizeof(ifv.device1) - 1); -+ ifv.device1[sizeof(ifv.device1) - 1] = '\0'; -+ if (ioctl(fd, SIOCGIFVLAN, &ifv) == 0) { -+ strncpy(real_ifname, ifv.u.device2, IFNAMSIZ - 1); -+ real_ifname[IFNAMSIZ - 1] = '\0'; -+ } - close(fd); - } - -@@ -1642,8 +1645,10 @@ static void fcm_process_link_msg(struct ifinfomsg *ip, int len, unsigned type) - /* try to find the real device name */ - real_dev[0] = '\0'; - fcm_vlan_dev_real_dev(ifname, real_dev); -- if (strlen(real_dev)) -- strncpy(p->real_ifname, real_dev, strlen(real_dev)+1); -+ if (strlen(real_dev)) { -+ strncpy(p->real_ifname, real_dev, sizeof(p->real_ifname) - 1); -+ p->real_ifname[sizeof(p->real_ifname) - 1] = '\0'; -+ } - if (p->ready) - update_fcoe_port_state(p, type, operstate, - FCP_CFG_IFNAME); -@@ -1655,7 +1660,8 @@ static void fcm_process_link_msg(struct ifinfomsg *ip, int len, unsigned type) - if (p) { - p->ifindex = ifindex; - memcpy(p->mac, mac, ETHER_ADDR_LEN); -- strncpy(p->real_ifname, ifname, strlen(ifname)+1); -+ strncpy(p->real_ifname, ifname, sizeof(p->real_ifname) - 1); -+ p->real_ifname[sizeof(p->real_ifname) - 1] = '\0'; - update_fcoe_port_state(p, type, operstate, - FCP_REAL_IFNAME); - } -@@ -1783,7 +1789,8 @@ static void fcm_process_ieee_msg(struct nlmsghdr *nlh) +@@ -1790,7 +1796,8 @@ static void fcm_process_ieee_msg(struct nlmsghdr *nlh) if (rta_parent->rta_type != DCB_ATTR_IFNAME) return; @@ -89,7 +50,7 @@ index 9a400c5..9572836 100644 ff = fcm_netif_lookup_create(ifname); if (!ff) { FCM_LOG("Processing IEEE message: %s not found or created\n", -@@ -3704,7 +3711,8 @@ int main(int argc, char **argv) +@@ -3700,7 +3707,8 @@ int main(int argc, char **argv) memset(&fcoe_config, 0, sizeof(fcoe_config)); @@ -165,15 +126,6 @@ index 5cb7fd3..9892c3d 100644 sa_sys_read_line(path, "symbolic_name", pa->symbolic_name, sizeof(pa->symbolic_name)); -@@ -443,7 +447,7 @@ char *get_pci_dev_from_netdev(const char *netdev) - return NULL; - - len = strlen(netdev) - strlen(subif); -- strncpy(realdev, netdev, len); -+ strncpy(realdev, netdev, sizeof(realdev) - 1); - if (realdev[len] != '\0') - realdev[len] = '\0'; - -- 1.8.3.1 diff --git a/fcoe-utils-gcc7-fmt-truc-err.patch b/fcoe-utils-gcc7-fmt-truc-err.patch deleted file mode 100644 index 3de42b442510c08781b4f047d61e351cff0a9175..0000000000000000000000000000000000000000 --- a/fcoe-utils-gcc7-fmt-truc-err.patch +++ /dev/null @@ -1,53 +0,0 @@ -diff --git a/fipvlan.c b/fipvlan.c -index 7c00c7c..065b742 100644 ---- a/fipvlan.c -+++ b/fipvlan.c -@@ -621,8 +621,10 @@ create_and_start_vlan(struct fcf *fcf, bool vn2vn) - real_dev->ifname, fcf->vlan, vlan->ifname); - rc = 0; - } else { -- snprintf(vlan_name, IFNAMSIZ, "%s.%d%s", -- real_dev->ifname, fcf->vlan, config.suffix); -+ rc = snprintf(vlan_name, IFNAMSIZ, "%s.%d%s", -+ real_dev->ifname, fcf->vlan, config.suffix); -+ if (rc >= IFNAMSIZ) -+ return -E2BIG; - rc = vlan_create(fcf->ifindex, fcf->vlan, vlan_name); - if (rc < 0) - printf("Failed to create VLAN device %s\n\t%s\n", -diff --git a/libopenfcoe.c b/libopenfcoe.c -index 07090d5..98fb975 100644 ---- a/libopenfcoe.c -+++ b/libopenfcoe.c -@@ -59,6 +59,7 @@ static int add_fcoe_fcf_device(struct dirent *dp, void *arg) - { - struct fcoe_ctlr_device *ctlr = (struct fcoe_ctlr_device *)arg; - struct fcoe_fcf_device *fcf; -+ int rc; - - if (!strstr(dp->d_name, "fcf") || - (!strcmp(dp->d_name, "fcf_dev_loss_tmo"))) -@@ -71,8 +72,10 @@ static int add_fcoe_fcf_device(struct dirent *dp, void *arg) - memset(fcf, 0, sizeof(struct fcoe_fcf_device)); - - /* Save the path */ -- snprintf(fcf->path, sizeof(fcf->path), -- "%s/%s", ctlr->path, dp->d_name); -+ rc = snprintf(fcf->path, sizeof(fcf->path), -+ "%s/%s", ctlr->path, dp->d_name); -+ if (rc >= sizeof(fcf->path)) -+ goto fail; - - /* Use the index from the logical enumeration */ - fcf->index = atoi(dp->d_name + sizeof("fcf_") - 1); -@@ -198,7 +201,9 @@ static int read_fcoe_ctlr_device(struct dirent *dp, void *arg) - sa_sys_read_line(ctlr->path, "mode", buf, sizeof(buf)); - sa_enum_encode(fip_conn_type_table, buf, &ctlr->mode); - -- snprintf(lesb_path, sizeof(lesb_path), "%s/lesb/", ctlr->path); -+ rc = snprintf(lesb_path, sizeof(lesb_path), "%s/lesb/", ctlr->path); -+ if (rc >= sizeof(lesb_path)) -+ goto fail; - - /* Get LESB statistics */ - sa_sys_read_u32(lesb_path, "link_fail", diff --git a/fcoe-utils-gcc8-fmt-truc-err.patch b/fcoe-utils-gcc8-fmt-truc-err.patch index d7602b0b3900b2a200470d16f5ba616456a5a0dc..f7d0ac8b5326dff6058834c6d1b1e308f85b661b 100644 --- a/fcoe-utils-gcc8-fmt-truc-err.patch +++ b/fcoe-utils-gcc8-fmt-truc-err.patch @@ -19,7 +19,7 @@ index 120c6084b7ca..f10cfb53d454 100644 - snprintf(npath, sizeof(npath), "%s/%s/", path, osname); + rc = snprintf(npath, sizeof(npath), "%s/%s/", path, osname); -+ if (rc < 0 || rc >= sizeof(npath)) { ++ if (rc < 0 || rc >= (int)sizeof(npath)) { + /* error or truncation, bailing out */ + return; + } @@ -27,7 +27,7 @@ index 120c6084b7ca..f10cfb53d454 100644 - snprintf(npath, sizeof(npath), "%s/%s/queue/", path, osname); + rc = snprintf(npath, sizeof(npath), "%s/%s/queue/", path, osname); -+ if (rc < 0 || rc >= sizeof(npath)) { ++ if (rc < 0 || rc >= (int)sizeof(npath)) { + /* error or truncation, bailing out */ + return; + } @@ -48,7 +48,7 @@ index 120c6084b7ca..f10cfb53d454 100644 - snprintf(npath, sizeof(npath), "%s/%s/", path, osname); + rc = snprintf(npath, sizeof(npath), "%s/%s/", path, osname); -+ if (rc < 0 || rc >= sizeof(npath)) { ++ if (rc < 0 || rc >= (int)sizeof(npath)) { + /* error or truncation, bailing out */ + return; + } @@ -56,7 +56,7 @@ index 120c6084b7ca..f10cfb53d454 100644 - snprintf(npath, sizeof(npath), "%s/%s/queue/", path, osname); + rc = snprintf(npath, sizeof(npath), "%s/%s/queue/", path, osname); -+ if (rc < 0 || rc >= sizeof(npath)) { ++ if (rc < 0 || rc >= (int)sizeof(npath)) { + /* error or truncation, bailing out */ + return; + } @@ -83,7 +83,7 @@ index 9a400c56b72a..bf73a0d4c89e 100644 - real_name, vid); + rc = snprintf(vlan_name, sizeof(vlan_name), FCOE_VLAN_FORMAT, + real_name, vid); -+ if (rc >= sizeof(vlan_name)) { ++ if (rc >= (int)sizeof(vlan_name)) { + FCM_LOG("Warning: Generating FCoE VLAN device name for" + "interface %s VLAN %d: format resulted in a" + "name larger than IFNAMSIZ\n", real_name, vid); @@ -93,12 +93,12 @@ index 9a400c56b72a..bf73a0d4c89e 100644 vlan_create(ifindex, vid, vlan_name); } rtnl_set_iff_up(0, vlan_name); -@@ -3549,7 +3557,7 @@ static void fcm_srv_receive(void *arg) +@@ -3544,7 +3552,7 @@ static void fcm_srv_receive(void *arg) } cmd = data->cmd; -- strncpy(ifname, data->ifname, sizeof(data->ifname)); -+ strncpy(ifname, data->ifname, sizeof(ifname) - 1); +- strncpy(ifname, data->ifname, IFNAMSIZ); ++ strncpy(ifname, data->ifname, IFNAMSIZ - 1); ifname[sizeof(data->ifname)] = 0; if (cmd != CLIF_PID_CMD) { @@ -106,7 +106,7 @@ diff --git a/libopenfcoe.c b/libopenfcoe.c index 07090d5a09aa..c1190adc2328 100644 --- a/libopenfcoe.c +++ b/libopenfcoe.c -@@ -179,7 +179,9 @@ static int read_fcoe_ctlr_device(struct dirent *dp, void *arg) +@@ -207,7 +207,9 @@ static int read_fcoe_ctlr_device(struct dirent *dp, void *arg) if (!rc) goto fail; diff --git a/fcoe-utils.spec b/fcoe-utils.spec index a087b95623a221f2cdefdb3b1b5e855a0b5cc1b3..16e6782febbb78a909057df51a04c06c03fed4af 100644 --- a/fcoe-utils.spec +++ b/fcoe-utils.spec @@ -1,6 +1,6 @@ Name: fcoe-utils -Version: 1.0.32 -Release: 8 +Version: 1.0.33 +Release: 9 Summary: Fibre Channel over Ethernet utilities License: GPLv2 URL: https://www.open-fcoe.org @@ -8,10 +8,10 @@ Source0: https://github.com/morbidrsa/fcoe-utils/archive/v%{version}. Source1: quickstart.txt Source2: fcoe.service Source3: fcoe.config -Patch0: fcoe-utils-gcc7-fmt-truc-err.patch Patch1: fcoe-utils-gcc8-fmt-truc-err.patch #This patch refer to ubuntu's version Patch2: fcoe-utils-fix-gcc9-build-error.patch +Patch3: fcoe-utils-fix-gcc9-build-error-1.patch BuildRequires: autoconf automake libpciaccess-devel libtool lldpad-devel systemd Requires: lldpad iproute device-mapper-multipath @@ -62,7 +62,8 @@ rm -f %{buildroot}/%{_sysconfdir}/fcoe/config %config(noreplace) %{_sysconfdir}/sysconfig/fcoe %{_unitdir}/fcoe.service %{_sbindir}/* -%{_sysconfdir}/bash_completion.d/* +#%{_sysconfdir}/bash_completion.d/* +%{_datadir}/bash-completion/completions/* %{_libexecdir}/fcoe/ %files help @@ -71,6 +72,12 @@ rm -f %{buildroot}/%{_sysconfdir}/fcoe/config %{_mandir}/man8/* %changelog +* Mon Jun 29 2020 cuibaobao - 1.0.33-9 +- Type:update +- Id:NA +- SUG:NA +- DESC:update to 1.0.33 + * Tue Jun 23 2020 gaihuiying - 1.0.32-8 - Type:bugfix - ID:NA