summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2010-08-26 22:49:27 +1000
committerAndrew Bartlett <abartlet@samba.org>2010-09-11 18:46:06 +1000
commitcae7babb1fcfbb0655bc1f7f6be51212f3d13c69 (patch)
tree1334dadf1ecec11b505f982f9cb5da484fbdbec5
parent25b0da5c532bbaee819fe239217e2d2f2c81a6c6 (diff)
downloadsamba-cae7babb1fcfbb0655bc1f7f6be51212f3d13c69.tar.gz
samba-cae7babb1fcfbb0655bc1f7f6be51212f3d13c69.tar.bz2
samba-cae7babb1fcfbb0655bc1f7f6be51212f3d13c69.zip
s3-privs Rename structure elements for greater clarity
It is important to make clear which is the LUID and which is the Samba-only bitmap mask. Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
-rw-r--r--source3/include/privileges.h4
-rw-r--r--source3/lib/privileges_basic.c18
-rw-r--r--source3/rpc_server/srv_lsa_nt.c2
3 files changed, 12 insertions, 12 deletions
diff --git a/source3/include/privileges.h b/source3/include/privileges.h
index aa04d42fd0..0bc085c166 100644
--- a/source3/include/privileges.h
+++ b/source3/include/privileges.h
@@ -65,10 +65,10 @@ typedef struct {
} PRIVILEGE_SET;
typedef struct {
- uint64_t se_priv;
+ uint64_t privilege_mask;
const char *name;
const char *description;
- uint32_t luid;
+ enum sec_privilege luid;
} PRIVS;
#endif /* PRIVILEGES_H */
diff --git a/source3/lib/privileges_basic.c b/source3/lib/privileges_basic.c
index 5271c45a88..aa723a4199 100644
--- a/source3/lib/privileges_basic.c
+++ b/source3/lib/privileges_basic.c
@@ -97,7 +97,7 @@ bool se_priv_put_all_privileges(uint64_t *privilege_mask)
return False;
}
for ( i=0; i<num_privs; i++ ) {
- se_priv_add(privilege_mask, &privs[i].se_priv);
+ se_priv_add(privilege_mask, &privs[i].privilege_mask);
}
return True;
}
@@ -166,9 +166,9 @@ bool se_priv_from_name( const char *name, uint64_t *privilege_mask )
{
int i;
- for ( i=0; !se_priv_equal(&privs[i].se_priv, &se_priv_end); i++ ) {
+ for ( i=0; !se_priv_equal(&privs[i].privilege_mask, &se_priv_end); i++ ) {
if ( strequal( privs[i].name, name ) ) {
- se_priv_copy( privilege_mask, &privs[i].se_priv );
+ se_priv_copy( privilege_mask, &privs[i].privilege_mask );
return True;
}
}
@@ -262,7 +262,7 @@ const char* get_privilege_dispname( const char *name )
return NULL;
}
- for ( i=0; !se_priv_equal(&privs[i].se_priv, &se_priv_end); i++ ) {
+ for ( i=0; !se_priv_equal(&privs[i].privilege_mask, &se_priv_end); i++ ) {
if ( strequal( privs[i].name, name ) ) {
return privs[i].description;
@@ -328,9 +328,9 @@ struct lsa_LUIDAttribute get_privilege_luid( uint64_t *privilege_mask )
ZERO_STRUCT( priv_luid );
- for ( i=0; !se_priv_equal(&privs[i].se_priv, &se_priv_end); i++ ) {
+ for ( i=0; !se_priv_equal(&privs[i].privilege_mask, &se_priv_end); i++ ) {
- if ( se_priv_equal( &privs[i].se_priv, privilege_mask ) ) {
+ if ( se_priv_equal( &privs[i].privilege_mask, privilege_mask ) ) {
priv_luid.luid.low = privs[i].luid;
priv_luid.luid.high = 0;
break;
@@ -351,7 +351,7 @@ const char *luid_to_privilege_name(const struct lsa_LUID *set)
if (set->high != 0)
return NULL;
- for ( i=0; !se_priv_equal(&privs[i].se_priv, &se_priv_end); i++ ) {
+ for ( i=0; !se_priv_equal(&privs[i].privilege_mask, &se_priv_end); i++ ) {
if ( set->low == privs[i].luid ) {
return privs[i].name;
}
@@ -400,7 +400,7 @@ bool se_priv_to_privilege_set( PRIVILEGE_SET *set, uint64_t *privilege_mask )
luid.luid.high = 0;
for ( i=0; i<num_privs; i++ ) {
- if ( !is_privilege_assigned(privilege_mask, &privs[i].se_priv) )
+ if ( !is_privilege_assigned(privilege_mask, &privs[i].privilege_mask) )
continue;
luid.luid.high = 0;
@@ -423,7 +423,7 @@ static bool luid_to_se_priv( struct lsa_LUID *luid, uint64_t *privilege_mask )
for ( i=0; i<num_privs; i++ ) {
if ( luid->low == privs[i].luid ) {
- se_priv_copy( privilege_mask, &privs[i].se_priv );
+ se_priv_copy( privilege_mask, &privs[i].privilege_mask );
return True;
}
}
diff --git a/source3/rpc_server/srv_lsa_nt.c b/source3/rpc_server/srv_lsa_nt.c
index 12fd6a948f..48d5609e0f 100644
--- a/source3/rpc_server/srv_lsa_nt.c
+++ b/source3/rpc_server/srv_lsa_nt.c
@@ -1497,7 +1497,7 @@ NTSTATUS _lsa_EnumPrivs(struct pipes_struct *p,
init_lsa_StringLarge(&entries[i].name, privs[i].name);
- luid = get_privilege_luid( &privs[i].se_priv );
+ luid = get_privilege_luid( &privs[i].privilege_mask );
entries[i].luid.low = luid.luid.low;
entries[i].luid.high = luid.luid.high;