summaryrefslogtreecommitdiff
path: root/include/mysql/plugin_auth.h
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2011-07-02 22:08:51 +0200
committerSergei Golubchik <sergii@pisem.net>2011-07-02 22:08:51 +0200
commit9809f05199aeb0b67991fac41bd86f38730768dc (patch)
treefa2792ff86d0da014b535d743759810612338042 /include/mysql/plugin_auth.h
parent0accbd0364e0333e0b119aa9ce93e34ded9df6cb (diff)
parent5a0e7394a5ae0c7b6a1ea35b7ea3a8985325987a (diff)
downloadmariadb-git-9809f05199aeb0b67991fac41bd86f38730768dc.tar.gz
5.5-merge
Diffstat (limited to 'include/mysql/plugin_auth.h')
-rw-r--r--include/mysql/plugin_auth.h47
1 files changed, 45 insertions, 2 deletions
diff --git a/include/mysql/plugin_auth.h b/include/mysql/plugin_auth.h
index 2b84a6c73af..fcfd1bc6f0b 100644
--- a/include/mysql/plugin_auth.h
+++ b/include/mysql/plugin_auth.h
@@ -1,5 +1,6 @@
#ifndef MYSQL_PLUGIN_AUTH_INCLUDED
/* Copyright (C) 2010 Sergei Golubchik and Monty Program Ab
+ Copyright (C) 2010 Sun Microsystems, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -30,6 +31,13 @@
#include <mysql/plugin_auth_common.h>
+/* defines for MYSQL_SERVER_AUTH_INFO.password_used */
+
+#define PASSWORD_USED_NO 0
+#define PASSWORD_USED_YES 1
+#define PASSWORD_USED_NO_MENTION 2
+
+
/**
Provides server plugin access to authentication information
*/
@@ -39,7 +47,13 @@ typedef struct st_mysql_server_auth_info
User name as sent by the client and shown in USER().
NULL if the client packet with the user name was not received yet.
*/
- const char *user_name;
+ char *user_name;
+
+ /**
+ Length of user_name
+ */
+ unsigned int user_name_length;
+
/**
A corresponding column value from the mysql.user table for the
matching account name
@@ -47,17 +61,46 @@ typedef struct st_mysql_server_auth_info
const char *auth_string;
/**
+ Length of auth_string
+ */
+ unsigned long auth_string_length;
+
+ /**
Matching account name as found in the mysql.user table.
A plugin can override it with another name that will be
used by MySQL for authorization, and shown in CURRENT_USER()
*/
char authenticated_as[MYSQL_USERNAME_LENGTH+1];
+
+
+ /**
+ The unique user name that was used by the plugin to authenticate.
+ Not used by the server.
+ Available through the @@EXTERNAL_USER variable.
+ */
+ char external_user[512];
+
/**
This only affects the "Authentication failed. Password used: %s"
- error message. If set, %s will be YES, otherwise - NO.
+ error message. has the following values :
+ 0 : %s will be NO.
+ 1 : %s will be YES.
+ 2 : there will be no %s.
Set it as appropriate or ignore at will.
*/
int password_used;
+
+ /**
+ Set to the name of the connected client host, if it can be resolved,
+ or to its IP address otherwise.
+ */
+ const char *host_or_ip;
+
+ /**
+ Length of host_or_ip
+ */
+ unsigned int host_or_ip_length;
+
} MYSQL_SERVER_AUTH_INFO;
/**