Changeset 596 for trunk/server/source3/lib/privileges_basic.c
- Timestamp:
- Jul 2, 2011, 3:35:33 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/server/source3/lib/privileges_basic.c
r414 r596 47 47 const SE_PRIV se_restore = SE_RESTORE; 48 48 const SE_PRIV se_take_ownership = SE_TAKE_OWNERSHIP; 49 const SE_PRIV se_security = SE_SECURITY; 49 50 50 51 /******************************************************************** … … 99 100 #endif 100 101 {SE_MACHINE_ACCOUNT, "SeMachineAccountPrivilege", "Add machines to domain", { 0x0, 0x0006 }}, 102 {SE_SECURITY, "SeSecurityPrivilege", "Manage auditing and security log", { 0x0, 0x0008 }}, 101 103 {SE_TAKE_OWNERSHIP, "SeTakeOwnershipPrivilege", "Take ownership of files or other objects",{ 0x0, 0x0009 }}, 102 104 {SE_BACKUP, "SeBackupPrivilege", "Back up files and directories", { 0x0, 0x0011 }}, … … 108 110 {SE_DISK_OPERATOR, "SeDiskOperatorPrivilege", "Manage disk shares", { 0x0, 0x1003 }}, 109 111 112 110 113 {SE_END, "", "", { 0x0, 0x0 }} 111 114 }; … … 190 193 { 191 194 return ( memcmp(mask1, mask2, sizeof(SE_PRIV)) == 0 ); 195 } 196 197 /*************************************************************************** 198 check if 2 LUID's are equal. 199 ****************************************************************************/ 200 201 static bool luid_equal( const LUID *luid1, const LUID *luid2 ) 202 { 203 return ( luid1->low == luid2->low && luid1->high == luid2->high); 192 204 } 193 205 … … 407 419 int i; 408 420 409 if (set->high != 0)410 return NULL;411 412 421 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)) { 414 423 return privs[i].name; 415 424 } … … 478 487 int i; 479 488 uint32 num_privs = count_all_privileges(); 489 LUID local_luid; 490 491 local_luid.low = luid->low; 492 local_luid.high = luid->high; 480 493 481 494 for ( i=0; i<num_privs; i++ ) { 482 if ( luid->low == privs[i].luid.low) {495 if (luid_equal(&local_luid, &privs[i].luid)) { 483 496 se_priv_copy( mask, &privs[i].se_priv ); 484 497 return True; … … 501 514 SE_PRIV r; 502 515 503 /* sanity check for invalid privilege. we really504 only care about the low 32 bits */505 506 if ( privset->set[i].luid.high != 0 )507 return False;508 509 516 if ( luid_to_se_priv( &privset->set[i].luid, &r ) ) 510 517 se_priv_add( mask, &r );
Note:
See TracChangeset
for help on using the changeset viewer.