summaryrefslogtreecommitdiff
path: root/source3
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
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')
-rw-r--r--source3/include/proto.h2
-rw-r--r--source3/lib/privileges.c14
-rw-r--r--source3/rpc_server/srv_lsa_nt.c2
-rw-r--r--source3/utils/net_sam.c2
4 files changed, 10 insertions, 10 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index a8e1ac3d53..5a24b158d3 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -637,7 +637,7 @@ bool get_privileges_for_sids(uint64_t *privileges, struct dom_sid *slist, int sc
NTSTATUS privilege_enumerate_accounts(struct dom_sid **sids, int *num_sids);
NTSTATUS privilege_enum_sids(const uint64_t *mask, TALLOC_CTX *mem_ctx,
struct dom_sid **sids, int *num_sids);
-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);
bool grant_privilege_by_name(struct dom_sid *sid, const char *name);
bool revoke_privilege(const struct dom_sid *sid, const uint64_t priv_mask);
bool revoke_all_privileges( struct dom_sid *sid );
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 );
}
diff --git a/source3/rpc_server/srv_lsa_nt.c b/source3/rpc_server/srv_lsa_nt.c
index 81bbd4fc8c..8074eadb69 100644
--- a/source3/rpc_server/srv_lsa_nt.c
+++ b/source3/rpc_server/srv_lsa_nt.c
@@ -2009,7 +2009,7 @@ NTSTATUS _lsa_AddPrivilegesToAccount(struct pipes_struct *p,
if ( !privilege_set_to_se_priv( &mask, set ) )
return NT_STATUS_NO_SUCH_PRIVILEGE;
- if ( !grant_privilege( &info->sid, &mask ) ) {
+ if ( !grant_privilege( &info->sid, mask ) ) {
DEBUG(3,("_lsa_AddPrivilegesToAccount: grant_privilege(%s) failed!\n",
sid_string_dbg(&info->sid) ));
DEBUG(3,("Privilege mask: 0x%llx\n", (unsigned long long)mask));
diff --git a/source3/utils/net_sam.c b/source3/utils/net_sam.c
index 113818200e..4da712d8cc 100644
--- a/source3/utils/net_sam.c
+++ b/source3/utils/net_sam.c
@@ -712,7 +712,7 @@ static int net_sam_rights_grant(struct net_context *c, int argc,
return -1;
}
- if (!grant_privilege(&sid, &mask)) {
+ if (!grant_privilege(&sid, mask)) {
d_fprintf(stderr, _("Could not grant privilege\n"));
return -1;
}