summaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-06-11 12:53:35 +0200
committerSergei Golubchik <sergii@pisem.net>2013-06-11 12:53:35 +0200
commitf722b15dc23e6a0ca587553d35982e0936b1de9f (patch)
tree1d0883976f7d0c958818cc5450752f72a74e2d5c /plugin
parent43a6831fe0529bf46f8dc1d73fc50a585e2f6361 (diff)
downloadmariadb-git-f722b15dc23e6a0ca587553d35982e0936b1de9f.tar.gz
MDEV-4636 use mysql_cleartext_plugin from auth_pam
add a new command-line option --pam-use-cleartext-plugin
Diffstat (limited to 'plugin')
-rw-r--r--plugin/auth_pam/auth_pam.c25
1 files changed, 23 insertions, 2 deletions
diff --git a/plugin/auth_pam/auth_pam.c b/plugin/auth_pam/auth_pam.c
index 4f549142e72..2a06b6a01a6 100644
--- a/plugin/auth_pam/auth_pam.c
+++ b/plugin/auth_pam/auth_pam.c
@@ -154,6 +154,27 @@ static struct st_mysql_auth info =
pam_auth
};
+static char use_cleartext_plugin;
+static MYSQL_SYSVAR_BOOL(use_cleartext_plugin, use_cleartext_plugin,
+ PLUGIN_VAR_NOCMDARG | PLUGIN_VAR_READONLY,
+ "Use mysql_cleartext_plugin on the client side instead of the dialog "
+ "plugin. This may be needed for compatibility reasons, but it only "
+ "supports simple PAM policies that don't require anything besides "
+ "a password", NULL, NULL, 0);
+
+static struct st_mysql_sys_var* vars[] = {
+ MYSQL_SYSVAR(use_cleartext_plugin),
+ NULL
+};
+
+
+static int init(void *p __attribute__((unused)))
+{
+ if (use_cleartext_plugin)
+ info.client_auth_plugin= "mysql_clear_password";
+ return 0;
+}
+
maria_declare_plugin(pam)
{
MYSQL_AUTHENTICATION_PLUGIN,
@@ -162,11 +183,11 @@ maria_declare_plugin(pam)
"Sergei Golubchik",
"PAM based authentication",
PLUGIN_LICENSE_GPL,
- NULL,
+ init,
NULL,
0x0100,
NULL,
- NULL,
+ vars,
"1.0",
MariaDB_PLUGIN_MATURITY_BETA
}