1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-25 17:57:42 +03:00

lib: Simplify grant_privilege_bitmap()

ZERO_STRUCT on a uint64_t doesn't really make sense...

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
This commit is contained in:
Volker Lendecke 2023-12-18 21:40:46 +01:00 committed by Jeremy Allison
parent 8e741b596e
commit 995d1958e9

View File

@ -339,16 +339,12 @@ NTSTATUS privilege_enum_sids(enum sec_privilege privilege, TALLOC_CTX *mem_ctx,
static bool grant_privilege_bitmap(const struct dom_sid *sid, const uint64_t priv_mask)
{
uint64_t old_mask, new_mask;
uint64_t old_mask = 0, new_mask = 0;
struct dom_sid_buf buf;
ZERO_STRUCT( old_mask );
ZERO_STRUCT( new_mask );
if ( get_privileges( sid, &old_mask ) )
if ( get_privileges( sid, &old_mask ) ) {
new_mask = old_mask;
else
new_mask = 0;
}
new_mask |= priv_mask;