commit
70f92433c3
3 changed files with 10 additions and 6 deletions
|
@ -31,7 +31,9 @@ script:
|
|||
- make restic
|
||||
- make gox
|
||||
- make test
|
||||
- GOARCH=386 make test
|
||||
- make test-integration
|
||||
- GOARCH=386 make test-integration
|
||||
- make all.cov
|
||||
- goveralls -coverprofile=all.cov -service=travis-ci -repotoken "$COVERALLS_TOKEN"
|
||||
- gofmt -l *.go */*.go */*/*.go
|
||||
|
|
10
node.go
10
node.go
|
@ -389,16 +389,18 @@ func lookupUsername(uid string) (string, error) {
|
|||
return value, nil
|
||||
}
|
||||
|
||||
username := ""
|
||||
|
||||
u, err := user.LookupId(uid)
|
||||
if err != nil {
|
||||
return "", err
|
||||
if err == nil {
|
||||
username = u.Username
|
||||
}
|
||||
|
||||
uidLookupCacheMutex.Lock()
|
||||
uidLookupCache[uid] = u.Username
|
||||
uidLookupCache[uid] = username
|
||||
uidLookupCacheMutex.Unlock()
|
||||
|
||||
return u.Username, nil
|
||||
return username, nil
|
||||
}
|
||||
|
||||
func (node *Node) fillExtra(path string, fi os.FileInfo) error {
|
||||
|
|
|
@ -71,10 +71,10 @@ func (sn Snapshot) ID() backend.ID {
|
|||
func (sn *Snapshot) fillUserInfo() error {
|
||||
usr, err := user.Current()
|
||||
if err != nil {
|
||||
return err
|
||||
return nil
|
||||
}
|
||||
|
||||
sn.Username = usr.Username
|
||||
|
||||
uid, err := strconv.ParseInt(usr.Uid, 10, 32)
|
||||
if err != nil {
|
||||
return err
|
||||
|
|
Loading…
Reference in a new issue