MySLQ is using identified with auth_pam by ... instead of identified with pam using ... like mariadb does

This commit is contained in:
Hubertus Krogmann 2022-09-13 16:37:57 +02:00
commit 1df6442b81
2 changed files with 5 additions and 5 deletions

View file

@ -170,8 +170,8 @@ def user_add(cursor, user, host, host_all, password, encrypted,
elif plugin and plugin_hash_string: elif plugin and plugin_hash_string:
query_with_args = "CREATE USER %s@%s IDENTIFIED WITH %s AS %s", (user, host, plugin, plugin_hash_string) query_with_args = "CREATE USER %s@%s IDENTIFIED WITH %s AS %s", (user, host, plugin, plugin_hash_string)
elif plugin and plugin_auth_string: elif plugin and plugin_auth_string:
# Mysql and MariaDB differ in naming pam plugin # Mysql and MariaDB differ in naming pam plugin and Syntax to set it
if plugin == 'pam' or plugin == 'auth_pam': if plugin == 'pam':
query_with_args = "CREATE USER %s@%s IDENTIFIED WITH %s USING %s", (user, host, plugin, plugin_auth_string) query_with_args = "CREATE USER %s@%s IDENTIFIED WITH %s USING %s", (user, host, plugin, plugin_auth_string)
else: else:
query_with_args = "CREATE USER %s@%s IDENTIFIED WITH %s BY %s", (user, host, plugin, plugin_auth_string) query_with_args = "CREATE USER %s@%s IDENTIFIED WITH %s BY %s", (user, host, plugin, plugin_auth_string)
@ -309,8 +309,8 @@ def user_mod(cursor, user, host, host_all, password, encrypted,
if plugin_hash_string: if plugin_hash_string:
query_with_args = "ALTER USER %s@%s IDENTIFIED WITH %s AS %s", (user, host, plugin, plugin_hash_string) query_with_args = "ALTER USER %s@%s IDENTIFIED WITH %s AS %s", (user, host, plugin, plugin_hash_string)
elif plugin_auth_string: elif plugin_auth_string:
# Mysql and MariaDB differ in naming pam plugin # Mysql and MariaDB differ in naming pam plugin and syntax to set it
if plugin == 'pam' or plugin == 'auth_pam': if plugin == 'pam':
query_with_args = "ALTER USER %s@%s IDENTIFIED WITH %s USING %s", (user, host, plugin, plugin_auth_string) query_with_args = "ALTER USER %s@%s IDENTIFIED WITH %s USING %s", (user, host, plugin, plugin_auth_string)
else: else:
query_with_args = "ALTER USER %s@%s IDENTIFIED WITH %s BY %s", (user, host, plugin, plugin_auth_string) query_with_args = "ALTER USER %s@%s IDENTIFIED WITH %s BY %s", (user, host, plugin, plugin_auth_string)

View file

@ -138,7 +138,7 @@ options:
plugin_auth_string: plugin_auth_string:
description: description:
- User's plugin auth_string (``CREATE USER user IDENTIFIED WITH plugin BY plugin_auth_string``). - User's plugin auth_string (``CREATE USER user IDENTIFIED WITH plugin BY plugin_auth_string``).
- If I(plugin) is ``pam`` or ``auth_pam`` I(plugin_auth_string) can be used to determine the pam service (``CREATE USER user IDENTIFIED WITH plugin USING plugin_auth_string``). - MariaDB: If I(plugin) is ``pam`` an optional I(plugin_auth_string) ults in (``CREATE USER user IDENTIFIED WITH plugin USING plugin_auth_string``).
This was chosen because MySQL and MariaDB store the ``USING plugin_auth_string`` part in the ``authentication_string`` column in ``mysql.user``. This was chosen because MySQL and MariaDB store the ``USING plugin_auth_string`` part in the ``authentication_string`` column in ``mysql.user``.
type: str type: str
version_added: '0.1.0' version_added: '0.1.0'