`snap remove` should reject commands with invalid snap names
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snapd |
Fix Released
|
High
|
Miguel Pires |
Bug Description
If you run `snap remove` with bad arguments, it currently assumes all arguments are snap names, regardless of whether these names are valid or not. As a result, slightly mistyping a `snap remove` command has very bad consequences.
Assume you refresh a snap to the latest version to see that it is broken. You revert to a previous revision and you want to remove the latest revision. This is what happens when you forget the two hyphens before `revision`.
```bash
merlijn@howard:~$ snap remove sdlpop revision=131
sdlpop removed
revision=131 not installed
```
Snap removes `sdlpop` entirely and tries to remove the snap `revision=131`. This causes irreversible damage since you can only revert to versions you have cached locally, so you lose the ability to use the previous working revision. This has already happened: https:/
In order to prevent users from accidentally shooting themselves in the foot, `snap remove` should check if all arguments are valid snap names. If they are not, `snap remove` should error out.
description: | updated |
description: | updated |
Changed in snapd: | |
status: | New → Confirmed |
importance: | Undecided → High |
Changed in snapd: | |
assignee: | nobody → Samuele Pedroni (pedronis) |
Changed in snapd: | |
status: | In Progress → Fix Committed |
Changed in snapd: | |
status: | Fix Committed → Fix Released |
The user data is not removed unless you also specified --purge (on reinstalling the app, 'snap restore sdlpop' would bring it back).