RedHatCloudForms / cfme-cloud_services

Red Hat Cloud Services plugin for CloudForms
Apache License 2.0
5 stars 13 forks source link

Fix an integer overflow error for large files #41

Closed agrare closed 5 years ago

agrare commented 5 years ago

Large files cause "You tried to feed more data than fits in the file." error from Rubygems tar file writer. The solution is to pass bytesize instead of length to add_file_simple.

Note: I didn't observe this on a GNU/Linux machine but it was seen on a Mac with a 10KiB resulting tgz file. I'm guessing there is a difference in byte size between int, long, and long long on the different systems.

agrare commented 5 years ago

cc @mturley

miq-bot commented 5 years ago

Checked commit https://github.com/agrare/cfme-cloud_services/commit/d0af27edde9505b9621cab60626d5686faed54c2 with ruby 2.4.6, rubocop 0.69.0, haml-lint 0.20.0, and yamllint 1.10.0 1 file checked, 0 offenses detected Everything looks fine. :cake:

mturley commented 5 years ago

@agrare this will need to be ivanchuk/yes right?

agrare commented 5 years ago

cc @abellotti

agrare commented 5 years ago

https://bugzilla.redhat.com/show_bug.cgi?id=1744606

simaishi commented 5 years ago

Ivanchuk backport details:

$ git log -1
commit c953eb00f194d1f43f8ebee8c12e75fb60f067e9
Author: Alberto Bellotti <abellotti@users.noreply.github.com>
Date:   Fri Aug 16 09:26:59 2019 -0400

    Merge pull request #41 from agrare/fix_file_size_issue

    Fix an integer overflow error for large files

    (cherry picked from commit bda65acc228b81d6286a8e67378900dda325575d)

    https://bugzilla.redhat.com/show_bug.cgi?id=1744606