mirror of
https://github.com/clearlinux/docker.git
synced 2026-09-07 06:22:03 +00:00
Add unit test to check wrong uid case
This commit is contained in:
@@ -702,6 +702,9 @@ func ParseRepositoryTag(repos string) (string, string) {
|
||||
return repos, ""
|
||||
}
|
||||
|
||||
// UserLookup check if the given username or uid is present in /etc/passwd
|
||||
// and returns the user struct.
|
||||
// If the username is not found, an error is returned.
|
||||
func UserLookup(uid string) (*user.User, error) {
|
||||
file, err := ioutil.ReadFile("/etc/passwd")
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user