VirtualBox

Changeset 23948 in vbox


Ignore:
Timestamp:
Oct 21, 2009 5:36:30 PM (15 years ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
53766
Message:

FE/Qt4: 4357: Warn if usbfs is mounted at /sys/bus/usb/drivers - implemented.

Location:
trunk/src/VBox/Frontends/VirtualBox
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/include/VBoxProblemReporter.h

    r23924 r23948  
    153153    void cannotDeleteFile (const QString& path, QWidget *aParent = NULL) const;
    154154
     155    void checkForMountedWrongUSB() const;
     156
    155157    /* Special problem handlers */
    156158    void showBETAWarning();
  • trunk/src/VBox/Frontends/VirtualBox/src/VBoxProblemReporter.cpp

    r23937 r23948  
    342342}
    343343
     344void VBoxProblemReporter::checkForMountedWrongUSB() const
     345{
     346    QFile file ("/etc/fstab");
     347    if (file.exists() && file.open (QIODevice::ReadOnly | QIODevice::Text))
     348    {
     349        QStringList contents;
     350        while (!file.atEnd())
     351            contents << file.readLine();
     352        QStringList grep1 (contents.filter ("/sys/bus/usb/drivers"));
     353        QStringList grep2 (grep1.filter ("usbfs"));
     354        if (!grep2.isEmpty())
     355            message (mainWindowShown(), Warning,
     356                     tr ("You seem to have the USBFS filesystem mounted at /sys/bus/usb/drivers in /etc/fstab. "
     357                         "We strongly recommend that you change this, as it is a severe mis-configuration of "
     358                         "your system which could cause USB devices to fail in unexpected ways."),
     359                     "checkForMountedWrongUSB");
     360    }
     361}
     362
    344363// Special Problem handlers
    345364/////////////////////////////////////////////////////////////////////////////
  • trunk/src/VBox/Frontends/VirtualBox/src/main.cpp

    r23296 r23948  
    479479#endif
    480480
     481            vboxProblem().checkForMountedWrongUSB();
     482
    481483            VBoxGlobalSettings settings = vboxGlobal().settings();
    482484            /* Process known keys */
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