From 9f9c2a2be0e25a7afe461a619c2c8328825a03ad Mon Sep 17 00:00:00 2001 From: klauspost Date: Wed, 12 Aug 2015 15:56:02 +0200 Subject: [PATCH] Ignore Uid/Gid parse errors, since Windows user/group ID isn't numbers. --- lock.go | 12 ++++-------- snapshot.go | 12 ++++-------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/lock.go b/lock.go index c662f1718..d5407a0a2 100644 --- a/lock.go +++ b/lock.go @@ -116,16 +116,12 @@ func (l *Lock) fillUserInfo() error { } l.Username = usr.Username - uid, err := strconv.ParseInt(usr.Uid, 10, 32) - if err != nil { - return err - } + // We ignore the error. On Windows Uid is not a number + uid, _ := strconv.ParseInt(usr.Uid, 10, 32) l.UID = uint32(uid) - gid, err := strconv.ParseInt(usr.Gid, 10, 32) - if err != nil { - return err - } + // We ignore the error. On Windows Gid is not a number + gid, _ := strconv.ParseInt(usr.Gid, 10, 32) l.GID = uint32(gid) return nil diff --git a/snapshot.go b/snapshot.go index b1477c316..1693d2b75 100644 --- a/snapshot.go +++ b/snapshot.go @@ -76,16 +76,12 @@ func (sn *Snapshot) fillUserInfo() error { } sn.Username = usr.Username - uid, err := strconv.ParseInt(usr.Uid, 10, 32) - if err != nil { - return err - } + // We ignore the error. On Windows Uid is not a number + uid, _ := strconv.ParseInt(usr.Uid, 10, 32) sn.UID = uint32(uid) - gid, err := strconv.ParseInt(usr.Gid, 10, 32) - if err != nil { - return err - } + // We ignore the error. On Windows Gid is not a number + gid, _ := strconv.ParseInt(usr.Gid, 10, 32) sn.GID = uint32(gid) return nil