VirtualBox

Changeset 75778 in vbox for trunk/src/VBox/Additions/common


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

VBoxGuest-freebsd.c: Correctly set requestor. bugref:9105

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/common/VBoxGuest/VBoxGuest-freebsd.c

    r70873 r75778  
    233233    int                 rc;
    234234    PVBOXGUESTSESSION   pSession;
     235    uint32_t            fRequestor;
     236    struct ucred       *pCred = curthread->td_ucred;
     237    if (!pCred)
     238        pCred = curproc->p_ucred;
    235239
    236240    LogFlow(("vgdrvFreeBSDOpen:\n"));
     
    245249     * Create a new session.
    246250     */
    247     rc = VGDrvCommonCreateUserSession(&g_DevExt, VMMDEV_REQUESTOR_USERMODE, &pSession);
     251    fRequestor = VMMDEV_REQUESTOR_USERMODE | VMMDEV_REQUESTOR_TRUST_NOT_GIVEN;
     252    if (pCred && pCred->cr_uid == 0)
     253        fRequestor |= VMMDEV_REQUESTOR_USR_ROOT;
     254    else
     255        fRequestor |= VMMDEV_REQUESTOR_USR_USER;
     256    if (pCred && groupmember(0, pCred))
     257        fRequestor |= VMMDEV_REQUESTOR_GRP_WHEEL;
     258    fRequestor |= VMMDEV_REQUESTOR_NO_USER_DEVICE; /** @todo implement /dev/vboxuser
     259    if (!fUnrestricted)
     260        fRequestor |= VMMDEV_REQUESTOR_USER_DEVICE; */
     261    fRequestor |= VMMDEV_REQUESTOR_CON_DONT_KNOW; /** @todo see if we can figure out console relationship of pProc. */
     262    rc = VGDrvCommonCreateUserSession(&g_DevExt, fRequestor, &pSession);
    248263    if (RT_SUCCESS(rc))
    249264    {
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