Changeset 34364 in vbox for trunk/src/VBox/HostDrivers/Support
- Timestamp:
- Nov 25, 2010 1:35:13 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/HostDrivers/Support/SUPR3HardenedMain.cpp
r33595 r34364 649 649 # elif defined(RT_OS_SOLARIS) 650 650 /* 651 * Add net_icmpaccess privilege to permitted, effective and inheritable privileges 652 * before dropping root privileges. 653 */ 654 priv_set_t *pPrivSet = priv_str_to_set("basic", ",", NULL); 655 if (pPrivSet) 656 { 657 priv_addset(pPrivSet, PRIV_NET_ICMPACCESS); 658 int rc = setppriv(PRIV_SET, PRIV_INHERITABLE, pPrivSet); 659 if (!rc) 651 * Add net_icmpaccess privilege to permitted, effective and inheritable 652 * privileges before dropping root privileges. Skip this hacky code for 653 * real root, as it removes lots of privileges due to the harcoded set. 654 */ 655 if (getuid() != 0) 656 { 657 priv_set_t *pPrivSet = priv_str_to_set("basic", ",", NULL); 658 if (pPrivSet) 660 659 { 661 rc = setppriv(PRIV_SET, PRIV_PERMITTED, pPrivSet); 660 priv_addset(pPrivSet, PRIV_NET_ICMPACCESS); 661 int rc = setppriv(PRIV_SET, PRIV_INHERITABLE, pPrivSet); 662 662 if (!rc) 663 663 { 664 rc = setppriv(PRIV_SET, PRIV_EFFECTIVE, pPrivSet); 665 if (rc) 666 supR3HardenedError(rc, false, "SUPR3HardenedMain: failed to set effective privilege set.\n"); 664 rc = setppriv(PRIV_SET, PRIV_PERMITTED, pPrivSet); 665 if (!rc) 666 { 667 rc = setppriv(PRIV_SET, PRIV_EFFECTIVE, pPrivSet); 668 if (rc) 669 supR3HardenedError(rc, false, "SUPR3HardenedMain: failed to set effective privilege set.\n"); 670 } 671 else 672 supR3HardenedError(rc, false, "SUPR3HardenedMain: failed to set permitted privilege set.\n"); 667 673 } 668 674 else 669 supR3HardenedError(rc, false, "SUPR3HardenedMain: failed to set permitted privilege set.\n"); 675 supR3HardenedError(rc, false, "SUPR3HardenedMain: failed to set inheritable privilege set.\n"); 676 677 priv_freeset(pPrivSet); 670 678 } 671 679 else 672 supR3HardenedError(rc, false, "SUPR3HardenedMain: failed to set inheritable privilege set.\n"); 673 674 priv_freeset(pPrivSet); 675 } 676 else 677 supR3HardenedError(-1, false, "SUPR3HardenedMain: failed to get basic privilege set.\n"); 678 680 supR3HardenedError(-1, false, "SUPR3HardenedMain: failed to get basic privilege set.\n"); 681 } 679 682 # endif 680 683 }
Note:
See TracChangeset
for help on using the changeset viewer.