Open fredizzimo opened 2 years ago
It seems like I spoke too soon. There's still something wrong, the main executable can now run. but when I try to set breakpoints before starting "Cannot access memory errors". When using control-c to add breakpoints once the program is running it works. however. And running without using wsl-distrod with -e /bin/bash
is also fine.
I don't know the exact reason yet. But I'll try to figure it out.
Edit I found the issue and explained it in more detail in #22. Those workarounds can be done without this pull request, but I still think it's worth including, since the fix is more general,
Some programs like GDB launces a shell without additional privileges, so dropping the privileges can fail. In order to fix that allow failures when already running inside a container.
Note, that I also tried another approach, testing if the effecting privileges are already correct, however it go unreasonably complex since 'getgroups' is a bit unspecified. And I think ignoring the failures gets the same end result. I also checked the bash source for a reference and they do check for matching privileges, but on the other hand they never call
setgroups
so they don't need to deal with that.I also noticed that bash has a
-p
, privileged mode parameter that wsl-distrod should probably also support, but that's not implemented in this pull request.Fixes https://github.com/nullpo-head/wsl-distrod/issues/22