Wrong permission on resources when on SNAPCRAFT_CONTAINER_BUILDS=1
Metadata
Current evaluation
Fixed by snapcore/snapcraft PR #1588, which corrected UID handling for SNAPCRAFT_CONTAINER_BUILDS=1 and resolved root ownership of generated build directories.
Resolution: closed resolved
Reason: The closing maintainer comment links snapcore/snapcraft#1588 as the resolving code change. It addressed the os.getuid() behavior under sudo that caused container builds to create root-owned resources.
Evaluated by: mr-cal-bot
No scores available.
Issue body
Snapcraft will create a bunch of directories with root privileges. The only way for me to clean them up is by becoming root, making it impossible to develop on a system if she's not an admin.
Furthermore, it requires typing "sudo rm -rf ...." which could go wrong on many levels.
apol@oliver:~/devel/snaps/kdeconnect-plasma (master)$ ls -l
drwxr-xr-x 3 root root 4096 set 27 20:50 snap
drwxr-xr-x 2 root root 4096 set 27 20:50 prime
drwxr-xr-x 7 root root 4096 set 27 20:55 stage
drwxr-xr-x 6 root root 4096 set 27 21:06 parts
...
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| stealth/space-bunny-alpha | — | closed resolved | Fixed by snapcore/snapcraft PR #1588, which corrected UID handling for SNAPCRAFT_CONTAINER_BUILDS=1 and resolved root ownership of generated build directories. | |
| stealth/space-bunny-alpha | — | closed resolved | Root-owned snap/prime/stage/parts dirs from `sudo SNAPCRAFT_CONTAINER_BUILDS=1` were caused by os.getuid() returning 0; fixed in merged PR #1588 (commit 695794f4c) using SUDO_UID for LXD ID mapping, closing LP#1719996. | |
| stealth/space-bunny-alpha | — | closed resolved | Fixed in snapcore/snapcraft#1588 by using SUDO_UID for LXD ID mapping, so container builds no longer leave project directories owned by root. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without resolution. Snapcraft created root-owned directories when SNAPCRAFT_CONTAINER_BUILDS=1, preventing safe cleanup. Zero comments and no patches indicate the report was abandoned or marked stale. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without resolution or comments, likely abandoned. The report detailed Snapcraft generating root-owned directories when container builds are enabled, preventing safe non-root cleanup. | |
| qwen/qwen3.6-35b-a3b | — | — | Closed without resolution, likely abandoned or superseded. The issue reported Snapcraft creating root-owned directories during container builds, preventing non-root cleanup. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Closed without resolution. The report of Snapcraft creating root-owned directories during container builds remains unaddressed, indicating the issue was abandoned. |
Update history
| Date | Change |
|---|---|
| created |
Related work
-
Likely Fixed By:
snapcore/snapcraft#1588
(confidence 97%)
Directly linked by the maintainer as the container-build UID handling fix.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #1741753 Snapcraft clean fails on root-owned files | snapcraft (launchpad) | closed | Root-owned LXD build files broke snapcraft clean; fixed by merged PR snapcore/snapcraft#1904 (commit 6bd4c9e59), correcting raw.idmap ownership handling. |