40 changed files with 1108 additions and 140 deletions
-
8extra/yassl/taocrypt/include/misc.hpp
-
6mysql-test/r/derived_view.result
-
48mysql-test/r/join_cache.result
-
5mysql-test/r/mysqld--help.result
-
48mysql-test/r/select.result
-
56mysql-test/r/select_jcl6.result
-
48mysql-test/r/select_pkeycache.result
-
17mysql-test/r/subselect.result
-
19mysql-test/r/subselect2.result
-
17mysql-test/r/subselect_no_mat.result
-
17mysql-test/r/subselect_no_opts.result
-
17mysql-test/r/subselect_no_scache.result
-
17mysql-test/r/subselect_no_semijoin.result
-
92mysql-test/r/view.result
-
2mysql-test/suite/plugins/r/pam.result
-
2mysql-test/suite/plugins/t/pam.test
-
49mysql-test/suite/sys_vars/r/ignore_db_dirs_basic.result
-
11mysql-test/suite/sys_vars/t/ignore_db_dirs_basic-master.opt
-
38mysql-test/suite/sys_vars/t/ignore_db_dirs_basic.test
-
49mysql-test/t/join_cache.test
-
2mysql-test/t/select.test
-
16mysql-test/t/subselect.test
-
19mysql-test/t/subselect2.test
-
86mysql-test/t/view.test
-
93plugin/auth_pam/mapper/pam_user_map.c
-
20plugin/auth_pam/testing/pam_mariadb_mtr.c
-
50scripts/mysql_install_db.sh
-
7sql/create_options.cc
-
4sql/item.cc
-
6sql/item_subselect.cc
-
28sql/mysqld.cc
-
10sql/mysqld.h
-
29sql/sql_join_cache.cc
-
2sql/sql_priv.h
-
278sql/sql_show.cc
-
8sql/sql_show.h
-
10sql/sys_vars.cc
-
12sql/table.cc
-
1sql/table.h
-
1storage/maria/ma_ft_nlq_search.c
@ -0,0 +1,49 @@ |
|||
select @@ignore_db_dirs; |
|||
@@ignore_db_dirs |
|||
e,lost+found,.mysqlgui,ignored_db |
|||
# Check that SHOW DATABASES ignores all directories from |
|||
# @@ignore_db_dirs and all directories with names starting |
|||
# with '.' |
|||
SHOW DATABASES; |
|||
Database |
|||
information_schema |
|||
#mysql50#.otherdir |
|||
mtr |
|||
mysql |
|||
performance_schema |
|||
test |
|||
USE ignored_db; |
|||
ERROR 42000: Incorrect database name 'ignored_db' |
|||
SELECT * FROM ignored_db.t1; |
|||
ERROR 42000: Incorrect database name 'ignored_db' |
|||
CALL ignored_db.p1(); |
|||
ERROR 42000: Incorrect database name 'ignored_db' |
|||
SELECT COUNT(*) FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME='ignored_db'; |
|||
COUNT(*) |
|||
1 |
|||
CREATE DATABASE ignored_db; |
|||
ERROR 42000: Incorrect database name 'ignored_db' |
|||
CREATE DATABASE `lost+found`; |
|||
USE `lost+found`; |
|||
CREATE TABLE t1(id INT); |
|||
INSERT INTO t1 VALUES (1), (2); |
|||
SELECT * FROM `lost+found`.t1; |
|||
id |
|||
1 |
|||
2 |
|||
SHOW DATABASES; |
|||
Database |
|||
information_schema |
|||
#mysql50#.otherdir |
|||
lost+found |
|||
mtr |
|||
mysql |
|||
performance_schema |
|||
test |
|||
DROP DATABASE `lost+found`; |
|||
SET @@global.ignore_db_dirs = 'aha'; |
|||
ERROR HY000: Variable 'ignore_db_dirs' is a read only variable |
|||
SET @@local.ignore_db_dirs = 'aha'; |
|||
ERROR HY000: Variable 'ignore_db_dirs' is a read only variable |
|||
SET @@ignore_db_dirs = 'aha'; |
|||
ERROR HY000: Variable 'ignore_db_dirs' is a read only variable |
@ -0,0 +1,11 @@ |
|||
--ignore-db-dir=a |
|||
--ignore-db-dir=b |
|||
--ignore-db-dir=c |
|||
--ignore-db-dir= |
|||
--ignore-db-dir=d |
|||
--ignore-db-dir x |
|||
--ignore-db-dir= |
|||
--ignore-db-dir=e |
|||
--ignore-db-dir=lost+found |
|||
--ignore-db-dir=.mysqlgui |
|||
--ignore-db-dir=ignored_db |
@ -0,0 +1,38 @@ |
|||
select @@ignore_db_dirs; |
|||
let $MYSQLD_DATADIR= `select @@datadir`; |
|||
|
|||
mkdir $MYSQLD_DATADIR/.mysqlgui; |
|||
mkdir $MYSQLD_DATADIR/.otherdir; |
|||
mkdir $MYSQLD_DATADIR/lost+found; |
|||
mkdir $MYSQLD_DATADIR/ignored_db; |
|||
--echo # Check that SHOW DATABASES ignores all directories from |
|||
--echo # @@ignore_db_dirs and all directories with names starting |
|||
--echo # with '.' |
|||
SHOW DATABASES; |
|||
--error ER_WRONG_DB_NAME |
|||
USE ignored_db; |
|||
--error ER_WRONG_DB_NAME |
|||
SELECT * FROM ignored_db.t1; |
|||
--error ER_WRONG_DB_NAME |
|||
CALL ignored_db.p1(); |
|||
SELECT COUNT(*) FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME='ignored_db'; |
|||
--error ER_WRONG_DB_NAME |
|||
CREATE DATABASE ignored_db; |
|||
CREATE DATABASE `lost+found`; |
|||
USE `lost+found`; |
|||
CREATE TABLE t1(id INT); |
|||
INSERT INTO t1 VALUES (1), (2); |
|||
SELECT * FROM `lost+found`.t1; |
|||
SHOW DATABASES; |
|||
DROP DATABASE `lost+found`; |
|||
rmdir $MYSQLD_DATADIR/.mysqlgui; |
|||
rmdir $MYSQLD_DATADIR/.otherdir; |
|||
rmdir $MYSQLD_DATADIR/lost+found; |
|||
rmdir $MYSQLD_DATADIR/ignored_db; |
|||
|
|||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR |
|||
SET @@global.ignore_db_dirs = 'aha'; |
|||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR |
|||
SET @@local.ignore_db_dirs = 'aha'; |
|||
--error ER_INCORRECT_GLOBAL_LOCAL_VAR |
|||
SET @@ignore_db_dirs = 'aha'; |
@ -0,0 +1,93 @@ |
|||
/* |
|||
Pam module to change user names arbitrarily in the pam stack. |
|||
|
|||
Compile as |
|||
|
|||
gcc pam_user_map.c -shared -lpam -fPIC -o pam_user_map.so |
|||
|
|||
Install as appropriate (for example, in /lib/security/). |
|||
Add to your /etc/pam.d/mysql (preferrably, at the end) this line: |
|||
========================================================= |
|||
auth required pam_user_map.so |
|||
========================================================= |
|||
|
|||
And create /etc/security/user_map.conf with the desired mapping |
|||
in the format: orig_user_name: mapped_user_name |
|||
========================================================= |
|||
#comments and emty lines are ignored |
|||
john: jack |
|||
bob: admin |
|||
top: accounting |
|||
========================================================= |
|||
|
|||
*/ |
|||
|
|||
#include <stdio.h> |
|||
#include <syslog.h> |
|||
#include <security/pam_modules.h> |
|||
|
|||
#define FILENAME "/etc/security/user_map.conf" |
|||
#define skip(what) while (*s && (what)) s++ |
|||
|
|||
int pam_sm_authenticate(pam_handle_t *pamh, int flags, |
|||
int argc, const char *argv[]) |
|||
{ |
|||
int pam_err, line= 0; |
|||
const char *username; |
|||
char buf[256]; |
|||
FILE *f; |
|||
|
|||
f= fopen(FILENAME, "r"); |
|||
if (f == NULL) |
|||
{ |
|||
pam_syslog(pamh, LOG_ERR, "Cannot open '%s'\n", FILENAME); |
|||
return PAM_SYSTEM_ERR; |
|||
} |
|||
|
|||
pam_err = pam_get_item(pamh, PAM_USER, (const void**)&username); |
|||
if (pam_err != PAM_SUCCESS) |
|||
goto ret; |
|||
|
|||
while (fgets(buf, sizeof(buf), f) != NULL) |
|||
{ |
|||
char *s= buf, *from, *to, *end_from, *end_to; |
|||
line++; |
|||
|
|||
skip(isspace(*s)); |
|||
if (*s == '#' || *s == 0) continue; |
|||
from= s; |
|||
skip(isalnum(*s) || (*s == '_')); |
|||
end_from= s; |
|||
skip(isspace(*s)); |
|||
if (end_from == from || *s++ != ':') goto syntax_error; |
|||
skip(isspace(*s)); |
|||
to= s; |
|||
skip(isalnum(*s) || (*s == '_')); |
|||
end_to= s; |
|||
if (end_to == to) goto syntax_error; |
|||
|
|||
*end_from= *end_to= 0; |
|||
if (strcmp(username, from) == 0) |
|||
{ |
|||
pam_err= pam_set_item(pamh, PAM_USER, to); |
|||
goto ret; |
|||
} |
|||
} |
|||
pam_err= PAM_SUCCESS; |
|||
goto ret; |
|||
|
|||
syntax_error: |
|||
pam_syslog(pamh, LOG_ERR, "Syntax error at %s:%d", FILENAME, line); |
|||
pam_err= PAM_SYSTEM_ERR; |
|||
ret: |
|||
fclose(f); |
|||
return pam_err; |
|||
} |
|||
|
|||
int pam_sm_setcred(pam_handle_t *pamh, int flags, |
|||
int argc, const char *argv[]) |
|||
{ |
|||
|
|||
return PAM_SUCCESS; |
|||
} |
|||
|
Write
Preview
Loading…
Cancel
Save
Reference in new issue