Wrong snapd error message when /root/snap folder has invalid permissions
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| snapd |
Fix Released
|
Undecided
|
Unassigned | ||
| snapd (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned | ||
| Jammy |
Fix Released
|
Undecided
|
Unassigned | ||
| Noble |
Fix Released
|
Undecided
|
Unassigned | ||
| Plucky |
Fix Released
|
Undecided
|
Unassigned | ||
| Questing |
Fix Released
|
Undecided
|
Unassigned | ||
Bug Description
[SRU] 2.72: https:/
[ Impact ]
Misleading error message: "home directories outside of /home needs configuration" when /root/snap is not accessible (e.g. wrong permissions such as 0660)
[ Test Plan ]
1. Reproduce with snapd snap < 2.72
- change /root/snap permissions to 0660
- run snap application as root
- expect: "home directories outside of /home needs configuration"
2. Prove fixed with snapd snap 2.72
- change /root/snap permissions to 0660
- run snap application as root
- expect: "cannot create user data directory:..."
---original---
After a mistake with a script on my laptop, the /root/snap folder was given wrong permissions (660 instead of 700). This lead to the following completely misleading error message that made the issue much harder to discover and fix: "Sorry, home directories outside of /home needs configuration."
The code in snapd indeed has the following check:
if (sc_nonfatal_
if ((errno == EROFS || errno == EACCES) && !sc_startswith(
// clear errno or it will be displayed in die()
errno = 0;
// XXX: may point to the right config option here?
}
die("cannot create user data directory: %s", user_data);
};
It should also check for "/root" in order to display the proper error message.
| description: | updated |
| description: | updated |
| tags: |
added: verification-done verification-done-jammy verification-done-noble verification-done-plucky verification-done-questing removed: verification-needed verification-needed-jammy verification-needed-noble verification-needed-plucky verification-needed-questing |
| Changed in snapd: | |
| status: | New → Fix Released |
PR: https:/ /github. com/canonical/ snapd/pull/ 15729