`snap set` silently fails when given an invalid key

Bug #1689396 reported by Kyle Fazzari
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
snapd
Fix Released
Medium
Kyle Fazzari

Bug Description

Config keys (the keys used by `snap set/get` and `snapctl set/get`) must follow a valid pattern. For example, underscores aren't valid. And you can see that by trying to pass it:

$ snap get my-snap invalid_key
error: invalid option name: "invalid_key"

$ snapctl get invalid_key
error: error running snapctl: invalid option name: "invalid_key"

However, `snap set` doesn't validate like these other commands. If you run `snap set my-snap invalid_key=foo` (assuming `my-snap` has a configure hook), it returns nothing, as if it succeeded. But it didn't: `invalid_key=foo` never made it into the transaction.

Revision history for this message
Kyle Fazzari (kyrofa) wrote :
Changed in snapd:
status: New → Fix Committed
assignee: nobody → Kyle Fazzari (kyrofa)
importance: Undecided → Medium
Changed in snapd:
status: Fix Committed → Fix Released
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.