~ubuntu-branches/ubuntu/maverick/dell-recovery/maverick

« back to all changes in this revision

Viewing changes to Dell/recovery_backend.py

  • Committer: Bazaar Package Importer
  • Author(s): Mario Limonciello
  • Date: 2010-08-05 17:43:39 UTC
  • Revision ID: james.westby@ubuntu.com-20100805174339-w70eza0q3iaueo3o
Tags: 0.63
* Fix a regression with tgz type fish packages from previous pylint cleanup
  due to tarfile not containing an __exit__ method.
* When operating on a newer ubiquity version, hide the progress_section
  at window bottom.
* Drop the title string on the bootstrap page.  It looks funny.
* Don't propagate BOOT_IMAGE either to target system.
* Add a title string to the recovery page, it looks funny without it.

Show diffs side-by-side

added added

removed removed

Lines of Context:
374
374
 
375
375
        def safe_tar_extract(filename, destination):
376
376
            """Safely extracts a tarball into destination"""
377
 
            with tarfile.open(filename) as rfd:
378
 
                dangerous_file = False
379
 
                for name in rfd.getnames():
380
 
                    if name.startswith('..') or name.startswith('/'):
381
 
                        dangerous_file = True
382
 
                        break
383
 
                if not dangerous_file:
384
 
                    rfd.extractall(destination)
 
377
            logging.debug('safe_tar_extract: %s to %s', (filename, destination))
 
378
            rfd = tarfile.open(filename)
 
379
            dangerous_file = False
 
380
            for name in rfd.getnames():
 
381
                if name.startswith('..') or name.startswith('/'):
 
382
                    dangerous_file = True
 
383
                    break
 
384
            if not dangerous_file:
 
385
                rfd.extractall(destination)
 
386
            rfd.close()
385
387
 
386
388
        self._reset_timeout()
387
389