Print this page
uts: add a concept of a 'default' set of privileges, separate from 'basic'

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/os/cred.c
          +++ new/usr/src/uts/common/os/cred.c
↓ open down ↓ 205 lines elided ↑ open up ↑
 206  206           */
 207  207          kcred = cralloc();
 208  208  
 209  209          bzero(kcred, crsize);
 210  210          kcred->cr_ref = 1;
 211  211  
 212  212          /* kcred is never freed, so we don't need zone_cred_hold here */
 213  213          kcred->cr_zone = &zone0;
 214  214  
 215  215          priv_fillset(&CR_LPRIV(kcred));
 216      -        CR_IPRIV(kcred) = *priv_basic;
      216 +        CR_IPRIV(kcred) = *priv_default; /* XXX: Really needed here? */
 217  217  
 218  218          /* Not a basic privilege, if chown is not restricted add it to I0 */
 219  219          if (!rstchown)
 220  220                  priv_addset(&CR_IPRIV(kcred), PRIV_FILE_CHOWN_SELF);
 221  221  
 222  222          /* Basic privilege, if link is restricted remove it from I0 */
 223  223          if (rstlink)
 224  224                  priv_delset(&CR_IPRIV(kcred), PRIV_FILE_LINK_ANY);
 225  225  
 226  226          CR_EPRIV(kcred) = CR_PPRIV(kcred) = CR_IPRIV(kcred);
↓ open down ↓ 1252 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX