Hello, I've just tested on Jammy; the warning message is present once an
invalid key is set:

Follow the logs:

$ snap version --verbose
snap            2.77.1
snapd           2.77.1
series          16
ubuntu          22.04
kernel          5.15.0-1109-kvm
architecture    amd64
snapd-bin-from  snap
snap-bin-from   snap

$ sudo snap refresh
All snaps up to date.


$ sudo snap set lxd x.Y="z"
error: cannot perform the following tasks:
- Run configure hook of "lxd" snap (invalid option name: "Y")
ubuntu@jj:~$ sudo snap set lxd -t x='{"Y": "z"}'
WARNING: There is 1 new warning. See 'snap warnings'.

$ snap warnings
last-occurrence:  today at 13:50 UTC
warning: |
  Option value has invalid field name "Y". For core26+ snaps, fields must be 
dash separated
  lowercase alphanumerics.


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


$ apt show snapd
Package: snapd
Version: 2.76.3+ubuntu22.04.1
Built-Using: apparmor (= 3.0.4-2ubuntu2.4), libcap2 (= 
1:2.44-1ubuntu0.22.04.3), libseccomp (= 2.5.3-2ubuntu2)
Priority: optional
Section: devel
Origin: Ubuntu
Maintainer: Ubuntu Developers <[email protected]>
Bugs: https://bugs.launchpad.net/ubuntu/+filebug
Installed-Size: 127 MB
Depends: adduser, apparmor (>= 2.10.95-0ubuntu2.2), ca-certificates, fuse3 (>= 
3.10.5-1) | fuse, libcap2-bin, openssh-client, squashfs-tools, systemd, udev, 
default-dbus-session-bus | dbus-session-bus, libblkid1 (>= 2.17.2), libc6 (>= 
2.34), libfuse3-3 (>= 3.2.3), liblzma5 (>= 5.1.1alpha+20120614), liblzo2-2 (>= 
2.02), libudev1 (>= 183), zlib1g (>= 1:1.1.4)
Recommends: gnupg
Suggests: zenity | kdialog
Conflicts: snap (<< 2013-11-29-1ubuntu1)
Breaks: snap-confine (<< 2.23), snapd-xdg-open (<= 0.0.0), ubuntu-core-launcher 
(<< 2.22), ubuntu-snappy (<< 1.9), ubuntu-snappy-cli (<< 1.9)
Replaces: snap-confine (<< 2.23), snapd-xdg-open (<= 0.0.0), 
ubuntu-core-launcher (<< 2.22), ubuntu-snappy (<< 1.9), ubuntu-snappy-cli (<< 
1.9)
Homepage: https://github.com/snapcore/snapd
Task: server-minimal, ubuntu-desktop-minimal, ubuntu-desktop, cloud-image, 
ubuntu-desktop-raspi, ubuntu-wsl, server, ubuntu-server-raspi, kubuntu-desktop, 
xubuntu-core, xubuntu-desktop, lubuntu-desktop, ubuntustudio-desktop-core, 
ubuntustudio-desktop, ubuntukylin-desktop, ubuntu-mate-core, 
ubuntu-mate-desktop, ubuntu-budgie-desktop, ubuntu-budgie-desktop-raspi
Download-Size: 33.9 MB
APT-Manual-Installed: no
APT-Sources: http://security.ubuntu.com/ubuntu jammy-security/main amd64 
Packages
Description: Daemon and tooling that enable snap packages
 Install, configure, refresh and remove snap packages. Snaps are
 'universal' packages that work across many different Linux systems,
 enabling secure distribution of the latest apps and utilities for
 cloud, servers, desktops and the internet of things.
 .
 Start with 'snap list' to see installed snaps.

N: There are 2 additional records. Please use the '-a' switch to see
them.

$ cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.5 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.5 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/";
SUPPORT_URL="https://help.ubuntu.com/";
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/";
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy";
UBUNTU_CODENAME=jammy
ubuntu@jj:~$

-- 
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