-
Notifications
You must be signed in to change notification settings - Fork 18.8k
[carry 39605] daemon/listeners: use chgrp binary for docker.sock #42879
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
may need some changes in packaging, per #39605 (comment)
|
In case the daemon is compiled statically, it is not using glibc's uid/gid to name resolving functions (because of `osusergo` build tag), and so users who (1) use LDAP, NIS, or similar stuff and (2) not relying on systemd creating the docker.sock file will suffer from the issue described in docker/for-linux#186. Commit a2e3846 fixed that, but not for the static build case. So, instead of relying on golang os/user doing a lookup, let's just call chgrp binary and have it do a group name to gid conversion. PS Commit messages from c7c2cd4 and 169c013 helped me to figure out why the code is the way it is. Signed-off-by: Kir Kolyshkin <kolyshkin@gmail.com> Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2891a46
to
09de87e
Compare
What if we shell out conditionally instead? It makes the code a little more complicated, but avoids requiring We could also consider shelling out to |
Do you know how to use group When no key is provided, use setgrent(3), getgrent(3),
and endgrent(3) to enumerate the group database. When
one or more key arguments are provided, pass each
numeric key to getgrgid(3) and each nonnumeric key to
getgrnam(3) and display the result. |
Ah, never mind, I guess I was reading getent group systemd-journal docker
systemd-journal:x:101:
docker:x:999:sebastiaan |
I'm actually wondering if this PR is still needed; #38126 changed the moby/pkg/idtools/idtools_unix.go Lines 153 to 161 in 686be57
moby/pkg/idtools/idtools_unix.go Lines 175 to 188 in 686be57
|
Perhaps we no longer need this patch, or am I missing a reason we'd still need it? @kolyshkin @tianon |
Aha, yeah, IMO this is a non-issue now 😀 |
👍 let's close this one |
I am very sorry that I somehow managed to totally miss the fact that idtools do fallback to calling |
No worries, I forgot about the other change as well; I came on this carry, because I was cleaning up some of my branches, and then found #39605 (comment), and thought: "oh! I never pushed that branch" 😂 |
carries #39605
closes #39605
In case the daemon is compiled statically, it is not using glibc's
uid/gid to name resolving functions (because of
osusergo
build tag),and so users who
will suffer from the issue described in docker/for-linux#186.
Commit a2e3846 (PR #38126) fixed that, but not for the static build case.
So, instead of relying on golang os/user doing a lookup, let's just call
chgrp binary and have it do a group name to gid conversion.
PS Commit messages from c7c2cd4 and 169c013 helped me to
figure out why the code is the way it is.
- Description for the changelog
- A picture of a cute animal (not mandatory but encouraged)