Skip to content

[19.03 backport] oci: correctly use user.GetExecUser interface#41293

Merged
tianon merged 1 commit into
moby:19.03from
thaJeztah:19.03_backport_fix_getexecuser
Sep 26, 2020
Merged

[19.03 backport] oci: correctly use user.GetExecUser interface#41293
tianon merged 1 commit into
moby:19.03from
thaJeztah:19.03_backport_fix_getexecuser

Conversation

@thaJeztah

Copy link
Copy Markdown
Member

backport of #41288

A nil interface in Go is not the same as a nil pointer that satisfies
the interface. libcontainer/user has special handling for missing
/etc/{passwd,group} files but this is all based on nil interface checks,
which were broken by Docker's usage of the API.

When combined with some recent changes in runc that made read errors
actually be returned to the caller, this results in spurrious -EINVAL
errors when we should detect the situation as "there is no passwd file".

- Description for the changelog

- A picture of a cute animal (not mandatory but encouraged)

A nil interface in Go is not the same as a nil pointer that satisfies
the interface. libcontainer/user has special handling for missing
/etc/{passwd,group} files but this is all based on nil interface checks,
which were broken by Docker's usage of the API.

When combined with some recent changes in runc that made read errors
actually be returned to the caller, this results in spurrious -EINVAL
errors when we should detect the situation as "there is no passwd file".

Signed-off-by: Aleksa Sarai <[email protected]>
(cherry picked from commit 3108ae6)
Signed-off-by: Sebastiaan van Stijn <[email protected]>
@thaJeztah thaJeztah added this to the 19.03.13 milestone Jul 29, 2020
@thaJeztah thaJeztah modified the milestones: 19.03.13, 19.03.14 Jul 31, 2020
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.

5 participants