VirtualBox

Changeset 75777 in vbox


Ignore:
Timestamp:
Nov 27, 2018 10:19:04 PM (6 years ago)
Author:
vboxsync
Message:

VBoxGuest-darwin.cpp: Correctly set requestor. bugref:9105

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-darwin.cpp

    r75714 r75777  
    415415    if (pCred)
    416416    {
     417#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
     418        RTUID           Uid = kauth_cred_getruid(pCred);
     419        RTGID           Gid = kauth_cred_getrgid(pCred);
     420#else
     421        RTUID           Uid = pCred->cr_ruid;
     422        RTGID           Gid = pCred->cr_rgid;
     423#endif
    417424        unsigned        iHash = SESSION_HASH(Process);
    418425        RTSpinlockAcquire(g_Spinlock);
     
    427434                pSession->fOpened = true;
    428435                pSession->fUserSession = !fUnrestricted;
     436                pSession->fRequestor = VMMDEV_REQUESTOR_USERMODE | VMMDEV_REQUESTOR_TRUST_NOT_GIVEN;
     437                if (Uid == 0)
     438                    pSession->fRequestor |= VMMDEV_REQUESTOR_USR_ROOT;
     439                else
     440                    pSession->fRequestor |= VMMDEV_REQUESTOR_USR_USER;
     441                if (Gid == 0)
     442                    pSession->fRequestor |= VMMDEV_REQUESTOR_GRP_WHEEL;
     443                if (!fUnrestricted)
     444                    pSession->fRequestor |= VMMDEV_REQUESTOR_USER_DEVICE;
     445                fRequestor |= VMMDEV_REQUESTOR_CON_DONT_KNOW; /** @todo see if we can figure out console relationship of pProc. */
    429446            }
    430447            else
     
    11711188            /*
    11721189             * Create a new session.
     1190             * Note! We complete the requestor stuff in the open method.
    11731191             */
    11741192            int rc = VGDrvCommonCreateUserSession(&g_DevExt, VMMDEV_REQUESTOR_USERMODE, &m_pSession);
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