Move secace.c to top-level.
[jra/samba/.git] / source3 / lib / util_nttoken.c
index 774ef498b7f670ef94f17e66928ef3f6b47f8722..76e7402422a022c31c0fde2e3d8212b443082ea3 100644 (file)
@@ -115,3 +115,19 @@ NTSTATUS merge_nt_token(TALLOC_CTX *mem_ctx,
 
        return NT_STATUS_OK;
 }
+
+/*******************************************************************
+ Check if this ACE has a SID in common with the token.
+********************************************************************/
+
+bool token_sid_in_ace(const NT_USER_TOKEN *token, const struct security_ace *ace)
+{
+       size_t i;
+
+       for (i = 0; i < token->num_sids; i++) {
+               if (sid_equal(&ace->trustee, &token->user_sids[i]))
+                       return true;
+       }
+
+       return false;
+}