Merge ~sergiodj/ubuntu/+source/open-iscsi:fix-gcc12-ftbfs into ubuntu/+source/open-iscsi:ubuntu/devel

Proposed by Sergio Durigan Junior
Status: Merged
Merged at revision: 7e0a8c21798da373bae56e7c1884109435b5f474
Proposed branch: ~sergiodj/ubuntu/+source/open-iscsi:fix-gcc12-ftbfs
Merge into: ubuntu/+source/open-iscsi:ubuntu/devel
Diff against target: 180 lines (+153/-0)
4 files modified
debian/changelog (+7/-0)
debian/patches/lp1979692-fix-gcc12-ftbfs-01.patch (+99/-0)
debian/patches/lp1979692-fix-gcc12-ftbfs-02.patch (+45/-0)
debian/patches/series (+2/-0)
Reviewer Review Type Date Requested Status
Lucas Kanashiro (community) Approve
Canonical Server Reporter Pending
Canonical Server packageset reviewers Pending
Review via email: mp+425342@code.launchpad.net

Description of the change

This fixes open-iscsi's FTBFS with GCC 12, as reported by Graham here:

https://people.canonical.com/~ginggs/ftbfs-report/test-rebuild-20220617-kinetic-gcc12-kinetic.html#ubuntu-server-pkgset

