Improper address:port joining

Bug #1518128 reported by Menno Finlay-Smits
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
juju-core
Fix Released
High
Cheryl Jennings
1.25
Fix Released
High
Cheryl Jennings

Bug Description

Similarly to bug 1478943, there's a number of place in Juju that incorrectly join addresses and ports. net.JoinHostAddr should be used instead a naive join using fmt.Sprintf. Not doing this correctly results in invalid address:port pairs when the address is IPv6.

Here are the problem areas:

provider/local/config.go: return fmt.Sprintf("%s:%d", c.bootstrapIPAddress(), c.storagePort())
provider/manual/config.go: return fmt.Sprintf("%s:%d", c.bootstrapHost(), c.storagePort())
provider/manual/config.go: return fmt.Sprintf("%s:%d", c.storageListenIPAddress(), c.storagePort())
state/address.go: newAddrs[i] = fmt.Sprintf("%s:%d", addr, port)
state/backups/backups_linux.go: memberHostPort := fmt.Sprintf("%s:%d", args.PrivateAddress, ssi.StatePort)
state/backups/restore_test.go: c.Assert(dialInfo.Addrs, gc.DeepEquals, []string{fmt.Sprintf("%s:%d", privateAddress, statePort)})
state/backups/restore.go: Addrs: []string{fmt.Sprintf("%s:%d", privateAddr, ssi.StatePort)},
utils/ssh/ssh_gocrypto.go: addr: fmt.Sprintf("%s:%d", host, port),

Tags: 2.0-count
Revision history for this message
Cheryl Jennings (cherylj) wrote :
Changed in juju-core:
status: Triaged → In Progress
Revision history for this message
Cheryl Jennings (cherylj) wrote :
Changed in juju-core:
status: In Progress → Fix Committed
Curtis Hovey (sinzui)
Changed in juju-core:
status: Fix Committed → Fix Released
tags: added: 2.0-count
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.