VirtualBox

Changeset 38017 in vbox for trunk


Ignore:
Timestamp:
Jul 18, 2011 1:24:08 PM (13 years ago)
Author:
vboxsync
Message:

USB/Solaris: vboxuser group access constraint for USB devices.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/VBoxUSB/solaris/VBoxUSB-solaris.c

    r38016 r38017  
    286286    int                     fPoll;           /* Polling status flag */
    287287    RTPROCESS               Process;         /* The process (id) of the session */
    288     bool                    fInstanceOpen;   /* If the process is still holding this instance */
    289288    VBOXUSBREQ_CLIENT_INFO  ClientInfo;      /* Registration data */
    290289    vboxusb_power_t        *pPower;          /* Power Management */
     
    481480                    pState->fPoll = VBOXUSB_POLL_OFF;
    482481                    pState->Process = NIL_RTPROCESS;
    483                     pState->fInstanceOpen = false;
    484482                    pState->pPower = NULL;
    485483
     
    848846    mutex_enter(&pState->Mtx);
    849847
    850     if (pState->fInstanceOpen == false)
     848    if (pState->Process == NIL_RTPROCESS)
    851849        pState->Process = Process;
    852850    else
     
    888886     * Only one user process can open a device instance at a time.
    889887     */
    890     if (pState->fInstanceOpen == true)
    891     {
    892         LogRel((DEVICE_NAME ":VBoxUSBSolarisOpen a process is already using this device instance.\n"));
    893         return EBUSY;
    894     }
    895 
    896888    if (pState->Process != RTProcSelf())
    897889    {
    898         LogRel((DEVICE_NAME ":VBoxUSBSolarisOpen invalid process.\n"));
     890        if (pState->Process == NIL_RTPROCESS)
     891            LogRel((DEVICE_NAME ":VBoxUSBSolarisOpen No prior information about authorized process.\n"));
     892        else
     893            LogRel((DEVICE_NAME ":VBoxUSBSolarisOpen Process %d is already using this device instance.\n", pState->Process));
     894
     895        mutex_exit(&pState->Mtx);
    899896        return EPERM;
    900897    }
    901898
    902899    pState->fPoll = VBOXUSB_POLL_ON;
    903     pState->fInstanceOpen = true;
    904900
    905901    mutex_exit(&pState->Mtx);
     
    927923    pState->fPoll = VBOXUSB_POLL_OFF;
    928924    pState->Process = NIL_RTPROCESS;
    929     pState->fInstanceOpen = false;
    930925    mutex_exit(&pState->Mtx);
    931926
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