Verify on noble: PASS
=====================

1. Confirm dotted invalid names are already rejected (old and new
snapd):

```
sudo snap set lxd x.Y=z
error: cannot perform the following tasks:
- Run configure hook of "lxd" snap (invalid option name: "Y")
```

2. Reproduce on unfixed snapd (2.76.3+ubuntu24.04). The deb was kept in
front of the seeded snapd snap with SNAP_REEXEC=0:

```
snap version --verbose
snap            2.76.3+ubuntu24.04
snapd           2.76.3+ubuntu24.04
series          16
ubuntu          24.04
kernel          6.8.0-142-generic
architecture    amd64
snapd-bin-from  native-package
snap-bin-from   native-package

sudo snap set lxd -t 'x={"Y": "z"}'

snap warnings
No further warnings.

sudo snap get lxd -d
{
        "x": {
                "Y": "z"
        }
}
```

3. Nested and list cases warn on 2.77.1+ubuntu24.04 from noble-proposed.
lxd 5.21 is not core26, so the set is kept and snapd warns. Fresh field
names were used so the warnings were not suppressed by an earlier
acknowledgement:

```
snap version --verbose
snap            2.77.1+ubuntu24.04
snapd           2.77.1+ubuntu24.04
series          16
ubuntu          24.04
kernel          6.8.0-142-generic
architecture    amd64
snapd-bin-from  native-package
snap-bin-from   native-package

sudo snap set lxd -t 'fresh={"Q": 1}'
WARNING: There is 1 new warning. See 'snap warnings'.

sudo snap set lxd -t 'nest={"good":{"Nope":1}}'
WARNING: There are 2 new warnings. See 'snap warnings'.

sudo snap set lxd -t 'items=[{"Zz":1}]'
WARNING: There are 3 new warnings. See 'snap warnings'.

snap warnings
warning: |
  Option value has invalid field name "Q". For core26+ snaps, fields must be
  dash separated lowercase alphanumerics.
---
warning: |
  Option value has invalid field name "Nope". For core26+ snaps, fields must be
  dash separated lowercase alphanumerics.
---
warning: |
  Option value has invalid field name "Zz". For core26+ snaps, fields must be
  dash separated lowercase alphanumerics.
```

4. Valid JSON keys still work:

```
sudo snap set lxd -t 'fresh={"q": 1}'

sudo snap get lxd fresh
{
        "q": 1
}

sudo snap set lxd plain=ok
sudo snap get lxd plain
ok
```

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2072331

Title:
  dash-case-subset config on snap set not being validated when passing
  JSON

To manage notifications about this bug go to:
https://bugs.launchpad.net/snapd/+bug/2072331/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to