Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
b8b7b4eb
Commit
b8b7b4eb
authored
Dec 30, 2011
by
Sergei Golubchik
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
plugin renamed socket_peercred -> unix_socket.
test added.
parent
1417606b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
87 additions
and
17 deletions
+87
-17
mysql-test/suite/plugins/r/unix_socket.result
mysql-test/suite/plugins/r/unix_socket.result
+30
-0
mysql-test/suite/plugins/t/unix_socket.test
mysql-test/suite/plugins/t/unix_socket.test
+56
-0
plugin/auth/auth_socket.c
plugin/auth/auth_socket.c
+1
-17
No files found.
mysql-test/suite/plugins/r/unix_socket.result
0 → 100644
View file @
b8b7b4eb
install plugin unix_socket soname 'auth_socket.so';
#
# with named user
#
create user USER identified via unix_socket;
#
# name match = ok
#
select user(), current_user(), database();
user() current_user() database()
USER@localhost USER@% test
#
# name does not match = failure
#
drop user USER;
#
# and now with anonymous user
#
grant SELECT ON test.* TO '' identified via unix_socket;
#
# name match = ok
#
select user(), current_user(), database();
user() current_user() database()
USER@localhost @% test
#
# name does not match = failure
#
delete from mysql.user where user='';
uninstall plugin unix_socket;
mysql-test/suite/plugins/t/unix_socket.test
0 → 100644
View file @
b8b7b4eb
--
source
include
/
not_embedded
.
inc
if
(
!
$AUTH_SOCKET_SO
)
{
skip
No
auth_socket
plugin
;
}
let
$plugindir
=
`SELECT @@global.plugin_dir`
;
eval
install
plugin
unix_socket
soname
'$AUTH_SOCKET_SO'
;
--
echo
#
--
echo
# with named user
--
echo
#
--
replace_result
$USER
USER
eval
create
user
$USER
identified
via
unix_socket
;
--
write_file
$MYSQLTEST_VARDIR
/
tmp
/
peercred_test
.
txt
--
replace_result
$USER
USER
select
user
(),
current_user
(),
database
();
EOF
--
echo
#
--
echo
# name match = ok
--
echo
#
--
exec
$MYSQL_TEST
-
u
$USER
--
plugin
-
dir
=
$plugindir
<
$MYSQLTEST_VARDIR
/
tmp
/
peercred_test
.
txt
--
echo
#
--
echo
# name does not match = failure
--
echo
#
--
error
1
--
exec
$MYSQL_TEST
-
u
foobar
--
plugin
-
dir
=
$plugindir
<
$MYSQLTEST_VARDIR
/
tmp
/
peercred_test
.
txt
--
replace_result
$USER
USER
eval
drop
user
$USER
;
--
echo
#
--
echo
# and now with anonymous user
--
echo
#
grant
SELECT
ON
test
.*
TO
''
identified
via
unix_socket
;
--
echo
#
--
echo
# name match = ok
--
echo
#
--
exec
$MYSQL_TEST
-
u
$USER
--
plugin
-
dir
=
$plugindir
<
$MYSQLTEST_VARDIR
/
tmp
/
peercred_test
.
txt
--
echo
#
--
echo
# name does not match = failure
--
echo
#
--
error
1
--
exec
$MYSQL_TEST
-
u
foobar
--
plugin
-
dir
=
$plugindir
<
$MYSQLTEST_VARDIR
/
tmp
/
peercred_test
.
txt
# restoring mysql.user to the original state.
delete
from
mysql
.
user
where
user
=
''
;
uninstall
plugin
unix_socket
;
--
remove_file
$MYSQLTEST_VARDIR
/
tmp
/
peercred_test
.
txt
plugin/auth/auth_socket.c
View file @
b8b7b4eb
...
...
@@ -83,27 +83,11 @@ static struct st_mysql_auth socket_auth_handler=
socket_auth
};
mysql_declare_plugin
(
socket_auth
)
{
MYSQL_AUTHENTICATION_PLUGIN
,
&
socket_auth_handler
,
"socket_peercred"
,
"Sergei Golubchik"
,
"Unix Socket based authentication"
,
PLUGIN_LICENSE_GPL
,
NULL
,
NULL
,
0x0100
,
NULL
,
NULL
,
NULL
}
mysql_declare_plugin_end
;
maria_declare_plugin
(
socket_auth
)
{
MYSQL_AUTHENTICATION_PLUGIN
,
&
socket_auth_handler
,
"
socket_peercred
"
,
"
unix_socket
"
,
"Sergei Golubchik"
,
"Unix Socket based authentication"
,
PLUGIN_LICENSE_GPL
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment