summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2010-08-30 12:44:08 +1000
committerAndrew Bartlett <abartlet@samba.org>2010-09-11 18:46:08 +1000
commita02ae674dd6ffaa8ebc4017af6a644162c59a00d (patch)
treee9d25b391a3f41e3a55cbad2b541137908ca3fd6
parentcbd72ab93bc35aa71a55b190cd999dda4106be07 (diff)
downloadsamba-a02ae674dd6ffaa8ebc4017af6a644162c59a00d.tar.gz
samba-a02ae674dd6ffaa8ebc4017af6a644162c59a00d.tar.bz2
samba-a02ae674dd6ffaa8ebc4017af6a644162c59a00d.zip
s3-privs Remove a pointer indirection from revoke_privilege()
Signed-off-by: Andrew Tridgell <tridge@samba.org>
-rw-r--r--source3/include/proto.h2
-rw-r--r--source3/lib/privileges.c8
-rw-r--r--source3/rpc_server/srv_lsa_nt.c2
-rw-r--r--source3/utils/net_sam.c2
4 files changed, 7 insertions, 7 deletions
diff --git a/source3/include/proto.h b/source3/include/proto.h
index c1910fb26b..a8e1ac3d53 100644
--- a/source3/include/proto.h
+++ b/source3/include/proto.h
@@ -639,7 +639,7 @@ 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_by_name(struct dom_sid *sid, const char *name);
-bool revoke_privilege(const struct dom_sid *sid, const uint64_t *priv_mask);
+bool revoke_privilege(const struct dom_sid *sid, const uint64_t priv_mask);
bool revoke_all_privileges( struct dom_sid *sid );
bool revoke_privilege_by_name(struct dom_sid *sid, const char *name);
NTSTATUS privilege_create_account(const struct dom_sid *sid );
diff --git a/source3/lib/privileges.c b/source3/lib/privileges.c
index 61425e8272..57c4d81fa4 100644
--- a/source3/lib/privileges.c
+++ b/source3/lib/privileges.c
@@ -313,7 +313,7 @@ bool grant_privilege_by_name(struct dom_sid *sid, const char *name)
Remove privilege from sid
****************************************************************************/
-bool revoke_privilege(const struct dom_sid *sid, const uint64_t *priv_mask)
+bool revoke_privilege(const struct dom_sid *sid, const uint64_t priv_mask)
{
uint64_t mask;
@@ -326,7 +326,7 @@ bool revoke_privilege(const struct dom_sid *sid, const uint64_t *priv_mask)
DEBUGADD( 10, ("original privilege mask: 0x%llx\n", (unsigned long long)mask));
- se_priv_remove( &mask, priv_mask );
+ mask &= ~priv_mask;
DEBUGADD( 10, ("new privilege mask: 0x%llx\n", (unsigned long long)mask));
@@ -339,7 +339,7 @@ bool revoke_privilege(const struct dom_sid *sid, const uint64_t *priv_mask)
bool revoke_all_privileges( struct dom_sid *sid )
{
- return revoke_privilege( sid, &se_priv_all );
+ return revoke_privilege( sid, SE_ALL_PRIVS);
}
/*********************************************************************
@@ -356,7 +356,7 @@ bool revoke_privilege_by_name(struct dom_sid *sid, const char *name)
return False;
}
- return revoke_privilege(sid, &mask);
+ return revoke_privilege(sid, mask);
}
diff --git a/source3/rpc_server/srv_lsa_nt.c b/source3/rpc_server/srv_lsa_nt.c
index c787502a35..e54bd9613f 100644
--- a/source3/rpc_server/srv_lsa_nt.c
+++ b/source3/rpc_server/srv_lsa_nt.c
@@ -2048,7 +2048,7 @@ NTSTATUS _lsa_RemovePrivilegesFromAccount(struct pipes_struct *p,
if ( !privilege_set_to_se_priv( &mask, set ) )
return NT_STATUS_NO_SUCH_PRIVILEGE;
- if ( !revoke_privilege( &info->sid, &mask ) ) {
+ if ( !revoke_privilege( &info->sid, mask ) ) {
DEBUG(3,("_lsa_RemovePrivilegesFromAccount: revoke_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 6a9e261ea0..113818200e 100644
--- a/source3/utils/net_sam.c
+++ b/source3/utils/net_sam.c
@@ -752,7 +752,7 @@ static int net_sam_rights_revoke(struct net_context *c, int argc,
return -1;
}
- if (!revoke_privilege(&sid, &mask)) {
+ if (!revoke_privilege(&sid, mask)) {
d_fprintf(stderr, _("Could not revoke privilege\n"));
return -1;
}