named_pipe authentication plugin
MariaDB starting with 10.1.11
This plugin first appeared in MariaDB 10.1.11.
Description
This plugin allows the user to use operating system credentials when connecting to MariaDB via named pipe.It works by retrieving user name of the process that has connected to the named pipe(using [named pipe impersonation | https://msdn.microsoft.com/en-us/library/windows/desktop/aa378618%28v=vs.85%29.aspx] and GetUserName()
) and allowing to connect to the MariaDB account with the corresponding user name.
See Plugin SQL Statements for information about using plugins in general and the Pluggable Authentication for authentication plugins details.
To install the plugin, use:
INSTALL SONAME 'auth_named_pipe';
Examples
CREATE USER wlad IDENTIFIED WITH named_pipe; CREATE USER monty IDENTIFIED WITH named_pipe; quit C:\>echo %USERNAME% wlad C:\> mysql --user=wlad --protocol=PIPE Welcome to the MariaDB monitor. Commands end with ; or \g. Your MariaDB connection id is 4 Server version: 10.1.12-MariaDB-debug Source distribution Copyright (c) 2000, 2015, Oracle, MariaDB Corporation Ab and others. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. MariaDB [(none)]> quit Bye C:\> mysql --user=monty --protocol=PIPE ERROR 1698 (28000): Access denied for user 'monty'@'localhost'
In this example, a user wlad
is already logged into the system. Because he has identified himself to the operating system, he does not need to do it again for the database — MariaDB trusts operating system credentials. But he cannot connect to the database as another user.