MySQL 8.0.40
Source Code Documentation
auth_socket.cc File Reference

auth_socket authentication plugin. More...

#include <mysql/plugin_auth.h>
#include <pwd.h>
#include <string.h>
#include <sys/socket.h>
#include "my_compiler.h"

Macros

#define _GNU_SOURCE   /* for struct ucred */
 

Functions

static int socket_auth (MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info)
 
static int generate_auth_string_hash (char *outbuf, unsigned int *buflen, const char *inbuf, unsigned int inbuflen)
 
static int validate_auth_string_hash (char *const inbuf, unsigned int buflen)
 
static int set_salt (const char *password, unsigned int password_len, unsigned char *salt, unsigned char *salt_len)
 
 mysql_declare_plugin (socket_auth)
 

Variables

static struct st_mysql_auth socket_auth_handler
 
 mysql_declare_plugin_end
 

Detailed Description

auth_socket authentication plugin.

Authentication is successful if the connection is done via a unix socket and the owner of the client process matches the user name that was used when connecting to mysqld.

Macro Definition Documentation

◆ _GNU_SOURCE

#define _GNU_SOURCE   /* for struct ucred */

Function Documentation

◆ generate_auth_string_hash()

static int generate_auth_string_hash ( char *  outbuf,
unsigned int *  buflen,
const char *  inbuf,
unsigned int  inbuflen 
)
static

◆ mysql_declare_plugin()

mysql_declare_plugin ( socket_auth  )

◆ set_salt()

static int set_salt ( const char *  password,
unsigned int  password_len,
unsigned char *  salt,
unsigned char *  salt_len 
)
static

◆ socket_auth()

static int socket_auth ( MYSQL_PLUGIN_VIO vio,
MYSQL_SERVER_AUTH_INFO info 
)
static

◆ validate_auth_string_hash()

static int validate_auth_string_hash ( char *const  inbuf,
unsigned int  buflen 
)
static

Variable Documentation

◆ mysql_declare_plugin_end

mysql_declare_plugin_end

◆ socket_auth_handler

struct st_mysql_auth socket_auth_handler
static
Initial value:
= {
nullptr,
nullptr}
static int validate_auth_string_hash(char *const inbuf, unsigned int buflen)
Definition: auth_socket.cc:92
static int socket_auth(MYSQL_PLUGIN_VIO *vio, MYSQL_SERVER_AUTH_INFO *info)
Definition: auth_socket.cc:44
static int set_salt(const char *password, unsigned int password_len, unsigned char *salt, unsigned char *salt_len)
Definition: auth_socket.cc:97
static int generate_auth_string_hash(char *outbuf, unsigned int *buflen, const char *inbuf, unsigned int inbuflen)
Definition: auth_socket.cc:84
#define AUTH_FLAG_PRIVILEGED_USER_FOR_PASSWORD_CHANGE
Definition: plugin_auth.h:49
#define MYSQL_AUTHENTICATION_INTERFACE_VERSION
Definition: plugin_auth.h:37