mirror of https://github.com/restic/restic.git
Fix restic for i386
Some functions aren't implemented on Linux/i386, e.g. user.LookupId() and user.Current(), so ignore these errors.
This commit is contained in:
parent
4e5094b7c9
commit
d42242556b
10
node.go
10
node.go
|
@ -389,16 +389,18 @@ func lookupUsername(uid string) (string, error) {
|
||||||
return value, nil
|
return value, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
username := ""
|
||||||
|
|
||||||
u, err := user.LookupId(uid)
|
u, err := user.LookupId(uid)
|
||||||
if err != nil {
|
if err == nil {
|
||||||
return "", err
|
username = u.Username
|
||||||
}
|
}
|
||||||
|
|
||||||
uidLookupCacheMutex.Lock()
|
uidLookupCacheMutex.Lock()
|
||||||
uidLookupCache[uid] = u.Username
|
uidLookupCache[uid] = username
|
||||||
uidLookupCacheMutex.Unlock()
|
uidLookupCacheMutex.Unlock()
|
||||||
|
|
||||||
return u.Username, nil
|
return username, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func (node *Node) fillExtra(path string, fi os.FileInfo) error {
|
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 {
|
func (sn *Snapshot) fillUserInfo() error {
|
||||||
usr, err := user.Current()
|
usr, err := user.Current()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
sn.Username = usr.Username
|
sn.Username = usr.Username
|
||||||
|
|
||||||
uid, err := strconv.ParseInt(usr.Uid, 10, 32)
|
uid, err := strconv.ParseInt(usr.Uid, 10, 32)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
|
|
Loading…
Reference in New Issue