Skip to content
This repository has been archived by the owner on Dec 13, 2018. It is now read-only.

Rebased: Additional groups lookup #603

Merged
merged 4 commits into from Jun 10, 2015

Conversation

dqminh
Copy link
Contributor

@dqminh dqminh commented May 26, 2015

Original PR #559:

This PR modifies AdditionalGroups to be a string array and the lookup to translate to group ids is performed in the container as discussed in moby/moby#10717
Signed-off-by: Mrunal Patel mrunalp@gmail.com

This carries #559, did a rebase and implement the group lookup by scanning through the group file only once.

@mrunalp Can you take a look if this looks good ? I cant open the PR back to the original because of the rebase.

@mrunalp
Copy link
Contributor

mrunalp commented May 26, 2015

@dqminh Thanks a lot for doing this. I tested it and it works fine :)

@dqminh dqminh force-pushed the mrunalp-add_groups_lookup branch from 16e6e87 to 3253691 Compare May 27, 2015 03:27
@mrunalp
Copy link
Contributor

mrunalp commented May 27, 2015

@LK4D4 PTAL

break
}
}
if !found {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here found can't be true, because you're break from loop when set true. So you don't need this variable at all.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you are right. The logic here can be reworked to make it clearer.

@dqminh dqminh force-pushed the mrunalp-add_groups_lookup branch from 3253691 to 0576622 Compare May 28, 2015 04:30
}
gidMap[gid] = struct{}{}
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@LK4D4 I reworked the loop so it's clearer now that we either look at the matched groups or save the new group id. PTAL.

@LK4D4
Copy link
Contributor

LK4D4 commented Jun 1, 2015

LGTM

@LK4D4
Copy link
Contributor

LK4D4 commented Jun 1, 2015

ping @crosbymichael

@LK4D4 LK4D4 mentioned this pull request Jun 2, 2015
@mrunalp
Copy link
Contributor

mrunalp commented Jun 4, 2015

@crosbymichael @vmarmol PTAL

@@ -85,7 +85,7 @@ type Config struct {

// AdditionalGroups specifies the gids that should be added to supplementary groups
// in addition to those that the user belongs to.
AdditionalGroups []int `json:"additional_groups"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any reason for the change from int to string for groups?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think it's because Docker wants to specify group as either gid or name.

Copy link
Contributor

@tianon tianon Jun 10, 2015 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for explaining :)

@vmarmol
Copy link
Contributor

vmarmol commented Jun 10, 2015

This looks good, but needs a rebase.

@dqminh
Copy link
Contributor Author

dqminh commented Jun 10, 2015

Going to rebase asap

Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
Signed-off-by: Mrunal Patel <mrunalp@gmail.com>
@dqminh dqminh force-pushed the mrunalp-add_groups_lookup branch from 0576622 to 1199ab6 Compare June 10, 2015 03:12
This parses group file only once to process a list of groups instead of parsing
once for each group. Also added an unit test for GetAdditionalGroupsPath

Signed-off-by: Daniel, Dao Quang Minh <dqminh89@gmail.com>
@dqminh dqminh force-pushed the mrunalp-add_groups_lookup branch from 1199ab6 to d4ece29 Compare June 10, 2015 03:55
@dqminh
Copy link
Contributor Author

dqminh commented Jun 10, 2015

@vmarmol rebased. PTAL

@vmarmol
Copy link
Contributor

vmarmol commented Jun 10, 2015

LGTM

vmarmol added a commit that referenced this pull request Jun 10, 2015
@vmarmol vmarmol merged commit cb2d973 into docker-archive:master Jun 10, 2015
@cyphar
Copy link
Contributor

cyphar commented Jun 28, 2015

Why wasn't I ping'd on this? This API isn't right, we need an io.Reader function so the tests are less dodgy.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
7 participants