VirtualBox

Changeset 106439 in vbox for trunk/src/VBox


Ignore:
Timestamp:
Oct 17, 2024 11:50:35 AM (6 weeks ago)
Author:
vboxsync
Message:

FE/Qt: bugref:10786 Sanitize file object names.

Location:
trunk/src/VBox
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoContentBrowser.cpp

    r106061 r106439  
    429429        if (iterator.value().isEmpty())
    430430            continue;
    431         QString strEntry = QString("%1=%2").arg(iterator.key()).arg(iterator.value());
     431        QString strSource = iterator.key();
     432        strSource.replace("\"", "\\\"");
     433        QString strTarget = iterator.value();
     434        strTarget.replace("\"", "\\\"");
     435        /* We must quote %1 and %2 here, as those might contain spaces as part of a path or file name. */
     436        QString strEntry = QString("\"%1\"=\"%2\"").arg(strSource).arg(strTarget);
    432437        entryList << strEntry;
    433438    }
  • trunk/src/VBox/Frontends/VirtualBox/src/medium/viso/UIVisoCreator.cpp

    r105901 r106439  
    985985        QTextStream stream(&file);
    986986        stream << QString("%1 %2").arg("--iprt-iso-maker-file-marker-bourne-sh").arg(QUuid::createUuid().toString()) << "\n";
    987         stream<< "--volume-id=" << strVisoName << "\n";
     987        /* Note: Quote the volume ID, as we might use the VM name as a default, which in turn can contain spaces. */
     988        stream<< "--volume-id=\"" << strVisoName << "\"\n";
    988989        if (!strImportedISOPath.isEmpty())
    989990            stream << "--import-iso=" << strImportedISOPath << "\n";
  • trunk/src/VBox/Main/src-server/UnattendedInstaller.cpp

    r106061 r106439  
    15061506         *        One less CDROM to mount. */
    15071507        /* Name the ISO. */
    1508         rVecArgs.append() = "--volume-id=VBox Unattended Boot";
     1508        rVecArgs.append() = "--volume-id=\"VBox Unattended Boot\"";
    15091509
    15101510        /* Copy the isolinux directory from the original install ISO. */
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