1
0
Fork 0
mirror of https://github.com/restic/restic.git synced 2025-03-09 00:00:02 +01:00

Ignore Uid/Gid parse errors, since Windows user/group ID isn't numbers.

This commit is contained in:
klauspost 2015-08-12 15:56:02 +02:00
parent caee192488
commit 9f9c2a2be0
2 changed files with 8 additions and 16 deletions

12
lock.go
View file

@ -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

View file

@ -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