initramfs parameters invalid for IPv6 portal

Bug #1641656 reported by Kevin Otte
10
This bug affects 1 person
Affects Status Importance Assigned to Milestone
partman-iscsi (Debian)
New
Unknown
partman-iscsi (Ubuntu)
New
Undecided
Unassigned

Bug Description

In init.d/iscsi the portal address is collected thusly:
echo "$(cat "$connectiondev/persistent_address"):$(cat "$connectiondev/persistent_port"),$(cat "/sys/$sessiondev/tpgt")" >iscsi_portal

resulting in an iscsi_portal file looking like
2606:a000:a449:5900::4:3260,1

In finish.d/iscsi_settings, this string is then picked apart:
        group="${portal##*,}"
        portal="${portal%,*}"
        ip="${portal%%:*}"
        port="${portal#*:}"

These variables are then used to populate iscsi.initramfs, which ends up looking like this:
ISCSI_TARGET_NAME="iqn.2016-11.net.nivex:storage.istest"
ISCSI_TARGET_IP="2606"
ISCSI_TARGET_PORT="a000:a449:5900::4:3260"
ISCSI_TARGET_GROUP="1"
ISCSI_USERNAME="istest"
ISCSI_PASSWORD="123456789012"

I think the easiest fix would be to switch the greed of the matching, as in:
        ip="${portal%:*}"
        port="${portal##*:}"
though I worry about naively splitting on colon when dealing with IPv6 addresses like this.

Tags: patch
Revision history for this message
Kevin Otte (nivex) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

The attachment "iscsi_settings.patch" seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.

[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]

tags: added: patch
Changed in partman-iscsi (Debian):
status: Unknown → New
Revision history for this message
Kevin Otte (nivex) wrote :

I've gotten no motion upstream (Debian) on this. Is this something Ubuntu can pick up for its installer?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.