Upstream has fixes for this (https://github.com/open-iscsi/open-iscsi/pull/297), which have been released as part of v2.1.6, so this is just a backport.

I set up a special PPA that depends on Foundation's "volatile" and "binutils" PPAs (which contain GCC 12 and binutils 2.38) here:

https://launchpad.net/~sergiodj/+archive/ubuntu/gcc12-ftbfs

I will post the autopkgtest results as soon as I have them.

To post a comment you must log in.
Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

Results from https://autopkgtest.ubuntu.com/results/autopkgtest-kinetic-sergiodj-gcc12-ftbfs/?format=plain:
  open-iscsi @ amd64:
    23.06.22 22:51:28 Log πŸ—’οΈ βœ… Triggers: ['open-iscsi/2.1.5-1ubuntu2~ppa2']
  open-iscsi @ arm64:
    23.06.22 22:47:09 Log πŸ—’οΈ βœ… Triggers: ['open-iscsi/2.1.5-1ubuntu2~ppa2']
  open-iscsi @ armhf:
    23.06.22 22:29:04 Log πŸ—’οΈ βœ… Triggers: ['open-iscsi/2.1.5-1ubuntu2~ppa2']
  open-iscsi @ ppc64el:
    23.06.22 22:38:10 Log πŸ—’οΈ βœ… Triggers: ['open-iscsi/2.1.5-1ubuntu2~ppa2']
  open-iscsi @ s390x:
    23.06.22 22:32:55 Log πŸ—’οΈ βœ… Triggers: ['open-iscsi/2.1.5-1ubuntu2~ppa2']

Revision history for this message
MichaΕ‚ MaΕ‚oszewski (michal-maloszewski99) :
Revision history for this message
Sergio Durigan Junior (sergiodj) :
Revision history for this message
Lucas Kanashiro (lucaskanashiro) wrote :

LGTM, +1.

review: Approve
Revision history for this message
Sergio Durigan Junior (sergiodj) wrote :

On Friday, June 24 2022, Lucas Kanashiro wrote:

> Review: Approve
>
> LGTM, +1.

$ dput open-iscsi_2.1.5-1ubuntu2_source.changes
Trying to upload package to ubuntu
Checking signature on .changes
gpg: /home/sergio/work/open-iscsi/open-iscsi_2.1.5-1ubuntu2_source.changes: Valid signature from 106DA1C8C3CBBF14
Checking signature on .dsc
gpg: /home/sergio/work/open-iscsi/open-iscsi_2.1.5-1ubuntu2.dsc: Valid signature from 106DA1C8C3CBBF14
Uploading to ubuntu (via ftp to upload.ubuntu.com):
  Uploading open-iscsi_2.1.5-1ubuntu2.dsc: done.
  Uploading open-iscsi_2.1.5-1ubuntu2.debian.tar.xz: done.
  Uploading open-iscsi_2.1.5-1ubuntu2_source.buildinfo: done.
  Uploading open-iscsi_2.1.5-1ubuntu2_source.changes: done.
Successfully uploaded packages.

--
Sergio
GPG key ID: E92F D0B3 6B14 F1F4 D8E0 EB2F 106D A1C8 C3CB BF14

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/debian/changelog b/debian/changelog
index b1bd9d9..adbc089 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,10 @@
1open-iscsi (2.1.5-1ubuntu2) kinetic; urgency=medium
2
3 * d/p/lp1979692-fix-gcc12-ftbfs-0*.patch: Fix FTBFS with GCC 12.
4 (LP: #1979692)
5
6 -- Sergio Durigan Junior <sergio.durigan@canonical.com> Thu, 23 Jun 2022 17:28:56 -0400
7
1open-iscsi (2.1.5-1ubuntu1) jammy; urgency=medium8open-iscsi (2.1.5-1ubuntu1) jammy; urgency=medium
29
3 * Merge with Debian unstable (LP: #1946835). Remaining changes:10 * Merge with Debian unstable (LP: #1946835). Remaining changes:
diff --git a/debian/patches/lp1979692-fix-gcc12-ftbfs-01.patch b/debian/patches/lp1979692-fix-gcc12-ftbfs-01.patch
4new file mode 10064411new file mode 100644
index 0000000..c97e8af
--- /dev/null
+++ b/debian/patches/lp1979692-fix-gcc12-ftbfs-01.patch
@@ -0,0 +1,99 @@
1From: Lee Duncan <lduncan@suse.com>
2Date: Tue, 25 Jan 2022 10:11:58 -0800
3Subject: Fix issues discovered by gcc12
4
5Gcc-12 caught a few errors in the code where we were checking
6for an array being empty incorrectly, so this commit fixes those.
7
8Origin: upstream, https://github.com/open-iscsi/open-iscsi/commit/151e701d08e16dce545d017e57c3d5ac957b7c1e
9Bug: https://github.com/open-iscsi/open-iscsi/issues/296
10Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/open-iscsi/+bug/1979692
11Applied-Upstream: 2.1.6
12---
13 usr/auth.c | 3 +--
14 usr/login.c | 18 +++++++++---------
15 2 files changed, 10 insertions(+), 11 deletions(-)
16
17diff --git a/usr/auth.c b/usr/auth.c
18index 2f7506f..46c328e 100644
19--- a/usr/auth.c
20+++ b/usr/auth.c
21@@ -109,7 +109,7 @@ acl_chap_auth_request(struct iscsi_acl *client, char *username, unsigned int id,
22 unsigned char verify_data[client->chap_challenge_len];
23
24 /* the expected credentials are in the session */
25- if (session->username_in == NULL) {
26+ if (session->username_in[0] == '\0') {
27 log_error("failing authentication, no incoming username "
28 "configured to authenticate target %s",
29 session->target_name);
30@@ -122,7 +122,6 @@ acl_chap_auth_request(struct iscsi_acl *client, char *username, unsigned int id,
31 }
32
33 if ((session->password_in_length < 1) ||
34- (session->password_in == NULL) ||
35 (session->password_in[0] == '\0')) {
36 log_error("failing authentication, no incoming password "
37 "configured to authenticate target %s",
38diff --git a/usr/login.c b/usr/login.c
39index 8af8756..096deda 100644
40--- a/usr/login.c
41+++ b/usr/login.c
42@@ -657,7 +657,7 @@ iscsi_process_login_response(iscsi_session_t *session, int cid,
43 struct iscsi_acl *auth_client;
44 iscsi_conn_t *conn = &session->conn[cid];
45
46- auth_client = (session->auth_buffers && session->num_auth_buffers) ?
47+ auth_client = (session->num_auth_buffers > 0) ?
48 (struct iscsi_acl *)session->auth_buffers[0].address : NULL;
49
50 end = text + ntoh24(login_rsp->dlength) + 1;
51@@ -1135,7 +1135,7 @@ iscsi_make_login_pdu(iscsi_session_t *session, int cid, struct iscsi_hdr *hdr,
52 struct iscsi_acl *auth_client;
53 iscsi_conn_t *conn = &session->conn[cid];
54
55- auth_client = (session->auth_buffers && session->num_auth_buffers) ?
56+ auth_client = (session->num_auth_buffers > 0) ?
57 (struct iscsi_acl *)session->auth_buffers[0].address : NULL;
58
59 /* initialize the PDU header */
60@@ -1170,7 +1170,7 @@ iscsi_make_login_pdu(iscsi_session_t *session, int cid, struct iscsi_hdr *hdr,
61 return 0;
62 }
63
64- if ((session->target_name && session->target_name[0]) &&
65+ if ((session->target_name[0] != '\0') &&
66 (session->type == ISCSI_SESSION_TYPE_NORMAL)) {
67 if (!iscsi_add_text(hdr, data, max_data_length,
68 "TargetName", session->target_name))
69@@ -1248,16 +1248,16 @@ check_for_authentication(iscsi_session_t *session,
70 return LOGIN_FAILED;
71 }
72
73- if (session->username &&
74+ if ((session->username[0] != '\0') &&
75 (acl_set_user_name(auth_client, session->username) !=
76- AUTH_STATUS_NO_ERROR)) {
77+ AUTH_STATUS_NO_ERROR)) {
78 log_error("Couldn't set username");
79 goto end;
80 }
81
82- if (session->password && (acl_set_passwd(auth_client,
83- session->password, session->password_length) !=
84- AUTH_STATUS_NO_ERROR)) {
85+ if ((session->password[0] != '\0') &&
86+ (acl_set_passwd(auth_client, session->password, session->password_length) !=
87+ AUTH_STATUS_NO_ERROR)) {
88 log_error("Couldn't set password");
89 goto end;
90 }
91@@ -1366,7 +1366,7 @@ iscsi_login_begin(iscsi_session_t *session, iscsi_login_context_t *c)
92 conn->current_stage = ISCSI_INITIAL_LOGIN_STAGE;
93 conn->partial_response = 0;
94
95- if (session->auth_buffers && session->num_auth_buffers) {
96+ if (session->num_auth_buffers > 0) {
97 c->ret = check_for_authentication(session, c->auth_client);
98 if (c->ret != LOGIN_OK)
99 return 1;
diff --git a/debian/patches/lp1979692-fix-gcc12-ftbfs-02.patch b/debian/patches/lp1979692-fix-gcc12-ftbfs-02.patch
0new file mode 100644100new file mode 100644
index 0000000..159412f
--- /dev/null
+++ b/debian/patches/lp1979692-fix-gcc12-ftbfs-02.patch
@@ -0,0 +1,45 @@
1From: Lee Duncan <lduncan@suse.com>
2Date: Wed, 26 Jan 2022 11:44:09 -0800
3Subject: Fix more issues discovered by gcc12
4
5Gcc-12 caught a few more errors in the code, where we are
6still checking an array address for NULL, which will never
7happen.
8
9Origin: upstream, https://github.com/open-iscsi/open-iscsi/commit/1cab1efc813f750f9fa68e35dc16e8e54a1ba1e8
10Bug: https://github.com/open-iscsi/open-iscsi/issues/296
11Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/open-iscsi/+bug/1979692
12Applied-Upstream: 2.1.6
13---
14 usr/discovery.c | 2 +-
15 usr/iscsi_sysfs.c | 4 ++--
16 2 files changed, 3 insertions(+), 3 deletions(-)
17
18diff --git a/usr/discovery.c b/usr/discovery.c
19index 7dec696..587af6d 100644
20--- a/usr/discovery.c
21+++ b/usr/discovery.c
22@@ -623,7 +623,7 @@ add_target_record(char *name, char *end, discovery_rec_t *drec,
23
24 /* if no address is provided, use the default */
25 if (text >= end) {
26- if (drec->address == NULL) {
27+ if (drec->address[0] == '\0') {
28 log_error("no default address known for target %s",
29 name);
30 return 0;
31diff --git a/usr/iscsi_sysfs.c b/usr/iscsi_sysfs.c
32index abefde2..8bc1f57 100644
33--- a/usr/iscsi_sysfs.c
34+++ b/usr/iscsi_sysfs.c
35@@ -1416,8 +1416,8 @@ int iscsi_sysfs_get_sessioninfo_by_id(struct session_info *info, char *session)
36 log_debug(7, "found targetname %s address %s pers address %s port %d "
37 "pers port %d driver %s iface name %s ipaddress %s "
38 "netdev %s hwaddress %s iname %s",
39- info->targetname, info->address ? info->address : "NA",
40- info->persistent_address ? info->persistent_address : "NA",
41+ info->targetname, info->address[0] ? info->address : "NA",
42+ info->persistent_address[0] ? info->persistent_address : "NA",
43 info->port, info->persistent_port, info->iface.transport_name,
44 info->iface.name, info->iface.ipaddress,
45 info->iface.netdev, info->iface.hwaddress,
diff --git a/debian/patches/series b/debian/patches/series
index e3bb90a..33b358e 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,2 +1,4 @@
1lp1755858-default-iscsid_conf-to-iscsid_socket.patch1lp1755858-default-iscsid_conf-to-iscsid_socket.patch
2fix-ftbfs-strcpy-destination-size.patch2fix-ftbfs-strcpy-destination-size.patch
3lp1979692-fix-gcc12-ftbfs-01.patch
4lp1979692-fix-gcc12-ftbfs-02.patch

Subscribers

People subscribed via source and target branches