Skip to content
This repository has been archived by the owner on Aug 14, 2020. It is now read-only.

spec: support supplementary GIDs #339

Merged
merged 1 commit into from
Sep 11, 2015
Merged

spec: support supplementary GIDs #339

merged 1 commit into from
Sep 11, 2015

Conversation

jonboulle
Copy link
Contributor

Image manifest allows me to spec what GID to run as, but does not allow me to add supplemental groups. This is important for many reasons, not the least of which is disk quota management.

@jonboulle
Copy link
Contributor

How exactly do you reconcile this with #340 ?

@thockin
Copy link
Contributor Author

thockin commented May 6, 2015

You can have supplemental GIDs without doing an nsswitch lookup.

On Tue, May 5, 2015 at 10:21 AM, Jonathan Boulle notifications@github.com
wrote:

How exactly do you reconcile this with #340
#340 ?


Reply to this email directly or view it on GitHub
#339 (comment).

@jonboulle jonboulle changed the title Supplemental GIDs spec: support supplementary GIDs May 7, 2015
@pquerna
Copy link

pquerna commented Aug 14, 2015

+1, supplemental GIDs are available as a systemd exec unit, but it would be great if I can put them in the appc manifest:

http://www.freedesktop.org/software/systemd/man/systemd.exec.html#SupplementaryGroups=

Allow users to specify supplementary group IDs (GIDs) in the app section
of an ImageManifest. These indicate additional GIDs that the processes
of the app should run with.
@jonboulle jonboulle added this to the v0.7.0 milestone Sep 11, 2015
@vbatts
Copy link
Contributor

vbatts commented Sep 11, 2015

solid
LGTM

vbatts added a commit that referenced this pull request Sep 11, 2015
spec: support supplementary GIDs
@vbatts vbatts merged commit 4fba3b3 into appc:master Sep 11, 2015
jonboulle added a commit to jonboulle/rkt that referenced this pull request Sep 24, 2015
Fixes rkt#1309.

Per appc/spec#339, one of the nice things about
supplementary gids is that they can be applied without requiring any
nsswitch lookup. I thought it would be easy to achieve this using systemd.exec's
SupplementaryGroups setting:
http://www.freedesktop.org/software/systemd/man/systemd.exec.html#SupplementaryGroups=

Unfortunately, this somewhat unexpectedly tries to resolve the groups
given even if they are numeric gids (which isn't guaranteed to succeed),
instead of just calling setgroups() (which is) as I'd hoped:

https://github.com/systemd/systemd/blob/56c581598389739ba2a97baf896ea9277c278a1d/src/core/execute.c#L675

It looks like systemd is trying to be clever and reverse-lookup
gid->groupname, which is annoying:
https://github.com/systemd/systemd/blob/d11885c81419cac217ae132c1ef80733707ba650/src/basic/util.c#L3383

Throwing this up for feedback/ideas.
jonboulle added a commit to jonboulle/rkt that referenced this pull request Sep 24, 2015
Fixes rkt#1309.

Per appc/spec#339, one of the nice things about
supplementary gids is that they can be applied without requiring any
nsswitch lookup. I thought it would be easy to achieve this using systemd.exec's
SupplementaryGroups setting:
http://www.freedesktop.org/software/systemd/man/systemd.exec.html#SupplementaryGroups=

Unfortunately, this somewhat unexpectedly tries to resolve the groups
given even if they are numeric gids (which isn't guaranteed to succeed),
instead of just calling setgroups() (which is) as I'd hoped:

https://github.com/systemd/systemd/blob/56c581598389739ba2a97baf896ea9277c278a1d/src/core/execute.c#L675

It looks like systemd is trying to be clever and reverse-lookup
gid->groupname, which is annoying:
https://github.com/systemd/systemd/blob/d11885c81419cac217ae132c1ef80733707ba650/src/basic/util.c#L3383

Throwing this up for feedback/ideas.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants