Ignore:
Timestamp:
Jul 2, 2011, 3:35:33 PM (14 years ago)
Author:
Herwig Bauernfeind
Message:

Samba 3.5: Update trunk to 3.5.8

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/server/source3/lib/privileges_basic.c

    r414 r596  
    4747const SE_PRIV se_restore         = SE_RESTORE;
    4848const SE_PRIV se_take_ownership  = SE_TAKE_OWNERSHIP;
     49const SE_PRIV se_security       = SE_SECURITY;
    4950
    5051/********************************************************************
     
    99100#endif
    100101        {SE_MACHINE_ACCOUNT,    "SeMachineAccountPrivilege",    "Add machines to domain",                  { 0x0, 0x0006 }},
     102        {SE_SECURITY,           "SeSecurityPrivilege",          "Manage auditing and security log",        { 0x0, 0x0008 }},
    101103        {SE_TAKE_OWNERSHIP,     "SeTakeOwnershipPrivilege",     "Take ownership of files or other objects",{ 0x0, 0x0009 }},
    102104        {SE_BACKUP,             "SeBackupPrivilege",            "Back up files and directories",           { 0x0, 0x0011 }},
     
    108110        {SE_DISK_OPERATOR,      "SeDiskOperatorPrivilege",      "Manage disk shares",                      { 0x0, 0x1003 }},
    109111
     112
    110113        {SE_END, "", "", { 0x0, 0x0 }}
    111114};
     
    190193{
    191194        return ( memcmp(mask1, mask2, sizeof(SE_PRIV)) == 0 );
     195}
     196
     197/***************************************************************************
     198 check if 2 LUID's are equal.
     199****************************************************************************/
     200
     201static bool luid_equal( const LUID *luid1, const LUID *luid2 )
     202{
     203        return ( luid1->low == luid2->low && luid1->high == luid2->high);
    192204}
    193205
     
    407419        int i;
    408420
    409         if (set->high != 0)
    410                 return NULL;
    411 
    412421        for ( i=0; !se_priv_equal(&privs[i].se_priv, &se_priv_end); i++ ) {
    413                 if ( set->low == privs[i].luid.low ) {
     422                if (luid_equal(set, &privs[i].luid)) {
    414423                        return privs[i].name;
    415424                }
     
    478487        int i;
    479488        uint32 num_privs = count_all_privileges();
     489        LUID local_luid;
     490
     491        local_luid.low = luid->low;
     492        local_luid.high = luid->high;
    480493
    481494        for ( i=0; i<num_privs; i++ ) {
    482                 if ( luid->low == privs[i].luid.low ) {
     495                if (luid_equal(&local_luid, &privs[i].luid)) {
    483496                        se_priv_copy( mask, &privs[i].se_priv );
    484497                        return True;
     
    501514                SE_PRIV r;
    502515
    503                 /* sanity check for invalid privilege.  we really
    504                    only care about the low 32 bits */
    505 
    506                 if ( privset->set[i].luid.high != 0 )
    507                         return False;
    508 
    509516                if ( luid_to_se_priv( &privset->set[i].luid, &r ) )
    510517                        se_priv_add( mask, &r );
Note: See TracChangeset for help on using the changeset viewer.