Skip to content
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

pkg: idtools: fix subid files parsing #20725

Merged
merged 1 commit into from Feb 26, 2016

Conversation

runcom
Copy link
Member

@runcom runcom commented Feb 26, 2016

/etc/sub{uid,gid} files can contain #-prefixed lines that are comments.
Fix those files parsing by skipping commented out lines. Add regression
unit test also.

ping @estesp

Signed-off-by: Antonio Murdaca runcom@redhat.com

@runcom
Copy link
Member Author

runcom commented Feb 26, 2016

This bug was here before 1.10.0, however this is failing distros like Fedora who ships comments in those files (which will be fixed in later versions of setup). Pls consider adding this to 1.10.3 :)

@thaJeztah
Copy link
Member

LGTM

I'll add it to the 1.10.3 milestone, but we probably won't have a 1.10.3

@thaJeztah thaJeztah modified the milestones: 1.10.3, 1.11.0 Feb 26, 2016
@cpuguy83
Copy link
Member

LGTM

@runcom
Copy link
Member Author

runcom commented Feb 26, 2016

test seems not ok, on it

@runcom runcom force-pushed the fix-subid-files-parsing branch 3 times, most recently from dad7000 to 83a1d20 Compare February 26, 2016 14:39
@runcom
Copy link
Member Author

runcom commented Feb 26, 2016

alright test now works (test name was not capital after Test*) and so it wasn't executed, w/o this patch the test successfully fails:

---> Making bundle: test-unit (in bundles/1.11.0-dev/test-unit)
Fri Feb 26 14:33:08 UTC 2016
--- FAIL: TestParseSubidFileWithNewlinesAndComments (0.00s)
    idtools_unix_test.go:260: Cannot parse subuid/gid information: Format not correct for /tmp/parsesubid713917116/testsubuid file
FAIL
coverage: 31.6% of statements
FAIL    github.com/docker/docker/pkg/idtools    0.004s

moving again to merge

@estesp
Copy link
Contributor

estesp commented Feb 26, 2016

Thanks @runcom!

Since Docker is already skipping newlines in /etc/sub{uid,gid},
this patch skips commented out lines - otherwise Docker fails to start.
Add unit test also.

Signed-off-by: Antonio Murdaca <runcom@redhat.com>
@runcom
Copy link
Member Author

runcom commented Feb 26, 2016

@estesp :)

vdemeester added a commit that referenced this pull request Feb 26, 2016
pkg: idtools: fix subid files parsing
@vdemeester vdemeester merged commit b2a15a2 into moby:master Feb 26, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants