VirtualBox

Changeset 61541 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Jun 7, 2016 1:58:26 PM (9 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
107878
Message:

bugref:8344. Better processing of source and destination filename. Check RAW type and CD, DVD type

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Main/src-server/MediumImpl.cpp

    r61519 r61541  
    30053005                    destMediumPath = sourceMediumPath.stripFilename().append('/').append(destMediumFileName);
    30063006                }
    3007 
    3008                 /* set the target extension like on the source. Permission to convert is prohibited */
    3009                 Utf8Str suffix = i_getFormat();
    3010                 suffix.toLower();
    3011                 destMediumPath.stripSuffix().append('.').append(suffix);
     3007                else
     3008                {
     3009                    /* set the target extension like on the source. Permission to convert is prohibited */
     3010                    Utf8Str suffix = i_getFormat();
     3011
     3012                    if (suffix.compare("RAW", Utf8Str::CaseInsensitive) == 0)
     3013                    {
     3014                        if(i_getDeviceType() == DeviceType_DVD)
     3015                        {
     3016                            suffix = "iso";
     3017                        }
     3018                        else
     3019                        {
     3020                            rc = setError(VERR_NOT_A_FILE,
     3021                                   tr("Medium '%s' has RAW type. \"Move\" operation isn't supported for this type."),
     3022                                   i_getLocationFull().c_str());
     3023                            throw rc;
     3024                        }
     3025                    }
     3026
     3027                    suffix.toLower();
     3028                    destMediumPath.stripSuffix().append('.').append(suffix);
     3029                }
    30123030            }
    30133031
Note: See TracChangeset for help on using the changeset viewer.

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