Browse Source

Improves user lookup error message.

Closes #3188
Closes #3184
pull/3839/head
James Phillips 7 years ago
parent
commit
9cd602de06
No known key found for this signature in database
GPG Key ID: 77183E682AC5FC11
  1. 9
      agent/util.go

9
agent/util.go

@ -61,12 +61,11 @@ func setFilePermissions(path string, user, group, mode string) error {
}
// Try looking up the user by name
if u, err := osuser.Lookup(user); err == nil {
uid, _ = strconv.Atoi(u.Uid)
goto GROUP
u, err := osuser.Lookup(user)
if err != nil {
return fmt.Errorf("failed to look up user %s: %v", user, err)
}
return fmt.Errorf("invalid user specified: %v", user)
uid, _ = strconv.Atoi(u.Uid)
}
GROUP:

Loading…
Cancel
Save