runc/libcontainer/user
Wang Long dde4b1a885 user: fix the parameter error
The parameters passed to `GetExecUser` is not correct.
Consider the following code:

```
package main

import (
	"fmt"
	"io"
	"os"
)

func main() {
	passwd, err := os.Open("/etc/passwd1")
	if err != nil {
		passwd = nil
	} else {
		defer passwd.Close()
	}

	err = GetUserPasswd(passwd)
	if err != nil {
		fmt.Printf("%#v\n", err)
	}
}

func GetUserPasswd(r io.Reader) error {
	if r == nil {
		return fmt.Errorf("nil source for passwd-formatted
data")
	} else {
		fmt.Printf("r = %#v\n", r)
	}
	return nil
}
```

If the file `/etc/passwd1` is not exist, we expect to return
`nil source for passwd-formatted data` error, and in fact, the func
`GetUserPasswd` return nil.

The same logic exists in runc code. this patch fix it.

Signed-off-by: Wang Long <long.wanglong@huawei.com>
2017-01-19 10:02:47 +08:00
..
MAINTAINERS Move libcontainer into subdirectory 2015-06-21 19:29:15 -07:00
lookup.go Export user and group lookup errors as variables. 2016-03-17 21:03:27 +01:00
lookup_unix.go Move libcontainer into subdirectory 2015-06-21 19:29:15 -07:00
lookup_unsupported.go Move libcontainer into subdirectory 2015-06-21 19:29:15 -07:00
user.go user: fix the parameter error 2017-01-19 10:02:47 +08:00
user_test.go Fix TestGetAdditionalGroups on i686 2016-09-27 18:25:53 +08:00