/srv/irclogs.ubuntu.com/2022/05/13/#snappy.txt

mupPR snapd#11652 closed: tests: update snapd testing tools <Created by sergiocazzolato> <Merged by sergiocazzolato> <https://github.com/snapcore/snapd/pull/11652>01:57
mborzeckimorning06:08
mardymborzecki: hi! Historical question: has there ever been a time when snap-confine was running under some other user than root (I mean, before we started using sc_set_effective_identity())?06:32
mardyI'm asking because we are *sometimes* calling chown() on newly created directories, which seems weird06:34
mardylike for example you did here: 73e89cf8cae423bca52df128e2f8d3508068f55c06:35
mardywasn't snap-confine running as root back then?06:35
mborzeckimardy: iirc that was done as part of suse review, the problem was that all of s-c would run as root as it's a setuid binary, so they requested to limit as-root operations only to what is really necessary06:38
mborzeckihence the code flips between uid/gid a number of times06:39
mardymborzecki: yes, that makes sense. I'm just wondering why we added chown after mkdir, if the mkdirs already are done as the root user06:48
mborzeckimardy: whcih place?06:48
mardymborzecki: I'm working on a branch with some cleanups, and one of them would be this: https://github.com/mardy/snapd/commit/b1b668b065790b1d741add95c476300c3894fecb06:50
mborzeckimardy: the directory could have eisted before, potentially with the wrong permissions06:50
mardymborzecki: but if you have a look at the commit I mentioned before (73e89cf8cae423bca52df128e2f8d3508068f55c), you'll see that some of those chowns were added by you06:50
mardymborzecki: but the code there calls chmod only if the directory did not exist :-)06:51
mborzeckimardy: ah right, heh, should have been `res != 0`06:52
mborzeckimardy: possible that this part was running under the real uid at some point06:53
mborzeckihm but then mkdirs would fail i think06:54
mborzeckimardy: so maybe a bug after all06:54
mardymborzecki: but the comment there explicitly says that the chown needs to be done only if we created the dirs, so the "==" is consistent with that06:56
mardyI saw a comment (or maybe it was a commit message) that stated that we rely on packaging doing the right thing. I think that the current assumption is correct, and that the chown is not needed06:57
mborzeckimardy: ok, i see now, take a look at commit 82c8083d64b9af5d35d7b7cfb11d6faeb800e37507:00
mborzeckimardy: now we're flipping both uid and gid, but before we only changed uid, hence mkdir would give ou a directory owned by `0:<user's-gid>`07:01
pstolowskimorning07:03
mardymborzecki: oh, that's interesting (and so cool when the git history is so explicative!), thanks!07:05
mardypstolowski: hi!07:05
mupPR snapd#11786 opened: Mount support cleanups <Created by mardy> <https://github.com/snapcore/snapd/pull/11786>07:39
mborzeckimardy: so there are going to be some wsl2 specific files under /var/lib/snapd/lib/07:54
mborzecki?07:54
diddledaniMardy, is that a response to my pr yesterday, or has someone else been working on wsl2, also?08:06
diddledanimborzecki: if the is a response to my wsl2 pr then maybe we will get wsl libs in that dir. I've marked my pr as draft to get feedback for now: https://github.com/snapcore/snapd/pull/1178508:07
mupPR #11785: RFC: WSL2 GPU support in strict confinement <Created by diddledani> <https://github.com/snapcore/snapd/pull/11785>08:07
diddledaniMardy once your pr merges I'll reabse and make changes to my code to match the same usage of the sc_nonfatal_mkdir etv08:11
mupPR snapd#11787 opened: portal-info: Add CommonID Field <Created by 3v1n0> <https://github.com/snapcore/snapd/pull/11787>08:19
mardydiddledani: AFAIK no one else is working on WSL2, I just created my PR after seeing yours08:25
diddledanimardy: I'd like to see the sc_mkdir_and_mount_and_bind function(s) abstracted out to a shared helper location with the nvidia specifics removed (ie. call to `sc_nv_version();` and `sc_probe_nvidia_driver(&version);` bits done in the nvidia files with the mount and bind method simply mounting and binding rather than checking nvidia versions and stsuff08:26
mardydiddledani: that would make sense, but we can work on it later09:05
mupPR snapd#11788 opened: secboot/keymgr: extend unit tests, add helper for identify keyslot used error <Simple 😃> <Created by bboozzoo> <https://github.com/snapcore/snapd/pull/11788>09:19
svipmardy: I think I know what the problem is.  If pwd is $HOME, and I play the file, it works.  But if I change pwd to the directory the file is in (on sshfs mounted directory), it fails.10:11
svipI am still not sure of what the problem, but I do have a workaround now.10:12
mardysvip: mmm... can you please try starting other snaps while your CWD is somewhere in the sshfs tree? I wonder if this might be a generic problem with snaps10:19
svipI've experienced this problem with omxplayer-pi and vlc-pi, but they are both by the same developer, so they might simply share the same issue.10:20
svipDo you have any suggestion of a snap I could try?10:20
mardysvip: the hello-world one :-)10:21
mardyif that works, then we can try something more complicated, like the chromium one10:21
svipmardy: hello-world fails the same way.10:23
ograthere should be nothing special in either of the snaps (i'm the maintainer)10:23
svipmardy: Could it be the way I mount the sshfs volume?  I simply do the sshfs command without any flags.10:24
svipThe external drives just happen to use the same user as me.10:24
mardysvip: wow, that's cool, in a way. Let me search if we already have a bug for this10:34
mardysvip: I cannot find anything, would you be so kind to file one? https://bugs.launchpad.net/snapd Or I can do it, if you don't have time10:36
svipI can do it.10:37
diddledanisshfs is fuse-based right? the default for fuse filesystems is to block "other users" including root, so snapd will be unable to access the CWD when launching a snapped app10:40
svipdiddledani: How do I allow others to read from the sshfs mounted directory?10:41
diddledanisvip: add `user_allow_other` or `allow_root` in `/etc/fuse.conf`10:41
diddledanisorry I got that wrong10:42
diddledaniadd `user_allow_other` to `/etc/fuse.conf` then you need to use the `allow_root` option when mounting the fs10:42
diddledaniwith `user_allow_other` in `/etc/fuse.conf`, run this to mount `sshfs -o allow_root user@server:/source /destination`10:43
svipdiddledani: That works!  Thanks.10:43
diddledanioh, you might not need `user_allow_other` in `/etc/fuse.conf` if you mount with that command10:43
diddledaniref: https://unix.stackexchange.com/questions/17402/why-does-root-get-permission-denied-when-accessing-fuse-directory#:~:text=It%27s%20the%20way%20fuse%20works.%20If%20you%20want,fuse%20filesystem%20with%20allow_other%20or%20allow_root%20as%20options.10:44
svipWell, considering it's just me on this machine (a Raspberry Pi), I wouldn't be too worried.10:44
mardydiddledani: too bad I was not looking at this chat, I just reached the same conclusion. I still think that we could improve this part a bit though, and make snap-confine more transparent about the user (who should not know about these details)12:01
mupPR snapd#11789 opened: interfaces: opengl: add rules for NXP i.MX GPU drivers <Created by IsaacJT> <https://github.com/snapcore/snapd/pull/11789>12:25
mupPR core-build#58 closed: initramfs: add neccessary modules for rockchip emmc and sdcard <Created by JeffyCN> <Closed by > <https://github.com/snapcore/core-build/pull/58>12:37
mupPR snapd#11790 opened: tests: core20 preseed/nested spread test <Preseeding 🍞> <Run nested> <Created by stolowski> <https://github.com/snapcore/snapd/pull/11790>12:50
mupPR snapcraft#3740 opened: repo: enable package repository architectures <Created by cmatsuoka> <https://github.com/snapcore/snapcraft/pull/3740>14:42
mupPR snapd#11762 closed: interfaces: tweak getPath() slightly and add some more tests <Created by mvo5> <Merged by mvo5> <https://github.com/snapcore/snapd/pull/11762>15:21
mupPR snapd#11599 closed: tests: use new snaps.name and snaps.cleanup tools <Created by sergiocazzolato> <Merged by sergiocazzolato> <https://github.com/snapcore/snapd/pull/11599>18:12
mupPR snapcraft#3740 closed: repo: enable package repository architectures <Created by cmatsuoka> <Merged by cmatsuoka> <https://github.com/snapcore/snapcraft/pull/3740>19:17
mupPR snapd#11791 opened: tests: fix the system-snap-refresh test <Created by sergiocazzolato> <https://github.com/snapcore/snapd/pull/11791>20:32

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!