VirtualBox

Changeset 104872 in vbox for trunk/src/VBox/ValidationKit


Ignore:
Timestamp:
Jun 10, 2024 9:22:12 AM (6 months ago)
Author:
vboxsync
Message:

ValKit/utils.py,tdAppliance1.py: Select the GNU tar-like extraction policy to shut up warnings and to stay safe.

Location:
trunk/src/VBox/ValidationKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/ValidationKit/common/utils.py

    r104532 r104872  
    23362336                            # Just make sure the user (we) got full access to dirs.  Don't bother getting it 100% right.
    23372337                            oTarInfo.mode |= 0x1c0; # (octal: 0700)
    2338                         oTarFile.extract(oTarInfo, sDstDir);
     2338                        if hasattr(tarfile, 'tar_filter'):
     2339                            oTarFile.extract(oTarInfo, sDstDir, filter = 'tar');
     2340                        else:
     2341                            oTarFile.extract(oTarInfo, sDstDir);
    23392342                    asMembers.append(os.path.join(sDstDir, oTarInfo.name.replace('/', os.path.sep)));
    23402343            except Exception as oXcpt:
  • trunk/src/VBox/ValidationKit/tests/api/tdAppliance1.py

    r98651 r104872  
    172172            os.mkdir(sTmpDir, 0o755);
    173173            oTarFile = tarfile.open(sOva, 'r:*'); # No 'with' support in 2.6.   pylint: disable=consider-using-with
    174             oTarFile.extractall(sTmpDir);
     174            if hasattr(tarfile, 'tar_filter'):
     175                oTarFile.extractall(sTmpDir, filter = 'tar');
     176            else:
     177                oTarFile.extractall(sTmpDir);
    175178            oTarFile.close();
    176179        except:
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette