diff --git a/.travis.yml b/.travis.yml index 672e08ec1..54bd6d0cc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -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 diff --git a/node.go b/node.go index 13d44ca04..2071c7acf 100644 --- a/node.go +++ b/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 { diff --git a/snapshot.go b/snapshot.go index 7558f15c3..c5abca5e1 100644 --- a/snapshot.go +++ b/snapshot.go @@ -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