Revision f2458d1d

View differences:

util/vm/build.py
192 192
    if not path.exists( iso ) or ( stat( iso )[ ST_MODE ] & 0777 != 0444 ):
193 193
        log( '* Retrieving', url )
194 194
        run( 'curl -C - -o %s %s' % ( iso, url ) )
195
        if 'ISO' not in run( 'file ' + iso ):
195
        # Make sure the file header/type is something reasonable like
196
        # 'ISO' or 'x86 boot sector', and not random html or text
197
        result = run( 'file ' + iso )
198
        if 'ISO' not in result and 'boot' not in result:
196 199
            os.remove( iso )
197 200
            raise Exception( 'findiso: could not download iso from ' + url )
198 201
        # Write-protect iso, signaling it is complete

Also available in: Unified diff