Snap strict confinement: inaccessible search path for git config
- Dominant language
- Rust
- Stars
- 22.5k
- Forks
- 773
- PR merge metrics
- No merged PRs in 30d
Description
**Describe the bug**
Running gitui installed from snap attempts to access file `'/etc/gitconfig` which is not accessible in snap context. For proper handling its probably would require configuring additional search paths, similar to [this](https://github.com/gitui-org/gitui/blob/9613d153aa713b24ca76db90a382041dab53e5ef/asyncgit/src/sync/mod.rs#L283) commentary.
**To Reproduce**
1. Install gitui from snap `snap install gitui`
2. Create non-bare repository
```
mkdir -p ./test-repo
cd ./test-repo
git init
git rev-parse --is-bare-repository # should yield false
```
or open any existing non-bare repo.
3. run gitui from snap `snap run gitui` and see error
```
Error: invalid repo path: failed open - '/etc/gitconfig' is locked: Permission denied; class=Os (2); code=Locked (-14)
```
**Expected behavior**
gitui would open main TUI screen
# Additional Context
```
snap run gitui --bugreport
```
#### Software version
gitui 0.28.1 (v0.19.0-1066-ge24fb45d-modified)
#### Operating system
- OS: Linux (Ubuntu Core 24)
- Kernel: 6.1.0-37-amd64
#### Compile time information
- Profile: release
- Target triple: x86_64-unknown-linux-gnu
- Family: unix
- OS: linux
- Architecture: x86_64
- Pointer width: 64
- Endian: little
- CPU features: crt-static,fxsr,sse,sse2
- Host: x86_64-unknown-linux-gnu
#### Environment variables
```bash
SHELL=/bin/bash
EDITOR=
GIT_EDITOR=
VISUAL=
```
#### Command-line
```bash
/snap/gitui/380/gitui --bugreport
```
Contributor guide
Research direction
Start with the search-path handling in asyncgit/src/sync/mod.rs, especially the referenced code near line 283, and reproduce the failure with a snap-installed gitui in a non-bare repository. Check how the snap's strict confinement affects access to /etc/gitconfig. Done means gitui opens its main TUI screen without the reported permission error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- git, linux, rust
- Domain
- cli, operating-systems
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 55/100