VirtualBox

Ignore:
Timestamp:
Dec 23, 2010 2:13:30 PM (14 years ago)
Author:
vboxsync
Message:

UPR3HardenedMain.cpp: next attempt at getting Solaris privileges working correctly

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/HostDrivers/Support/SUPR3HardenedMain.cpp

    r35307 r35311  
    656656    seteuid(g_uid);
    657657    priv_set_t *pPrivEffective = priv_allocset();
    658     priv_set_t *pPrivNewEffective = priv_allocset();
    659     priv_set_t *pPrivNewPermitted = priv_allocset();
    660     if (pPrivEffective && pPrivNewEffective && pPrivNewPermitted)
     658    priv_set_t *pPrivNew = priv_allocset();
     659    if (pPrivEffective && pPrivNew)
    661660    {
    662661        int rc = getppriv(PRIV_EFFECTIVE, pPrivEffective);
     
    664663        if (!rc)
    665664        {
    666             priv_copyset(pPrivEffective, pPrivNewEffective);
    667             priv_copyset(pPrivEffective, pPrivNewPermitted);
    668             rc = priv_addset(pPrivNewEffective, PRIV_NET_ICMPACCESS);
     665            priv_copyset(pPrivEffective, pPrivNew);
     666            rc = priv_addset(pPrivNew, PRIV_NET_ICMPACCESS);
    669667            if (!rc)
    670668            {
    671669                /* Order is important, as one can't set a privilege which is
    672                  * not in the permitted privilege set. We limit ourselves as
    673                  * much as possible after grabbing the extra privileges. */
    674                 rc = setppriv(PRIV_SET, PRIV_EFFECTIVE, pPrivNewEffective);
     670                 * not in the permitted privilege set. */
     671                rc = setppriv(PRIV_SET, PRIV_EFFECTIVE, pPrivNew);
    675672                if (rc)
    676673                    supR3HardenedError(rc, false, "SUPR3HardenedMain: failed to set effective privilege set.\n");
    677                 rc = setppriv(PRIV_SET, PRIV_PERMITTED, pPrivNewPermitted);
     674                rc = setppriv(PRIV_SET, PRIV_PERMITTED, pPrivNew);
    678675                if (rc)
    679                     supR3HardenedError(rc, false, "SUPR3HardenedMain: failed to set effective privilege set.\n");
     676                    supR3HardenedError(rc, false, "SUPR3HardenedMain: failed to set permitted privilege set.\n");
    680677            }
    681678            else
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