r10810: This adds the hooks required to communicate the current user from the
[metze/samba/wip.git] / source4 / libcli / security / security_token.c
index a23aa92bf35614da1fc0ee167934060b25deece0..8e52759e70c1725346c7261b3a33b634646674e2 100644 (file)
@@ -165,3 +165,28 @@ void security_token_debug(int dbg_lev, const struct security_token *token)
 
        talloc_free(mem_ctx);
 }
+
+/* These really should be cheaper... */
+
+BOOL is_system_token(struct security_token *token) 
+{
+       TALLOC_CTX *mem_ctx = talloc_new(token);
+       if (dom_sid_equal(token->user_sid, dom_sid_parse_talloc(mem_ctx, SID_NT_SYSTEM))) {
+               talloc_free(mem_ctx);
+               return True;
+       }
+       talloc_free(mem_ctx);
+       return False;
+}
+
+BOOL is_anonymous_token(struct security_token *token) 
+{
+       TALLOC_CTX *mem_ctx = talloc_new(token);
+       if (dom_sid_equal(token->user_sid, dom_sid_parse_talloc(mem_ctx, SID_NT_ANONYMOUS))) {
+               talloc_free(mem_ctx);
+               return True;
+       }
+       talloc_free(mem_ctx);
+       return False;
+}
+