summaryrefslogtreecommitdiff
path: root/source4/libcli/security
diff options
context:
space:
mode:
Diffstat (limited to 'source4/libcli/security')
-rw-r--r--source4/libcli/security/security_token.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/source4/libcli/security/security_token.c b/source4/libcli/security/security_token.c
index a23aa92bf3..8e52759e70 100644
--- a/source4/libcli/security/security_token.c
+++ b/source4/libcli/security/security_token.c
@@ -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;
+}
+