mariadb/sql/sql_acl.h
unknown d13f2dfdeb SSL compiles and works as far as can see. Continue testing..
Docs/manual.ja.texi:
  e-mail address fixed
include/mysqld_error.h:
  Added 3 new errormessages related to SSL
mysql-test/install_test_db.sh:
  SSL fix
scripts/mysql_install_db.sh:
  mysql.user table changes to conform SSL ACL
sql/lex.h:
  Fixed GRANT+SSL clause
sql/share/czech/errmsg.txt:
  Added 3 new errormessages related to SSL
sql/share/danish/errmsg.txt:
  Added 3 new errormessages related to SSL
sql/share/dutch/errmsg.txt:
  Added 3 new errormessages related to SSL
sql/share/english/errmsg.txt:
  Added 3 new errormessages related to SSL
sql/share/estonian/errmsg.txt:
  Added 3 new errormessages related to SSL
sql/share/french/errmsg.txt:
  Added 3 new errormessages related to SSL
sql/share/german/errmsg.txt:
  Added 3 new errormessages related to SSL
sql/share/greek/errmsg.txt:
  Added 3 new errormessages related to SSL
sql/share/hungarian/errmsg.txt:
  Added 3 new errormessages related to SSL
sql/share/italian/errmsg.txt:
  Added 3 new errormessages related to SSL
sql/share/japanese/errmsg.txt:
  Added 3 new errormessages related to SSL
sql/share/korean/errmsg.txt:
  Added 3 new errormessages related to SSL
sql/share/norwegian-ny/errmsg.txt:
  Added 3 new errormessages related to SSL
sql/share/norwegian/errmsg.txt:
  Added 3 new errormessages related to SSL
sql/share/polish/errmsg.txt:
  Added 3 new errormessages related to SSL
sql/share/portuguese/errmsg.txt:
  Added 3 new errormessages related to SSL
sql/share/romanian/errmsg.txt:
  Added 3 new errormessages related to SSL
sql/share/russian/errmsg.txt:
  Added 3 new errormessages related to SSL
sql/share/slovak/errmsg.txt:
  Added 3 new errormessages related to SSL
sql/share/spanish/errmsg.txt:
  Added 3 new errormessages related to SSL
sql/share/swedish/errmsg.txt:
  Added 3 new errormessages related to SSL
sql/share/ukrainian/errmsg.txt:
  Added 3 new errormessages related to SSL
Docs/manual.texi:
  SSL fixes
BUILD/compile-pentium-max:
  SSL was missing here
acinclude.m4:
  typo fix
  alignment fix
client/mysql.cc:
  SSL fixes
client/mysqladmin.c:
  SSL fixes
client/mysqlcheck.c:
  SSL fixes
client/mysqldump.c:
  SSL fixes
client/mysqlimport.c:
  SSL fixes
client/mysqlshow.c:
  SSL fixes
include/mysql.h:
  SSL fixes
include/sslopt-case.h:
  SSL fixes
include/sslopt-longopts.h:
  SSL fixes
include/sslopt-usage.h:
  SSL fixes
include/sslopt-vars.h:
  SSL fixes
include/violite.h:
  SSL fixes
  cleanups
libmysql/libmysql.c:
  SSL fixes
libmysqld/lib_sql.cc:
  SSL fixes
sql/mini_client.cc:
  SSL fixes
sql/mysqld.cc:
  SSL fixes
  cleanup
  new variables to SHOW STATUS
sql/sql_acl.cc:
  SSL fixes
sql/sql_acl.h:
  SSL fixes
sql/sql_lex.h:
  SSL fixes
sql/sql_parse.cc:
  SSL fixes
sql/sql_show.cc:
  New functions added
sql/structs.h:
  New functions added
vio/test-ssl.c:
  SSL fixes
vio/test-sslclient.c:
  SSL fixes
vio/test-sslserver.c:
  SSL fixes
vio/viosocket.c:
  SSL fixes
vio/viossl.c:
  SSL fixes
  cleanup
vio/viosslfactories.c:
  SSL fixes
sql/sql_yacc.yy:
  SSL fixes
2001-09-30 10:46:20 +08:00

84 lines
3.5 KiB
C

/* Copyright (C) 2000 MySQL AB & MySQL Finland AB & TCX DataKonsult AB
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
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */
#define SELECT_ACL 1
#define INSERT_ACL 2
#define UPDATE_ACL 4
#define DELETE_ACL 8
#define CREATE_ACL 16
#define DROP_ACL 32
#define RELOAD_ACL 64
#define SHUTDOWN_ACL 128
#define PROCESS_ACL 256
#define FILE_ACL 512
#define GRANT_ACL 1024
#define REFERENCES_ACL 2048
#define INDEX_ACL 4096
#define ALTER_ACL 8192
#define EXTRA_ACL 16384
#define DB_ACLS (UPDATE_ACL | SELECT_ACL | INSERT_ACL | \
DELETE_ACL | CREATE_ACL | DROP_ACL | GRANT_ACL | \
REFERENCES_ACL | INDEX_ACL | ALTER_ACL)
#define TABLE_ACLS (SELECT_ACL | INSERT_ACL | UPDATE_ACL | \
DELETE_ACL | CREATE_ACL | DROP_ACL | GRANT_ACL | \
REFERENCES_ACL | INDEX_ACL | ALTER_ACL)
#define COL_ACLS (SELECT_ACL | INSERT_ACL | UPDATE_ACL | REFERENCES_ACL)
#define GLOBAL_ACLS (SELECT_ACL | INSERT_ACL | UPDATE_ACL | DELETE_ACL |\
CREATE_ACL | DROP_ACL | RELOAD_ACL | SHUTDOWN_ACL |\
PROCESS_ACL | FILE_ACL | GRANT_ACL | REFERENCES_ACL |\
INDEX_ACL | ALTER_ACL)
#define NO_ACCESS 32768
/* defines to change the above bits to how things are stored in tables */
#define fix_rights_for_db(A) (((A) & 63) | (((A) & ~63) << 4))
#define get_rights_for_db(A) (((A) & 63) | (((A) & ~63) >> 4))
#define fix_rights_for_table(A) (((A) & 63) | (((A) & ~63) << 4))
#define get_rights_for_table(A) (((A) & 63) | (((A) & ~63) >> 4))
#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))
/* prototypes */
int acl_init(bool dont_read_acl_tables);
void acl_reload(void);
void acl_free(bool end=0);
uint acl_get(const char *host, const char *ip, const char *bin_ip,
const char *user, const char *db);
uint 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);
bool acl_check_host(const char *host, const char *ip);
bool change_password(THD *thd, const char *host, const char *user,
char *password);
int mysql_grant(THD *thd, const char *db, List <LEX_USER> &user_list,
uint rights, bool revoke);
int mysql_table_grant(THD *thd, TABLE_LIST *table, List <LEX_USER> &user_list,
List <LEX_COLUMN> &column_list, uint rights,
bool revoke);
int grant_init(void);
void grant_free(void);
void grant_reload(void);
bool check_grant(THD *thd, uint want_access, TABLE_LIST *tables,
uint show_command=0, bool dont_print_error=0);
bool check_grant_column (THD *thd,TABLE *table, const char *name,uint length,
uint show_command=0);
bool check_grant_all_columns(THD *thd, uint want_access, TABLE *table);
bool check_grant_db(THD *thd,const char *db);
uint get_table_grant(THD *thd, TABLE_LIST *table);
uint get_column_grant(THD *thd, TABLE_LIST *table, Field *field);
int mysql_show_grants(THD *thd, LEX_USER *user);