mirror of
https://github.com/samba-team/samba.git
synced 2025-03-19 18:50:24 +03:00
libcli/security: implement SECURITY_GUEST
SECURITY_GUEST is not exactly the same as SECURITY_ANONYMOUS. BUG: https://bugzilla.samba.org/show_bug.cgi?id=11847 Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andreas Schneider <asn@samba.org> Reviewed-by: Günther Deschner <gd@samba.org> (cherry picked from commit 837e6176329330893d5a1e4ce4ac67dbac758e56)
This commit is contained in:
parent
71b49a4d86
commit
4b4c1b56c9
@ -130,6 +130,11 @@ bool security_token_has_sid_string(const struct security_token *token, const cha
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool security_token_has_builtin_guests(const struct security_token *token)
|
||||
{
|
||||
return security_token_has_sid(token, &global_sid_Builtin_Guests);
|
||||
}
|
||||
|
||||
bool security_token_has_builtin_administrators(const struct security_token *token)
|
||||
{
|
||||
return security_token_has_sid(token, &global_sid_Builtin_Administrators);
|
||||
|
@ -51,6 +51,8 @@ bool security_token_has_sid(const struct security_token *token, const struct dom
|
||||
|
||||
bool security_token_has_sid_string(const struct security_token *token, const char *sid_string);
|
||||
|
||||
bool security_token_has_builtin_guests(const struct security_token *token);
|
||||
|
||||
bool security_token_has_builtin_administrators(const struct security_token *token);
|
||||
|
||||
bool security_token_has_nt_authenticated_users(const struct security_token *token);
|
||||
|
@ -38,6 +38,10 @@ enum security_user_level security_session_user_level(struct auth_session_info *s
|
||||
return SECURITY_ANONYMOUS;
|
||||
}
|
||||
|
||||
if (security_token_has_builtin_guests(session_info->security_token)) {
|
||||
return SECURITY_GUEST;
|
||||
}
|
||||
|
||||
if (security_token_has_builtin_administrators(session_info->security_token)) {
|
||||
return SECURITY_ADMINISTRATOR;
|
||||
}
|
||||
|
@ -24,6 +24,7 @@
|
||||
|
||||
enum security_user_level {
|
||||
SECURITY_ANONYMOUS = 0,
|
||||
SECURITY_GUEST = 1,
|
||||
SECURITY_USER = 10,
|
||||
SECURITY_RO_DOMAIN_CONTROLLER = 20,
|
||||
SECURITY_DOMAIN_CONTROLLER = 30,
|
||||
|
Loading…
x
Reference in New Issue
Block a user