mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Merge pull request #41288 from thaJeztah/fix_getexecuser
oci: correctly use user.GetExecUser interface
This commit is contained in:
commit
6d9c4d60c5
1 changed files with 8 additions and 1 deletions
|
@ -176,7 +176,14 @@ func readUserFile(c *container.Container, p string) (io.ReadCloser, error) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
return os.Open(fp)
|
fh, err := os.Open(fp)
|
||||||
|
if err != nil {
|
||||||
|
// This is needed because a nil *os.File is different to a nil
|
||||||
|
// io.ReadCloser and this causes GetExecUser to not detect that the
|
||||||
|
// container file is missing.
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return fh, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func getUser(c *container.Container, username string) (uint32, uint32, []uint32, error) {
|
func getUser(c *container.Container, username string) (uint32, uint32, []uint32, error) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue