summaryrefslogtreecommitdiff
path: root/sql/sql_acl.h
diff options
context:
space:
mode:
authorpeter@mysql.com <>2002-11-30 16:31:58 +0300
committerpeter@mysql.com <>2002-11-30 16:31:58 +0300
commit54ff0efe7cb79c2f3e7acc84f74905d750e51ba0 (patch)
tree8cb72ffc1f46d5e546f302958453ce4a83d26d5e /sql/sql_acl.h
parent08f51eaedd8fb15eb629614af323d3cdc64dace1 (diff)
downloadmariadb-git-54ff0efe7cb79c2f3e7acc84f74905d750e51ba0.tar.gz
SCRUM: Secure auth
Implement mysql_change_user Get rid of double user search at authentication Some cleanups
Diffstat (limited to 'sql/sql_acl.h')
-rw-r--r--sql/sql_acl.h52
1 files changed, 51 insertions, 1 deletions
diff --git a/sql/sql_acl.h b/sql/sql_acl.h
index 66e7d0dad7c..cfab9bf22cf 100644
--- a/sql/sql_acl.h
+++ b/sql/sql_acl.h
@@ -79,6 +79,55 @@
#define fix_rights_for_column(A) (((A) & COL_ACLS) | ((A & ~COL_ACLS) << 7))
#define get_rights_for_column(A) (((A) & COL_ACLS) | ((A & ~COL_ACLS) >> 7))
+/* Classes */
+
+struct acl_host_and_ip
+{
+ char *hostname;
+ long ip,ip_mask; // Used with masked ip:s
+};
+
+
+class ACL_ACCESS {
+public:
+ ulong sort;
+ ulong access;
+};
+
+
+/* ACL_HOST is used if no host is specified */
+
+class ACL_HOST :public ACL_ACCESS
+{
+public:
+ acl_host_and_ip host;
+ char *db;
+};
+
+
+class ACL_USER :public ACL_ACCESS
+{
+public:
+ acl_host_and_ip host;
+ uint hostname_length;
+ USER_RESOURCES user_resource;
+ char *user,*password;
+ ulong salt[6]; // New password has longer length
+ uint8 pversion; // password version
+ enum SSL_type ssl_type;
+ const char *ssl_cipher, *x509_issuer, *x509_subject;
+};
+
+
+class ACL_DB :public ACL_ACCESS
+{
+public:
+ acl_host_and_ip host;
+ char *user,*db;
+};
+
+
+
/* prototypes */
my_bool acl_init(THD *thd, bool dont_read_acl_tables);
@@ -88,7 +137,8 @@ ulong acl_get(const char *host, const char *ip, const char *bin_ip,
const char *user, const char *db);
ulong acl_getroot(THD *thd, const char *host, const char *ip, const char *user,
const char *password,const char *scramble,char **priv_user,
- bool old_ver, USER_RESOURCES *max,char* prepared_scramble, int stage);
+ bool old_ver, USER_RESOURCES *max,char* prepared_scramble,
+ int stage, uint *cur_priv_version, ACL_USER **cached_user);
bool acl_check_host(const char *host, const char *ip);
bool check_change_password(THD *thd, const char *host, const char *user);
bool change_password(THD *thd, const char *host, const char *user,