summaryrefslogtreecommitdiff
path: root/source3/lib/privileges.c
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2010-08-30 12:59:38 +1000
committerAndrew Bartlett <abartlet@samba.org>2010-09-11 18:46:09 +1000
commitb057867de3fbb423ef6afb9b7038ab99c83124d8 (patch)
tree313ac5da30310a23fab1f0da6a63981a68336b71 /source3/lib/privileges.c
parent0e2142a9275b567a3c6a8f90e95240d9e686ec27 (diff)
downloadsamba-b057867de3fbb423ef6afb9b7038ab99c83124d8.tar.gz
samba-b057867de3fbb423ef6afb9b7038ab99c83124d8.tar.bz2
samba-b057867de3fbb423ef6afb9b7038ab99c83124d8.zip
s3-privs Remove a pointer from grant_privilege()
Andrew Bartlett Signed-off-by: Andrew Tridgell <tridge@samba.org>
Diffstat (limited to 'source3/lib/privileges.c')
-rw-r--r--source3/lib/privileges.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/source3/lib/privileges.c b/source3/lib/privileges.c
index 57c4d81fa4..349067f047 100644
--- a/source3/lib/privileges.c
+++ b/source3/lib/privileges.c
@@ -269,7 +269,7 @@ NTSTATUS privilege_enum_sids(const uint64_t *mask, TALLOC_CTX *mem_ctx,
Add privilege to sid
****************************************************************************/
-bool grant_privilege(const struct dom_sid *sid, const uint64_t *priv_mask)
+bool grant_privilege(const struct dom_sid *sid, const uint64_t priv_mask)
{
uint64_t old_mask, new_mask;
@@ -277,11 +277,11 @@ bool grant_privilege(const struct dom_sid *sid, const uint64_t *priv_mask)
ZERO_STRUCT( new_mask );
if ( get_privileges( sid, &old_mask ) )
- se_priv_copy( &new_mask, &old_mask );
+ new_mask = old_mask;
else
- se_priv_copy( &new_mask, &se_priv_none );
+ new_mask = 0;
- se_priv_add( &new_mask, priv_mask );
+ new_mask |= priv_mask;
DEBUG(10,("grant_privilege: %s\n", sid_string_dbg(sid)));
@@ -306,7 +306,7 @@ bool grant_privilege_by_name(struct dom_sid *sid, const char *name)
return False;
}
- return grant_privilege( sid, &mask );
+ return grant_privilege( sid, mask );
}
/***************************************************************************
@@ -366,7 +366,7 @@ bool revoke_privilege_by_name(struct dom_sid *sid, const char *name)
NTSTATUS privilege_create_account(const struct dom_sid *sid )
{
- return ( grant_privilege(sid, &se_priv_none) ? NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL);
+ return ( grant_privilege(sid, 0) ? NT_STATUS_OK : NT_STATUS_UNSUCCESSFUL);
}
/***************************************************************************
@@ -498,5 +498,5 @@ bool grant_all_privileges( const struct dom_sid *sid )
return False;
}
- return grant_privilege( sid, &mask );
+ return grant_privilege( sid, mask );
}