Fix 32bit overflow

math.UaxUint32 will actually overflow on a 32 bit platform (tested on armv7)

This will resolve that issue.
This commit is contained in:
PhoenixMage 2020-03-30 23:37:34 +11:00 committed by GitHub
parent 5dcc1706c0
commit aa6a3de316
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -725,7 +725,7 @@ func mkdirAllWithPermissions(path string, mode os.FileMode, uid, gid int64) erro
}
if uid > math.MaxUint32 || gid > math.MaxUint32 {
// due to https://github.com/golang/go/issues/8537
return errors.New(fmt.Sprintf("Numeric User-ID or Group-ID greater than %v are not properly supported.", math.MaxUint32))
return errors.New(fmt.Sprintf("Numeric User-ID or Group-ID greater than %v are not properly supported.", uint64(math.MaxUint32)))
}
if err := os.Chown(path, int(uid), int(gid)); err != nil {
return err