{
  MYSQL_AUTHENTICATION_INTERFACE_VERSION,
  "dialog",
  pam_auth
};

static char use_cleartext_plugin;
static MYSQL_SYSVAR_BOOL(use_cleartext_plugin, use_cleartext_plugin,
       PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
       "Use mysql_cleartext_plugin on the client side instead of the dialog "
       "plugin. This may be needed for compatibility reasons, but it only "
       "supports simple PAM policies that don't require anything besides "
       "a password", NULL, NULL, 0);

static struct st_mysql_sys_var* vars[] = {
  MYSQL_SYSVAR(use_cleartext_plugin),
  NULL
};


static int init(void *p __attribute__((unused)))
{
  if (use_cleartext_plugin)
    info.client_auth_plugin= "mysql_clear_password";
  return 0;
}

maria_declare_plugin(pam)
{
  MYSQL_AUTHENTICATION_PLUGIN,
  &info,
示例#2
0
static MYSQL_SYSVAR_UINT(rotations, rotations,
       PLUGIN_VAR_READONLY, "Number of rotations before log is removed.",
       NULL, NULL, 9, 1, 999, 1);

static MYSQL_SYSVAR_BOOL(rotate, rotate,
       PLUGIN_VAR_OPCMDARG, "Force log rotation", NULL, rotate_log,
       0);

static MYSQL_SYSVAR_STR(filename, filename,
       PLUGIN_VAR_READONLY | PLUGIN_VAR_RQCMDARG,
       "The file to log sql errors to", NULL, NULL,
       "sql_errors.log");

static struct st_mysql_sys_var* vars[] = {
    MYSQL_SYSVAR(rate),
    MYSQL_SYSVAR(size_limit),
    MYSQL_SYSVAR(rotations),
    MYSQL_SYSVAR(rotate),
    MYSQL_SYSVAR(filename),
    NULL
};


static void log_sql_errors(MYSQL_THD thd __attribute__((unused)),
                           unsigned int event_class __attribute__((unused)),
                           const void *ev)
{
  const struct mysql_event_general *event =
         (const struct mysql_event_general*)ev;
  if (rate &&
		  PLUGIN_VAR_OPCMDARG,
		  "Use TLS for LDAP connection (disable by default).",
		  NULL,                         // check
		  NULL,                         // update
		  0);

static MYSQL_SYSVAR_BOOL(debug, ldap_authorization_debug,
		  PLUGIN_VAR_RQCMDARG,
		  "Debug output from LDAP plugin.",
		  NULL, 
		  NULL,
		  0);

static struct st_mysql_sys_var* 
ldap_authorization_variables[]= {
    MYSQL_SYSVAR(auth_host),
    MYSQL_SYSVAR(port),
    MYSQL_SYSVAR(validgroups),
    MYSQL_SYSVAR(binddn),
    MYSQL_SYSVAR(basedn),
    MYSQL_SYSVAR(bindpasswd),
    MYSQL_SYSVAR(defaultfilter),
    MYSQL_SYSVAR(timeout),
    MYSQL_SYSVAR(protocol_version),
    MYSQL_SYSVAR(tls),
    MYSQL_SYSVAR(debug),
    NULL
};

static struct st_mysql_auth ldap_handler =
{