MySQL 8.0.40
Source Code Documentation
|
#include <string.h>
#include "lex_string.h"
#include "my_inttypes.h"
#include "mysql/components/services/bits/psi_bits.h"
#include "mysql/mysql_lex_string.h"
#include "mysql/service_security_context.h"
#include "sql/auth/auth_acls.h"
#include "sql/auth/auth_common.h"
#include "sql/auth/sql_security_ctx.h"
#include "sql/current_thd.h"
#include "sql/protocol_classic.h"
#include "sql/sql_class.h"
#include "sql/sql_thd_internal_api.h"
Macros | |
#define | SQL_SECURITY_CTX_SERVICE_INCLUDED |
#define | MY_SVC_TRUE 1 |
#define | MY_SVC_FALSE 0 |
Functions | |
my_svc_bool | thd_get_security_context (MYSQL_THD _thd, MYSQL_SECURITY_CONTEXT *out_ctx) |
Gets the security context for the thread. More... | |
my_svc_bool | thd_set_security_context (MYSQL_THD _thd, MYSQL_SECURITY_CONTEXT in_ctx) |
Sets a new security context for the thread. More... | |
my_svc_bool | security_context_create (MYSQL_SECURITY_CONTEXT *out_ctx) |
Creates a new security context and initializes it with the defaults (no access, no user etc). More... | |
my_svc_bool | security_context_destroy (MYSQL_SECURITY_CONTEXT ctx) |
Deallocates a security context. More... | |
my_svc_bool | security_context_copy (MYSQL_SECURITY_CONTEXT in_ctx, MYSQL_SECURITY_CONTEXT *out_ctx) |
Duplicates a security context. More... | |
my_svc_bool | security_context_lookup (MYSQL_SECURITY_CONTEXT ctx, const char *user, const char *host, const char *ip, const char *db) |
Looks up in the defined user accounts an account based on the user@host[ip] combo supplied and checks if the user has access to the database requested. More... | |
my_svc_bool | security_context_get_option (MYSQL_SECURITY_CONTEXT ctx, const char *name, void *inout_pvalue) |
Reads a named security context attribute and returns its value. More... | |
my_svc_bool | security_context_set_option (MYSQL_SECURITY_CONTEXT ctx, const char *name, void *pvalue) |
Sets a value for a named security context attribute Currently defined names are: More... | |
#define MY_SVC_FALSE 0 |
#define MY_SVC_TRUE 1 |
#define SQL_SECURITY_CTX_SERVICE_INCLUDED |
my_svc_bool security_context_copy | ( | MYSQL_SECURITY_CONTEXT | in_ctx, |
MYSQL_SECURITY_CONTEXT * | out_ctx | ||
) |
Duplicates a security context.
[in] | in_ctx | The handle of the security context to copy |
[out] | out_ctx | placeholder for the handle of the copied security context |
true | failure |
false | success |
my_svc_bool security_context_create | ( | MYSQL_SECURITY_CONTEXT * | out_ctx | ) |
Creates a new security context and initializes it with the defaults (no access, no user etc).
[out] | out_ctx | placeholder for the newly created security context handle |
true | failure |
false | success |
my_svc_bool security_context_destroy | ( | MYSQL_SECURITY_CONTEXT | ctx | ) |
Deallocates a security context.
[in] | ctx | The handle of the security context to destroy |
true | failure |
false | success |
my_svc_bool security_context_get_option | ( | MYSQL_SECURITY_CONTEXT | ctx, |
const char * | name, | ||
void * | inout_pvalue | ||
) |
Reads a named security context attribute and returns its value.
Currently defined names are:
[in] | ctx | The handle of the security context to read from |
[in] | name | The option name to read |
[out] | inout_pvalue | The value of the option. Type depends on the name. |
true | failure |
false | success |
my_svc_bool security_context_lookup | ( | MYSQL_SECURITY_CONTEXT | ctx, |
const char * | user, | ||
const char * | host, | ||
const char * | ip, | ||
const char * | db | ||
) |
Looks up in the defined user accounts an account based on the user@host[ip] combo supplied and checks if the user has access to the database requested.
The lookup is done in exactly the same way as at login time. The new security context need to checkout additional privileges using the checkout_acl method.
[in] | ctx | The handle of the security context to update |
[in] | user | The user name to look up |
[in] | host | The host name to look up |
[in] | ip | The ip of the incoming connection |
[in] | db | The database to check access to |
true | failure |
false | success |
my_svc_bool security_context_set_option | ( | MYSQL_SECURITY_CONTEXT | ctx, |
const char * | name, | ||
void * | pvalue | ||
) |
Sets a value for a named security context attribute Currently defined names are:
[in] | ctx | The handle of the security context to set into |
[in] | name | The option name to set |
[in] | pvalue | The value of the option. Type depends on the name. |
true | failure |
false | success |
my_svc_bool thd_get_security_context | ( | MYSQL_THD | _thd, |
MYSQL_SECURITY_CONTEXT * | out_ctx | ||
) |
Gets the security context for the thread.
[in] | _thd | The thread to get the context from |
[out] | out_ctx | placeholder for the security context handle |
true | failure |
false | success |
my_svc_bool thd_set_security_context | ( | MYSQL_THD | _thd, |
MYSQL_SECURITY_CONTEXT | in_ctx | ||
) |
Sets a new security context for the thread.
[in] | _thd | The thread to set the context to |
[in] | in_ctx | The handle of the new security context |
true | failure |
false | success |