canonical / canonical/multipass

[mounts/sshfs] Try to take into consideration both ownership and permissions of a file.

Open
#3,334 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
9.2k
Forks
828
Avg merge
3d 1h
Merged PRs (30d)
44

Description

**Describe the bug**
When doing a classic mount on a directory, we heavily restrict interaction with files which have uids/gids that are not mapped. This limits the interactions with a file even if its permissions should theoretically allow them i.e. a file with `0777` permissions should not care about ownership when trying to read from and write to it.

**To Reproduce**
How, and what happened?
1. Provide irrelevant mappings to override the default
```
multipass mount dir instance:dir -u 1234:1234 -g 1234:1234
```
2. Have a file with full permissions
```
sudo chmod 0777 dir/file
```
3. From inside the VM, the files still appears with full permissions
```
stat -c "%a" dir/file
777
```
4. But we can't use it
```
cat dir/file
cat: dir/file: Permission denied
```

**Expected behavior**
Take into consideration the permissions of files with unmapped uids/gids.

Contributor guide

Open the contributing guide

Research direction

Start in the mounts/sshfs implementation and reproduce the issue with the supplied multipass mount, chmod, stat, and cat commands. Trace how unmapped uids/gids are handled and verify that access to files with permissive modes respects both ownership and permissions.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, linux
Domain
operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.