Allow specifying wildcards (`*`) for `--[ug]id-map` on mounts
What are the host-side ids to use when running multipass mount? I am accessing files through a user other than "multipass".
Without specifying -u and -g, I see from "multipass info", the following map: "UID map: -2:default". From the code, it looks like both the host and instance ids should be unsigned integers.
Hi @dhruvrajan,
You're right, it's a missing case at the moment. We default to a mapping of "map all uids/gids to the default user", but we don't support it on the command line.
Thanks for the quick response! I'm happy to take a look at this and see if I can help.
@dhruvrajan great! This is where you'd need to look: mount.cpp and then sftp_server.cpp#L302.
Could this be a bug?
I am running Windows 10 and see the same issue:
Mounts: c:/ => /c-drive
UID map: -2:default
GID map: -2:default
It looks like the cause of processes that try to access files in the mount getting 'permission denied' for Read access to files. Here is syslog when I start named with a config file in mount:
Mar 17 14:28:14 mysys named[2300]: loading configuration from '/c-drive/local/named.conf'
Mar 17 14:28:14 mysys named[2300]: open: /c-drive/local/named.conf: permission denied
Mar 17 14:28:14 mysys kernel: [ 2250.379791] audit: type=1400 audit(1584473294.206:27): apparmor="DENIED" operation="open" profile="/usr/sbin/named" name="/c-drive/local/named.conf" pid=2300 comm="isc-worker0000" requested_mask="r" denied_mask="r" fsuid=0 ouid=1000
I have read #1346 (and others covered by 'is:issue is:open map' ), and I don't think they are the issue.
I don't code C or it's variants, but, will be happy to collaborate from a test bed perspective if I can.
hth,
David
Hi @dhruvrajan,
You're right, it's a missing case at the moment. We default to a mapping of "map all uids/gids to the default user", but we don't support it on the command line.
Isn't that what it's already doing in the command line ? doesn't "-2:default" mean "map all uids/gids to the default user" i tried it and that's what it's doing no ? isn't the "-2" just a special value to indicate (everyone), and "default" is just the default user on the guest ? so it should work for now since there's no way of parsing window's SIDs.
I'm interesting in solve this issue.
But, I don't know what can be the solution. Map all guest uids/gids with his mirror host uids/gids? @Saviq @Pastoray @dhruvrajan
I apologize, I was working on this 5 years ago and can't remember the context for this haha. All the best in fixing this.
I'm interesting in solve this issue.
But, I don't know what can be the solution. Map all guest uids/gids with his mirror host uids/gids? @Saviq @Pastoray @dhruvrajan
i believe you should inspect where command line arguments are being parsed, which was if i can recall in cli/mount.cpp, of course that's after you run vcpkg instsall and run cmake to actually get most of stuff that's defined in the .proto files, also don't build on windows build on linux or wsl, you might wanna take a look at sftp_server.cpp#L302 as Saviq mentioned.
I'm interesting in solve this issue. But, I don't know what can be the solution. Map all guest uids/gids with his mirror host uids/gids? @Saviq @Pastoray @dhruvrajan
i believe you should inspect where command line arguments are being parsed, which was if i can recall in cli/mount.cpp, of course that's after you run vcpkg instsall and run cmake to actually get most of stuff that's defined in the .proto files, also don't build on windows build on linux or wsl, you might wanna take a look at sftp_server.cpp#L302 as Saviq mentioned.
Thanks, man. That's helpful.
I don't understand this issue and if already exists.
@ricab, or @Pastoray you guys understand this? If that the case, explain me how to replicate, please. I really want to collaborate.