Warn about leading "0" (octal) in snap.yaml?
Bug #1640523 reported by
Ondrej Kubik
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Ubuntu Image |
Fix Released
|
High
|
Barry Warsaw | ||
snapd |
Triaged
|
Medium
|
Unassigned | ||
snapd (Ubuntu) |
Triaged
|
Medium
|
Unassigned |
Bug Description
USB vip and pid parsing in gadget snap interface definition is very sensitive to the value.
example from snap.yaml
usb-vendor: 0658
this value will make parser fail
Changed in ubuntu-image: | |
milestone: | none → 0.12 |
importance: | Undecided → High |
status: | New → Triaged |
Changed in ubuntu-image: | |
assignee: | nobody → Barry Warsaw (barry) |
status: | Triaged → In Progress |
Changed in ubuntu-image: | |
status: | In Progress → Fix Committed |
Changed in ubuntu-image: | |
status: | Fix Committed → Fix Released |
Changed in ubuntu-image: | |
status: | Fix Released → New |
summary: |
- Parse integer-like YAML values as strings + Warn about leading "0" (octal) in snap.yaml? |
Changed in snapd: | |
assignee: | Michael Vogt (mvo) → nobody |
status: | In Progress → Triaged |
Changed in snapd (Ubuntu): | |
status: | In Progress → Triaged |
Changed in snapd: | |
importance: | Undecided → Medium |
To post a comment you must log in.
I'm looking at this again in more detail now and what I don't understand is why this is a bug on ubuntu-image given that u-i doesn't parse the snap.yaml, but instead only the gadget.yaml. And the gadget.yaml doesn't define `usb-vendor` or vip/pid.
However, we already have to special case a few instances where int-like values are parsed into actual integers, from which we have to convert back into strings. What I'd like to do is parse int-like things as strings and then turn the one or two cases back into ints in post-processing. The only values that might naturally be integers are the `size` and `offset` keys, but we already have to post-process them because their values can also have suffixes.